From c3aa7160dbd35f7f162bf11b887ebd4a8f1318d4 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Jan 23 2021 22:16:35 +0000 Subject: bison-3.0.4 base --- diff --git a/.prev-version b/.prev-version new file mode 100644 index 0000000..75a22a2 --- /dev/null +++ b/.prev-version @@ -0,0 +1 @@ +3.0.3 diff --git a/.tarball-version b/.tarball-version new file mode 100644 index 0000000..b0f2dcb --- /dev/null +++ b/.tarball-version @@ -0,0 +1 @@ +3.0.4 diff --git a/.version b/.version new file mode 100644 index 0000000..b0f2dcb --- /dev/null +++ b/.version @@ -0,0 +1 @@ +3.0.4 diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..4f50fb5 --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,1327 @@ +1 Notes on the Free Translation Project +*************************************** + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work on translations can contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +1.1 Quick configuration advice +============================== + +If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +1.2 INSTALL Matters +=================== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the included GNU +`gettext' library will be used. This library is wholly contained +within this package, usually in the `intl/' subdirectory, so prior +installation of the GNU `gettext' package is _not_ required. +Installers may use special options at configuration time for changing +the default behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will, respectively, bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might not be desirable. You should use +the more recent version of the GNU `gettext' library. I.e. if the file +`intl/VERSION' shows that the library which comes with this package is +more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages usually have many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +1.3 Using This Package +====================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. If you happen to have the `LC_ALL' or some other +`LC_xxx' environment variables set, you should unset them before +setting `LANG', otherwise the setting of `LANG' will not have the +desired effect. Here `LL' is an ISO 639 two-letter language code, and +`CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +1.4 Translating Teams +===================== + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://translationproject.org/', in the "Teams" area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `coordinator@translationproject.org' to +reach the coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skills are praised more than +programming skills, here. + +1.5 Available Packages +====================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of May 2010. +The matrix shows, in regard of each package, for which languages PO +files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files af am ar as ast az be be@latin bg bn_IN bs ca crh + +---------------------------------------------------+ + a2ps | [] [] | + aegis | | + ant-phone | | + anubis | | + aspell | [] [] | + bash | | + bfd | | + bibshelf | [] | + binutils | | + bison | | + bison-runtime | [] | + bluez-pin | [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] [] | + cpio | | + cppi | | + cpplib | [] | + cryptsetup | | + dfarc | | + dialog | [] [] | + dico | | + diffutils | [] | + dink | | + doodle | | + e2fsprogs | [] | + enscript | [] | + exif | | + fetchmail | [] | + findutils | [] | + flex | [] | + freedink | | + gas | | + gawk | [] [] | + gcal | [] | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gip | [] | + gjay | | + gliv | [] | + glunarclock | [] [] | + gnubiff | | + gnucash | [] | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | | + gold | | + gpe-aerial | | + gpe-beam | | + gpe-bluetooth | | + gpe-calendar | | + gpe-clock | [] | + gpe-conf | | + gpe-contacts | | + gpe-edit | | + gpe-filemanager | | + gpe-go | | + gpe-login | | + gpe-ownerinfo | [] | + gpe-package | | + gpe-sketchbook | | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | [] [] | + gsasl | | + gss | | + gst-plugins-bad | [] | + gst-plugins-base | [] | + gst-plugins-good | [] | + gst-plugins-ugly | [] | + gstreamer | [] [] [] | + gtick | | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] [] | + gutenprint | | + hello | [] | + help2man | | + hylafax | | + idutils | | + indent | [] [] | + iso_15924 | | + iso_3166 | [] [] [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | | + iso_639 | [] [] [] [] [] | + iso_639_3 | [] | + jwhois | | + kbd | | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | | + ld | [] | + leafpad | [] [] | + libc | [] [] | + libexif | () | + libextractor | | + libgnutls | | + libgpewidget | | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | [] | + libidn | | + lifelines | | + liferea | [] [] | + lilypond | | + linkdr | [] | + lordsawar | | + lprng | | + lynx | [] | + m4 | | + mailfromd | | + mailutils | | + make | | + man-db | | + man-db-manpages | | + minicom | | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | | + psmisc | | + pspp | [] | + pwdutils | | + radius | [] | + recode | [] [] | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] | + sharutils | [] [] | + shishi | | + skencil | | + solfege | | + solfege-manual | | + soundtracker | | + sp | | + sysstat | | + tar | [] | + texinfo | | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] [] | + wyslij-po | | + xchat | [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +---------------------------------------------------+ + af am ar as ast az be be@latin bg bn_IN bs ca crh + 6 0 2 3 19 1 11 3 28 3 1 38 5 + + cs da de el en en_GB en_ZA eo es et eu fa fi + +-------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] () | + anubis | [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] [] | + bfd | [] [] | + bibshelf | [] [] [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] | + bombono-dvd | [] [] | + buzztard | [] [] [] | + cflow | [] [] [] | + clisp | [] [] [] [] | + coreutils | [] [] [] [] | + cpio | [] | + cppi | [] | + cpplib | [] [] [] | + cryptsetup | [] | + dfarc | [] [] [] [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] [] | + dink | [] [] [] | + doodle | [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + exif | () [] [] [] | + fetchmail | [] [] () [] [] [] | + findutils | [] [] [] [] | + flex | [] [] [] | + freedink | [] [] [] [] | + gas | [] | + gawk | [] [] [] | + gcal | [] | + gcc | [] [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gip | [] [] [] [] [] | + gjay | [] [] | + gliv | [] [] [] [] | + glunarclock | [] [] [] | + gnubiff | () | + gnucash | [] () () () () () | + gnuedu | [] [] | + gnulib | [] [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] [] | + gpe-aerial | [] [] [] [] [] | + gpe-beam | [] [] [] [] [] | + gpe-bluetooth | [] [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] [] | + gpe-go | [] [] [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] [] [] [] | + gpe-sketchbook | [] [] [] [] [] | + gpe-su | [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] | + gpe-today | [] [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] [] () [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] [] | + grub | [] [] [] | + gsasl | [] [] | + gss | [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] | + gtick | [] () [] [] | + gtkam | [] [] () [] [] | + gtkorphan | [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] [] | + hello | [] [] [] [] [] | + help2man | [] [] | + hylafax | [] [] | + idutils | [] [] [] | + indent | [] [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] [] | + iso_3166 | [] [] [] () [] [] [] () [] | + iso_3166_2 | () | + iso_4217 | [] [] [] () [] [] [] | + iso_639 | [] [] [] () [] [] [] | + iso_639_3 | | + jwhois | [] [] | + kbd | [] [] [] [] [] | + keytouch | [] [] [] | + keytouch-editor | [] [] [] | + keytouch-keyboa... | [] [] | + klavaro | [] [] [] [] | + latrine | [] () [] | + ld | [] [] [] | + leafpad | [] [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] [] () | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] () | + libgphoto2_port | [] () [] | + libgsasl | [] | + libiconv | [] [] [] [] [] [] | + libidn | [] [] [] [] | + lifelines | [] () | + liferea | [] [] [] [] [] | + lilypond | [] [] [] [] | + linkdr | [] [] [] [] | + lordsawar | [] | + lprng | | + lynx | [] [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | | + mailutils | [] | + make | [] [] [] [] | + man-db | | + man-db-manpages | | + minicom | [] [] [] [] [] | + mkisofs | [] | + myserver | | + nano | [] [] [] [] | + opcodes | [] [] [] | + parted | [] [] | + pies | | + popt | [] [] [] [] [] [] | + psmisc | [] [] [] [] | + pspp | [] | + pwdutils | [] | + radius | [] | + recode | [] [] [] [] [] [] [] | + rosegarden | () () () () | + rpm | [] [] [] | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] | + sharutils | [] [] [] [] [] | + shishi | | + skencil | [] () [] | + solfege | [] [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] [] | + sp | [] | + sysstat | [] [] [] [] | + tar | [] [] [] [] [] | + texinfo | [] [] [] | + tin | [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] [] | + vice | () () | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] [] | + wget | [] [] [] [] | + wyslij-po | [] | + xchat | [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] | + +-------------------------------------------------+ + cs da de el en en_GB en_ZA eo es et eu fa fi + 64 105 117 18 1 8 0 28 89 18 19 0 104 + + fr ga gl gu he hi hr hu hy id is it ja ka kn + +------------------------------------------------+ + a2ps | [] [] [] | + aegis | [] [] | + ant-phone | [] [] | + anubis | [] [] [] | + aspell | [] [] [] [] | + bash | [] [] [] | + bfd | [] [] | + bibshelf | [] [] [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] | + bombono-dvd | | + buzztard | [] | + cflow | [] [] | + clisp | [] | + coreutils | [] [] [] [] [] | + cpio | [] [] [] | + cppi | [] | + cpplib | [] [] | + cryptsetup | [] [] [] | + dfarc | [] [] | + dialog | [] [] [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] [] [] | + dink | [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + exif | [] [] [] [] [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] | + freedink | [] [] | + gas | [] [] | + gawk | [] [] [] [] () [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] [] | + gip | [] [] [] [] [] | + gjay | | + gliv | () | + glunarclock | [] [] [] | + gnubiff | () [] () | + gnucash | () () () () [] | + gnuedu | [] [] | + gnulib | [] [] [] [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] | + gpe-aerial | [] [] | + gpe-beam | [] [] [] | + gpe-bluetooth | [] [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] [] [] | + gpe-contacts | [] [] [] | + gpe-edit | [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] | + gpe-su | [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] | + grub | [] [] [] | + gsasl | [] [] [] [] | + gss | [] [] [] [] | + gst-plugins-bad | [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | [] [] [] [] | + gtick | [] [] [] [] | + gtkam | [] [] [] [] [] | + gtkorphan | [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] | + hello | [] [] | + help2man | [] | + hylafax | [] | + idutils | [] [] [] [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | () [] [] | + iso_3166 | () [] [] [] [] [] [] [] [] [] [] | + iso_3166_2 | () [] [] [] | + iso_4217 | () [] [] [] [] | + iso_639 | () [] [] [] [] [] [] [] | + iso_639_3 | () [] [] | + jwhois | [] [] [] [] | + kbd | [] [] | + keytouch | [] [] [] [] [] | + keytouch-editor | [] [] [] [] | + keytouch-keyboa... | [] [] [] [] | + klavaro | [] [] | + latrine | [] [] | + ld | [] [] [] | + leafpad | [] [] [] [] [] [] () | + libc | [] [] [] [] | + libexif | | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] | + libiconv | [] [] [] [] [] | + libidn | [] [] [] | + lifelines | () | + liferea | [] [] [] [] | + lilypond | [] | + linkdr | [] [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] | + man-db | [] [] | + man-db-manpages | [] | + minicom | [] [] [] [] | + mkisofs | [] [] [] | + myserver | | + nano | [] [] [] [] [] | + opcodes | [] [] [] | + parted | [] [] [] [] | + pies | | + popt | [] [] [] [] [] [] [] [] | + psmisc | [] [] | + pspp | | + pwdutils | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] | + rosegarden | () () () () | + rpm | [] [] | + rush | | + sarg | [] | + screem | [] [] | + scrollkeeper | [] [] [] | + sed | [] [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] | + shishi | [] | + skencil | [] | + solfege | [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] | + sp | [] () | + sysstat | [] [] [] [] | + tar | [] [] [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux-ng | [] [] [] [] [] | + vice | () () () | + vmm | [] | + vorbis-tools | [] | + wastesedge | () () | + wdiff | | + wget | [] [] [] [] [] [] [] | + wyslij-po | [] [] | + xchat | [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | + +------------------------------------------------+ + fr ga gl gu he hi hr hu hy id is it ja ka kn + 121 53 20 4 8 2 5 53 2 120 5 83 66 0 4 + + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + +-----------------------------------------------+ + a2ps | [] | + aegis | | + ant-phone | | + anubis | [] [] | + aspell | [] | + bash | | + bfd | | + bibshelf | [] [] | + binutils | | + bison | [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] | + cpio | | + cppi | | + cpplib | | + cryptsetup | | + dfarc | [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] | + dink | | + doodle | | + e2fsprogs | | + enscript | | + exif | [] | + fetchmail | | + findutils | | + flex | | + freedink | [] | + gas | | + gawk | | + gcal | | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] | + gettext-tools | [] | + gip | [] [] | + gjay | | + gliv | | + glunarclock | [] | + gnubiff | | + gnucash | () () () () | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | [] | + gold | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] | + gpe-login | [] | + gpe-ownerinfo | [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] | + gpe-timesheet | [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | | + gsasl | | + gss | | + gst-plugins-bad | [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | | + gtick | | + gtkam | [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | | + hello | [] [] [] | + help2man | | + hylafax | | + idutils | | + indent | | + iso_15924 | [] [] | + iso_3166 | [] [] () [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] [] | + iso_639 | [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | [] | + ld | | + leafpad | [] [] [] | + libc | [] | + libexif | | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | | + libidn | | + lifelines | | + liferea | | + lilypond | | + linkdr | | + lordsawar | | + lprng | | + lynx | | + m4 | | + mailfromd | | + mailutils | | + make | [] | + man-db | | + man-db-manpages | | + minicom | [] | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | [] [] [] | + psmisc | | + pspp | | + pwdutils | | + radius | | + recode | | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] | + sed | | + sharutils | | + shishi | | + skencil | | + solfege | [] | + solfege-manual | | + soundtracker | | + sp | | + sysstat | [] | + tar | [] | + texinfo | [] | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] | + wyslij-po | | + xchat | [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +-----------------------------------------------+ + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + 20 5 10 1 12 48 4 2 2 4 24 10 19 3 1 + + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + +---------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] [] | + anubis | [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] | + bfd | [] | + bibshelf | [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] () | + buzztard | [] [] | + cflow | [] | + clisp | [] [] | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cppi | [] | + cpplib | [] | + cryptsetup | [] | + dfarc | [] | + dialog | [] [] [] [] | + dico | [] | + diffutils | [] [] [] [] [] [] | + dink | () | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + exif | [] [] [] () [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] [] | + freedink | [] [] | + gas | | + gawk | [] [] [] [] | + gcal | | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] | + gip | [] [] [] [] [] | + gjay | | + gliv | [] [] [] [] [] [] | + glunarclock | [] [] [] [] [] | + gnubiff | [] () | + gnucash | [] () () () | + gnuedu | [] | + gnulib | [] [] [] [] | + gnunet | | + gnunet-gtk | | + gnutls | [] [] | + gold | | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] [] | + gphoto2 | [] [] [] [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] | + gramadoir | [] [] | + grep | [] [] [] [] | + grub | [] [] [] | + gsasl | [] [] [] [] | + gss | [] [] [] | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] | + gtkam | [] [] [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] | + hello | [] [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] [] [] [] | + iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | + iso_3166_2 | [] [] [] | + iso_4217 | [] [] [] [] [] [] [] [] | + iso_639 | [] [] [] [] [] [] [] [] [] | + iso_639_3 | [] [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] [] [] | + keytouch-editor | [] [] [] | + keytouch-keyboa... | [] [] [] | + klavaro | [] [] | + latrine | [] [] | + ld | | + leafpad | [] [] [] [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] | + libidn | [] [] | + lifelines | [] [] | + liferea | [] [] [] [] [] () () [] | + lilypond | [] | + linkdr | [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | [] | + mailutils | [] | + make | [] [] [] [] | + man-db | [] [] [] | + man-db-manpages | [] [] [] | + minicom | [] [] [] [] | + mkisofs | [] [] [] | + myserver | | + nano | [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + pies | [] | + popt | [] [] [] [] | + psmisc | [] [] [] | + pspp | [] [] | + pwdutils | [] | + radius | [] [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () | + rpm | [] [] [] | + rush | [] [] | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + skencil | [] [] | + solfege | [] [] [] [] | + solfege-manual | [] [] [] | + soundtracker | [] | + sp | | + sysstat | [] [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] [] | + vice | [] | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] | + +---------------------------------------------------+ + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + 135 10 4 7 105 1 29 61 47 91 3 55 47 8 37 + + sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + +---------------------------------------------------+ + a2ps | [] [] [] [] [] | 27 + aegis | [] | 9 + ant-phone | [] [] [] [] | 9 + anubis | [] [] [] [] | 15 + aspell | [] [] [] | 20 + bash | [] [] | 11 + bfd | [] | 6 + bibshelf | [] [] [] | 16 + binutils | [] [] | 8 + bison | [] [] | 12 + bison-runtime | [] [] [] [] [] [] | 29 + bluez-pin | [] [] [] [] [] [] [] [] | 37 + bombono-dvd | [] | 4 + buzztard | [] | 7 + cflow | [] [] [] | 9 + clisp | | 10 + coreutils | [] [] [] [] | 22 + cpio | [] [] [] [] [] [] | 13 + cppi | [] [] | 5 + cpplib | [] [] [] [] [] [] | 13 + cryptsetup | [] [] | 7 + dfarc | [] | 9 + dialog | [] [] [] [] [] [] [] | 30 + dico | [] | 2 + diffutils | [] [] [] [] [] [] | 30 + dink | | 4 + doodle | [] [] | 7 + e2fsprogs | [] [] [] | 11 + enscript | [] [] [] [] | 17 + exif | [] [] [] | 16 + fetchmail | [] [] [] | 17 + findutils | [] [] [] [] [] | 20 + flex | [] [] [] [] | 15 + freedink | [] | 10 + gas | [] | 4 + gawk | [] [] [] [] | 18 + gcal | [] [] | 5 + gcc | [] [] [] | 7 + gettext-examples | [] [] [] [] [] [] [] | 34 + gettext-runtime | [] [] [] [] [] [] [] | 30 + gettext-tools | [] [] [] [] [] [] | 22 + gip | [] [] [] [] | 22 + gjay | [] | 3 + gliv | [] [] [] | 14 + glunarclock | [] [] [] [] [] | 19 + gnubiff | [] [] | 4 + gnucash | () [] () () | 9 + gnuedu | [] [] | 7 + gnulib | [] [] [] [] | 16 + gnunet | [] | 1 + gnunet-gtk | [] [] [] | 5 + gnutls | [] [] [] | 10 + gold | [] | 4 + gpe-aerial | [] [] [] | 18 + gpe-beam | [] [] [] | 19 + gpe-bluetooth | [] [] [] | 13 + gpe-calendar | [] [] [] [] | 12 + gpe-clock | [] [] [] [] [] | 28 + gpe-conf | [] [] [] [] | 20 + gpe-contacts | [] [] [] | 17 + gpe-edit | [] [] [] | 12 + gpe-filemanager | [] [] [] [] | 16 + gpe-go | [] [] [] [] [] | 25 + gpe-login | [] [] [] | 11 + gpe-ownerinfo | [] [] [] [] [] | 25 + gpe-package | [] [] [] | 13 + gpe-sketchbook | [] [] [] | 20 + gpe-su | [] [] [] [] [] | 30 + gpe-taskmanager | [] [] [] [] [] | 29 + gpe-timesheet | [] [] [] [] [] | 25 + gpe-today | [] [] [] [] [] [] | 30 + gpe-todo | [] [] [] [] | 17 + gphoto2 | [] [] [] [] [] | 24 + gprof | [] [] [] | 15 + gpsdrive | [] [] [] | 11 + gramadoir | [] [] [] | 11 + grep | [] [] [] | 10 + grub | [] [] [] | 14 + gsasl | [] [] [] [] | 14 + gss | [] [] [] | 11 + gst-plugins-bad | [] [] [] [] | 22 + gst-plugins-base | [] [] [] [] [] | 24 + gst-plugins-good | [] [] [] [] [] | 25 + gst-plugins-ugly | [] [] [] [] [] | 29 + gstreamer | [] [] [] [] | 22 + gtick | [] [] [] | 13 + gtkam | [] [] [] | 20 + gtkorphan | [] [] [] | 14 + gtkspell | [] [] [] [] [] [] [] [] [] | 45 + gutenprint | [] | 10 + hello | [] [] [] [] [] [] | 21 + help2man | [] [] | 7 + hylafax | [] | 5 + idutils | [] [] [] [] | 17 + indent | [] [] [] [] [] [] | 30 + iso_15924 | () [] () [] [] | 16 + iso_3166 | [] [] () [] [] () [] [] [] () | 53 + iso_3166_2 | () [] () [] | 9 + iso_4217 | [] () [] [] () [] [] | 26 + iso_639 | [] [] [] () [] () [] [] [] [] | 38 + iso_639_3 | [] () | 8 + jwhois | [] [] [] [] [] | 16 + kbd | [] [] [] [] [] | 15 + keytouch | [] [] [] | 16 + keytouch-editor | [] [] [] | 14 + keytouch-keyboa... | [] [] [] | 14 + klavaro | [] | 11 + latrine | [] [] [] | 10 + ld | [] [] [] [] | 11 + leafpad | [] [] [] [] [] [] | 33 + libc | [] [] [] [] [] | 21 + libexif | [] () | 6 + libextractor | [] | 1 + libgnutls | [] [] [] | 9 + libgpewidget | [] [] [] | 14 + libgpg-error | [] [] [] | 9 + libgphoto2 | [] [] | 8 + libgphoto2_port | [] [] [] [] | 13 + libgsasl | [] [] [] | 13 + libiconv | [] [] [] [] | 21 + libidn | () [] [] | 11 + lifelines | [] | 4 + liferea | [] [] [] | 21 + lilypond | [] | 7 + linkdr | [] [] [] [] [] | 17 + lordsawar | | 1 + lprng | [] | 3 + lynx | [] [] [] [] | 17 + m4 | [] [] [] [] | 19 + mailfromd | [] [] | 3 + mailutils | [] | 5 + make | [] [] [] [] | 21 + man-db | [] [] [] | 8 + man-db-manpages | | 4 + minicom | [] [] | 16 + mkisofs | [] [] | 9 + myserver | | 0 + nano | [] [] [] [] | 21 + opcodes | [] [] [] | 11 + parted | [] [] [] [] [] | 15 + pies | [] [] | 3 + popt | [] [] [] [] [] [] | 27 + psmisc | [] [] | 11 + pspp | | 4 + pwdutils | [] [] | 6 + radius | [] [] | 9 + recode | [] [] [] [] | 28 + rosegarden | () | 0 + rpm | [] [] [] | 11 + rush | [] [] | 4 + sarg | | 1 + screem | [] | 3 + scrollkeeper | [] [] [] [] [] | 27 + sed | [] [] [] [] [] | 30 + sharutils | [] [] [] [] [] | 22 + shishi | [] | 3 + skencil | [] [] | 7 + solfege | [] [] [] [] | 16 + solfege-manual | [] | 8 + soundtracker | [] [] [] | 9 + sp | [] | 3 + sysstat | [] [] | 15 + tar | [] [] [] [] [] [] | 23 + texinfo | [] [] [] [] | 16 + tin | | 4 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux-ng | [] [] [] [] | 20 + vice | () () | 1 + vmm | [] | 4 + vorbis-tools | [] | 6 + wastesedge | | 2 + wdiff | [] [] | 7 + wget | [] [] [] [] [] | 26 + wyslij-po | [] [] | 8 + xchat | [] [] [] [] [] [] | 36 + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | 60 + xkeyboard-config | [] [] [] [] | 25 + +---------------------------------------------------+ + 84 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + 178 domains 119 1 3 2 0 10 66 50 155 17 97 7 41 2610 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If May 2010 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://translationproject.org/extra/matrix.html'. + +1.6 Using `gettext' in new packages +=================================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`coordinator@translationproject.org' to make the `.pot' files available +to the translation teams. + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..8ba2335 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,42 @@ +Authors of GNU Bison. + +Bison was written primarily by Robert Corbett. + +Richard Stallman made it Yacc-compatible. + +Wilfred Hansen of Carnegie Mellon University added multicharacter +string literals and other features (Bison 1.25, 1995). + +Akim Demaille rewrote the parser in Bison, and changed the back end to +use M4 (1.50, 2002). + +Paul Hilfinger added GLR support (Bison 1.50, 2002). + +Joel E. Denny contributed canonical-LR support, and invented and added +IELR and LAC (Lookahead Correction) support (Bison 2.5, 2011). + +Paolo Bonzini contributed Java support (Bison 2.4, 2008). + +Alex Rozenman added named reference support (Bison 2.5, 2011). + +Paul Eggert fixed a million portability issues, arbitrary limitations, +and nasty bugs. + +----- + +Copyright (C) 1998-2015 Free Software Foundation, Inc. + +This file is part of Bison, the GNU Compiler Compiler. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..b0d9308 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,10618 @@ +2015-01-23 Akim Demaille + + version 3.0.4 + * NEWS: Record release date. + +2015-01-23 Akim Demaille + + gnulib: update + +2015-01-23 Akim Demaille + + build: re-enable compiler warnings, and fix them + There are warnings (-Wextra) in generated C++ code: + + ltlparse.cc: In member function 'ltlyy::parser::symbol_number_type + ltlyy::parser::by_state::type_get() const': + ltlparse.cc:452:33: warning: enumeral and non-enumeral type in + conditional expression + return state == empty_state ? empty_symbol : yystos_[state]; + + Reported by Alexandre Duret-Lutz. + + It turns out that -Wall and -Wextra were disabled because of a stupid + typo. + + * configure.ac: Fix the stupid typo. + * data/lalr1.cc, src/AnnotationList.c, src/InadequacyList.c, + * src/ielr.c, src/print.c, src/scan-code.l, src/symlist.c, + * src/symlist.h, src/symtab.c, src/tables.c, tests/actions.at, + * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at, + * tests/named-refs.at, tests/torture.at: + Fix warnings, mostly issues about variables used only with assertions, + which are disabled with -DNDEBUG. + +2015-01-22 Akim Demaille + + tests: c++: fix a C++03 conformance issue + This fixes test 241 on xLC: + + "input.y", line 42.11: 1540-0274 (S) The name lookup for "report" did not find a declaration. + "input.y", line 42.11: 1540-1292 (I) Static declarations are not considered for a function call if the function is not qualified. + + where report is: + + static void + report (std::ostream& yyo, int ival, float fval) + { + yyo << "ival: " << ival << ", fval: " << fval; + } + + and line 42 is: + + %printer { report (yyo, $$, $$); } ; + + It turns out that indeed this function must not be declared static, + . Let's put it into an + anonymous namespace. + + Reported by Thomas Jahns. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html + + * tests/actions.at (Qualified $$ in actions): Don't use "static", + prefer anonymous namespace. + +2015-01-20 Akim Demaille + + tests: fix a title + * tests/conflicts.at: De-overquote. + +2015-01-20 Akim Demaille + + c++: reserve 200 slots in the parser's stack + This is consistent with what is done with yacc.c and glr.c. Because + it also avoids that the stack needs to be resized very soon, it should + help keeping tests about destructors more reliable. + + Indeed, if the stack is created too small, very soon the C++ library + needs to enlarge it, which means creating a new one, copying the + elements from the initial one onto it, and then destroy the elements + of the initial stack: that would be a spurious call to a destructor. + + Reported by Thomas Jahns. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html + + * data/stack.hh (stack::stack): Reserve 200 slots. + * tests/c++.at: Remove traces of stack expansions. + +2015-01-20 Akim Demaille + + tests: be more robust to unrecognized synclines, and try to recognize xlc + Reported by Thomas Jahns. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html + + * tests/synclines.at (AT_SYNCLINES_COMPILE): Rename as... + (_AT_SYNCLINES_COMPILE): this. + Try to recognize xlc locations. + (AT_SYNCLINES_COMPILE): New. Skips the test if we can't read the + synclines. + +2015-01-20 Akim Demaille + + tests: fix C++ conformance + Reported by Thomas Jahns. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html + + * tests/c++.at (Exception safety): Add missing include. + Don't use const_iterator for erase. + +2015-01-18 Akim Demaille + + build: fix some warnings + Reported by John Horigan. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00034.html + + * src/graphviz.c, src/symtab.h: Address compiler warnings. + +2015-01-16 Akim Demaille + + build: avoid infinite recursions on include_next + On MacOS X 10.5 PPC with Apple's GCC 4.0.1: + + % uname -a + Darwin aria.cielonegro.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:0 + 1 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh + % gcc --version + powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493) + Copyright (C) 2005 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. + + building in place enters into an infinite recursion on "#include_next": + + % gmake V=1 + [snip] + depbase=`echo lib/math.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ + gcc -std=gnu99 -I. -Ilib -I. -I./lib -g -O2 -MT lib/math.o -MD -MP -MF $depbase.Tpo -c -o lib/math.o lib/math.c &&\ + mv -f $depbase.Tpo $depbase.Po + In file included from lib/math.h:27, + from lib/math.h:27, + from lib/math.h:27, + from lib/math.h:27, + [snip] + from lib/math.h:27, + from lib/math.h:27, + from lib/math.c:3: + lib/math.h:27:23: error: #include nested too deeply + Makefile:3414: recipe for target 'lib/math.o' failed + gmake[2]: *** [lib/math.o] Error 1 + + Using -I./lib instead of -Ilib fixes the problem. + + Reported by Pho. + + + * Makefile.am (AM_CPPFLAGS): Use -I./lib instead of -Ilib. + +2015-01-16 Akim Demaille + + doc: minor fixes + * doc/bison.texi: Fix warnings about colon in reference names. + * data/bison.m4, src/files.h: Fix comments. + * doc/Doxyfile.in: update. + +2015-01-15 Akim Demaille + + gnulib: strtoul is considered obsolete and now useless + * bootstrap.conf: here. + +2015-01-15 Akim Demaille + + c++: avoid warnings when destructors don't use $$ + * data/c++.m4: here. + +2015-01-15 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2015-01-15 Akim Demaille + + version 3.0.3 + * NEWS: Record release date. + +2015-01-15 Akim Demaille + + gnulib: update + +2015-01-13 Akim Demaille + + tests: split a large test case into several smaller ones + * tests/conflicts.at (AT_CONSISTENT_ERRORS_CHECK): Move AT_SETUP/AT_CLEANUP + into it, so that we don't skip non Java tests following a test case in Java. + +2015-01-12 Akim Demaille + + package: a bit of trouble shooting indications + * README-hacking: here. + +2015-01-12 Akim Demaille + + doc: liby's main arms the internationalization + Reported by Nicolas Bedon. + + + * doc/bison.texi (Yacc Library): Document the call the setlocale. + +2015-01-09 Akim Demaille + + bison: avoid warnings from static code analysis + A static analysis tool reports that some callers of symbol_list_n_get + might get NULL and not handle it properly. This is not the case, yet + we can suppress this pattern. + + Reported by Mike Sullivan. + + + * src/symlist.c (symbol_list_n_get): Actually it is never called + to return 0. Enforce this postcondition via aver. + (symbol_list_n_type_name_get): Simplify accordingly. In particular, + discards a (translated) useless error message. + * src/symlist.h: Adjust documentation. + * src/scan-code.l: Style change. + +2015-01-09 Akim Demaille + + c++: fix the use of destructors when variants are enabled + When using variants, destructors generate invalid code. + + Reported by Michael Catanzaro. + + * data/c++.m4 (~basic_symbol): b4_symbol_foreach works on yysym: + define it. + * tests/c++.at (Variants): Check it. + +2015-01-08 Akim Demaille + + style: tests: simplify the handling of some C++ tests + * tests/c++.at: here. + (Doxygen): Pass %define, so that files such as position.hh etc. + are generated, instead of putting everything into input.hh. + +2015-01-08 Akim Demaille + + c++: symbols can be empty, so use it + The previous patches ensure that symbols (symbol_type and + stack_symbol_type) can be empty, cleared, and their emptiness can be + checked. Therefore, yyempty, which codes whether yyla is empty or + not, is now useless. + + In C skeletons (e.g., yacc.c), the fact that the lookahead is empty is + coded by "yychar = YYEMPTY", which is exactly what this patch + restores, since yychar/yytoken corresponds to yyla.type. + + * data/lalr1.cc (yyempty): Remove. + Rather, depend on yyla.empty (). + +2015-01-08 Akim Demaille + + c++: variants: don't leak the lookahead in error recovery + During error recovery, when discarding the lookeahead, we don't + destroy it, which is caught by parse.assert assertions. + + Reported by Antonio Silva Correia. + With an analysis and suggested patch from Michel d'Hooge. + + + * tests/c++.at (Variants): Strengthen the test to try syntax errors + with discarded lookahead. + +2015-01-08 Akim Demaille + + c++: provide a means to clear symbols + The symbol destructor is currently the only means to clear a symbol. + Unfortunately during error recovery we might have to clear the + lookahead, which is a local variable (yyla) that has not yet reached + its end of scope. + + Rather that duplicating the code to destroy a symbol, or rather than + destroying and recreating yyla, let's provide a means to clear a + symbol. + + Reported by Antonio Silva Correia, with an analysis from Michel d'Hooge. + + + * data/c++.m4, data/lalr1.cc (basis_symbol::clear, by_state::clear) + (by_type::clear): New. + (basic_symbol::~basic_symbol): Use clear. + +2015-01-08 Akim Demaille + + c++: clean up the handling of empty symbols + * data/c++.m4, data/lalr1.cc (yyempty_): Remove, replaced by... + (empty_symbol, by_state::empty_state): these. + (basic_symbol::empty): New. + +2015-01-08 Akim Demaille + + c++: comment and style changes + * data/c++.m4, data/lalr1.cc: More documentation. + Tidy. + * tests/c++.at (string_cast): Rename as... + (to_string): this C++11 name. + +2015-01-07 Akim Demaille + + c++: variants: comparing addresses of typeid.name() is undefined + Instead of storing and comparing pointers to names of types, store + pointers to the typeids, and compares the typeids. + Reported by Thomas Jahns. + + + * data/variant.hh (yytname_): Replace with... + (yytypeid_): this. + +2015-01-05 Akim Demaille + + c++: locations: complete the API and fix comments + There are no support for += between locations, and some comments are wrong. + Reported by Alexandre Duret-Lutz. + + * data/location.cc: Fix. + * doc/bison.texi: Document. + * tests/c++.at: Check. + +2015-01-05 Akim Demaille + + build: do not clean figure sources in make clean + "make clean && make" fails in in-tree builds. + + * doc/local.mk (CLEANDIRS): Replace with... + (CLEANFILES): this safer list of files to clean. + +2015-01-05 Akim Demaille + + build: don't try to generate docs when cross-compiling + When cross-compiling don't run the generated bison to update the docs. + Reported by Aaro Koskinen. + + + * configure.ac (CROSS_COMPILING): New. + * doc/local.mk: Use it. + +2015-01-04 Akim Demaille + + package: fix a reporter's name + * THANKS, build-aux/git-log-fix: s/Bernd Edligner/Bernd Edlinger/. + +2015-01-04 Akim Demaille + + %union: fix the support for named %union + Bison supports a union tag, for obscure reasons. But it does a poor + job at it, especially since Bison 3.0. + Reported by Stephen Cameron and Tobias Frost. + + It did not ensure that the name was not given several times. An easy + way to do this is to make the %union tag be handled as a %define + variable, as they cannot be defined several times. + + Since Bison 3.0, the synclines were wrongly placed, resulting in + invalid code. Addressing this issue, because of the way the union tag + was stored (as a code muscle), would have been tedious. Unless we + rather define the %union tag as a %percent variable, whose synclines + are easier to manipulate. + + So replace the b4_union_name muscle by the api.value.union.name + %define variable, document, and check. + + * data/bison.m4: Make sure that api.value.union.name has a keyword value. + * data/c++.m4: Make sure that api.value.union.name is not defined. + * data/c.m4 (b4_union_name): No longer use it, use api.value.union.name. + * doc/bison.texi (%define Summary): Document it. + * src/parse-gram.y (union_name): No longer define b4_uion_name, but + api.value.union.name. + * tests/input.at (Redefined %union name): New. + * tests/synclines.at (%union name syncline): New. + * tests/types.at: Check named %unions. + +2015-01-04 Akim Demaille + + package: bump to 2015 + Which also requires: + + * gnulib: Update. + +2014-12-31 Akim Demaille + + flex: don't trust YY_USER_INIT + Reported by Bernd Edlinger and others. + + * src/scan-gram.l: here. + +2014-12-31 Akim Demaille + + yacc.c: fix broken union when api.value.type=union and %defines are used + Reported by Rich Wilson. + + * data/c.m4 (b4_symbol_type_register): Append to b4_union_members, + not b4_user_union_members. + The latter invokes the former, but it is the former which is reinitialized + to empty by b4_value_type_setup_union. + * tests/types.at: Check it. + + This reveals another bug, this time in the case of glr.c parsers. + + * data/glr.c: Generate the header file before the implementation file, + to be sure that the setup is run before what depends on it. + +2014-12-31 Akim Demaille + + doc: fix missing xref + Reported by xolodho. + + * doc/bison.texi (Printer Decl): here. + +2014-12-29 Akim Demaille + + gnulib: update + +2014-02-03 Akim Demaille + + location: remove some ugly debugging code traces + * data/location.cc: here. + +2014-02-03 Akim Demaille + + build: use abort to pacify compiler errors + clang, with -DNDEBUG and -Werror fails on some functions that might + lack a return. This is because aver is just another assert, discarded + with -DNDEBUG. So use abort. + + * src/muscle-tab.c, src/scan-skel.l: here. + +2014-02-03 Akim Demaille + + package: bump to 2014 + * AUTHORS, ChangeLog-2012, Makefile.am, NEWS, PACKAGING, README, + * README-alpha, README-hacking, THANKS, TODO, bootstrap.conf, + * build-aux/darwin11.4.0.valgrind, build-aux/local.mk, + * build-aux/update-b4-copyright, + * build-aux/update-package-copyright-year, cfg.mk, configure.ac, + * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4, + * data/c-like.m4, data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc, + * data/java-skel.m4, data/java.m4, data/lalr1.cc, data/lalr1.java, + * data/local.mk, data/location.cc, data/stack.hh, data/variant.hh, + * data/xslt/bison.xsl, data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl, + * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint, + * djgpp/README.in, djgpp/config.bat, djgpp/config.sed, + * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat, + * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h, + * djgpp/testsuite.sed, doc/bison.texi, doc/local.mk, doc/refcard.tex, + * etc/README, etc/bench.pl.in, etc/local.mk, + * examples/calc++/calc++.test, examples/calc++/local.mk, + * examples/extexi, examples/local.mk, examples/mfcalc/local.mk, + * examples/mfcalc/mfcalc.test, examples/rpcalc/local.mk, + * examples/rpcalc/rpcalc.test, examples/test, examples/variant.yy, + * lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c, + * lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h, + * lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c, + * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c, + * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h, + * lib/local.mk, lib/main.c, lib/timevar.c, lib/timevar.def, + * lib/timevar.h, lib/vbitset.c, lib/vbitset.h, lib/yyerror.c, + * m4/bison-i18n.m4, m4/c-working.m4, m4/cxx.m4, m4/flex.m4, + * m4/timevar.m4, src/AnnotationList.c, src/AnnotationList.h, + * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c, src/LR0.h, + * src/Sbitset.c, src/Sbitset.h, src/assoc.c, src/assoc.h, + * src/closure.c, src/closure.h, src/complain.c, src/complain.h, + * src/conflicts.c, src/conflicts.h, src/derives.c, src/derives.h, + * src/files.c, src/files.h, src/flex-scanner.h, src/getargs.c, + * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c, + * src/graphviz.h, src/ielr.c, src/ielr.h, src/lalr.c, src/lalr.h, + * src/local.mk, src/location.c, src/location.h, src/main.c, + * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c, + * src/named-ref.h, src/nullable.c, src/nullable.h, src/output.c, + * src/output.h, src/parse-gram.c, src/parse-gram.y, src/print-xml.c, + * src/print-xml.h, src/print.c, src/print.h, src/print_graph.c, + * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c, + * src/reduce.h, src/relation.c, src/relation.h, src/scan-code.h, + * src/scan-code.l, src/scan-gram.h, src/scan-gram.l, src/scan-skel.h, + * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c, + * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h, + * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h, + * tests/actions.at, tests/atlocal.in, tests/bison.in, tests/c++.at, + * tests/calc.at, tests/conflicts.at, tests/cxx-type.at, + * tests/existing.at, tests/glr-regression.at, tests/headers.at, + * tests/input.at, tests/java.at, tests/javapush.at, tests/local.at, + * tests/local.mk, tests/named-refs.at, tests/output.at, tests/push.at, + * tests/reduce.at, tests/regression.at, tests/sets.at, + * tests/skeletons.at, tests/synclines.at, tests/testsuite.at, + * tests/torture.at, tests/types.at: + here. + +2014-01-03 Paul Eggert + + doc: specify documentation encoding + * doc/bison.texi: Add '@documentencoding UTF-8'; needed since the + manual contains UTF-8 characters. This will cause the .info files + to contain UTF-8 quotes and the like, which should be OK nowadays. + Add @documentlanguage while we're at it. + +2013-12-09 Akim Demaille + + package: install the examples + Currently, we do not install the various examples extracted from the + documentation. Let's do it, as they are useful starting points. + + * configure.ac: When --enable-gcc-warnings is set, enable ENABLE_GCC_WARNINGS. + * examples/extexi: No longer issue synclines by default. + * examples/local.mk: Except if ENABLE_GCC_WARNINGS. + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk: Install the example files. + +2013-12-09 Akim Demaille + + package: install README and the like in docdir + * Makefile.am: here. + +2013-12-09 Akim Demaille + + diagnostics: fix the order of multiple declarations reports + On + + %token FOO "foo" + %printer {} "foo" + %printer {} FOO + + we report + + /tmp/foo.yy:2.10-11: error: %printer redeclaration for FOO + %printer {} "foo" + ^^ + /tmp/foo.yy:3.10-11: previous declaration + %printer {} FOO + ^^ + + * src/symtab.c (locations_sort): New. + Use it. + * tests/input.at (Invalid Aliases): Stress the order of diagnostics. + +2013-12-09 Akim Demaille + + symbol: provide an easy means to compare them in source order + * src/symtab.c (symbols_sort): New. + (user_token_number_redeclaration): Taken from here. + +2013-12-05 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-12-05 Akim Demaille + + version 3.0.2 + * NEWS: Record release date. + +2013-12-05 Akim Demaille + + gnulib: update + * gnulib: here. + +2013-12-04 Akim Demaille + + output: do not generate source files when late errors are caught + Reported by Alexandre Duret-Lutz as "second problem" in: + http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html + + * bootstrap.conf: We need the "unlink" module. + * src/files.h, src/files.c (unlink_generated_sources): New. + * src/output.c: Use it. + * tests/output.at: Check the case of late errors. + +2013-12-04 Akim Demaille + + output: record what generated files are source or report files + * src/files.h, src/files.c (output_file_name_check): Take an additional + argument to record whether a file is a source or report file. + * src/files.c (generated_file): New. + (file_names, file_names_count): Replace with... + (generated_files, generated_files_size): these. + * src/scan-skel.l: Adjust. + +2013-12-04 Akim Demaille + + output: do not generate source files when early errors are caught + Reported by Alexandre Duret-Lutz as "second problem" in: + http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html + + One problem is that some errors are caught early, before the + generation of output files, while others can only be detected + afterwards (since, for instance, skeletons can raise errors + themselves). + + This will be addressed in two steps: early errors do not generate + source files at all, while later errors will remove the files that + have already been generated. + + * src/scan-skel.l (yyout): Open to /dev/null when there are errors. + * tests/output.at (AT_CHECK_FILES): Factored out of... + (AT_CHECK_OUTPUT): this. + Fuse the "SHELLIO" argument in the "FLAGS" one. + Use $5 to denote the expected exit status. + Add a test case for early errors. + +2013-11-26 Akim Demaille + + xml: also use "%empty" with html output + * data/xslt/xml2xhtml.xsl: No longer issue an Epsilon, display as in + dot and text formats. + +2013-11-26 Akim Demaille + + style: formatting changes + * src/print-xml.c: here. + +2013-11-26 Akim Demaille + + xml: also display %empty for empty right-hand sides + * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl: Display %empty where needed. + +2013-11-26 Akim Demaille + + reports: display %empty in the generated pointed-rules + * src/print.c (print_core): Use %empty for empty rules. + * src/print_graph.c (print_core): Ditto. + * tests/conflicts.at, tests/output.at, tests/reduce.at: Adjust + expectations. + +2013-11-26 Akim Demaille + + news: YYERROR vs variants + +2013-11-18 Akim Demaille + + style: scope reduction in lalr.cc + * src/lalr.c: Shorten variable scopes. + (lookahead_tokens_print): Use the same variable name in two loops + iterating over the same structure. + +2013-11-15 Akim Demaille + + lalr1.cc: formatting changes + * data/lalr1.cc: Fix indentation. + +2013-11-15 Akim Demaille + + lalr1.cc: fix the support of YYERROR with variants + When variant are enabled, the yylhs variable (the left-hand side of + the rule being reduced, i.e. $$ and @$) is explicitly destroyed when + YYERROR is called. This is because before running the user code, $$ + is initialized, so that the user can properly use it. + + However, when quitting yyparse, yylhs is also reclaimed by the C++ + compiler: the variable goes out of scope. + + Instead of trying to be too smart, let the compiler do its job: reduce + the scope of yylhs to exactly the reduction. This way, whatever the + type of scope exit (regular, exception, return, goto...) this variable + will be properly reclaimed. + + Reported by Paolo Simone Gasparello. + + + * data/lalr1.cc (yyparse): Reduce the scope of yylhs. + * tests/c++.at: We now pass this test. + +2013-11-15 Akim Demaille + + tests: check $$'s destruction with variant, YYERROR, and no error recovery + When variant are enabled, the yylhs variable (the left-hand side of + the rule being reduced, i.e. $$ and @$) is explicitly destroyed when + YYERROR is called. This is because before running the user code, $$ + is initialized, so that the user can properly use it. + + However, when quitting yyparse, yylhs is also reclaimed by the C++ + compiler: the variable goes out of scope. + + This was not detected by the test suite because (i) the Object tracker + was too weak, and (ii) the problem does not show when there is error + recovery. + + Reported by Paolo Simone Gasparello. + + + * tests/c++.at (Exception safety): Improve the objects logger to make + sure that we never destroy twice an object. + Also track copy-constructors. + Use a set instead of a list. + Display the logs before running the function body, this is more + useful in case of failure. + Generalize to track with and without error recovery. + +2013-11-15 Akim Demaille + + tests: simplify useless obfuscation + * tests/c++.at: $$ is not special for M4, there is no need to "escape" + it. + +2013-11-14 Akim Demaille + + skeletons: use better names when computing a "goto" + * data/glr.c (yyLRgotoState): Name the symbol argument yysym, instead + of yylhs. + * data/lalr1.cc (yy_lr_goto_state_): Likewise. + * data/lalr1.java (yy_lr_goto_state_): New, modeled after the previous + two routines. + Use it. + +2013-11-12 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-11-12 Akim Demaille + + version 3.0.1 + * NEWS: Record release date. + +2013-11-12 Akim Demaille + + aver: it is no longer "protected against NDEBUG" + Apply the same rules for aver as for assert: no side effects, + especially not important ones. + + * src/AnnotationList.c, src/muscle-tab.c: Adjust aver uses to resist + to -DNDEBUG. + +2013-11-08 Akim Demaille + + parsers: rename YY_NULL as YY_NULLPTR to avoid conflicts with Flex + Flex also defines YY_NULL (to 0). Avoid gratuitous conflicts. + + * data/c.m4 (b4_null_define): Rename YY_NULL as YY_NULLPTR. + + * data/glr.c, data/lalr1.cc, data/location.cc, data/variant.hh, + * data/yacc.c, src/parse-gram.c, tests/actions.at, tests/c++.at, + * tests/cxx-type.at, tests/glr-regression.at, tests/headers.at, + * tests/push.at, tests/regression.at: + Adjust. + +2013-11-05 Akim Demaille + + build: use Automake 1.14's non-recursive Makefile features + * configure.ac: Require Automake 1.14. + * examples/calc++/local.mk, examples/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk, tests/local.mk: Use %D% and %C%. + +2013-11-05 Akim Demaille + + build: restore maintainer-push-check + * tests/local.mk: here. + +2013-11-05 Akim Demaille + + c++: use __attribute__((__pure__)) to avoid warnings + Building C++ parsers with -Wsuggest-attribute=const and + -Wsuggest-attribute=noreturn triggers warning in generated code. + + * data/lalr1.cc: Call b4_attribute_define. + (debug_stream, debug_level): Flag as pure. + * tests/headers.at (Several parsers): There are now more YY macros + that "leak". + +2013-11-05 Akim Demaille + + skeletons: update the handling of compiler attributes + * data/c.m4 (b4_attribute_define): Instead of defining __attribute__, + define YY_ATTRIBUTE conditionally. + (YY_ATTRIBUTE_PURE, YY_ATTRIBUTE_UNUSED, _Noreturn): New. + Use them. + * data/glr.c: Use them. + +2013-11-05 Akim Demaille + + gnulib: update + +2013-10-24 Akim Demaille + + style: use /* ... */ comments + * src/complain.c: Here. + +2013-10-24 Akim Demaille + + tests: skip C++ tests that are too demanding for some compilers + Some tests now fail when compiled with G++ 4.3 or 4.4 on MacPorts. + + * tests/local.at (AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR): New. + * tests/c++.at (Exception safety): Use it. + +2013-10-22 Akim Demaille + + install: do not install yacc.1 when --disable-yacc + * configure.ac (ENABLE_YACC): New conditional. + (YACC_SCRIPT, YACC_LIBRARY): Remove. + * lib/local.mk, src/local.mk: Use the former instead of the latter. + * doc/local.mk: Use ENABLE_YACC to avoid installing yacc.1. + +2013-10-22 Akim Demaille + + style: avoid tabs + * src/scan-code.l: here. + +2013-10-22 Akim Demaille + + c++: fix generated doxygen comments + * configure.ac: Enable -Wdocumentation if supported. + * data/lalr1.cc: Fix comments. + +2013-10-22 Akim Demaille + + fix: uniqstr are already pointers + * src/uniqstr.c (uniqstr_assert): Remove incorrect double indirection, + and now useless cast. + +2013-10-22 Paul Eggert + + bison: pacify Sun C 5.12 + * src/scan-code.l (show_sub_message): + Redo initializations to work around a bogus Sun C 5.12 warning. + (parse_ref): Remove unreachable code that Sun C 5.12 complains about. + * src/uniqstr.h (uniqstr_vsprintf): Use + _GL_ATTRIBUTE_FORMAT_PRINTF (...) instead of __attribute__ + ((__format__ (__printf__, ...))). Otherwise, Sun C 5.12 + complains about an unknown attribute. + +2013-10-22 Paul Eggert + + maint: git now ignores rpcalc + * examples/rpcalc/.gitignore: Ignore rpcalc. + +2013-10-22 Paul Eggert + + build: examples/calc++/calc++ requires flex + * configure.ac (FLEX_CXX_WORKS): New AM_CONDITIONAL. + * examples/calc++/local.mk (examples/calc++/calc++): + Build if FLEX_CXX_WORKS, not BISON_CXX_WORKS. + +2013-10-22 Paul Eggert + + maint: mention help2man, texinfo, apt-get + * README-hacking: Add help2man, texinfo. + Describe how to add packages if you're using Debian. + +2013-10-22 Paul Eggert + + maint: git now ignores .log and .trs files + * .gitignore: Add *.log, *.trs. + +2013-10-21 Akim Demaille + + tests: fix incorrect object construction + Reported by Ken Moffat. + http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00009.html + + * tests/c++.at (Exception safety): Here. + +2013-10-16 Akim Demaille + + glr: allow spaces between "%?" and "{" in predicates + Reported by Rici Lake. + http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00004.html + http://stackoverflow.com/questions/19330171/ + + * src/scan-gram.l: Do not try to be too smart when diagnosing invalid + directives. + * tests/glr-regression.at (Predicates): New test. + +2013-10-16 Akim Demaille + + diagnostics: "-Werror -Wno-error=foo" must not emit errors + Currently "-Werror -Wno-error=foo" still turns "foo" warnings into errors. + Reported by Alexandre Duret-Lutz. + See http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html. + + * src/complain.c (errority, errority_flag): New. + (complain_init): Initialize the latter. + (warning_argmatch): Extract the loop iterating on the flag's bits. + Set and unset errority_flag here. + (warnings_argmatch): -Wno-error is not the same as -Wno-error=everything: + we must remember if category foo was explicitly turned in an error/warning + via -W(no-)error=foo. + (warning_severity): Use errority_flag. + + * tests/input.at (Symbols): Just check --yacc, not -Wyacc, that's the + job of tests on -W. + (-Werror is not affected by -Wnone and -Wall): Rename as... + (-Werror combinations): this. + Tests more combinations of -W, -W(no-)error, and -W(no-)error=foo. + * tests/local.at (AT_BISON_CHECK_WARNINGS): Don't expect -Werror + to turn runs that issue warnings into runs with errors, as the + warnings might be enforced as warnings by -Wno-error=foo, in which + case -Werror does not change anything. + + * doc/bison.texi (Bison Options): Try to be clearer about how + -W(no-)error and -W(no-)error=foo interact. + +2013-10-16 Akim Demaille + + comment changes + * src/complain.h, src/complain.c: More documentation, more comments. + +2013-10-04 Andreas Schwab + + location: fix EOF check + * location.c (location_caret): Use int, not char, for values from + getc. + +2013-09-19 Akim Demaille + + style: variant: remove empty line + * data/variant.hh (b4_symbol_constructor_define_): Remove + stray eol. + +2013-09-19 Akim Demaille + + glr: more assertions + * data/glr.c (yyaddDeferredAction, yyglrShiftDefer, yypdumpstack): + More assertions. + +2013-09-19 Akim Demaille + + glr: shorten scopes + * data/glr.c (yyglrReduce): Define yyflag with its value. + +2013-09-19 Akim Demaille + + glr: formatting changes + * data/glr.c: here. + +2013-09-19 Akim Demaille + + glr: better use of tracing macros + * data/glr.c (yydestroyGLRState): Use YY_SYMBOL_PRINT instead of + yy_symbol_print. + +2013-09-19 Akim Demaille + + examples: improve the output of the "variant" example + * examples/variant.yy: Improve the printing of lists. + +2013-09-19 Akim Demaille + + variant: remove useless assertion + * data/variant.hh (move): Remove precondition assertion which is + ensured by the first call of the body (this precondition is also one + of "build"). + +2013-09-19 Akim Demaille + + tests: remove stray debugging traces + * tests/atlocal.in: Remove traces. + Be ready to remove conftest.dSYM generated on OS X. + +2013-09-04 Akim Demaille + + tests: do not use grep -q + Reported by Daniel Galloway. + http://lists.gnu.org/archive/html/bug-bison/2013-08/msg00020.html + + * tests/java.at: Ignore grep's output instead. + +2013-08-25 Paul Eggert + + build: don't require flex for ordinary builds + * configure.ac (LEX): Don't fail if this is lex, as flex is not + required for ordinary builds. Instead, issue a warning and + substitute a no-op LEX. Reported by Michael Felt in + . + +2013-08-25 Paul Eggert + + maint: update .gitignore + * .gitignore: Add *.eps, *.o, *.pdf, *.png, *.stamp, *~, + .deps, .dirstamp. Needed to suppress unwanted chatter from + 'git status' after a bootstrap build. + +2013-08-24 Paul Eggert + + build: port to pre-5.8.7 perl + * examples/local.mk (extract): Omit -f from perl options. + This doesn't work with perl versions before 5.8.7 + that are configured without USE_SITECUSTOMIZE. + Reported by Michael Felt in + . + +2013-08-01 Akim Demaille + + tests: minor change to make it easier to test other skeletons + * tests/c++.at (Variants): Pass the skeleton as argument. + +2013-08-01 Valentin Tolmer + + uniqstr: fix assertion + * src/uniqstr.c (uniqstr_assert): Really make sure str is a uniqstr, + not just whether some uniqstr with the same content was registered. + +2013-08-01 Akim Demaille + + build: ship the ASCII art figures + We don't ship the *.txt files that are used to build the info + file. + Reported by Colin Daley. + + * doc/figs/example.txt: New. + * doc/local.mk (bison.info): Depend on the txt files. + And ship them. + +2013-08-01 Akim Demaille + + doc: prefer the ".gv" extension to ".dot" + See http://marc.info/?l=graphviz-devel&m=129418103126092 for the + motivation (basically, some word processor now uses *.dot). + + * doc/figs/example-reduce.dot: Rename as... + * doc/figs/example-reduce.gv: this. + * doc/figs/example-shift.dot: Rename as... + * doc/figs/example-shift.gv: this. + * doc/figs/example.dot: Rename as... + * doc/figs/example.gv: this. + * doc/local.mk: Adjust. + +2013-07-25 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-07-25 Akim Demaille + + version 3.0 + * NEWS: Record release date. + +2013-07-25 Akim Demaille + + regen + +2013-07-25 Akim Demaille + + news: prepare 3.0 + * NEWS (3.0): Reorder. + +2013-07-25 Akim Demaille + + tests: fix invalid assignment when using variants in C++11 + * tests/c++.at (Exception safety): In variant mode $$ is an instance + of Object. Assigning YY_NULL in C++98 is incorrect, but behaves ok, + as it assigns YY_NULL=0 using Object::operator= (char v). It is wrong + in C++11 as there is operator for "$$ = nullptr". + +2013-07-25 Akim Demaille + + yacc: beware of "uninitialized uses" warnings + Again some issues with the fact that yylval is reported by GCC as + possibly not initialized in some cases. Here, the case at hand is the + %destructor. + + I am still not convinced that it is worth going all the trouble of + using pragmas to disable temporarily some warnings, instead of just + initializing the looking symbol once for all, but that's what Paul + voted for, see + . + + * data/c.m4 (b4_attribute_define): Define + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, + YY_INITIAL_VALUE here, as we will need them in the generation of the + destructor function, which is defined in yacc.c before yyparse, which + was in charge of defining these macros. + * data/yacc.c (b4_declare_scanner_communication_variables): Simplify: + trying to factor the definitions of the case pure and impure is + too complex. + Actually, it is not even clear that this macro should really exist, + as even the calls are complex. + Be careful not to issue a lone ";", as this is a statement, and C90 + forbids declarations after statements ; so write + "YY_INITIAL_VALUE(Decl;)", not "YY_INITIAL_VALUE(Decl);". + +2013-07-25 Akim Demaille + + gnulib: update + +2013-07-03 Akim Demaille + + tests: skip C++ tests if we can't compile a simple program + There are possible conflicts between gnulib replacement functions (in + ) and their C++ wrappers (in ). Trying to address + these in configure seems too hard, and I don't know how to fix the issue + in gnulib. Cowardly avoid the problem by skipping C++ tests when this + happens. + Reported by Stefano Lattarini. + http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00001.html + + * tests/atlocal.in (BISON_CXX_WORKS): Also set it to "skip" if we can't + compile a simple program using . + * tests/local.at: Comment changes. + +2013-07-03 Akim Demaille + + tests: fix 'find' portability issues + Reported by Stefano Lattarini. + http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00000.html + + * tests/output.at (AT_CHECK_OUTPUT): Use Perl instead. + +2013-06-24 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-06-24 Akim Demaille + + version 2.7.91 + * NEWS: Record release date. + +2013-06-24 Akim Demaille + + NEWS: prepare for 2.7.91 + * NEWS (2.7.91): Java push parsers. + +2013-06-24 Akim Demaille + + java: rename YYMORE as YYPUSH_MORE for consistency with C + http://lists.gnu.org/archive/html/bison-patches/2013-06/msg00008.html + + * data/lalr1.java, doc/bison.texi, tests/javapush.at: + s/YYMORE/YYPUSH_MORE. + +2013-06-21 Akim Demaille + + tests: fix Java push failure when running with BISON_USE_PUSH_FOR_PULL + * tests/javapush.at (Trivial Push Parser with api.push-pull verification): + When push for pull is enabled, there is one such function generated. + +2013-06-21 Akim Demaille + + style: minor changes in the Java tests + * tests/java.at (AT_CHECK_JAVA_GREP): Ignore the exit status. + * tests/javapush.at (AT_CHECK_JAVA_GREP): Be more alike the previous + one. + Formating changes. + Remove stray debugging "jj" file. + +2013-06-21 Akim Demaille + + java: push: do not reset the error counter + * data/lalr1.java (parse): here, when in push-pull is in "both" mode. + This breaks the test suite, for instance + make check TESTSUITEFLAGS='-d 388 BISON_USE_PUSH_FOR_PULL=1'. + More generally make maintainer-push-check. + +2013-06-14 Akim Demaille + + build: add Valgrind suppression file for GNU/Linux + * build-aux/linux-gnu.valgrind: New. + * build-aux/local.mk: Ship it. + * configure.ac: Use it. + +2013-06-13 Dennis Heimbigner + + java: add push-parser support + * data/lalr1.java: Capture the declarations as m4 macros to avoid + duplication. When push parsing, the declarations occur at the class + instance level rather than within the parse() function. + + Change the way that the parser state is initialized. For + push-parsing, the parse state declarations are moved to + "push_parse_initialize()", which is called on the first invocation of + "push_parse()". The %initial-action code is also inserted after the + invocation of "push_parse_initialize()". + + The body of the parse loop is modified to return values at appropriate + points when doing push parsing. In order to make push parsing work, + it is necessary to divide YYNEWSTATE into two states: YYNEWSTATE and + YYGETTOKEN. On the first call to push_parse(), the state is + YYNEWSTATE. On all later entries, the state is set to YYGETTOKEN. The + YYNEWSTATE switch arm falls through into YYGETTOKEN. YYGETTOKEN + indicates that a new token is potentially needed. Normally, with a + pull parser, this new token would be obtained by calling "yylex()". In + the push parser, the value YYMORE is returned to the caller. On the + next call to push_parse(), the parser will return to the YYGETTOKEN + state and continue operation. + + * tests/javapush.at: New test file for java push parsing. + * tests/testsuite.at: Use it. + * tests/local.mk: Adjust. + * doc/bison.texi (Java Push Parser Interface): New. + +2013-06-11 Akim Demaille + + build: ship all the files, even if the C++ compiler is broken + * examples/calc++/local.mk: Be sure to ship calc++.test even if + the current C++ compiler is not sufficient to run the tests. + +2013-06-05 Dennis Heimbigner + + style: comment changes in Java skeleton + * data/lalr1.java: Here. + +2013-06-03 Akim Demaille + + tests: fix a G++ warning + * tests/c++.at: Use YY_NULL instead of 0 for the null pointer. + And formatting changes. + +2013-06-03 Akim Demaille + + build: fix a warning from clang + * src/muscle-tab.c: Declare local functions static. + +2013-05-30 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-05-30 Akim Demaille + + version 2.7.90 + * NEWS: Record release date. + +2013-05-30 Akim Demaille + + style: syntax-check fixes + * data/yacc.c, src/Sbitset.c, src/Sbitset.h, src/muscle-tab.h, + * src/output.c, src/parse-gram.y, src/reader.c, src/symtab.c, + * src/uniqstr.c, src/uniqstr.h: Fix space before parens. + * cfg.mk (_space_before_paren_exempt): Add needed exceptions. + +2013-05-30 Akim Demaille + + xml: use %empty in the text output + * data/xslt/xml2text.xsl: here. + +2013-05-30 Akim Demaille + + build: locally disable new GCC warnings that fail on Flex generated code + * configure.ac: here. + +2013-05-30 Akim Demaille + + fix a memory leak + * src/print-xml.c (num_escape_bufs): New. + (print_xml): Be sure to release all the escape_bufs. + +2013-05-30 Akim Demaille + + regen + +2013-05-30 Akim Demaille + + build: be sure to include config.h first in the generated parser + Using %code for config.h is wrong, as some headers will already have + been included by Bison. In some cases, e.g., glibc's string.h, this + results in some declaration not being made for lack of definition of + _GNU_SOURCE, which is performed by config.h. + + * src/parse-gram.y: here. + +2013-05-29 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: post-release administrivia + version 2.7.1 + regen + +2013-05-29 Petr Machata + + drop unused options --raw, -n, -e, --include and -I + * --raw appears to be ignored. It was marked as obsolete in the + commit ec3bc39, and documented as no longer supported as of 1.29 + (2001-09-07). Support for %raw appears to have been dropped in + e9955c83 on 2002-06-11, but --raw was kept around. Maybe it's time + to drop it as well? + + * Commit e9955c83 dropped support for %no-parser as well, and + converted it to option. --no-parser was later dropped in 728c4be2 + on 2007-08-12, but -n was kept around, probably as an omission. All + three are documented as removed since 2.3b (2008-05-27). + + * -e existed for a single day in 2001. It was introduced in eeeb962b + on 2001-11-27. The handling was removed in c7925b99 on 2001-11-28, + but "e" was kept in the list of short options. Probably an + omission. + + * --include appears to be dead code. The option sets a variable, but + that variable is not used anywhere. It was added in f6bd5427 on + 2001-11-26 as a %-directive, with comments that it's not yet + implemented. It was converted to a command-line option later, but + doesn't seem to ever have been actually implemented. + +2013-05-28 Akim Demaille + + gnulib: update + +2013-04-22 Akim Demaille + + diagnostics: always point to the first directive + Some directives cannot be used several times (e.g., a given symbol may + only have a single printer). In case of repeated definitions, an + error is issued for the second definition, yet it is not discarded, + and becomes the definition used for the rest of the file. + + This is not consistent with the idea that multiple definitions are not + allowed: discard any repeated directive. + + * src/symtab.c (symbol_type_set, symbol_code_props_set) + (semantic_type_code_props_set, symbol_class_set, symbol_translation): + Discard repeated directives. + * tests/input.at (Default %printer and %destructor redeclared) + (Per-type %printer and %destructor redeclared): Update expectations. + +2013-04-22 Akim Demaille + + tests: factor test for printer/desctructor redefined + * tests/input.at (Default %printer and %destructor redeclared): + Introduce AT_TEST to factor. + +2013-04-22 Akim Demaille + + diagnostics: use appropriate location for useless precedence/associativity + * src/symtab.c (symbol_precedence_set): Use prec_location, not + location (which is the first occurrence of the symbol, possibly just + %token). + Also, as redefinitions are not allowed, keep the first values, not + the subsequent ones. + * tests/conflicts.at, tests/existing.at, tests/regression.at: Adjust. + +2013-04-22 Akim Demaille + + tests: factor duplicate expected warnings + * tests/existing.at: Instead of "t ? abc : aBc", write "a(t?b:B)c". + +2013-04-19 Akim Demaille + + tests: enable -Wsign-compare and fix corresponding warnings + -Wsign-compare was disabled for bison's own code, following gnulib's + approach. However, the generated parsers should not trigger such + warnings. + + Reported by Efi Fogel. + http://lists.gnu.org/archive/html/help-bison/2013-04/msg00018.html + + See also http://stackoverflow.com/questions/16101062 for the weird + "-(unsigned)i" piece of code. + + * configure.ac (warn_tests): Enable -Wsign-compare. + * data/location.cc (position::add_): New. + (position::lines, position::columns): Use it. + * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): Fix signedness issues. + +2013-04-18 Akim Demaille + + muscle: check more cases of %define variables with code values + * data/bison.m4 (b4_percent_define_check_kind): Fix overquotation. + (api.location.type, api.position.type): Check they have code values here. + * data/c++.m4 (api.location.type): No longer checked here. + (parser_class_name): Check it here. + * data/java.m4 (api.value.type, init_throws, lex_throws, parser_class_name) + (throws, annotations, extends, implements): Check they have code values. + * doc/bison.texi: Fix every incorrect occurrence of %define. + Document the additional syntax for %define: code values. + Document the additional syntax for -D/-F: string and code values. + * tests/calc.at, tests/headers.at, tests/input.at, tests/java.at, + * tests/local.at: Fix dependencies. + +2013-04-18 Akim Demaille + + regen + +2013-04-18 Akim Demaille + + parser: do not convert $ and @ in code values of %define variables + * src/parse-gram.y (value: "{...}"): Just strip the braces, but pass + the value as is. + +2013-04-18 Akim Demaille + + parser: no longer use the "braceless" non-terminal + The purpose of this symbol was only to factor function calls. As a + result the actions were indeed simpler, but the grammar was somewhat + uselessly obfuscated. Get rid of this symbol, but introduce functions + to simplify dependencies. + + There is no (intended) changes of behavior here. + + * src/parse-gram.y (strip_braces, translate_code( + (translate_code_braceless): New. + (braceless): Remove, use "{...}" instead, and one of the previous + functions depending on the context. + (STRING, "%{...%}", EPILOGUE): Declare as , instead of , + the difference between both is useless (well, I couldn't make sense of + it, even after having read the initial commit that introduced them). + (%union): Remove the now useless "chars" type. + Adjust the printers. + * src/scan-gram.l: Adjust. + +2013-04-18 Akim Demaille + + regen + +2013-04-18 Akim Demaille + + style: avoid %{...%} in our parser + * src/parse-gram.y (%{...%}): Split in %code and %code requires. + * src/location.h: Add missing includes for self containedness. + +2013-04-18 Akim Demaille + + style: use %code for local function declarations in our parser + * src/parse-gram.y (version_check, gram_error, char_name, lloc_default): + Move their prototypes from %{...%} to %code. + (YYLLOC_DEFAULT, YY_LOCATION_PRINT): Move from %{...%} to %code. + (current_lhs): Move its implementation to the epilogue. + +2013-04-16 Akim Demaille + + regen + +2013-04-16 Akim Demaille + + muscle: check the kind of api.prefix, api.location.type + * data/bison.m4: Check api.prefix. + * data/c++.m4: Check api.location.type. + * doc/bison.texi: Fix uses of api.value.type, api.prefix, api.location.type. + Document {...} values for %define. + * src/parse-gram.y: Fix use of api.prefix. + * tests/calc.at: Fix uses of api.location.type. + * tests/input.at: Check api.prefix, and api.location.type. + +2013-04-15 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-04-15 Akim Demaille + + version 2.7.1 + * NEWS: Record release date. + +2013-04-15 Akim Demaille + + regen + +2013-04-15 Akim Demaille + + muscle: enforce definition syntax for keyword variables + * src/muscle-tab.c (muscle_percent_define_get_kind) + (muscle_percent_define_check_kind): New. + (muscle_percent_define_default): Variables with a default value are + of "keyword" kind. + (muscle_percent_define_flag_if, muscle_percent_define_check_values): + Check that the variable is of keyword kind. + * data/bison.m4: Likewise, but in M4. That is to say... + (b4_percent_define_default): Define the kind when the variable is undefined. + (b4_percent_define_check_kind): Use a better error message. + (_b4_percent_define_check_values, _b4_percent_define_check_values): + Former "enum" variables should be defined using the keyword syntax. + * doc/bison.texi: Update. + A couple of fixes. + * tests/input.at (%define keyword variables): New. + +2013-04-15 Akim Demaille + + muscle: let -D/-F support the three kinds of %define variable values + See http://lists.gnu.org/archive/html/bison-patches/2013-04/msg00012.html + + * src/getargs.c (getargs): Recognize {value} and "value" for -D and -F. + +2013-04-15 Akim Demaille + + muscle: minor refactoring + * src/muscle-tab.c (muscle_percent_define_default): Reduce the scopes. + +2013-04-15 Akim Demaille + + muscle: minor simplification which uncovers a missing warning + * src/muscle-tab.c (muscle_percent_define_ensure): Discover the virtues + of || to factor conditionals. + * NEWS: As api.pure is no longer flagged as "used" by accident, + we now have warnings for useless definitions. + * tests/calc.at: So remove api.pure settings when running C++ tests, + since C++ skeletons use a pure interface. + +2013-04-15 Akim Demaille + + muscle: factor the field retrieval + * src/muscle-tab.c (muscle_percent_define_get_raw): New. + Use it where appropriate. + (location_decode): No longer fetch the value from the table, + take the value as argument. + +2013-04-15 Akim Demaille + + muscle: factor the handling of used variables + * src/muscle-tab.c (muscle_percent_define_use): New, corresponding + to b4_percent_define_use. + Use it where appropriate. + +2013-04-15 Akim Demaille + + muscle: factor the computation of variable names + * src/muscle-tab.c (muscle_name): New. + Use it. + Propagate "uniqstr" as value type instead of plain "char const *". + +2013-04-15 Akim Demaille + + muscle: factor the kind check in M4 + * data/bison.m4 (b4_percent_define_check_kind): New. + Use it to check api.token.prefix. + * data/c++.m4: Check the kind of api.namespace. + * doc/bison.texi: Update a reference to former 'namespace' variable. + * tests/input.at ("%define" code variables): Check api.namespace. + +2013-04-15 Akim Demaille + + muscle: factor conditionals on defined %define variables + * data/bison.m4 (b4_percent_define_ifdef_): New. + Use it where appropriate. + +2013-04-11 Akim Demaille + + api.token.prefix: use code values + * data/bison.m4: Remove useless (and incorrect: m4_* instead of b4_*) + default assignment to api.token.prefix. + Check that api.token.prefix is assigned code. + * tests/input.at (%define code variables): New test. + * NEWS, doc/bison.texi, tests/c++.at, tests/calc.at, + * tests/java.at, tests/local.at: Adjust to use braces. + +2013-04-11 Akim Demaille + + c++: fix several issues with locations + Reported by Daniel Frużyński. + http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html + + * data/location.cc (position::columns, position::lines): Check for + underflow. + Fix some weird function signatures. + (location): Accept signed integers as arguments where appropriate. + Add operator- and operator+=. + * doc/bison.texi (C++ position, C++ location): Various fixes + and completion. + * tests/c++.at (C++ Locations): New tests. + +2013-04-11 Akim Demaille + + muscles: be sure that %code snippets are not glue together on a single line + Recently "braceless" in the parser was changed so that an eol was no + longer added to the value. This is not correct when a %code is used + multiple times, because the syncline of the next snippet might be + appended to the last (and not ended) line of the previous snippet. + + * src/muscle-tab.h (muscle_grow): Make it private. + * src/muscle-tab.c (muscle_grow): Accept a fourth argument: a required + terminator. + Adjust callers. + * tests/input.at (Multiple %code): New. + +2013-04-11 Akim Demaille + + style: fix comments + * tests/actions.at: Fix incorrect "prototype". + +2013-04-10 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + glr.cc: fix a clang warning + maint: update copyright years + build: fix VPATH issue + build: avoid clang's colored diagnostics in the test suite + tests: please clang and use ".cc", not ".c", for C++ input + gnulib: update + skeletons: avoid empty switch constructs + lalr1.cc: fix compiler warnings + yacc.c: do not use __attribute__ unprotected + tests: style changes + +2013-04-09 Akim Demaille + + api.value.type: use keyword/brace values + Suggested by Joel E. Denny. + http://lists.gnu.org/archive/html/bison-patches/2013-03/msg00016.html + + * data/bison.m4 (b4_percent_define_get_kind): New. + (b4_variant_flag): Check that api.value.type is defined as the 'variant' + keyword value. + * data/c.m4 (_b4_value_type_setup_keyword): New. + (b4_value_type_setup): Use it to simplify reading. + Use b4_define_silent. + Decode api.value.type, including its type. + (b4_value_type_define): Likewise. + * data/c++.m4 (b4_value_type_declare): Adjust the decoding of api.value.type, + taking its kind into account. + * doc/bison.texi: Adjust all the examples to the new syntax. + * NEWS: Ditto. + * tests/types.at: Adjust + +2013-04-09 Akim Demaille + + api.value.type: diagnose guaranteed failure with --yacc + Instead of generating invalid C code, generate an error when --yacc and + '%define api.value.type union' are used together. + + * data/bison.m4: Issue an error in this case. + * tests/types.at (%yacc vs. %define api.value.type union): New, check this + error. + * doc/bison.texi (Type Generation): Document it. + * tests/output.at: Check that '-o y.tab.c' and '-y' behave equally + wrt generated file names. + * NEWS (Use of YACC='bison -y'): New. + Promote the use of 'bison -o y.tab.c'. + +2013-04-09 Akim Demaille + + doc: style changes + * doc/bison.texi (Destructor Decl, Printer Decl): Group series of %token + and %type together. + +2013-04-09 Akim Demaille + + doc: display locations in error as recommended by GNU Coding Standards + * doc/bison.texi (Actions and Locations): here. + +2013-04-09 Akim Demaille + + doc: api.value.type union + * doc/bison.texi (Type Generation): New section. + (Multi-function Calc): Convert to use api.value.type=union. + +2013-04-09 Akim Demaille + + doc: move the section about "%union" where types are discussed + * doc/bison.texi (Union Decl): Move to... + (Defining Language Semantics): here. + +2013-04-09 Akim Demaille + + doc: deprecate #define YYSTYPE in favor of %define api.value.type + * doc/bison.texi: Convert examples with YYSTYPE to use api.value.type. + Deprecate YYSTYPE. + +2013-04-09 Akim Demaille + + value type: accept "->" in type tags + Provide a means to dereference pointers when defining tags. One + example could be: + + %code requires + { + typedef struct ListElementType + { + union value + { + int intVal; + float floatVal; + char* charptrVal; + } value; + + struct ListElementType* next; + } ListElementType; + } + + %union + { + ListElementType* list; + } + + %token value.charptrVal> STRING + %token value.intVal> INTEGER + %token value.floatVal> REAL + %type ElementList LiteralType + + * src/scan-code.l, src/scan-gram.l: Accept "->" in tags. + * tests/types.at: Add more test cases to cover this case. + +2013-04-09 Akim Demaille + + style: simplify the scanning of type tags + * src/scan-gram.l: Remove the rule for simple tags: the "complex" case + subsumes it. It was more efficient, but duplicated the code for a + negligible benefit. + +2013-04-09 Akim Demaille + + api.value.type: implement proper support, check, and document + * data/c.m4 (b4_symbol_type_register, b4_type_define_tag) + (b4_symbol_value_union, b4_value_type_setup_union) + (b4_value_type_setup_variant, b4_value_type_setup): + New. + (b4_value_type_define): Use it to set up properly the type. + Handle the various possible values of api.value.type. + * data/c++.m4 (b4_value_type_declare): Likewise. + * data/lalr1.cc (b4_value_type_setup_variant): Redefine. + + * tests/types.at: New. + Exercise all the C/C++ skeletons with different types of + api.value.type values. + * tests/local.mk, tests/testsuite.at: Use it. + + * doc/bison.texi (%define Summary): Document api.value.type. + * NEWS: Advertise it, together with api.token.constructor. + +2013-04-09 Akim Demaille + + m4: allow the definition of side-effect only macros + * data/bison.m4 (b4_divert_kill, b4_define_silent): New. + * data/c.m4: Comment change. + +2013-04-09 Akim Demaille + + variant: fix inconsistent quotation + * data/variant.hh (b4_char_sizeof): De-overquote. + (b4_value_type_declare): De-underquote. + +2013-04-09 Akim Demaille + + m4: style changes in error messages + * data/bison.m4: Use $0 to denote the current macro's name. + +2013-04-08 Akim Demaille + + glr.cc: fix a clang warning + * data/glr.cc (b4_epilogue): Be sure to end with an end-of-line, + so that the file does end with one. + +2013-04-08 Akim Demaille + + maint: update copyright years + Run "make update-copyright". + +2013-04-08 Akim Demaille + + build: fix VPATH issue + * Makefile.am (update-b4-copyright, update-package-copyright-year): Fix + path to build-aux. + +2013-04-08 Akim Demaille + + build: avoid clang's colored diagnostics in the test suite + The syncline tests, which try to recognize compiler diagnostics, + are confused by escapes for colors. + + * configure.ac (warn_tests): New, to factor the warnings for both + C and C++ tests. + Add -fno-color-diagnostics to it. + * tests/local.at (AT_TEST_TABLES_AND_PARSE): Do not remove glue + together compiler flags. + +2013-04-08 Akim Demaille + + tests: please clang and use ".cc", not ".c", for C++ input + When fed with foo.c, clang++ 3.2 answers: + + clang: error: treating 'c' input as 'c++' when in C++ mode, + this behavior is deprecated + + * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use *.cc and *.hh + for C++. + +2013-04-08 Akim Demaille + + gnulib: update + +2013-04-08 Akim Demaille + + skeletons: avoid empty switch constructs + Reported by Rob Conde. + http://lists.gnu.org/archive/html/bug-bison/2013-03/msg00003.html + + * data/c.m4 (b4_symbol_actions): Rename as... + (_b4_symbol_actions): this. + (b4_symbol_actions): New wrapper. + Do not emit empty switches. + Adjust all b4_symbol_actions callers. + +2013-04-08 Akim Demaille + + lalr1.cc: fix compiler warnings + Reported by Rob Conde. + http://lists.gnu.org/archive/html/bug-bison/2013-03/msg00003.html + + * data/stack.hh (operator=, stack(const stack&)): Make this class + uncopyable, i.e., "undefine" these operators: make them private and + don't implement them. + (clear): New. + * data/lalr1.cc: Use it instead of an assignment. + (parser): Make this class uncopyable. + +2013-04-08 Akim Demaille + + yacc.c: do not use __attribute__ unprotected + Reported by Victor Khomenko. + http://lists.gnu.org/archive/html/bug-bison/2013-04/msg00001.html + + * data/glr.c (YYUSE, __attribute__): Fuse their definition into... + * data/c.m4 (b4_attribute_define): this new macro. + * data/yacc.c, data/glr.c: Use it. + +2013-04-05 Akim Demaille + + api.namespace: demonstrate and use {...} values instead of "..." values + * tests/c++.at, tests/input.at: Use "%define api.namespace {foo}" instead + of using quotes. + * tests/local.at (AT_SETUP_STRIP, AT_NAME_PREFIX): Recognize uses of + braces instead of quotes. + * doc/bison.texi: Use braces for api.namespace's values. + +2013-04-05 Akim Demaille + + grammar: do not add a \n at the end of blocks of code + Now that we use "braceless" (which is {...} blocks of code with + initial and final braces stripped) to denote "short" values (such as + api.namespaces), the added end-of-line is a nuisance. As a matter of + fact, this extra-safety was useless, as every expansion of "braceless" + (aka, "user code") is followed by an end of line. + + * src/parse-gram.y, src/parse-gram.c (braceless): Instead of replacing + the final brace by \n, just delete the brace. + +2013-04-04 Akim Demaille + + regen + +2013-04-04 Akim Demaille + + grammar: record the kind of %define variable values + Provide a means to tell the difference between "keyword" values (e.g., + %define api.pull both), "string" values (e.g., %define file.name + "foo"), and "code" values (e.g., %define api.namespace {calc}). + + Suggested by Joel E. Denny. + http://lists.gnu.org/archive/html/bison-patches/2013-03/msg00016.html + + * src/muscle-tab.h, src/muscle-tab.c (muscle_kind, muscle_kind_new) + (muscle_kind_string): New. + (muscle_percent_define_insert): Take the kind as new argument. + Insert it in the muscle table. + Adjust callers. + * src/getargs.c: Adjust callers. + * src/parse-gram.y: Ditto. + (content.opt): Remove, replaced by... + (value): this new non-terminal, whose semantics value is stored + in the new "value" union member. + Provide a printer. + Support values in braces in additions to keyword and string values. + + fuse me + +2013-04-04 Akim Demaille + + style: fix comments + * src/muscle-tab.c (muscle_percent_define_ensure): Update obsolete + comments. + +2013-04-04 Akim Demaille + + regen + +2013-04-04 Akim Demaille + + grammar: style changes + * src/parse-gram.y (PARAM_TYPE): Remove useless typedef guard. + There's a header guard. + Use 'yyo' with %printer. + Use a consistent style for %union one-liners. + +2013-04-04 Akim Demaille + + grammar: split %union to group together related aspects + * src/parse-gram.y (INT): Fuse the %type and %token declaration. + Move its %union right before its introduction. + (%union): Split in several %unions, right before their use. + +2013-04-04 Akim Demaille + + muscle: refactor + * src/muscle-tab.c (muscle_lookup, muscle_entry_new): New. + (muscle_insert, muscle_grow, muscle_find_const, muscle_find): Use them. + +2013-04-03 Akim Demaille + + style: comment changes + * src/muscle-tab.c: Move the documentation of public functions to... + * src/muscle-tab.h: here. + Fix comment consistency issues. + +2013-04-03 Akim Demaille + + muscle: minor refactoring + * src/muscle-tab.h (MUSCLE_INSERT_C_STRING): Use MUSCLE_INSERT_STRING. + +2013-03-06 Akim Demaille + + regen + +2013-03-06 Valentin Tolmer + + gram: correct token numbering in precedence declarations + In a precedence declaration, when tokens are declared with a litteral + character (e.g., 'a') or with a identifier (e.g., B), Bison behaved + differently: the litteral tokens would be numbered first, and then the + other ones, leading to the following grammar: + + %right A B 'c' 'd' + + being numbered as such: 'c' 'd' A B. + + * src/parse-gram.y (symbol.prec): Set the symbol number when reading the + symbols. + * tests/conflicts.at (Token declaration order: literals vs. identifiers): + New. + +2013-03-04 Akim Demaille + + maint: update autoconf submodule + * submodules/autoconf: Up to master. + No significant changes in the files we use (m4sugar.m4 and foreach.m4). + +2013-03-04 Akim Demaille + + diagnostics: no longer include the yacc category in -Wall + It would be a pity to warn the users against Bison features... + http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00107.html + + * src/complain.h, src/complain.c (Wall): Disable Wyacc. + (Weverything): New (hidden so far) category which really denotes all + the categories (what used to be Wall). + (warnings_args, warnings_types): Adjust. + (warning_argmatch): Now !none = Weverything and conversely, no longer Wall. + * NEWS, doc/bison.texi, src/getargs.c: Adjust the documentation. + * tests/input.at (-Werror is not affected by -Wnone and -Wall): Adjust + by not using a -Wyacc type of warning. + +2013-03-04 Akim Demaille + + grammar: no longer detect and cure missing semicolon at end of actions + Bison 3.0 is already breaking backward compatibility with other + features. It is an appropriate time to drop this feature. Note that + it was disabled when --yacc is passed. See + http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00102.html + + Basically, revert e8cd1ad655bcc704b06fb2f191dc3ac1df32b796. + + * src/scan-code.l (braces_level, need_semicolon, in_cpp): Remove. + Remove every rule needed to detect and add missing semicolon. + * tests/actions.at (Fix user actions without a trailing semicolon): + Remove. + * NEWS: Adjust. + +2013-03-04 Akim Demaille + + build: stop using bison -y + * Makefile.am (YACC): Pass -o y.tab.c, so that ylwrap is happy, and + yet we don't pass --yacc to bison. + (AM_YFLAGS): Disable Yacc warnings. + +2013-02-23 Akim Demaille + + c++: rename b4_semantic_type_declare as b4_value_type_declare + This is to match the names used in C and api.value.type, even if the + parser actually defines semantic_type. + + * data/c++.m4 (b4_semantic_type_declare): Rename as... + (b4_value_type_declare): this. + * data/variant.hh: Likewise. + +2013-02-23 Akim Demaille + + news: typo + * NEWS: here. + +2013-02-23 Akim Demaille + + style: space changes in the tests + * tests/local.at: here. + +2013-02-22 Akim Demaille + + style: formatting changes in the doc + * doc/bison.texi: Use @file where appropriate. + +2013-02-19 Akim Demaille + + tests: fix invalid C++11 code + * tests/c++.at (Object): Somehow instances of Object were assigned + YY_NULL, which is 0 most of the time (that case passes), but is + nullptr in C++11, and there is nothing in Object to support such an + assignment (failure). Use 0 as value, and provide the needed + assignment operator. + Also, use a more natural order within the class definition. + +2013-02-19 Akim Demaille + + tests: fix failures with G++ 4.8 in Flex scanner + * configure.ac (WARN_NO_NULL_CONVERSION_CXXFLAGS): Rename as... + (FLEX_SCANNER_CXXFLAGS): this. + Pass -Wno-zero-as-null-pointer-constant to G++ if it supports it. + * examples/calc++/local.mk: Adjust. + +2013-02-19 Akim Demaille + + regen + +2013-02-19 Akim Demaille + + gnulib: update + +2013-02-19 Akim Demaille + + style: rename variant private members + * data/variant.hh (buffer, tname, as_, raw, align_me): Rename as... + (yybuffer_, yytname_,yyas_, yyraw, yyalign_me): these. + +2013-02-19 Akim Demaille + + style: space changes + * data/variant.hh: Be sure to leave a space before arguments in function + calls. + +2013-02-19 Akim Demaille + + variant: fix G++ 4.4 warnings + The changes by Théophile Ranquet about type punning issues need + to be extend to in-place new to please G++ 4.4.7. + + * data/variant.hh (variant::as_): New, factors the casts that avoid + compiler warnings. + (as, build): Use them. + +2013-02-18 Akim Demaille + + news: spell fixes + * NEWS: here. + +2013-02-18 Akim Demaille + + diagnostics: factor and enhance messages about duplicate rule directives + When reporting a duplicate directive on a rule, point to its first + occurrence: + + one.y:11.10-15: error: only one %empty allowed per rule + %empty {} %empty + ^^^^^^ + one.y:11.3-8: previous declaration + %empty {} %empty + ^^^^^^ + + And consistently discard the second one. + + * src/complain.h, src/complain.c (duplicate_directive): New. + * src/reader.c: Use it where appropriate. + * src/symlist.h, src/symlist.c (symbol_list): Add a dprec_location member. + * tests/actions.at: Adjust expected output. + +2013-02-18 Akim Demaille + + style: no longer use backquotes + * tests/actions.at, tests/atlocal.in, tests/c++.at, tests/calc.at, + * tests/conflicts.at, tests/existing.at, tests/glr-regression.at, + * tests/input.at, tests/java.at, tests/local.at, tests/sets.at, + * tests/synclines.at, doc/bison.texi, lib/libiberty.h, lib/timevar.h: + Use single quotes. + +2013-02-18 Akim Demaille + + style: no longer use backquotes + * README, REFERENCES, TODO, configure.ac, data/README, data/bison.m4, + * data/c++.m4, data/c.m4, data/java.m4, data/lalr1.cc, + * data/lalr1.java, data/yacc.c, doc/local.mk, etc/bench.pl.in, + * src/conflicts.c, src/files.c, src/getargs.c, src/gram.h, src/lalr.c, + * src/location.c, src/location.h, src/muscle-tab.c, src/muscle-tab.h, + * src/output.c, src/parse-gram.c, src/parse-gram.y, src/print-xml.c, + * src/print.c, src/reader.c, src/reduce.c, src/scan-skel.l, + * src/symtab.h, src/system.h, src/tables.c: + Use single quotes, as currently recommended by the GNU Coding Standards. + +2013-02-18 Akim Demaille + + style: no longer use backquotes in messages + * src/getargs.c (usage): Use single quotes. + +2013-02-18 Akim Demaille + + doc: use %empty instead of /* empty */ + * doc/bison.texi: Change the comments into explicit %empty. + +2013-02-18 Akim Demaille + + doc: introduce %empty and -Wempty-rule + * doc/bison.texi (Grammar Rules): Make it a @section which + contains... + (Rules Syntax): this new subsection (with the previous contents of + "Grammar Rules". + (Empty Rules): New subsection, extracted from the former + "Grammar Rules". + Document %empty. + (Recursion): New a subsection of "Grammar Rules". + Complete a few index entries. + (Bison Options): Document -Wempty-rule. + +2013-02-18 Akim Demaille + + report: use %empty to denote empty rules + * src/gram.c (rule_rhs_print): Use %empty for empty rules. + * tests/conflicts.at, tests/regression.at, tests/sets.at: Adjust. + +2013-02-18 Akim Demaille + + diagnostics: %empty enables -Wempty-rule + * src/complain.h, src/complain.c (warning_is_unset): New. + * src/reader.c (grammar_current_rule_empty_set): If enabled -Wempty-rule, + if not disabled. + * tests/actions.at (Implicitly empty rule): Check this feature. + Also check that -Wno-empty-rule does disable this warning. + +2013-02-18 Akim Demaille + + -Wempty-rule: diagnose empty rules without %empty + * src/complain.h, src/complain.c (warning_empty_rule, Wempty_rule): + New warning category. + (warnings_args, warnings_types): Adjust. + * src/reader.c (grammar_rule_check): Check the empty rules are + flagged by %empty. + * tests/actions.at (Implicitly empty rule): New. + * tests/existing.at: Add expected warnings. + +2013-02-18 Akim Demaille + + tests: use %empty + * tests/actions.at, tests/input.at, tests/reduce.at, + * tests/regression.at: + here. + +2013-02-18 Akim Demaille + + regen + +2013-02-18 Akim Demaille + + parser: use %empty + Avoid that Bison's own use of "bison -Wall" trigger warnings. + + * src/parse-gram.y: Use %empty for every empty rule. + +2013-02-18 Akim Demaille + + grammar: introduce %empty + Provide a means to explicitly denote empty right-hand sides of rules: + instead of + + exp: { ... } + + allow + + exp: %empty { ... } + + Make sure that %empty is properly used. + + With help from Joel E. Denny and Gabriel Rassoul. + http://lists.gnu.org/archive/html/bison-patches/2013-01/msg00142.html + + * src/reader.h, src/reader.c (grammar_current_rule_empty_set): New. + * src/parse-gram.y (%empty): New token. + Use it. + * src/scan-gram.l (%empty): Scan it. + * src/reader.c (grammar_rule_check): Check that %empty is properly used. + * tests/actions.at (Invalid uses of %empty, Valid uses of %empty): New. + +2013-02-16 Akim Demaille + + getargs: minor simplification + * src/getargs.c (flag_argmatch): Simplify the handling of "none". + +2013-02-16 Akim Demaille + + style: move argument handling of -W into the diagnostics module + This allows to reduce the number of public interfaces. + + * src/getargs.c (--yacc): Use warning_argmatch instead of tweaking + directly warnings_flag (which will be private). + (warning_argmatch, warnings_argmatch): Move to... + * src/complain.h, src/complain.c: here. + + * src/getargs.h, src/getargs.c (warnings_args, warnings_types): Move to... + * src/complain.c: here, now private. + + * src/complain.h (severity, warnings_flag): Move to... + * src/complain.c: here, now private. + +2013-02-16 Akim Demaille + + diagnostics: revamp the handling of -Werror + Recent discussions with Joel E. Denny + (http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00026.html) + show that it is desirable to tell the difference between an option + that was explicitly disabled with -Wno-foo, as opposed to be left + unset. The current framework does not allow this. + + Instead of having a first int to store which options are enabled, and + another to store which are turned into errors, use an array that for + each warning category tells its status: disabled, unset, warning, + error. + + * src/complain.h, src/complain.c (warning_bit): New enum. + (warnings): Use it. + (severity): New enum. + (warnings_flag): Now an array of severity. + (errors_flag): Remove, now done by warnings_flag. + (complain_init): New function, to initialie warnings_flag. + (warnings_are_errors): New Boolean, for -Werror. + * src/complain.c (warning_severity): New. + (warnings_print_categories, complains): Use it. + * src/getargs.c (warning_argmatch): Adjust to use warnings_flag. + (warnings_argmatch): Ditto. + Handle -Werror and -Wno-error here. + (getargs): Adjust. + * src/main.c (main): Call complain_init. + * tests/input.at (Invalid options): Add more corner cases. + +2013-02-14 Akim Demaille + + options: simplify the handling of -W + * src/getargs.c (warnings_argmatch, warning_argmatch): Simplify by + replacing function arguments with their actual values. + (WARNING_ARGMATCH): Remove, useless. + Adjust callers. + +2013-02-14 Akim Demaille + + options: don't accept "error=" for -f and -r + * src/getargs.c (warning_argmatch, warnings_argmatch, WARNINGS_ARGMATCH): + New. + Use them for -W/--warning. + They are copied from... + (flag_argmatch, flags_argmatch, FLAGS_ARGMATCH): these. + Simplify by removing the support for "error". + * tests/input.at (Invalid options): New. + * TODO (Laxism in Bison invocation arguments): Remove. + +2013-02-14 Akim Demaille + + diagnostics: factor the list of warning names + * src/getargs.h, src/getargs.c (warnings_args, warnings_types): Make + them public. + * src/complain.h, src/complain.c (warnings_print_categories): Its + only use outside complain.c was removed in a recent commit, so + make it static. + Simplify its implementation. + Use warnings_args and warnings_types. + * src/muscle-tab.c (muscle_percent_define_check_values): Make it + silent. + +2013-02-14 Akim Demaille + + diagnostics: no longer pretty-print rules in error messages, carets suffice + * src/gram.c (grammar_rules_useless_report): Let -fcaret handle the + pretty-printing of the guilty rules. + (rule_print): Inline in its only use. + * tests/conflicts.at, tests/existing.at, tests/reduce.at, + * tests/regression.at: Adjust. + * NEWS: Document. + +2013-02-14 Akim Demaille + + options: no longer document warnings when diagnosing an invalid -W + The argmatch functions accept prefixes of the alternatives (like + getopt does for long options). Bison uses this to document the + warning categories. This is troublesome: it duplicates the --help + documentation, it is not gettextized, it is displayed with ugly quotes + (because argmatch uses it to display the list of possible answers), + and it prevents straighforward uses of the tables of valid warning + categories (for instance so that warning diagnostics end with the name + of the warning). + + The "hidden" option --trace uses the same trick, but it does not need + to be translated, nor to be described in --help. + + * src/getargs.c (warnings_args): Remove pseudo documentation. + Comment changes. + +2013-02-11 Akim Demaille + + tests: enlarge the allowed duration for calc tests + Hydra "often" fails on this test: + + 252. calc.at:658: 252. Calculator %glr-parser api.pure + parse.error=verbose %debug %locations %defines api.prefix="calc" + %verbose %yacc %parse-param {semantic_value *result} + %parse-param {int *count} (calc.at:658): FAILED + + * tests/calc.at: Give 200s instead of 100s. + Use AT_DEBUG_IF. + +2013-02-11 Akim Demaille + + debug: improve the display of symbol lists + * src/symtab.c (symbol_print): Remove useless quotes (the symbol already + has quotes). + Prefer fputs. + * src/symlist.c (symbol_list_syms_print): Likewise. + Fix separators. + +2013-02-09 Akim Demaille + + style: minor changes + * src/complain.c: Space changes. + * src/reader.c: Comment changes. + Avoid && in assertions. + * src/location.c: Move comments to... + * src/location.h: here. + * src/symlist.h, src/symlist.c: Create a pseudo section for members + that apply to the rule. + +2013-02-08 Akim Demaille + + news: restructure, document variants for C++ + * NEWS: here. + +2013-02-08 Akim Demaille + + c++: api.token.constructor requires api.value.type=variant + Eventually it should also support "union". + + * data/glr.cc: Move this check to... + * data/c++.m4: here, as lalr1.cc is affected too. + +2013-02-05 Akim Demaille + + build: restore C90 compatibility + * src/parse-gram.y, src/parse-gram.c: Don't use // comments. + +2013-02-05 Akim Demaille + + doc: use @group to improve page breaking + * doc/bison.texi: here. + +2013-02-04 Akim Demaille + + style: rename internal "stype" as "union_members" for clarity + "stype" is quite unclear, and it also collides with the former %define + variable that had the same name (replaced by api.value.type). + + * src/parse-gram.y (stype): Rename as... + (union_members): this. + * data/bison.m4: Adjust. + (b4_user_stype): Rename as... + (b4_user_union_members): this. + * data/c++.m4, data/c.m4: Adjust. + * src/parse-gram.c: regen. + +2013-02-04 Akim Demaille + + tests: improve the language independance layer + * tests/local.at (_AT_LANG_DISPATCH): New, shamelessly stolen from + Autoconf's _AT_LANG_DISPATCH. + (AT_LANG_DISPATCH): New. + (AT_YYERROR_FORMALS, AT_YYERROR_PROTOTYPE, AT_YYERROR_DECLARE_EXTERN) + (AT_YYERROR_DECLARE, AT_YYERROR_DEFINE, AT_MAIN_DEFINE, AT_COMPILE) + (AT_FULL_COMPILE): + Use AT_LANG_DISPATCH instead of an ad hoc m4_case. + +2013-02-04 Akim Demaille + + regen + +2013-02-04 Akim Demaille + + style: space changes in the parser + * src/parse-gram.y: Fix spaces. + +2013-02-04 Akim Demaille + + parser: use api.pure full + * src/parse-gram.y: Use api.pure full instead of silly macro tricks. + +2013-02-04 Akim Demaille + + style: use a for loop instead of a while loop, and scope reduction + * src/reader.c (packgram): Improve readability. + The parser calls grammar_current_rule_end at the end of every rhs, + which adds a NULL to separate the rules. So there is no need to + check whether "p" is non-null before proceeding. + +2013-02-01 Theophile Ranquet + + variants: stylistic change + * data/variant.hh (tname): Respect the GNU Coding Standards for this + pointer's declaration. + +2013-02-01 Theophile Ranquet + + grammar: free the association tracking graph + The graph introduced by Valentin wasn't free'd after use. + + * src/symtab.c (assoc_free): New, clear the array of linked lists with... + (linkedlist_free): This, new. + (print_precedence_warnings): Call assoc_free when done. + (print_assoc_warnings): Free used_assoc after use. + +2013-02-01 Theophile Ranquet + + tests: use AT_FULL_COMPILE where possible + * tests/c++.at (C++ Variant-based Symbol, Variants): Here. Rename the + generated input files to use .y instead of .yy, as a requirement for using + AT_FULL_COMPILE instead of a combination of AT_BISON_CHECK and + AT_BISON_COMPILE_CXX. + +2013-02-01 Theophile Ranquet + + variants: avoid type punning issue + This is based on what is recommended by both Scott Meyers, in 'Effective + C++', and Andrei Alexandrescu and Herb Sutter in 'C++ Coding Standards'. + + Use a static_cast on void* rather than directly use a reinterpret_cast, + which can have nefarious effects on objects. However, even though following + this guideline is good practice in general, I am not quite sure how relevant + it is when applied to conversions from POD to objects. Actually, it might + very well be the opposite: isn't this exactly what reinterpret_cast is for? + What we really want *is* to transmit the memory map as a series of bytes, + which, if I am correct, falls into the kind of "low level" hack for which + this cast is meant. + + In any case, this silences the warning, which will be greatly appreciated by + anyone using variants with a compiler supporting -fstrict-aliasing. + + * data/variant.hh (as): Here. + * tests/c++.at (Exception safety, C++ Variant-based Symbols, Variants): + Don't use NO_STRICT_ALIAS_CXXFLAGS (revert commit ddb9db15), as type punning + is no longer an issue. + * tests/atlocal.in, configure.ac (NO_STRICT_ALIAS_CXXFLAGS): Remove + definition. + * examples/local.mk (NO_STRICT_ALIAS_CXXFLAGS): Remove from AM_CXXFLAGS. + * doc/bison.texi: Don't mention type punning issues. + +2013-02-01 Theophile Ranquet + + todo: update + Reformulate and give more details on my thoughts concerning the graphical + visualization, and add an entry about a bug in the options processing for + warnings as errors. + + * TODO: Here. + +2013-02-01 Akim Demaille + + regen + +2013-02-01 Akim Demaille + + location: pass the location first + * src/location.h, src/location.c (location_print): For consistency + with other data structures and other location_* routines, pass the + location argument first. + * src/complain.c: Adjust. + (location_caret): Likewise. + * src/parse-gram.y: Adjust. + +2013-02-01 Akim Demaille + + symlist: use the right stream + * src/symlist.c (symbol_list_syms_print): Use "f", not stderr. + +2013-01-30 Akim Demaille + + tests: put two related tests together + * tests/conflicts.at (Useless associativity warning): Move next + to "Useless precedence warning". + +2013-01-30 Akim Demaille + + news: name contributors + * NEWS: here. + +2013-01-30 Valentin Tolmer + + warnings: introduce -Wprecedence + The new warning category "precedence" flags useless precedence and + associativity. -Wprecedence can now be used, it is disabled by default. + The warnings about precedence and associativity are grouped into one, and + the testsuite was corrected accordingly. + + * src/complain.h (warnings): Introduce "precedence". + * src/complain.c (warnings_print_categories): Adjust. + * src/getargs.c (warnings_args, warning_types): Likewise. + * src/symtab.h, src/symtab.c (print_associativity_warnings): Remove. + * src/symtab.h (register_assoc): Correct arguments. + * src/symtab.c (print_precedence_warnings): Print both warnings together. + * doc/bison.texi (Bison options): Document the warnings and provide an + example. + * tests/conflicts.at, tests/existing.at, tests/local.at, + * tests/regression.at: Adapt the testsuite for the new category + (-Wprecedence instead of -Wother where appropriate). + +2013-01-30 Akim Demaille + + build: avoid clang's colored diagnostics in the test suite + The syncline tests, which try to recognize compiler diagnostics, + are confused by escapes for colors. + + * configure.ac (warn_tests): New, to factor the warnings for both + C and C++ tests. + Add -fno-color-diagnostics to it. + * tests/local.at (AT_TEST_TABLES_AND_PARSE): Do not remove glue + together compiler flags. + +2013-01-30 Akim Demaille + + build: please Clang++ 3.2+ on Flex scanners + Clang++, with -Wall, rejects code generated by Flex (for C scanners): + + CXX examples/calc++/examples_calc___calc__-calc++-scanner.o + In file included from examples/calc++/calc++-scanner.cc:1: + error: implicit conversion of NULL constant to 'bool' [-Werror,-Wnull-conversion] + if ( ! ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : __null) ) { + ~ ^~~~~~ + false + * configure.ac (WARN_NO_NULL_CONVERSION_CXXFLAGS): Compute it. + * examples/calc++/local.mk (examples_calc___calc___CXXFLAGS): Use it. + +2013-01-30 Valentin Tolmer + + grammar: record used associativity and print useless ones + Record which symbol associativity is used, and display useless ones. + + * src/symtab.h, src/symtab.c (register_assoc, print_assoc_warnings): New + * src/symtab.c (init_assoc, is_assoc_used): New + * src/main.c: Use print_assoc_warnings + * src/conflicts.c: Use register_assoc + * tests/conflicts.at (Useless associativity warning): New. + + Due to the new warning, many tests had to be updated. + + * tests/conflicts.at tests/existing.at tests/regression.at: + Add the associativity warning in the expected results. + * tests/java.at: Fix the java calculator's grammar to remove a useless + associativity. + * doc/bison.texi (mfcalc example): Fix associativity to remove + warning. + +2013-01-29 Valentin Tolmer + + grammar: warn about unused precedence for symbols + Symbols with precedence but no associativity, and whose precedence is + never used, can be declared with %token instead. The used precedence + relationships are recorded and a warning about useless ones is issued. + + * src/conflicts.c (resolve_sr_conflict): Record precedence relation. + * src/symtab.c, src/symtab.h (prec_nodes, init_prec_nodes) + (symgraphlink_new, register_precedence_second_symbol) + (print_precedence_warnings): New. + Record relationships in a graph and warn about useless ones. + * src/main.c (main): Print precedence warnings. + * tests/conflicts.at: New. + +2013-01-29 Theophile Ranquet + + variants: remove the 'built' assertions + When using %define parse.assert, the variants come with additional variables + that are useful for development purposes. One is a Boolean indicating if the + variant is built (to make sure we don't read a non-built variant), and the + other is a string describing the stored type. There is no need to have both of + these, the string is enough. + + * data/variant.hh (built): Remove. + +2013-01-29 Akim Demaille + + style: indentation fixes + * src/parse-gram.y: here. + +2013-01-29 Akim Demaille + + maint: be sure to neutralize out-of-tree paths from our parser + * tests/bison.in: Adjust to support fixed versions of ylwrap. + +2013-01-29 Theophile Ranquet + + m4: generate a basic_symbol constructor for each symbol type + Recently, there was a slightly vicious bug hidden in the make_ functions: + + parser::symbol_type + parser::make_TEXT (const ::std::string& v) + { + return symbol_type (token::TOK_TEXT, v); + } + + The constructor for symbol_type doesn't take an ::std::string& as + argument, but a constant variant. However, because there is a variant + constructor which takes an ::std::string&, this caused the implicit + construction of a built variant. Considering that the variant argument + for the symbol_type constructor was cv-qualified, this temporary variant + was never destroyed. + + As a temporary solution, the symbol was built in two stages: + + symbol_type res (token::TOK_TEXT); + res.value.build< ::std::string&> (v); + return res; + + However, the solution introduced in this patch contributes to letting + the symbols handle themselves, by supplying them with constructors that + take a non-variant value and build the symbol's own variant with that + value. + + * data/variant.hh (b4_symbol_constructor_define_): Use the new + constructors rather than building in a temporary symbol. + (b4_basic_symbol_constructor_declare, + b4_basic_symbol_constructor_define): New macros generating the + constructors. + * data/c++.m4 (basic_symbol): Invoke the macros here. + +2013-01-29 Theophile Ranquet + + c++: minor stylistic changes + * data/c++m4: Remove useless comment lines. + * data/variant.hh (self_type): Use this typedef instead of variant. + (b4_symbol_constructor_define_): Remove commented-out line, and stylistic + change (avoid blank line). + +2013-01-29 Akim Demaille + + c++: please G++ 4.8 with -O3: type puning issue + * tests/c++.at (Exception safety): Now that this test covers + variants, pass -fno-strict-aliasing to g++. + +2013-01-29 Akim Demaille + + c++: please G++ 4.8 with -O3: array bounds + * data/c++.m4, data/lalr1.cc (by_state, by_type): Do not use -1 to + denote the absence of value, as GCC then fears that this -1 might + be used to dereference arrays (such as yytname). + Use 0, which corresponds to $accept, which is valueless (the needed + property: the symbol destructor must not try to reclaim the memory + associated with the symbol). + +2013-01-29 Akim Demaille + + c++: use more explicit types than int + * data/c++.m4 (b4_public_types_declare): Declare token_number_type soon. + Introduce symbol_number_type (wider than token_number_type). + Clarify the requirement that kind_type from by_state and by_type + denote the _input_ type (required by the constructor), not the stored type. + Use symbol_number_type and token_number_type where appropriate, instead + of int. + * data/lalr1.cc: Adjust to these changes. + Propagate "symbol_number_type". + Invoke "type_get ()" instead of read "type" directly. + +2013-01-29 Akim Demaille + + c++: value_type -> kind_type + * data/c++.m4, data/lalr1.cc (by_type, by_state): Rename 'value_type' + as 'kind_type', as it is clearer. + +2013-01-29 Akim Demaille + + c++: improve the signature of yysyntax_error_ + * data/lalr1.cc: This function is const. + It takes a symbol_number_type. + +2013-01-29 Akim Demaille + + c++: style changes + * data/lalr1.cc: Formatting changes. + And name changes. + +2013-01-28 Akim Demaille + + doxygen: upgrade Doxyfile, and complete it + * doc/Doxyfile.in: Let doxygen upgrade it. + (INCLUDE_PATH): Point to lib too. + (PROJECT_BRIEF): New. + (EXCLUDE): Update to reflect the current file hierarchy. + +2013-01-28 Akim Demaille + + maint: fix syntax-check issues + * cfg.mk: Ignore strcmp in local.at. + * tests/conflicts.at: Use AT_PARSER_CHECK. + * tests/regression.at: Preserve the exit status of the generated parsers. + + * tests/local.mk ($(TESTSUITE)): Map @tb@ to a tabulation. + * tests/c++.at, tests/input.at, tests/regression.at: Use @tb@. + * cfg.mk: (space-tab): There are no longer exceptions. + +2013-01-28 Akim Demaille + + tests: please C90 compilers + * tests/actions.at, tests/conflicts.at: Use /* ... */ comments. + Let "main" return a value. + +2013-01-28 Akim Demaille + + maint: update todo + * TODO: Remove fixed items. + +2013-01-28 Akim Demaille + + news: minor improvements + * NEWS: Name some more contributors. + Restructure slightly. + +2013-01-28 Akim Demaille + + tests: please clang and use ".cc", not ".c", for C++ input + When fed with foo.c, clang++ 3.2 answers: + + clang: error: treating 'c' input as 'c++' when in C++ mode, + this behavior is deprecated + + * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use *.cc and *.hh + for C++. + +2013-01-28 Akim Demaille + + tests: formatting changes + * tests/local.at: Restore proper indentation. + +2013-01-28 Theophile Ranquet + + c++: better inline expansion + Many 'inline' keywords were in the declarations. They rather belong in + definitions, so move them. + + * data/c++.m4 (basic_symbol, by_type): Many inlines here. + * data/lalr1.cc (yytranslate_, yy_destroy_, by_state, yypush_, yypop_): Inline + these as well. + (move): Move the definition outside the struct, where it belongs. + +2013-01-28 Akim Demaille + + tests: check that using variants is exception safe + * tests/local.at: (Slightly) improve the regexp by escaping '.' + when it denotes a point. + (AT_VARIANT_IF): New. + * tests/c++.at (Exception Safety): Run it for variants too. + +2013-01-28 Akim Demaille + + tests: remove useless %defines + Many tests were using %defines because C++ skeletons used to require + it. + + * tests/actions.at, tests/c++.at, tests/input.at, tests/regression.at: + Remove useless %defines. + +2013-01-28 Akim Demaille + + c++: remove now-useless operators + Now that symbols behaves properly, we can eliminate special routines + that are no longer needed. + + * data/c++.m4, data/glr.cc, data/lalr1.cc, data/variant.hh: + Remove useless assignment operators and copy constructors. + As a consequence, remove useless includes for "abort". + +2013-01-28 Akim Demaille + + tests: enable support for --debug + * tests/c++.at (Variants): Here. + And remove useless clutter when api.token.constructor is enabled. + +2013-01-28 Akim Demaille + + c++: revamp the support for variants + The current approach was too adhoc: the symbols were not sufficiently + self-contained, in particular wrt memory management. The "new" + guideline is the one that should have been followed from the start: + let the symbols handle themslves, instead of leaving their users to + it. It was justified by the will to avoid gratuitious moves and + copies, but the current approach does not seem to be slower, yet it + will probably be simpler to adjust to support move semantics from + C++11. + + The documentation says that the %parse-param are available from the + %destructor. In retrospect, that was a silly design decision, which + we can break for variants, as its a new feature. It should be phased + out for non-variants too. + + * data/variant.hh: A variant never knows if it stores something or + not, it is up to its users to store this information. + Yet, in parse.assert mode, make sure the empty/filled variants + are properly used. + (b4_symbol_constructor_define_): Don't call directly the symbol + constructor, to save a useless temporary. + * data/stack.hh (push): Steal the pushed value instead of duplicating + it. + This will simplify the callers of push, who handled this "move" + approach themselves. + * data/c++.m4 (basic_symbol): Let -1, as kind, denote the fact that + a symbol is empty. + This is needed for instance when shifting the lookahead: yyla + is given as argument to "push", and its value is then moved on + the stack. But then yyla must be declared "empty" so that its + destructor won't be called. + (basic_symbol::move): New. + Move the responsibility of calling the destructor from yy_destroy + to ~basic_symbol in the case of variants. + * data/lalr1.cc (stack_symbol_type): Now a derived class from its + previous value, so that we can add a constructor from a symbol_type. + (by_state): State -1 means empty. + (yypush_): Factor, by calling one overload from the other one, and + using the new semantics of stack::push. + No longer reclaim by hand the memory from rhs symbols, since now + that we store objects with proper destructors, they will be reclaimed + automatically. + Conversely, be sure to delete yylhs. + * tests/c++.at (C++ Variant-based Symbols): New "unit" test for + symbols. + +2013-01-28 Akim Demaille + + c++: formatting and comment changes + * data/c++.m4, data/lalr1.cc, data/stack.hh, data/variant.hh: + Fix indentation. + Fix some comments. + +2013-01-27 Valentin Tolmer + + tests: add token declaration order test + * tests/conflicts.at: New test. + +2013-01-27 Akim Demaille + + regen + +2013-01-27 Valentin Tolmer + + grammar: preserve token declaration order + In a declaration %token A B, the token A is declared before B, but in %left + A B (or with %precedence or %nonassoc or %right), the token B was declared + before A (tokens were declared in reverse order). + + * src/symlist.h, src/symlist.c (symbol_list_append): New. + * src/parse-gram.y: Use it instead of symbol_list_prepend. + * tests/input.at: Adjust expectations. + +2013-01-25 Akim Demaille + + tests: improve test group titles + * tests/local.at (AT_SETUP_STRIP): AT_SETUP does not behave properly + with new-lines in its argument. + Remove them. + Fix the handling of %define with quotes. + +2013-01-25 Akim Demaille + + c: no longer require stdio.h when locations are enabled + Recent changes (in 2.7) introduced a dependency on both FILE and + fprintf, which are "available" only in %debug mode. This was to + define yy_location_print_, which is used only in %debug mode by the + parser, but massively used by the test suite to output the locations + in yyerror. + + Break this dependency: the test suite should define its own routines + to display the locations. Eventually Bison will provide the user with + a means to display locations, but not yet. + + * data/c.m4 (b4_yy_location_print_define): Use YYFPRINTF instead of + fprintf directly. + * data/yacc.c (b4_yy_location_print_define): Invoke it only in %debug + mode, so that stdio.h is included (needed for FILE*), and YYFPRINTF + is defined. + + * tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DEFINE): Declare + and define location_print and LOCATION_PRINT. + + * tests/actions.at, tests/existing.at, tests/glr-regression.at, + * tests/input.at, tests/named-refs.at, tests/regression.at: Adjust + to use them. + Fix the expected line numbers (as the prologue's length has changed). + +2013-01-25 Akim Demaille + + c: minor simplification in the debug code + * data/c.m4 (yy_symbol_print): Minor factoring. + +2013-01-25 Akim Demaille + + c++: display locations as C does + See commit 3804aa260b956dd012adde3894767254422a5fcf. + + * data/location.cc (operator<<): Display location exactly as is + done in C skeletons. + * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): Also define + AT_FIRST_LINE, AT_LAST_LINE, AT_FIRST_COLUMN, AT_LAST_COLUMN. + * tests/actions.at (Location Print): Also check C++ skeletons. + +2013-01-25 Akim Demaille + + tests: highlight empty right-hand sides + * tests/actions.at, tests/c++.at, tests/headers.at, + * tests/input.at: here. + +2013-01-25 Akim Demaille + + news: prepare for 2.8 + * NEWS: Restructure. + Name contributors. + +2013-01-21 Akim Demaille + + tests: generalize default main for api.namespace + * tests/local.at (AT_NAME_PREFIX): Also match api.namespace. + (AT_MAIN_DEFINE): Take it into account. + * tests/c++.at, tests/headers.at: Use AT_NAME_PREFIX. + (AT_CHECK_NAMESPACE): Rename as... + (AT_TEST): this. + +2013-01-21 Akim Demaille + + tests: improve factoring of the main function + * tests/local.at (AT_MAIN_DEFINE): If %debug is used, check if + -d/--debug is passed to the generated parser, and enable the traces. + Return exactly the result of yyparse, so that we can check exit code + 2 too. + * tests/actions.at, tests/glr-regression.at, tests/regression.at: + Use AT_MAIN_DEFINE, helping AT_BISON_OPTION_PUSHDEFS where needed, + preferably to option -t. + +2013-01-21 Akim Demaille + + tests: factor the definition of main + With Théophile Ranquet. + + * tests/local.at (AT_MAIN_DEFINE): New. + (AT_YYERROR_DEFINE): Improve formatting. + * tests/actions.at, tests/c++.at, tests/conflicts.at, + * tests/glr-regression.at, tests/input.at, tests/regression.at, + * tests/skeletons.at, tests/torture.at: Adjust. + * tests/c++.at: Add missing %skeleton for a PUSHDEFS, and a missing + PUSH/POPDEFS for another test. + +2013-01-21 Akim Demaille + + tests: minor refactoring + * tests/named-refs.at: Use AT_FULL_COMPILE where applicable. + +2013-01-21 Akim Demaille + + diagnostics: avoid useless caret stuttering + * src/scan-code.l: When reporting a missing ending ';', don't display + the guilty action twice. + +2013-01-21 Theophile Ranquet + + examples: please clang + * doc/bison.texi (calc++-scanner.ll): Don't output useless yyinput function. + +2013-01-21 Theophile Ranquet + + tests: better silencing of unused argument warnings + input.yy:35:44: error: unused parameter 'msg' [-Werror,-Wunused-parameter] + void yy::parser::error (std::string const& msg) + ^ + + * tests/c++.at (C++ GLR parser identifier shadowing): Don't name unused + argument, use YYUSE instead of a direct cast to void. + +2013-01-21 Theophile Ranquet + + bench: compatibility for Bison <= 2.7 + There used to be a bug in some skeletons, which caused the expansion of + 'yylval' and 'yylloc', generating these errors: + + input.cc:547:16: error: expected ',' or '...' before '(' token + #define yylval (yystackp->yyval) + ^ + input.yy:29:39: note: in expansion of macro 'yylval' + int yylex (yy::parser::semantic_type *yylval) + ^ + + This bug is fixed by 'skel: better aliasing of identifiers', but a workaround + is useful when benchmarking against older versions of Bison, which are still + affected by the bug. + + * etc/bench.pl.in: Rename yylval to yylvalp and yylloc to yyllocp in base + grammar 'list'. + +2013-01-15 Theophile Ranquet + + c++: remove useless inlines + * data/c++.m4 (basic_symbol): Keep 'inline' in the prototypes, but don't + duplicate it in the implementation. + * data/variant.hh (variant): 'inline' is not needed when the implementation is + provided in the class definition. + +2013-01-15 Theophile Ranquet + + c++: m4 stylistic change + * data/c++.m4 (syntax_error): Fix the indentation of 'inline'. + +2013-01-14 Theophile Ranquet + + c++: silence warnings + * data/c++.m4 (basic_symbol::operator=): Unused parameter. + * tests/c++.at (C++ GLR parser identifier shadowing): Here too. + - + +2013-01-14 Theophile Ranquet + + news: typos + * NEWS: Fix a typo, use YYSTYPE rather than semantic_type. + +2013-01-12 Akim Demaille + + regen + +2013-01-12 Akim Demaille + + maint: update copyright years + Suggested by Stefano Lattarini. + Run "make update-copyright". + +2013-01-12 Akim Demaille + + build: fix VPATH issue + * Makefile.am (update-b4-copyright, update-package-copyright-year): Fix + path to build-aux. + +2013-01-11 Theophile Ranquet + + carets: document default activation + * NEWS: Announce it. + * doc/bison.texi: Adjust. + +2013-01-11 Theophile Ranquet + + carets: show them in more tests + * tests/input.at, tests/named-refs.at: Here. + +2013-01-11 Theophile Ranquet + + carets: activate by default + * src/getargs.c (feature_flag): Here. + * tests/local.at (AT_BISON_CHECK_, AT_BISON_CHECK_NO_XML): Deactivate carets + for the testsuite, by default. + * tests/input.at: Adjust the locations for command line definitions. + +2013-01-11 Theophile Ranquet + + variants: document move and swap + * data/variant.hh (swap): Doc. + (build): Rename as... + (move): This, more coherent naming with clearer meaning. + * data/c++.m4 (move): Adjust. + +2013-01-11 Theophile Ranquet + + c++: privatize variant blind copies + * data/variant.hh (variant, operator=): Make private. + * data/c++.m4 (operator=): New, to avoid needing a definition of that operator + for each class member (such as a possible variant). + * data/glr.cc, data/lalr.cc: Add the necessary include for the abort. + +2013-01-11 Akim Demaille + + glr.c: fix an unused argument issue + * data/glr.c (yyuserAction): "Use" yyrhslen, as in variant mode, we might + not use it. + +2013-01-11 Akim Demaille + + glr.c: style changes + * data/glr.c (yyuserAction): Use a size_t for sizes. + +2013-01-11 Akim Demaille + + c.m4: style fix + * data/c.m4 (b4_parse_param_use): Add missing space before paren. + +2013-01-11 Theophile Ranquet + + skel: better aliasing of identifiers + * data/glr.c, data/yacc.c: Avoid emitting useless defines. + * data/glr.cc: Restore prefixes for epilogue. + +2013-01-11 Theophile Ranquet + + glr.cc: fatal if using api.token.ctor without variants + * data/glr.cc: Here. + +2013-01-11 Theophile Ranquet + + skel: correctly indent switch cases + * data/bison.m4 (b4_type_action_): Here. + +2013-01-11 Theophile Ranquet + + variants: assert changes + * data/variant.hh (swap): More asserts can't hurt. Don't perform useless swaps. + (build): Deactivate problematic asserts, pending further investigation. + (variant): Prohibit copy construction. + +2013-01-11 Theophile Ranquet + + lalr1.cc: use a vector for the symbol stack + * data/lalr1.cc: Adjust includes. + * data/stack.hh (push, pop): Use push_back and pop_back. + (operator []): Access vector from the end. + +2013-01-11 Theophile Ranquet + + lalr1.cc: change symbols implementation + A "symbol" groups together the symbol type (INT, PLUS, etc.), its + possible semantic value, and its optional location. The type is + needed to access the value, as it is stored as a variant/union. + + There are two kinds of symbols. "symbol_type" are "external symbols": + they have type, value and location, and are returned by yylex. + "stack_symbol_type" are "internal symbols", they group state number, + value and location, and are stored in the parser stack. The type of + the symbol is computed from the state number. + + The class template symbol_base_type factors the code common to + stack_symbol_type and symbol_type. It uses the Curiously Recurring + Template pattern so that we can always (static_) downcast to the exact + type. symbol_base_type features value and location, and delegates the + handling of the type to its parameter. + + When trying to generalize the support for variant, a significant issue + was revealed: because stack_symbol_type and symbol_type _derive_ from + symbol_base_type, the type/state member is defined _after_ the value + and location. In C++ the order of the definition of the members + defines the order in which they are initialized, things go backward: + the value is initialized _before_ the type. This is wrong, since the + type is needed to access the value. + + Therefore, we need another means to factor the common code, one that + ensures the order of the members. + + The idea is simple: define two (base) classes that code the symbol + type ("by_type" codes it by its type, and "by_state" by the state + number). Define basic_symbol as the class template that + provides value and location support. Make it _derive_ from its + parameter, by_type or by_state. Then define stack_symbol_type and + symbol_type as basic_symbol, basic_symbol. The + name basic_symbol was chosen by similarity with basic_string and + basic_ostream. + + * data/c++.m4 (symbol_base_type): Remove, replace by... + (basic_symbol): which derives from its parameter, one of... + (by_state, by_type): which provide means to retrieve the actual type of + symbol. + (symbol_type): Is now basic_symbol. + (stack_symbol_type): Is now basic_symbol. + * data/lalr1.cc: Many adjustments. + +2013-01-11 Theophile Ranquet + + bench: add %b directive to use a specific Bison + For example, + $ bench.pl -v '%s lalr1.cc & %d variant & ( %b ~/old-bison/bin/bison + | %b ~/new-bison/bin/bison )' -g list -i 10000 + + * etc/bench.pl.in: Here. + +2013-01-09 Akim Demaille + + regen + +2013-01-04 Akim Demaille + + gnulib: update + +2012-12-31 Akim Demaille + + doc: use deffn to declare the list of %define variables + * doc/bison.texi (%define Summary): Use @deffn instead of @table, it + spares a lot of width, especially in PDF, and looks nicer in the other + formats too. + It is also more consistent with the rest of the document. + +2012-12-31 Akim Demaille + + doc: minor completion and fixes + * doc/bison.texi (%define Summary): Provide more history to some + variables. + +2012-12-31 Akim Demaille + + java: stype is obsoleted by api.value.type + This is consistent with the other %define variable names. + + * data/java.m4: Use api.value.type instead of stype. + * doc/bison.texi, NEWS: Document that change. + * src/muscle-tab.c (muscle_percent_variable_update): Provide backward + compatibility. + * tests/java.at: Adjust. + +2012-12-31 Akim Demaille + + doc: fix html build + * doc/local.mk (bison.html): Fix dependencies. + +2012-12-31 Akim Demaille + + todo: remove erroneous task + * tests/input.at: Check that there are no warnings about stray $ and @ + in the epilogue. + * TODO: Remove the correponding task. + +2012-12-31 Akim Demaille + + gnulib: update + +2012-12-28 Akim Demaille + + regen + +2012-12-28 Akim Demaille + + syncline: one line is enough + So far we were issuing two lines for each syncline change: + + /* Line 356 of yacc.c */ + #line 1 "src/parse-gram.y" + + This is a lot of clutter, especially when reading diffs, as these + lines change often. Fuse them into a single, shorter, line: + + #line 1 "src/parse-gram.y" /* yacc.c:356 */ + + * data/bison.m4 (b4_syncline): Issue a single line. + Comment improvements. + (b4_sync_start, b4_sync_end): Issue a shorter comment. + * data/c++.m4 (b4_semantic_type_declare): b4_user_code must be + on its own line as it might start with a "#line" directive. + +2012-12-28 Akim Demaille + + regen + +2012-12-28 Akim Demaille + + maint: restore ANSI 89 compliance + * data/bison.m4, src/conflicts.c, src/files.c, src/output.c, + * src/symtab.c: Use /* ... */ comments only. + Declare variables before statements. + +2012-12-28 Akim Demaille + + graph: minor simplification + * src/gram.c (print_lhs): Use %*s to indent. + * src/print_graph.c (print_lhs): Use obstack_printf. + Became simple enough to be inlined in... + (print_core): here. + Use a "rule*" instead of an index in "rules[]". + +2012-12-28 Akim Demaille + + closure, gram: add missing const + * src/closure.h, src/closure.c, src/gram.h, src/gram.c: Add some missing + const where appropriate. + +2012-12-27 Theophile Ranquet + + carets: properly display when no line feed is present + * src/location.c (location_caret): finish the line with one whether or not it + is present in input. Rewrite code without getline. + (cleanup_caret): Reset the caret_info global. + * bootstrap.conf: No longer require getline. + +2012-12-27 Theophile Ranquet + + scanner: reintroduce unput for missing end tokens + Unput was no longer used since a POSIX-compatiblity issue with Flex 2.5.31, + which has been adressed in newer versions of Flex. See this discussion: + + + This partially reverts commit aa4180418fff518198e1b0f2c43fec6432210dc7. + + * src/scan-gram.l (unexpected_end): Here. + * tests/input.at: Adjust for new order of error reports. + +2012-12-27 Akim Demaille + + tables: scope reduction + * src/tables.c (default_goto): Make it easier to understand. + +2012-12-27 Akim Demaille + + regen + +2012-12-27 Akim Demaille + + skeletons: fix comments + The commit 38de4e570fdc7c8db9633c3b2054e565d8c1c6b9 underquoted the + content of the comments, which resulted in losing square brackets in + the comments. Besides, some other invocations were underquoting the + effective arguments. + + * data/c.m4 (b4_comment_): Properly quote the comment. + (b4_comment_, b4_comment): Move to... + * data/c-like.m4: here, so that... + * data/java.m4: can use it instead of its own copy. + * data/bison.m4 (b4_integral_parser_tables_map): Fix some comments. + + * data/lalr1.cc, data/lalr1.java, data/yacc.c: Comment fixes. + + * data/lalr1.cc: Reorder a bit to factor some CPP directives. + +2012-12-27 Akim Demaille + + maint: which -> whose + Apparently, I was confusing both. + + * data/bison.m4, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: + Use "whose" where appropriate. + +2012-12-26 Akim Demaille + + tables: scope reduction + * src/tables.c (matching_state): here. + +2012-12-26 Akim Demaille + + tables: scope reduction + * src/tables.c (token_actions): here. + +2012-12-26 Akim Demaille + + tables: scope reduction + * src/tables.c (save_row): here. + +2012-12-26 Akim Demaille + + tables: scope reduction + * src/tables.c (save_column, pack_vector): Reduce the scope to + emphasize the structure of the code. + Rename the returned value "res" to make understanding easier. + +2012-12-26 Akim Demaille + + tables: use size_t where appropriate + These changes aim at making the code easier to understand. + + * src/tables.c (tally): This is a size, always >= 0, so make it + a size_t. + +2012-12-26 Akim Demaille + + tables: style changes + * src/tables.c: Prefer < to >. + Fix/complete some comments. + Remove useless parens. + +2012-12-26 Akim Demaille + + skeletons: no longer call yylex via a CPP macro + The YYLEX existed only to support YYLEX_PARAM, which is now removed. + This macro was a nuisance, since incorrect yylex calls where pointed + the macro _use_, instead of its definition. + + * data/c.m4 (b4_lex_formals, b4_lex): New. + * data/glr.c, data/yacc.c: Use it. + * data/lalr1.cc (b4_lex): New. + Use it. + + squash! skeletons: no longer call yylex via a CPP macro + +2012-12-26 Akim Demaille + + YYLEX_PARAM: drop support + * data/yacc.c, doc/bison.texi: Remove YYLEX_PARAM support. + * NEWS: Document it. + +2012-12-26 Akim Demaille + + examples: minor improvements + * examples/variant.yy: Don't use debug_stream(), obsoleted. + Use <*>. + +2012-12-26 Akim Demaille + + skeletons: factor comments about symbols + * data/variant.hh (b4_char_sizeof_): Rename as... + * data/bison.m4 (b4_symbol_tag_comment): this. + Provide more documentation about b4_symbol_*. + +2012-12-26 Akim Demaille + + c: improve the definition of public types + * data/c.m4 (b4_token_enum): Improve comments. + (b4_value_type_define, b4_location_type_define): New, extracted + from... + (b4_declare_yylstype): here. + Separate the typedefs from the union/struct definitions. + +2012-12-26 Akim Demaille + + doc: update variant usage + * doc/bison.texi, examples/variant.yy: Use "%define api.value.type variant", + instead of "%define variant". + +2012-12-26 Akim Demaille + + tests: check the "%define variant" is deprecated. + * tests/input.at: Rename some AT_SETUP to avoid that + AT_SETUP_STRIP thinks they contain %define directives. + ("%define" backward compatibility): Merge tests together + to speed up the test suite, and to make maintenance easier + (multiple AT_CHECK means multiple runs of the test suite to + be sure to have updated all the error messages). + Check the "%define variant" is properly obsoleted. + +2012-12-23 Akim Demaille + + %define variables: support value changes in deprecation + * src/muscle-tab.c (define_directive): Be robust to "assignment" + containing '='. + (muscle_percent_variable_update): Upgrade "variant" to "api.value.type". + Support such upgrade patterns. + Adjust callers. + + * data/bison.m4: Use api.value.type for variants. + * tests/c++.at: Adjust tests. + +2012-12-23 Akim Demaille + + diagnostics: treat obsolete %define variable names as obsolete directives + Instead of + + warning: deprecated %define variable name: 'namespace', use 'api.namespace' [-Wdeprecated] + + display (in -fno-caret mode): + + warning: deprecated directive: '%define namespace foo', use '%define api.namespace foo' [-Wdeprecated] + + and (in -fcaret mode): + + warning: deprecated directive, use '%define api.namespace toto' [-Wdeprecated] + %define namespace toto + ^^^^^^^^^ + + This is in preparation of cases where not only the variable is + renamed, but the values are too: + + warning: deprecated directive: '%define variant', use '%define api.value.type variant' [-Wdeprecated] + + * src/muscle-tab.c (define_directive): New. + (muscle_percent_variable_update): Take the value as argument, and use it + in the diagnostics. + Loop with a pointer instead of an index. + * tests/input.at (%define backward compatibility): Adjust. + +2012-12-23 Akim Demaille + + diagnostics: factor the deprecated directive message + * src/complain.h, src/complain.c (deprecated_directive): New. + * src/muscle-tab.c: Use it. + +2012-12-23 Akim Demaille + + variant: produce stable results + Improve the output by ensuring a well defined order for type switches. + + * src/uniqstr.h: Style changes for macro arguments. + (UNIQSTR_CMP): Replace by... + (uniqstr_cmp): this. + * src/uniqstr.c (uniqstr_cmp): New. + Produce well defined results. + * src/output.c: Use it. + +2012-12-23 Akim Demaille + + uniqstr: formatting changes + * src/uniqstr.h: Sort functions by object type. + +2012-12-23 Akim Demaille + + skeletons: fix an error message + * data/bison.m4 (b4_flag_if): Display the invalid value. + +2012-12-23 Akim Demaille + + tests: improve titles + * tests/local.at (AT_SETUP_STRIP): New. + (AT_SETUP): Use it to shorten the test titles: remove %defines, %language + and %skeleton whose arguments suffice. + * tests/synclines.at: Use more precise AT_SETUP. + +2012-12-23 Akim Demaille + + c++: comment changes + * data/c++.m4, data/glr.cc, data/lalr1.cc: Convert some /* ... */ + comments to //. + +2012-12-23 Akim Demaille + + c++: use // comments in the output + This is mostly used for the license header, the synclines, and the + generated tables: + + - /* STOS_[STATE-NUM] -- The (internal number of the) accessing + - symbol of state STATE-NUM. */ + + // STOS_[STATE-NUM] -- The (internal number of the) accessing + + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + * data/c.m4: Comment changes. + (b4_comment_): Expand the text argument. + Before this change, we were actually formatting M4 code as a + C comment, and then expand it. + (b4_comment): Fix the closing of comments: there is no reason to + add the (line) prefix before the closing "*/". + * data/c++.m4 (b4_comment): New. + +2012-12-21 Akim Demaille + + maint: disable sc_prohibit_test_backticks + * cfg.mk: here. + And fix typos. + Reported by Stefano Lattarini. + +2012-12-21 Akim Demaille + + maint: more syntax-checks + * cfg.mk (sc_prohibit_tab_based_indentation, sc_prohibit_test_backticks) + (sc_preprocessor_indentation, sc_space_before_open_paren): New, + stolen from Coreutils (2e9f5ca4ebbbdb6a9fa2dd3d5add3f7720a172d7). + +2012-12-21 Akim Demaille + + debug: no longer generate tabs + * src/closure.c, src/derives.c, src/nullable.c, tests/sets.at: Use + spaces. + +2012-12-21 Akim Demaille + + style changes: run cppi + Run it in src/ for a start. + + * src/AnnotationList.h, src/InadequacyList.h, src/Sbitset.h, + * src/closure.c, src/complain.h, src/flex-scanner.h, src/getargs.h, + * src/gram.h, src/graphviz.h, src/ielr.h, src/location.h, + * src/muscle-tab.h, src/named-ref.h, src/relation.h, src/scan-code.h, + * src/state.h, src/symtab.h, src/system.h, src/uniqstr.h: + Reindent preprocessor directives. + +2012-12-21 Akim Demaille + + style changes: untabify + * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl, m4/flex.m4, + * tests/glr-regression.at, tests/torture.at: here. + +2012-12-21 Akim Demaille + + tests: be robust to set -e. + * examples/test (run): here. + +2012-12-19 Akim Demaille + + variants: prohibit simple copies + The "variant" structure provides a means to store, in a typeless way, + C++ objects. Manipulating it without provide the type of the stored + content is doomed to failure. So provide a means to copy in a type + safe way, and prohibit typeless assignments. + + * data/c++.m4 (symbol_type::move): New. + * data/lalr1.cc: Use it. + * data/variant.hh (b4_variant_define): Provide variant::copy. + Let variant::operator= abort. + We cannot undefine it, yet, as it is still uses by the implicit + assigment in symbols, which must also be disabled. + +2012-12-19 Akim Demaille + + variant: more assertions + Equip variants with more checking code. Provide a means to request + includes. + + * data/variant.hh (b4_variant_includes): New. + * data/lalr1.cc: Use it. + * data/variant.hh (variant::built): Define at the end, as a private member. + (variant::tname): New. + Somewhat makes "built" useless, but let's keep both for a start, in + case using "typeinfo" is considered unacceptable in some environments. + Fix some formatting issues. + +2012-12-19 Akim Demaille + + gnulib: update + +2012-12-19 Akim Demaille + + skeletons: fix output directives + * data/lalr1.cc, data/location.cc, data/glr.cc: Use b4_output_begin. + Broken during a merge. + +2012-12-19 Akim Demaille + + yacc.c: style changes + * data/yacc.c (b4_lex_param): Provide arguments with a name. + +2012-12-19 Akim Demaille + + glr.cc: simplifying the handling of parse/lex params + The fact that glr.cc uses glr.c makes the handling of parse params + more complex, as the parser object of glr.cc must be passed to the + parse function of glr.c. Yet not all the functions need access to + the parser object. + + * data/glr.cc (b4_parse_param_wrap): New. + Use them. + +2012-12-19 Akim Demaille + + glr: rename lex params + * data/glr.c (b4_lex_param): Rename as... + (b4_lex_formals): this, for consistency. + Provide arguments a name. + (LEX): Adjust. + +2012-12-19 Akim Demaille + + glr.c: move function declaration earlier + * data/glr.c (yypstack, yypdumpstack): Declare earlier, to make + it easier to call them from other functions. + +2012-12-19 Akim Demaille + + %define variables: backward compatibility + * src/muscle-tab.c (muscle_percent_variable_update): Accept lex_symbol. + Reported by Roland Levillain. + +2012-12-16 Akim Demaille + + diagnostics: improve -fcaret for list of accepted values + Instead of + + input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + input.y:1.9-21: accepted value: 'pull' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + input.y:1.9-21: accepted value: 'push' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + input.y:1.9-21: accepted value: 'both' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + + report + + input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + input.y:1.9-21: accepted value: 'pull' + input.y:1.9-21: accepted value: 'push' + input.y:1.9-21: accepted value: 'both' + + * src/complain.h (no_caret): New. + * src/complain.c (error_message): Use it. + * src/muscle-tab.c (muscle_percent_define_check_values): Use it. + * src/scan-skel.l (flag): Ditto. + * tests/input.at: Adjust and check. + +2012-12-16 Akim Demaille + + skeletons: simplify the handling of default api.location.type + * data/bison.m4 (b4_bison_locations_if): New. + * data/glr.cc, data/lalr1.cc: Use it. + +2012-12-16 Akim Demaille + + tests: address syntax-check failures + * cfg.mk: Ignore failures in timevar (uses GCC style configuration, + not gnulib's). + * doc/local.mk: Space changes. + * lib/main.c, tests/calc.at: Remove useless HAVE_ tests. + +2012-12-15 Akim Demaille + + remove duplicate definitions + * src/system.h: here, inherited from a merge. + +2012-12-15 Akim Demaille + + tests: style changes + * tests/glr-regression.at: Issue yyerror before yylex. + +2012-12-15 Akim Demaille + + doc: fix dependencies + * doc/local.mk: here. + +2012-12-14 Akim Demaille + + doc: style fixes + * doc/bison.texi: Add a couple of missing @var and @code. + +2012-12-14 Theophile Ranquet + + doc: fix build dependencies + Suggested by Nick Bowler + + + * doc/local.mk: Avoid overwriting Automake's rules. + +2012-12-14 Akim Demaille + + Merge branch 'origin/maint' + * origin/maint: + maint: credit Wojciech Polak + maint: post-release administrivia + version 2.7 + yacc.c: scope reduction + tests: C90 compliance + fix C90 compliance + glr.c: scope reduction + gnulib: update + +2012-12-14 Theophile Ranquet + + symtab: add missing initializations + * src/symtab.c (semantic_type_new): Here. + +2012-12-14 Theophile Ranquet + + symtab: fix some leaks + * src/symlist.c (symbol_list_free): Deep free it. + * src/symtab.c (symbols_free, semantic_types_sorted): Free it too. + (symbols_do, sorted): Call by address. + +2012-12-14 Theophile Ranquet + + tests: remove use of PARSE_PARAM + * tests/header.at: Here. + +2012-12-13 Akim Demaille + + maint: credit Wojciech Polak + * NEWS, THANKS: He is the author of XML support (including XSLTs). + +2012-12-12 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-12-12 Akim Demaille + + version 2.7 + * NEWS: Record release date. + +2012-12-12 Akim Demaille + + yacc.c: scope reduction + * data/yacc.c (yysyntax_error): here. + +2012-12-12 Akim Demaille + + tests: C90 compliance + * tests/synclines.at: here. + +2012-12-12 Akim Demaille + + fix C90 compliance + * data/glr.c, src/graphviz.h, src/ielr.c, src/scan-gram.l, + * src/system.h, tests/actions.at, tests/glr-regression.at: Do not + use // comments. + Do not introduce variables after statements. + Provide "main" with a return value. + +2012-12-12 Akim Demaille + + glr.c: scope reduction + * data/glr.c (yyreportSyntaxError): Reduce the scope of yysize1 (now + yysz). + +2012-12-12 Akim Demaille + + gnulib: update + +2012-12-10 Theophile Ranquet + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + news: prepare for forthcoming release + doc: explain how mid-rule actions are translated + error: use better locations for unused midrule values + doc: various minor improvements and fixes + tests: ignore more useless compiler warnings + tests: be robust to C being compiled with a C++11 compiler + build: beware of Clang++ not supporting POSIXLY_CORRECT + maint: post-release administrivia + version 2.6.90 + build: fix syntax-check error. + cpp: simplify the Flex version checking macro + news: improve the carets example and fix a typo + cpp: improve the Flex version checking macro + carets: improve the code + maint: update news + build: keep -Wmissing-declarations and -Wmissing-prototypes for modern GCCs + build: drop -Wcast-qual + gnulib: update + +2012-12-09 Akim Demaille + + news: prepare for forthcoming release + * NEWS: Fill paragraph. + Reorder. + Update examples. + Remove line for 2.6.90. + +2012-12-09 Akim Demaille + + doc: explain how mid-rule actions are translated + * doc/bison.texi (Actions in Mid-Rule): Mention and use named references. + Split into three subsections, among which... + (Mid-Rule Action Translation): this new section. + +2012-12-09 Akim Demaille + + error: use better locations for unused midrule values + On + + %% + exp: {;} {$$;} { $$ = $1; } + + instead of reporting (with -fcaret -Wmidrule-value) + + midrule.y:2.6-8: warning: unset value: $$ [-Wmidrule-values] + exp: {;} {$$;} { $$ = $1; } + ^^^ + midrule.y:2.6-27: warning: unused value: $2 [-Wmidrule-values] + exp: {;} {$$;} { $$ = $1; } + ^^^^^^^^^^^^^^^^^^^^^^ + + report + + midrule.y:2.6-8: warning: unset value: $$ + exp: {;} {$$;} { $$ = $1; } + ^^^ + midrule.y:2.10-14: warning: unused value: $2 + exp: {;} {$$;} { $$ = $1; } + ^^^^^ + + * src/reader.c (grammar_rule_check): When warning about the value of a + midrule action, use the location of the midrule action instead of the + location of the rule. + the location of the part of the rule. + * tests/actions.at (Default %printer and %destructor for mid-rule values): + Adjust expectations + * tests/input.at (Unused values with default %destructor): Ditto. + (AT_CHECK_UNUSED_VALUES): Ditto. + And use -fcaret. + +2012-12-09 Akim Demaille + + doc: various minor improvements and fixes + * doc/figs/example.dot, doc/figs/example.y: New. + * doc/bison.texi: Prefer "token" to TOKEN. + Use @group where appropriate. + Adjust with style changes in the output (State 0, not state 0). + Fix some @ref that were missing the third argument. + Fix some incorrect line numbers. + Use "nonterminal", not "non-terminal". + Fix overfull and underfull TeX hboxes. + Put the comments in the index. + Remove duplicate index entries. + Fuse glossary entries where appropriate. + (Understanding): Improve the continuity between sections. + Use example.dot to show the whole graph. + * doc/Makefile.am: Adjust. + +2012-12-09 Akim Demaille + + tests: ignore more useless compiler warnings + * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore complains about + using c++ to compile C. + +2012-12-09 Akim Demaille + + tests: be robust to C being compiled with a C++11 compiler + * tests/glr-regression.at: Use YY_NULL instead of NULL. + Comment changes. + +2012-12-09 Akim Demaille + + build: beware of Clang++ not supporting POSIXLY_CORRECT + * m4/c-working.m4 (BISON_LANG_COMPILER_POSIXLY_CORRECT): New. + (BISON_C_COMPILER_POSIXLY_CORRECT): Use it. + For consistency with C++, also define BISON_C_WORKS. + * m4/cxx.m4 (BISON_CXX_COMPILER_POSIXLY_CORRECT): New. + * configure.ac: Use it. + * tests/atlocal.in: Get its result. + Propagate properly CXX values when used to compile C. + When POSIXLY_CORRECT, adjust BISON_C_WORKS and BISON_CXX_WORKS. + * tests/local.at (AT_COMPILE): Use BISON_C_WORKS. + +2012-12-07 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-12-07 Akim Demaille + + version 2.6.90 + * NEWS: Record release date. + +2012-12-07 Akim Demaille + + build: fix syntax-check error. + * cfg.mk: Exclude names-refs, it includes a "double" if (end of first + line, first of second line below). + + test.y:43.12-44.59: symbol not found in production: if + if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +2012-12-07 Theophile Ranquet + + cpp: simplify the Flex version checking macro + * src/flex-scanner,h (FLEX_VERSION): Consider YY_FLEX_SUBMINOR_VERSION + defined. + +2012-12-07 Theophile Ranquet + + news: improve the carets example and fix a typo + * NEWS: Here. + +2012-12-07 Theophile Ranquet + + cpp: improve the Flex version checking macro + * src/flex-scanner.h (FLEX_VERSION): Here. + +2012-12-07 Theophile Ranquet + + carets: improve the code + * src/location.c: Remove duplicate documentations. + (caret_info): Stylistic change. + (location_caret): Many reworks. + +2012-12-07 Akim Demaille + + maint: update news + * NEWS: There is no 2.6.6, remove its stub. + +2012-12-07 Akim Demaille + + build: keep -Wmissing-declarations and -Wmissing-prototypes for modern GCCs + Fixes a -Werror failure of xalloc.h used in src. + From Eric Blake. + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00006.html + + * configure.ac: Check whether GCC pragma diagnostic push/pop works. + Enable these warnings for bison if it does. + Enable these warnings for the test suite anyway. + +2012-12-07 Akim Demaille + + build: drop -Wcast-qual + Suggested by Jim Meyering. + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00017.html + * configure.ac (warn_common): Remove -Wcast-qual. + +2012-12-07 Akim Demaille + + gnulib: update + +2012-12-06 Theophile Ranquet + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + misc: pacify the Tiny C Compiler + cpp: make the check of Flex version portable + misc: require getline + c++: support wide strings for file names + doc: document carets + tests: enhance existing tests with carets + errors: show carets + getargs: add support for --flags/-f + +2012-12-06 Theophile Ranquet + + misc: pacify the Tiny C Compiler + * src/graphviz.c (conclude_red): Remove a useless return. + +2012-12-05 Theophile Ranquet + + cpp: make the check of Flex version portable + This was problematic with tcc 0.9.25 + + * src/flex-scanner.h (FLEX_VERSION_GT): Rewrite and rename as... + (FLEX_VERSION): This. + +2012-12-05 Theophile Ranquet + + misc: require getline + * bootstrap.conf: Here, used by src/location.c. + * src/getargs.c (long_options): Rename --flags to --feature. + +2012-12-05 Akim Demaille + + c++: support wide strings for file names + Reported by Mark Boyall. + http://lists.gnu.org/archive/html/help-bison/2011-08/msg00002.html + + * data/location.cc (operator<<): Be templated on the type of + output stream. + * tests/headers.at (Several parsers): Adjust. + +2012-12-05 Theophile Ranquet + + doc: document carets + * NEWS: Announce it. + * doc/bison.texi (Bison Options): Here. + +2012-12-05 Theophile Ranquet + + tests: enhance existing tests with carets + * tests/actions.at: Unset value. + * tests/conflicts.at: Rule useless due to conflicts. + * tests/input.at: Missing terminator, unexpected end of file, command line + redefinition of variable. + * tests/named-refs.at: Many errors. + * tests/reduce.at: Useless nonterminals and rules. + * tests/regression.at: Large token. + +2012-12-05 Theophile Ranquet + + errors: show carets + * src/locations.c (caret_info): New, persistant information useful + for... + (location_caret): New, print a caret. + (cleanup_caret): Release caret_info cleanly, call it... + * src/main.c (main): Here. + * src/complain.c (error_message): Call location_caret here. + +2012-12-05 Theophile Ranquet + + getargs: add support for --feature/-f + Introduce -fdiagnostics-show-caret + + * src/getargs.c (feature_flag): New global. + * src/getargs.h (feature): New enum. + +2012-12-05 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + getargs: don't label --language/-l as experimental + getargs: fix the locations of command-line input + errors: indent missing action code semicolon warning + +2012-12-04 Theophile Ranquet + + getargs: don't label --language/-l as experimental + * NEWS: Announce it. + * doc/bison.texi, src/getargs.c (usage): Here. + +2012-12-03 Akim Demaille + + tests: minor improvements + * tests/calc.at (AT_CHECK_SPACES): To speed up, accept several files + at once, and factor some calls. + +2012-12-03 Theophile Ranquet + + getargs: fix the locations of command-line input + * src/getargs.c (command_line_location): Here. + * tests/input.at: Adjust. + +2012-12-03 Theophile Ranquet + + errors: indent missing action code semicolon warning + Also, remove a duplicate #define. + + * src/scan-code.l (SC_RULE_ACTION): Here. + * tests/actions.at: Adjust. + +2012-12-03 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + parser: accept #line NUM + m4: use a safer pattern to enable/disable output + tests: beware of gnulib's need for config.h + gnulib: update + yacc.c, glr.c: check and fix the display of locations + formatting changes + glr.c: remove stray macro + +2012-12-03 Akim Demaille + + parser: accept #line NUM + * src/scan-gram.l (scanner): Accept '#line NUM'. + (handle_syncline): Adjust to the possible missing file name. + +2012-12-03 Akim Demaille + + m4: use a safer pattern to enable/disable output + Work on some other areas of Bison revealed that some macros expanded + to be expanded only once were actually expanded several times. This + was due to the fact that changecom was not properly restored each + time, and macro names appearing in comments were then expanded. + + Introduce begin/end macros which are easier to match that + changecom()/changecom(#). + + * data/bison.m4 (b4_output_begin, b4_output_end): New. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, + * data/location.cc, data/stack.hh, data/yacc.c: + Use them. + +2012-12-03 Akim Demaille + + tests: beware of gnulib's need for config.h + * tests/skeletons.at, tests/torture.at: Be sure to include config.h + where appropriate. + +2012-11-30 Akim Demaille + + gnulib: update + * lib/yyerror.c: Include config.h since the following stdio.h might be + from gnulib. + +2012-11-30 Akim Demaille + + yacc.c, glr.c: check and fix the display of locations + In some case, negative column number could be displayed. + Make YY_LOCATION_PRINT similar to bison's own implementation of + locations. Since the macro is getting fat, make it a static + function. + Reported by Jonathan Fabrizio. + + * data/c.m4 (yy_location_print_define): Improve the implementation, + and generate the yy_location_print_ function. + Adjust YY_LOCATION_PRINT. + * tests/actions.at (Location Print): New tests. + +2012-11-30 Akim Demaille + + formatting changes + * data/c.m4: Fix comments, put macros in a more natural order. + Space changes (from M-x whitespace-cleanup). + * src/location.c: Fix spaces. + * tests/actions.at: Space changes. + +2012-11-30 Akim Demaille + + glr.c: remove stray macro + * data/glr.c (YYOPTIONAL_LOC): Remove, unused since commit + 769a8ef9bcb5e14d0be9d0869f5dca20ab093930. + +2012-11-29 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + doc: minor fixes + doc: improve the index + doc: introduce api.pure full, rearrange some examples + yacc.c: support "%define api.pure full" + local.at: improvements + +2012-11-29 Akim Demaille + + doc: minor fixes + * doc/bison.texi: Use stderr for error messages. + Meta-variables are usually spelled in lower case. + Use @code for function names. + +2012-11-29 Akim Demaille + + doc: improve the index + * doc/bison.texi: Fix uses of "deffn" so that the arguments of the + directives do not show in the index. + Remove a duplicate entry for api.pure. + +2012-11-29 Theophile Ranquet + + doc: introduce api.pure full, rearrange some examples + * NEWS: Add entry. + * doc/bison.texi (%define Summary): Show the old Yacc behaviour. + (Parser Function): Move parse-param examples here. + (Pure Calling): Remove parse-param examples. + (Error Reporting): Don't show the old behavior, stick to 'full'. + +2012-11-29 Theophile Ranquet + + yacc.c: support "%define api.pure full" + This makes the interface for yyerror() pure without the need for a spurious + parse_param. + + * data/yacc.c (b4_pure_if, b4_pure_flag): New definition, accept three states. + (b4_yacc_pure_if): Rename as... + (b4_yyerror_arg_loc_if): This, and use b4_pure_flag. + * tests/actions.at (%define api.pure): Modernize. + * test/calc.at (Simple LALR Calculator): Modernize. + * tests/local.at (AT_YYERROR_ARG_LOC_IF): Adjust. + +2012-11-28 Akim Demaille + + tests: check variants without locations + * tests/c++.at (Variants): Support non-use of locations, and + check its support. + +2012-11-26 Theophile Ranquet + + local.at: improvements + * tests/local.at (AT_YYERROR_FORMALS): Make llocp const. + (AT_PURE_AND_LOC_IF, AT_GLR_OR_PARAM_IF): Remove, expand... + (AT_YYERROR_ARG_LOC_IF): Here, and use m4_join for readability. + +2012-11-26 Akim Demaille + + tests: use -fno-strict-aliasing with variants + Reported by Théophile Ranquet. + + * configure.ac (NO_STRICT_ALIAS_CXXFLAGS): New. + * tests/c++.at, tests/atlocal.in, examples/local.mk: Use it. + +2012-11-26 Akim Demaille + + tests: remove leftover + * tests/atlocal.in: Remove duplicate handling of --compile-c-with-cxx. + +2012-11-26 Akim Demaille + + doc: use %precedence instead of nonassoc when associativity is not wanted + * doc/bison.texi: here. + Formatting changes in some grammars. + Fix a %prec into %precedence. + +2012-11-26 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + yacc.c: always initialize yylloc + scanner: issue a single error for groups of invalid characters + tests: formatting changes + doc: one of the fixes for an ambiguous grammar was ambiguous too + doc: fix the dangling else with precedence directives + doc: prefer "token" to TOKEN + doc: formatting changes + scanner: use explicit "ignore" statements + +2012-11-26 Akim Demaille + + Merge remote-tracking branch 'origin/branch-2.6' into maint + * origin/branch-2.6: + yacc.c: always initialize yylloc + doc: one of the fixes for an ambiguous grammar was ambiguous too + doc: fix the dangling else with precedence directives + doc: prefer "token" to TOKEN + doc: formatting changes + +2012-11-23 Theophile Ranquet + + yacc.c: always initialize yylloc + The initial location might be used if the parser starts by an empty + reduction, so really ensure proper initialization of the initial + location. The previous approach fails for PostgreSQL, which uses + Reported by Peter Eisentraut. + http://lists.gnu.org/archive/html/bug-bison/2012-11/msg00023.html + With help from Théophile Ranquet. + + * data/yacc.c (b4_declare_scanner_communication_variables): Be sure + to initialize yylloc, even when its structure is unknown. + (yyparse): Simplify the call to b4_dollar_pushdef. + * tests/actions.at (Initial location): Check of similar pattern + as in the case of PostgreSQL. + +2012-11-23 Akim Demaille + + scanner: issue a single error for groups of invalid characters + * src/scan-gram.l: Scan groups of invalid characters together. + * tests/input.at, tests/named-refs.at: Adjust. + +2012-11-23 Akim Demaille + + tests: formatting changes + * tests/named-refs.at: Here. + +2012-11-23 Akim Demaille + + doc: one of the fixes for an ambiguous grammar was ambiguous too + Reported by Аскар Сафин. + http://lists.gnu.org/archive/html/bug-bison/2012-11/msg00024.html + + * doc/bison.texi (Reduce/Reduce): Fix the resulting ambiguity using + precedence/associativity directives. + +2012-11-22 Akim Demaille + + doc: fix the dangling else with precedence directives + * doc/bison.texi (Non Operators): New node. + (Shift/Reduce): Point to it. + Don't promote "%expect n" too much. + +2012-11-22 Akim Demaille + + doc: prefer "token" to TOKEN + This is more readable in short examples. + + * doc/bison.texi (Shift/Reduce): here. + Make "win" and "lose" action more alike. + +2012-11-22 Akim Demaille + + doc: formatting changes + * doc/bison.texi: Use @group. + +2012-11-14 Akim Demaille + + scanner: use explicit "ignore" statements + * src/scan-gram.l: here. + +2012-11-13 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: close files in glr-regression + xml: match DOT output and xml2dot.xsl processing + xml: factor xslt space template + graph: fix a memory leak + xml: documentation + output: capitalize State + +2012-11-12 Theophile Ranquet + + tests: close files in glr-regression + * tests/glr-regression.at: Here. + +2012-11-12 Theophile Ranquet + + xml: match DOT output and xml2dot.xsl processing + Make the DOT produced by XSLT processing equivalent to the one made with the + --graph option. + + * data/xslt/xml2dot.xsl: Stylistic changes, and add support for reductions. + * doc/bison.texi (Xml): Update. + * src/graphviz.c (conclude_red): Minor stylistic changes to DOT internals. + (output_red): Swap enabled and disabled reductions output, for coherence + with XSLT output. + * src/print_graph.c (print_core): Minor stylistic change to States' output. + (print_actions): Swap order of output for reductions and transitions. + * tests/local.at (AT_BISON_CHECK_XML): Ignore differences in order. + * tests/output.at: Adjust to changes in DOT internals. + +2012-11-12 Theophile Ranquet + + xml: factor xslt space template + * data/xslt/bison.xsl (space): New, import from... + * data/xslt/xml2text.xsl: Here. + +2012-11-12 Theophile Ranquet + + graph: fix a memory leak + * src/graphviz.c (output_red): Here. + +2012-11-12 Theophile Ranquet + + xml: documentation + The XML output combined with the XSL Transformations provided in data/ are + incredibly useful, they should be documented. + + * doc/bison.texi (Xml): New node. + +2012-11-12 Theophile Ranquet + + output: capitalize State + * src/print.c (print_state): Here. + * tests/conflicts.at, tests/existing.at, tests/local.at, tests/reduce.at, + tests/regression.at, tests/sets.at: Adjust. + +2012-11-12 Akim Demaille + + tests: fix syntax-check errors + Reported by Théophile Ranquet. + + * tests/c++.at: Use AT_PARSER_CHECK. + Avoid using "strcmp", which triggers an error from syntax-check. + +2012-11-12 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: address syntax-check errors. + tests: use valgrind where appropriate + tests: use valgrind where appropriate + tests: don't expect $EGREP to support -w + tests: more possible error compiler messages for "#error" + +2012-11-12 Akim Demaille + + maint: address syntax-check errors. + * cfg.mk: Ignore the "error" call in tests/c++.at, it is not to be + translated. + * doc/bison.texi: Fix incorrect @pxref use. + * po/POTFILES.in: Add missing file. + * src/print_graph.c: Remove useless include. + +2012-11-12 Akim Demaille + + tests: use valgrind where appropriate + Reported by Théophile Ranquet. + + * cfg.mk (sc_at_parser_check): New. + * tests/c++.at: Fix use of AT_CHECK vs. AT_PARSER_CHECK. + +2012-11-12 Akim Demaille + + Merge remote-tracking branch 'origin/branch-2.6' into maint + * origin/branch-2.6: + tests: use valgrind where appropriate + tests: don't expect $EGREP to support -w + +2012-11-10 Akim Demaille + + tests: use valgrind where appropriate + Reported by Théophile Ranquet. + + * tests/glr-regression.at: Rewrite some test cases so that AT_PARSER_CHECK, + which runs valgrind, is exposed with the parser, not with "echo". + * tests/local.at, tests/regression.at, tests/headers.at: + Use AT_PARSER_CHECK for generated parsers. + +2012-11-08 Akim Demaille + + tests: don't expect $EGREP to support -w + Does not work on Solaris 10. Reported by Dennis Clarke. + http://lists.gnu.org/archive/html/bug-bison/2012-11/msg00009.html + * tests/headers.at (Several parsers): Use Perl instead. + While at it, run it only once, on all the generated headers. + Adjust to YY_NULL be defined in position.hh. + +2012-11-08 Akim Demaille + + tests: more possible error compiler messages for "#error" + * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust for Clang. + Verified with GCC 4.0, 4.2 to 4.8, and Clang 2.9, 3.2: none skip. + +2012-11-08 Akim Demaille + + regen + +2012-11-08 Akim Demaille + + Merge branch 'maint' + * origin/maint: + regen + maint: post-release administrivia + version 2.6.5 + regen + tests: syntax-check + tests: beware of compilers that do not support POSIXLY_CORRECT + gnulib: update + +2012-11-08 Akim Demaille + + regen + +2012-11-08 Akim Demaille + + Merge branch 'branch-2.6' into maint + * origin/branch-2.6: + maint: post-release administrivia + version 2.6.5 + regen + tests: syntax-check + tests: beware of compilers that do not support POSIXLY_CORRECT + gnulib: update + +2012-11-07 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-11-07 Akim Demaille + + version 2.6.5 + * NEWS: Record release date. + +2012-11-07 Akim Demaille + + regen + +2012-11-07 Akim Demaille + + tests: syntax-check + * tests/actions.at: Fix typo. + +2012-11-07 Akim Demaille + + tests: beware of compilers that do not support POSIXLY_CORRECT + Running "maintainer-release-check" on OS X with Clang 2.9 fails, + because "clang-mp-2.9 -o test -g test.c" launches "/usr/bin/dsymutil + test -o test.dSYM" which fails with "error: unable to open executable + '-o'". + + * m4/c-working.m4 (BISON_CHECK_WITH_POSIXLY_CORRECT) + (BISON_C_COMPILER_POSIXLY_CORRECT): New. + * configure.ac: Use the latter. + * tests/atlocal.in (POSIXLY_CORRECT_IS_EXPORTED): New. + * tests/local.at (AT_BISON_CHECK_WARNINGS_): Use it instead of computing its + value each time. + (AT_QUELL_VALGRIND): Skip tests that cannot work because of compilers + that do not support POSIXLY_CORRECT. + +2012-11-07 Akim Demaille + + gnulib: update + +2012-11-06 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: (24 commits) + tests: calc: modernize the use of locations + tests: remove useless location initializations + lalr1.cc: always initialize yylval. + tests: check that C and C++ objects can be linked together. + yacc.c: also disable -Wuninitialized. + glr.cc, yacc.c: initialize yylloc properly + yacc.c, glr.c: a better YY_LOCATION_PRINT + yacc.c: simplify initialization + doc: formatting changes + c++: fix position operator signatures + tests: remove useless location initialization. + tests: fix locations in C + tests: handle %parse-param in the generated yyerror + tests: simplifications + grammars: fix display of nul character in error message + tests: sort + tests: cosmetic changes + comment changes + autoconf: update + gnulib: update + ... + +2012-11-06 Akim Demaille + + Merge branch 'branch-2.6' into maint + * origin/branch-2.6: (24 commits) + tests: calc: modernize the use of locations + tests: remove useless location initializations + lalr1.cc: always initialize yylval. + tests: check that C and C++ objects can be linked together. + yacc.c: also disable -Wuninitialized. + glr.cc, yacc.c: initialize yylloc properly + yacc.c, glr.c: a better YY_LOCATION_PRINT + yacc.c: simplify initialization + doc: formatting changes + c++: fix position operator signatures + tests: remove useless location initialization. + tests: fix locations in C + tests: handle %parse-param in the generated yyerror + tests: simplifications + grammars: fix display of nul character in error message + tests: sort + tests: cosmetic changes + comment changes + autoconf: update + gnulib: update + ... + +2012-11-06 Akim Demaille + + tests: calc: modernize the use of locations + * tests/calc.at: Don't initialize the location, let the parser + do it. + Use a $printer. + Change some testing input to be easier to distinguish (instead of always + "0 0" for instance). + +2012-11-06 Akim Demaille + + tests: remove useless location initializations + * tests/actions.at, tests/calc.at: here. + +2012-11-06 Akim Demaille + + lalr1.cc: always initialize yylval. + * data/lalr1.cc: here. + +2012-11-06 Akim Demaille + + tests: check that C and C++ objects can be linked together. + * tests/local.at (AT_SKIP_IF_CANNOT_LINK_C_AND_CXX): New. + * tests/headers.at (Several parsers): Use it. + +2012-11-06 Akim Demaille + + yacc.c: also disable -Wuninitialized. + * data/yacc.c (YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN): For some versions + of GCC, -Wmaybe-uninitialized alone does not suffice. + +2012-11-06 Akim Demaille + + glr.cc, yacc.c: initialize yylloc properly + There are several issues to address here. One is that yylloc should + be initialized when possible. Another is that the push parser needs + to update yypushed_loc when the user modified it. And if the parser + starts by a reduction of an empty, it uses the first location on the + stack, which, therefore, must also be initialized to this initial + location. + + This is getting complex, especially since because initializing a + global (impure interface) is different from initializing a local + variable. To simplify, the local yylloc is not initialized during its + definition. + + * data/c.m4 (b4_yyloc_default_define): Replace by... + (b4_yyloc_default): this. + Adjust dependencies. + * data/glr.cc: Initialize yylloc. + * data/yacc.c (b4_declare_scanner_communication_variables): + Initialize yylloc during its definition. + Don't define yyloc_default. + (yypush_parse): The location formal is not const, as we might + initialize it. + (yyparse): Define yyloc_default. + Use it before running the user initial action. + Possibly update the first location on the stack, and the pushed + location after the user initial action. + * tests/actions.at (Initial locations): Check that the initial + location is correct. + +2012-11-06 Akim Demaille + + yacc.c, glr.c: a better YY_LOCATION_PRINT + * data/c.m4 (b4_yy_location_print_define): New. + Now issues "short" locations, e.g., "1.1" instead of "1.1-1.1". + Was initially a function, but then we face "static but unused" + warnings. + Simpler as a macro. + * tests/local.at, data/glr.c, data/yacc.c: Use it instead of duplicating. + * tests/actions.at: Adjust expectations. + +2012-11-06 Akim Demaille + + yacc.c: simplify initialization + * data/yacc.c: Fuse the initializations of yyssp, yyss and the like. + Remove an obsolete comment: we do initialize these initial stack + members (in some cases). + +2012-11-05 Akim Demaille + + doc: formatting changes + * doc/bison.texi: In a pointer type. + +2012-11-05 Akim Demaille + + c++: fix position operator signatures + * data/location.cc (operator+=, operator-=): Remove const from return + type. + +2012-11-05 Akim Demaille + + tests: remove useless location initialization. + * tests/glr-regression.at: here. + glr.c does initialize yylloc. + +2012-11-05 Akim Demaille + + tests: fix locations in C + * tests/local.at (AT_YYERROR_DEFINE): Don't display the end of the location + if it is not after its beginning. + * tests/actions.at, tests/cxx-type.at: Adjust the expected output. + +2012-11-05 Akim Demaille + + tests: handle %parse-param in the generated yyerror + * tests/local.at (AT_PARSE_PARAMS): New. + (AT_YYERROR_FORMALS, AT_YYERROR_DEFINE): Use it to add the parse-param + to yyerror. + * tests/calc.at, tests/regression.at: Use AT_YYERROR_DEFINE and + AT_YYERROR_DECLARE, now that they handle properly the parse-params. + Be sure to let AT_BISON_OPTION_PUSHDEFS now what parse-params are used. + +2012-11-05 Akim Demaille + + tests: simplifications + * tests/actions.at (Exotic Dollars): Formatting changes. + Use AT_FULL_COMPILE. + (AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove useless initialization of @$. + +2012-11-01 Akim Demaille + + lalr1.cc: rename lex_symbol as api.token.constructor + * data/bison.m4 (b4_lex_symbol_if): Rename as... + (b4_token_ctor_if): this. + Depend upon api.token.constructor. + * data/c++.m4, data/lalr1.cc: Adjust. + * doc/bison.texi: Fix all the occurrences of lex_symbol. + * etc/bench.pl.in: Adjust. + * examples/variant.yy: Likewise. + + * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): + Handle AT_TOKEN_CTOR_IF. + * tests/c++.at: Adjust to using api.token.constructor and AT_TOKEN_CTOR_IF. + Simplify the test of both build call styles. + (AT_CHECK_VARIANTS): Rename as... + (AT_TEST): this. + And undef when done. + +2012-11-01 Akim Demaille + + examples: simplify/improve + * examples/variant.yy: Put yylex in yy::, and simplify accordingly. + Minor formatting changes. + +2012-11-01 Akim Demaille + + bison.m4: support b4_*_if macros whose name differ from their variable + * data/bison.m4 (b4_percent_define_if_define_, b4_percent_define_if_define): + Accept a second argument. + +2012-11-01 Akim Demaille + + grammars: fix display of nul character in error message + Reported by Marc Mendiola. + http://lists.gnu.org/archive/html/help-bison/2012-10/msg00017.html + + * gnulib: Update to get quote_mem. + * src/scan-gram.l: Use it. + * tests/input.at (Invalid inputs): Additional checks. + * tests/named-refs.at: Likewise. + +2012-11-01 Akim Demaille + + tests: sort + * tests/regression.at (Invalid inputs, Invalid inputs with {}): Move to... + * tests/input.at: here, for consistency. + +2012-11-01 Akim Demaille + + tests: cosmetic changes + * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): Improve the + displayed title. + +2012-11-01 Akim Demaille + + comment changes + * data/lalr1.cc: here. + +2012-11-01 Akim Demaille + + autoconf: update + There are comment changes only in the files we use. + +2012-11-01 Akim Demaille + + gnulib: update + +2012-10-28 Akim Demaille + + regen + +2012-10-28 Akim Demaille + + yacc.c: initialize yylval and yylloc. + When generating a pure push parser, the initialization of yylval and + yylloc may not be visible to the compiler. With warnings enabled, GCC + 4.3.6, 4.4.7, 4.5.4, and 4.6.3 report uninitialized uses of + yylval/yylloc. Using local pragmas to disable these warnings is not + supported before 4.6, and 4.6 does not support it properly. So + initialize yylval and yylloc at their definition. Reported by Peter + Simons. See + http://lists.gnu.org/archive/html/bison-patches/2012-10/msg00133.html + + * data/c.m4 (b4_yyloc_default_define): New. + * data/yacc.c: Use it when locations are requested. + (YYLVAL_INITIALIZE): Replace by... + (YY_INITIAL_VALUE): this. + (yyparse): Initialize yylloc and yylval. + Therefore, remove the initialization of yylloc's field. + * data/glr.c: Likewise. + +2012-10-26 Theophile Ranquet + + graphs: fix spacing refactoring + * src/print_graph.c (print_lhs, print_core): Here. + +2012-10-26 Theophile Ranquet + + tests: make deprecation tests more specific + * tests/input.at (Deprecated directives): Here, don't generate unrelated errors + or warnings. + +2012-10-26 Theophile Ranquet + + tests: fix AT_BISON_CHECK_WARNINGS_ stderr rewriting + * tests/input.at (Deprecated directives): Avoid spurious error. + * tests/locat.at (AT_BISON_CHECK_WARNINGS): Adjust for recent changes. + +2012-10-26 Theophile Ranquet + + scan-skel.l: consider m4 notes as related to "complaint" errors + * src/scan-skel.l (flag): Here. + +2012-10-26 Theophile Ranquet + + warnings: distinguish context information based on warning type + * src/scan-code.l (show_sub_message, show_sub_messages): Take a new warnings + argument. + +2012-10-26 Theophile Ranquet + + warnings: fix early exit of warnings treated as errors + Treating warnings as errors caused Bison to exit earlier than needed, making it + hide warnings that would have been printed had -Werror not been set. + + Also, fix a bug that caused some context information of errors to not be + shown. + + * src/complain.c (complaint_issued): Rename as... + (complaint_status): This, and change its type from boolean to + * src/complain.h (err_status): This, new enumeration. + * src/main.c (main): Adjust (only finish early if an actual complaint was + risen, not a mere warning treated an error). + * src/reader.c: Adjust. + +2012-10-26 Theophile Ranquet + + tests: reindent for legibility + * tests/local.at (AT_BISON_CHECK_WARNINGS_): Here. + +2012-10-26 Akim Demaille + + build: fix Texinfo compilation + * doc/local.mk: fix dependencies. + +2012-10-26 Akim Demaille + + regen + +2012-10-26 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: (46 commits) + doc: minor style change + maint: use gendocs's new -I option + regen + yacc.c: do not define location support when not using locations + maint: be compilable with GCC 4.0 + tests: address a warning from GCC 4.4 + tests: don't use options that Clang does not support + tests: restore the tests on -Werror + regen + parse-gram: update the Bison interface + fix comment + maint: post-release administrivia + version 2.6.4 + regen + 2.6.4: botched 2.6.3 + maint: post-release administrivia + version 2.6.3 + gnulib: update + tests: check %no-lines + NEWS: warnings with clang + ... + +2012-10-26 Akim Demaille + + Merge branch 'branch-2.6' into maint + * origin/branch-2.6: + regen + yacc.c: do not define location support when not using locations + maint: be compilable with GCC 4.0 + tests: address a warning from GCC 4.4 + tests: don't use options that Clang does not support + tests: restore the tests on -Werror + regen + parse-gram: update the Bison interface + fix comment + +2012-10-26 Akim Demaille + + doc: minor style change + * doc/figs/example-reduce.txt: here. + +2012-10-26 Akim Demaille + + maint: use gendocs's new -I option + * gnulib: Update gendocs. + * cfg.mk (gendocs_options_): New. + +2012-10-26 Akim Demaille + + regen + +2012-10-26 Akim Demaille + + yacc.c: don't use _Pragma GCC diagnostic with 4.6 + Reported by Peter Simons. + http://lists.gnu.org/archive/html/bug-bison/2012-10/msg00033.html + + * data/yacc.c (b4_declare_scanner_communication_variables): 4.7 + seems fine though. + +2012-10-26 Akim Demaille + + regen + +2012-10-26 Akim Demaille + + yacc.c: do not define location support when not using locations + * data/yacc.c (YYLLOC_DEFAULT, YYRHSLOC): Don't define when not + using locations. + +2012-10-26 Akim Demaille + + maint: be compilable with GCC 4.0 + The "shadows a global declaration" warning in GCC 4.0 was a bit + annoying. It does not like that a type name be used in a prototype of + a function (not the implementation, just the declaration): + + In file included from src/LR0.c:38: + src/reader.h:56: warning: declaration of 'named_ref' shadows a + global declaration + src/named-ref.h:35: warning: shadowed declaration is here + + It does not like either when a global variable name is used in a + prototype. Flex 2.5.37 generates this prototype: + + void gram_set_debug (int debug_flag ); + + * src/getargs.h, src/getargs.c (debug_flag): Rename as... + (debug): this. + Adjust dependencies. + * src/reader.h: Don't use "named_ref" as a formal argument name. + +2012-10-26 Theophile Ranquet + + misc: document TESTSUITEFLAGS in README-hacking + * README-hacking: Document -j and -k flags. + +2012-10-26 Theophile Ranquet + + deprecation: add tests + * tests/input.at (Deprecated directives warn, Non-deprecated + directives don't, Unput doesn't mess up locations): New tests. + +2012-10-25 Akim Demaille + + tests: address a warning from GCC 4.4 + 236. torture.at:465: testing Exploding the Stack Size with Alloca ... + ../../../tests/torture.at:474: bison -o input.c input.y + ../../../tests/torture.at:474: $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS + stderr: + cc1: warnings being treated as errors + input.y: In function 'main': + input.y:60: error: 'status' may be used uninitialized in this function + + * tests/torture.at (AT_DATA_STACK_TORTURE): Initial status to avoid + the previous error. + +2012-10-25 Akim Demaille + + tests: don't use options that Clang does not support + * configure.ac (WARN_CFLAGS, WARN_CXXFLAGS): Do not include options + that Clang does not support. + +2012-10-25 Akim Demaille + + tests: restore the tests on -Werror + When run as /bin/sh, Bash sets the shell variable POSIXLY_CORRECT to + y. The test suite checks for the envvar POSIXLY_CORRECT to turn of + some tests not supported in POSIX mode. Restore these tests. + + Reported by the Hydra build farm, from Rob Vermaas. + + * tests/local.at (AT_BISON_CHECK_WARNINGS_): Check the envvar + POSIXLY_CORRECT, not the shell variable. + +2012-10-25 Akim Demaille + + regen + +2012-10-25 Akim Demaille + + parse-gram: update the Bison interface + * src/parse-gram.y (%pure-parser, %name-prefix): Replace with... + (%define api.pure, %define api.prefix) + * src/location.h, src/scan-gram.h: Adjust to api.prefix. + +2012-10-25 Akim Demaille + + fix comment + * data/c.m4 (b4_YYDEBUG_define): here. + +2012-10-24 Theophile Ranquet + + regen + +2012-10-24 Theophile Ranquet + + deprecation: issue warnings in scanner + * src/parse-gram.y: Move the handling of (three) deprecated constructs ... + * src/scan-gram.l: ...Here, and issue warnings. + (DEPRECATED): New. + +2012-10-23 Akim Demaille + + Merge branch 'branch-2.6' into maint + * origin/branch-2.6: + maint: post-release administrivia + version 2.6.4 + regen + 2.6.4: botched 2.6.3 + +2012-10-23 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-10-23 Akim Demaille + + version 2.6.4 + * NEWS: Record release date. + +2012-10-22 Akim Demaille + + regen + +2012-10-22 Akim Demaille + + 2.6.4: botched 2.6.3 + * NEWS: here. + +2012-10-22 Akim Demaille + + Merge branch '2.6.3' into maint + * 2.6.3: (22 commits) + maint: post-release administrivia + version 2.6.3 + gnulib: update + tests: check %no-lines + NEWS: warnings with clang + warnings: avoid warnings from clang + tests: no longer disable -O compiler options + yacc.c: initialize yylval in pure-parser mode + skeletons: style changes + tests: minor improvements + tests: use $PERL instead of perl + build: look for Perl in configure. + tests: fix sed portability issues + tests: diff -u is not portable + maint: word changes + lalr1.cc: fix test suite portability + maint: fix an erroneous include + tests: check that headers are self contained + doc: add missing documentation for --report + headers: move CPP guards into YY_*_INCLUDED to avoid collisions + ... + +2012-10-22 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-10-22 Akim Demaille + + version 2.6.3 + * NEWS: Record release date. + +2012-10-22 Akim Demaille + + gnulib: update + +2012-10-22 Akim Demaille + + tests: check %no-lines + * tests/synclines.at: here. + +2012-10-22 Akim Demaille + + NEWS: warnings with clang + * NEWS: here. + +2012-10-22 Akim Demaille + + warnings: avoid warnings from clang + Fix the following warning + + parse-gram.c:2078:14: error: equality comparison with extraneous parentheses + [-Werror,-Wparentheses-equality] + if (((yyn) == (-91))) + ~~~~~~^~~~~~~~ + parse-gram.c:2078:14: note: remove extraneous parentheses around the + comparison to silence this warning + if (((yyn) == (-91))) + ~ ^ ~ + parse-gram.c:2078:14: note: use '=' to turn this equality comparison into + an assignment + if (((yyn) == (-91))) + ^~ + = + 1 error generated. + + and the following one: + + input.cc:740:1: error: function declared 'noreturn' should not return + [-Werror,-Winvalid-noreturn] + static void yyMemoryExhausted (yyGLRStack* yystackp) + __attribute__ ((__noreturn__)); + static void + yyMemoryExhausted (yyGLRStack* yystackp) + { + YYLONGJMP (yystackp->yyexception_buffer, 2); + } + ^ + 1 warning and 1 error generated. + + This is Apple clang version 3.1 (tags/Apple/clang-318.0.61). + + * data/c.m4 (b4_table_value_equals): Use (!!(A == B)) instead of (A == B) + to avoid this warning. + Any reasonable compiler should generate the same code. + * src/uniqstr.h (UNIQSTR_EQ): Likewise. + * data/glr.c (LONGJMP): abort after longjmp to pacify clang. + +2012-10-22 Akim Demaille + + tests: no longer disable -O compiler options + Tests are running without -O since + f377f69fec28013c79db4efe12bbb9d48987fb2c because some warnings (about + yylval not being initialized) show only when GCC is given -O2. The + previous patch fixes the warnings. Run the test suite with compiler + options unmodified. + + * tests/atlocal.in (O0CFLAGS, O0CXXFLAGS): Remove, use CFLAGS and + CXXFLAGS. + +2012-10-22 Paul Eggert + + yacc.c: initialize yylval in pure-parser mode + See http://lists.gnu.org/archive/html/bison-patches/2012-08/msg00024.html + (spreading over September and October). + + * data/yacc.c (YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN) + (YY_IGNORE_MAYBE_UNINITIALIZED_END, YYLVAL_INITIALIZE): + New macros. Use them to suppress an unwanted GCC diagnostic. + +2012-10-22 Akim Demaille + + skeletons: style changes + * data/yacc.c, data/glr.c: Prefer Title case for (CPP) macro arguments. + +2012-10-22 Akim Demaille + + tests: minor improvements + * tests/c++.at: Space changes. + Use AT_YYERROR_DEFINE. + * tests/local.at (AT_YYERROR_DEFINE): Issue errors on unknown languages. + +2012-10-22 Akim Demaille + + tests: use $PERL instead of perl + * tests/atlocal.in (PERL): New. + Sort. + * tests/calc.at, tests/input.at, tests/local.at, tests/regression.at, + * tests/skeletons.at, tests/synclines.at, tests/torture.at: here. + +2012-10-22 Akim Demaille + + build: look for Perl in configure. + Bison uses "/usr/bin/perl" or "perl" in several places, and it does + not appear to be a problem. But, at least to make it simpler to + change PERL on the make command line, check for perl in configure. + + * configure.ac (PERL): New. + * doc/Doxyfile.in, doc/Makefile.am, tests/bison.in: Use it. + +2012-10-22 Akim Demaille + + tests: fix sed portability issues + Reported by Didier Godefroy, + . + + * tests/calc.at (AT_CHECK_SPACES): Use Perl. + +2012-10-22 Akim Demaille + + tests: diff -u is not portable + Reported by Didier Godefroy + . + + * tests/existing.at (AT_LALR1_DIFF_CHECK): Skip if diff -u does not + work. + +2012-10-22 Akim Demaille + + maint: word changes + * README-hacking (Typical errors): Improve wording. + +2012-10-22 Akim Demaille + + lalr1.cc: fix test suite portability + Reported by Rob Vermaas' Hydra build farm on x86_64-darwin 10.2.0 with + G++ 4.6.3. + + * tests/headers.at (Several parsers): Include AT_DATA_SOURCE_PROLOGUE + in the files to compile. + * data/location.cc: Do not include twice string and iostream (once + by position.hh, and then by location.hh). + * README-hacking (Typical errors): Some hints for other maintainers. + +2012-10-22 Theophile Ranquet + + maint: fix an erroneous include + This fixes test 130 (Several parsers). + + * data/location.cc: Include rather than since + we really need << on strings for instance. + * NEWS: Document this. + +2012-10-22 Akim Demaille + + tests: check that headers are self contained + Reported by Alexandre Duret-Lutz. + + * tests/headers.at (Several parsers): here. + +2012-10-22 Akim Demaille + + doc: add missing documentation for --report + * doc/bison.texi (Bison Options): Document --report's "solved", "all", + and "none". + +2012-10-22 Akim Demaille + + headers: move CPP guards into YY_*_INCLUDED to avoid collisions + See . + + * data/c.m4 (b4_cpp_guard): Prepend YY_ and append _INCLUDED. + * tests/headers.at: Adjust. + * NEWS, doc/bison.texi: Document. + +2012-10-22 Akim Demaille + + minor changes. + * NEWS: Word changes. + * doc/bison.texi: Spell check. + Fix minor issues. + * tests/headers.at: Comment and formatting changes. + +2012-10-22 Akim Demaille + + gnulib: update + +2012-10-19 Akim Demaille + + gnulib: update + +2012-10-19 Akim Demaille + + xml: slight improvement of the DOT output + This was completely forgotten... Nothing about XML is actually + documented... + + * data/xslt/xml2dot.xsl: Use boxes, and Courier font. + +2012-10-19 Akim Demaille + + maint: check for dot before using it + * configure.ac: here. + * doc/Makefile.am: Use $(DOT). + Ship the generated files, to spare the user the need for Graphviz. + +2012-10-18 Theophile Ranquet + + graphs: documentation + Note that 'make web-manual' fails. + + * NEWS: Document these changes. + * doc/Makefile.am: Adjust to generate example files. + * doc/bison.texi: Add a Graphviz section after "Understanding::", the section + describing the .output file, because these are similar. + * doc/figs/example-reduce.dot, doc/figs/example-reduce.txt, + doc/figs/example-shift.dot, doc/figs/example-shift.txt: New, minimal + examples to illustrate the documentation. + +2012-10-18 Theophile Ranquet + + graphs: add tests, introducing -k graph + * tests/output.at (AT_TEST): New. + Use it to add 6 --graph tests. + +2012-10-18 Theophile Ranquet + + graphs: change the output format of the rules + Use something similar to the report file. + + * src/print_graph.c (print_lhs): New, obstack equivalent of rule_lhs_print. + (print_core): Use here. + +2012-10-18 Theophile Ranquet + + graphs: style changes + * src/graphviz.c (start_graph): Use courier font. + (conclude_red): Use commas to separate attributes. Show the acceptation + as a special reduction, with a blue color and an "Acc" label. Show the + lookahead tokens between square brackets. + (output_red): No longer label default reductions. + * src/print_graph.c (print_core): Refactor spacing, and print an + additional space between a rule's rhs and its lookahead tokens. Also, + capitalize "State". + (print_actions): Style, move a declaration. + +2012-10-18 Theophile Ranquet + + graphs: address an issue with R/R conflicts + All disabled reductions should now be shown as such. + + * src/graphviz.c (output_red): Here. + (conclude_red): New. + +2012-10-16 Akim Demaille + + news: spell check + * NEWS: here. + +2012-10-16 Akim Demaille + + Merge branch 'maint' + * origin/maint: + java: use api.location.type and api.position.type + +2012-10-16 Akim Demaille + + variables: use singular in %define variable names + See http://lists.gnu.org/archive/html/bison-patches/2012-02/msg00045.html + + * doc/bison.texi, src/lalr.c, src/main.c, src/muscle-tab.c, + * src/print.c, src/reader.c, src/tables.c, tests/conflicts.at, + * tests/input.at, tests/reduce.at: + s/lr.default-reductions/lr.default-reduction/ + s/lr.keep-unreachable-states/lr.keep-unreachable-state/. + * NEWS: Document. + +2012-10-16 Akim Demaille + + java: fixes + * data/java.m4: Remove stray M4 characters. + +2012-10-16 Akim Demaille + + api.tokens.prefix -> api.token.prefix + See + http://lists.gnu.org/archive/html/bison-patches/2012-02/msg00045.html + Note that api.tokens.prefix has not been released, yet. + + * NEWS, data/bison.m4, doc/bison.texi, tests/c++.at, + * tests/calc.at, tests/java.at, tests/local.at: Do it. + * src/muscle-tab.c (muscle_percent_variable_update): Ensure + backward compatibility. + +2012-10-15 Theophile Ranquet + + scan-skel.l: shift complain_args arguments + Because argv[0] is never used, shift it out from the argument list. + + * src/complain.c (complain_args): Here. + * src/scan-skel.l (at_complain): Adjust argv and argc. + +2012-10-15 Theophile Ranquet + + scan-skel.l: formatting changes + * src/scan-skel.l (fail_for_at_directive_too_few_args): Here. + +2012-10-12 Akim Demaille + + java: use api.location.type and api.position.type + * data/java.m4: here. + * NEWS, doc/bison.texi, tests/java.at: Adjust. + +2012-10-12 Akim Demaille + + Merge branch 'maint' + * origin/maint: + tests: check %no-lines + tests: minor simplification + graphs: stylistic changes. + graphs: minor style changes + graphs: show reductions + graphs: style: prefix state number with "state" + graphs: style: use left justification for states + graphs: style: prefix rules and change shapes + obstack: import obstack_finish0 from master + c++: api.location.type + muscles: a function for backward compatibility + maint: more macros + +2012-10-12 Akim Demaille + + tests: check %no-lines + * tests/synclines.at: here. + +2012-10-12 Akim Demaille + + tests: minor simplification + * tests/headers.at (Several parsers): Use *.y even for C++. + +2012-10-11 Akim Demaille + + graphs: stylistic changes. + * src/graphviz.c (output_red): Comment and formatting changes. + +2012-10-11 Theophile Ranquet + + graphs: minor style changes + * src/graphviz.c (output_red): Fix C90 issues. + Reduce variable scopes. + +2012-10-11 Theophile Ranquet + + graphs: show reductions + * src/graphviz.c (output_red): New, show reductions on the graph. + (no_reduce_bitset_init): New, initialize a bitset. + (print_token): New, print a lookahead token. + (escape): New, print "foo" as \"foo\" because Dot doesn't like quotes within + a label. + + * src/graphviz.h : Adjust. + * src/print_graph.c (print_actions): Call output_red here. + +2012-10-11 Theophile Ranquet + + graphs: style: prefix state number with "state" + * src/print_graph.c (print_core): Here. + +2012-10-11 Theophile Ranquet + + graphs: style: use left justification for states + The label text of nodes is centered "by default" (by the use of '\n' as + a line feed). This gives bad readability to the grammar rules shown in + state nodes, a left justification is much nicer. This is done by using '\l' + as the line feed. + + In order to allow \l in the DOT file, changes to the quoting system seem + necessary. + + * src/print_graph.c (print_core): Escape tokens here, instead of... + * src/graphviz.c (output_node): Here... + (escape): Using this, new. + +2012-10-11 Theophile Ranquet + + graphs: style: prefix rules and change shapes + * src/graphviz.c (start_graph): Use box rather than ellipsis. + * src/print_graph.c (print_core): Prefix rules with their number. + +2012-10-11 Theophile Ranquet + + obstack: import obstack_finish0 from master + * src/system.h (obstack_finish0): New. + +2012-10-11 Akim Demaille + + Merge branch 'maint' + * origin/maint: + NEWS: warnings with clang + warnings: avoid warnings from clang + tests: no longer disable -O compiler options + yacc.c: initialize yylval in pure-parser mode + skeletons: style changes + lalr1.cc: document exception safety + lalr1.cc: check exception safety of error handling + lalr1.cc: check (and fix) %printer exception safety + lalr1.cc: check (and fix) %initial-action exception safety + lalr1.cc: fix exception safety + lalr1.cc: check exception safety. + lalr1.cc: indentation fixes. + lalr1.cc: don't leave macros define to nothing + tests: minor improvements + tests: use $PERL instead of perl + build: look for Perl in configure. + tests: fix sed portability issues + tests: diff -u is not portable + +2012-10-09 Akim Demaille + + c++: api.location.type + This feature was introduced in 95a2de5695670ae0df98cb3c42141cad549f0204 + (which is part of 2.5), but not documented. Give it a proper name, and + make it public. + + * data/c++.m4, data/lalr1.cc, data/glr.cc, data/java.m4: Use + api.location.type instead of location_type. + * src/muscle-tab.c (muscle_percent_variable_update): Map the latter to + the former. + * tests/local.at: Adjust. + * tests/calc.at: Use api.location.type. + Leave tests/java.at with location_type, at least for the time being, + to cover both names. + * doc/bison.texi: Document api.location.type. + (User Defined Location Type): New. + * NEWS: Update. + +2012-10-09 Akim Demaille + + muscles: a function for backward compatibility + Based on commit 171ad99d6421935a278656be6dc7161591835d00 from master. + + * src/muscle-tab.c (muscle_percent_variable_update): New. + (muscle_percent_define_insert): Use it. + Define the variables with their initial value. + +2012-10-09 Akim Demaille + + maint: more macros + * src/output.c (ARRAY_CARDINALITY): Move to... + * src/system.h: here. + (STREQ, STRNEQ): new. + +2012-10-08 Akim Demaille + + NEWS: warnings with clang + * NEWS: here. + +2012-10-08 Akim Demaille + + warnings: avoid warnings from clang + Fix the following warning + + parse-gram.c:2078:14: error: equality comparison with extraneous parentheses + [-Werror,-Wparentheses-equality] + if (((yyn) == (-91))) + ~~~~~~^~~~~~~~ + parse-gram.c:2078:14: note: remove extraneous parentheses around the + comparison to silence this warning + if (((yyn) == (-91))) + ~ ^ ~ + parse-gram.c:2078:14: note: use '=' to turn this equality comparison into + an assignment + if (((yyn) == (-91))) + ^~ + = + 1 error generated. + + and the following one: + + input.cc:740:1: error: function declared 'noreturn' should not return + [-Werror,-Winvalid-noreturn] + static void yyMemoryExhausted (yyGLRStack* yystackp) + __attribute__ ((__noreturn__)); + static void + yyMemoryExhausted (yyGLRStack* yystackp) + { + YYLONGJMP (yystackp->yyexception_buffer, 2); + } + ^ + 1 warning and 1 error generated. + + This is Apple clang version 3.1 (tags/Apple/clang-318.0.61). + + * data/c.m4 (b4_table_value_equals): Use (!!(A == B)) instead of (A == B) + to avoid this warning. + Any reasonable compiler should generate the same code. + * src/uniqstr.h (UNIQSTR_EQ): Likewise. + * data/glr.c (LONGJMP): abort after longjmp to pacify clang. + +2012-10-08 Akim Demaille + + tests: no longer disable -O compiler options + Tests are running without -O since + f377f69fec28013c79db4efe12bbb9d48987fb2c because some warnings (about + yylval not being initialized) show only when GCC is given -O2. The + previous patch fixes the warnings. Run the test suite with compiler + options unmodified. + + * tests/atlocal.in (O0CFLAGS, O0CXXFLAGS): Remove, use CFLAGS and + CXXFLAGS. + +2012-10-08 Paul Eggert + + yacc.c: initialize yylval in pure-parser mode + See http://lists.gnu.org/archive/html/bison-patches/2012-08/msg00024.html + (spreading over September and October). + + * data/yacc.c (YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN) + (YY_IGNORE_MAYBE_UNINITIALIZED_END, YYLVAL_INITIALIZE): + New macros. Use them to suppress an unwanted GCC diagnostic. + +2012-10-08 Akim Demaille + + skeletons: style changes + * data/yacc.c, data/glr.c: Prefer Title case for (CPP) macro arguments. + +2012-10-06 Akim Demaille + + lalr1.cc: document exception safety + * NEWS: here. + * doc/bison.texi (Destructor Decl, C++ Parser Interface): and there. + +2012-10-06 Akim Demaille + + lalr1.cc: check exception safety of error handling + * tests/c++.at (Exception safety): Don't use swap here, it + is useless. + Cover more test cases: yyerror, YYERROR, YYABORT, and + error recovery. + (Object): Instead of just keeping a counter of instances, keep + a list of them. + +2012-10-06 Akim Demaille + + lalr1.cc: check (and fix) %printer exception safety + * tests/c++.at (Exception safety): Let the parser support the --debug + option. + On 'p', throw an exception from the %printer. + * data/lalr1.cc (yyparse): Do not display the values we discard, as it + uses %printer, which might have thrown the exception. + +2012-10-06 Akim Demaille + + lalr1.cc: check (and fix) %initial-action exception safety + * data/lalr1.cc: Check size > 1, rather than size != 1, when cleaning + the stack, as at the beginning, size is 0. + * tests/c++.at (Exception safety): Check exception safety in + %initial-action. + +2012-10-06 Akim Demaille + + lalr1.cc: fix exception safety + lalr1.cc does not reclaim its memory when ended by an exception. + + Reported by Oleksii Taran: + http://lists.gnu.org/archive/html/help-bison/2012-09/msg00000.html + + * data/lalr1.cc (yyparse): Protect the whole yyparse by a try-catch + block that cleans the stack and the lookahead. + +2012-10-06 Akim Demaille + + lalr1.cc: check exception safety. + * tests/c++.at (Exception safety): New. + +2012-10-06 Akim Demaille + + lalr1.cc: indentation fixes. + * data/lalr1.cc (yyparse): here. + Untabify a block of code. + +2012-10-06 Akim Demaille + + lalr1.cc: don't leave macros define to nothing + * data/lalr1.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT, YY_STACK_PRINT): + Define to something so that, for instance, "if (foo) YY_SYMBOL_PRINT" + is valid even when !YYDEBUG. + +2012-10-06 Akim Demaille + + tests: minor improvements + * tests/c++.at: Space changes. + Use AT_YYERROR_DEFINE. + * tests/local.at (AT_YYERROR_DEFINE): Issue errors on unknown languages. + +2012-10-05 Akim Demaille + + tests: use $PERL instead of perl + * tests/atlocal.in (PERL): New. + Sort. + * tests/calc.at, tests/input.at, tests/local.at, tests/regression.at, + * tests/skeletons.at, tests/synclines.at, tests/torture.at: here. + +2012-10-05 Akim Demaille + + build: look for Perl in configure. + Bison uses "/usr/bin/perl" or "perl" in several places, and it does + not appear to be a problem. But, at least to make it simpler to + change PERL on the make command line, check for perl in configure. + + * configure.ac (PERL): New. + * doc/Doxyfile.in, doc/Makefile.am, tests/bison.in: Use it. + +2012-10-05 Akim Demaille + + tests: fix sed portability issues + Reported by Didier Godefroy, + . + + * tests/calc.at (AT_CHECK_SPACES): Use Perl. + +2012-10-05 Akim Demaille + + tests: diff -u is not portable + Reported by Didier Godefroy + . + + * tests/existing.at (AT_LALR1_DIFF_CHECK): Skip if diff -u does not + work. + +2012-10-04 Akim Demaille + + Merge branch 'maint' + * origin/maint: + maint: word changes + lalr1.cc: fix test suite portability + maint: fix an erroneous include + tests: check that headers are self contained + doc: add missing documentation for --report + +2012-10-04 Akim Demaille + + scan-skel: use the scanner to reject all invalid directives + * src/scan-skel.l: Use a simpler and more consistent pattern escaping + scheme. + Catch all the invalid directives here by just removing the previous + catch-all-but-alphabetical rule. + +2012-10-04 Theophile Ranquet + + scan-skel: recognize the @directives directly in scanner + * src/scan-skel.l (at_directive, at_init): New. + (at_ptr): New, function pointer used to call the right at_directive + function (at_basename, etc.). + (outname): Rename as... + (out_name): this, for consistency with out_lineno. + +2012-10-04 Theophile Ranquet + + scan-skel: split @directive functions + * src/scan-skel.l (at_directive_perform): Split as... + (at_basename, at_complain, at_output): these. + +2012-10-04 Theophile Ranquet + + errors: support indented context info in m4 macros + * TODO: Address the issue, so remove it. + * data/bison.m4: Use b4_error with [[note]] rather than a complain_at + for context information. + * src/complain.c (complain_args): Take an additional argument, an + indentation pointer, to allow the dispatching of context information. + * src/complain.h (complain_args): Adjust prototype. + * src/scan-skel.l (at_directive_perform): Recognize the new @note mark. + * tests/input.at: Adjust. + +2012-10-04 Theophile Ranquet + + errors: factor b4_error @directives + Instead of @complain, @warn, and @fatal, use a unique @complain + directive. This directive's first argument is "complain", "warn", etc. + + * data/bison.m4 (m4_error): Here. + * src/scan-skel.l (at_directive_perform): Adjust. + (flag): Replace the switch by safer and more explicit if branches. + +2012-10-04 Theophile Ranquet + + errors: pointerize complain_at_indent + * src/complain.c (complain_at_indent): Rename as... + (complaint_indent): This, and take the location as a pointer. + * src/complain.h, src/muscle-tab.c, src/reader.c, src/scan-code.l, + src/symtab.c: Adjust. + +2012-10-04 Akim Demaille + + maint: word changes + * README-hacking (Typical errors): Improve wording. + +2012-10-04 Akim Demaille + + lalr1.cc: fix test suite portability + Reported by Rob Vermaas' Hydra build farm on x86_64-darwin 10.2.0 with + G++ 4.6.3. + + * tests/headers.at (Several parsers): Include AT_DATA_SOURCE_PROLOGUE + in the files to compile. + * data/location.cc: Do not include twice string and iostream (once + by position.hh, and then by location.hh). + * README-hacking (Typical errors): Some hints for other maintainers. + +2012-10-03 Theophile Ranquet + + maint: fix an erroneous include + This fixes test 130 (Several parsers). + + * data/location.cc: Include rather than since + we really need << on strings for instance. + * NEWS: Document this. + +2012-10-03 Akim Demaille + + tests: check that headers are self contained + Reported by Alexandre Duret-Lutz. + + * tests/headers.at (Several parsers): here. + +2012-10-03 Akim Demaille + + doc: add missing documentation for --report + * doc/bison.texi (Bison Options): Document --report's "solved", "all", + and "none". + +2012-10-01 Akim Demaille + + build: use gnulib's non-recursive-gnulib-prefix-hack + Suggested by Jim Meyering. + + * etc/prefix-gnulib-mk: Remove, as it is now provided by... + * bootstrap.conf (modules): the non-recursive-gnulib-prefix-hack module. + * build-aux/.gitignore, configure.ac, m4/.gitignore: Adjust. + +2012-10-01 Akim Demaille + + warnings: simplify the m4 interface + * data/bison.m4 (error_at): Replace... + (error): this. + (b4_warn, b4_complain, b4_fatal): Bounce to their _at equivalent, + with empty location. + * src/scan-skel.l (at_directive_perform): Simplify accordingly. + +2012-10-01 Theophile Ranquet + + warnings: separate flags_argmatch + This function is now a mere iterator that calls flag_argmatch, + a new function, that matches a single option parameter. + + * src/getargs.c (flag_argmatch): New, taken from... + (flags_argmatch): Here. + +2012-10-01 Theophile Ranquet + + warnings: refactoring + The code here was too confusing, this seems more natural. + + * src/complain.c (error_message): Move the indentation check and the category + output to complains. Also, no longer take a 'warnings' argument. + (complains): Factor calls to error_message. + +2012-10-01 Theophile Ranquet + + formatting changes + * src/complain.c: Here. + +2012-10-01 Theophile Ranquet + + warnings: organize variadic complaints call + Move the dispatch of variadic complains to complain.c, rather than do + it in a scanner. + + * src/complain.h, src/complain.c (complain_args): New. + * src/scan-skel.l (at_directive_perform): Use it. + +2012-10-01 Theophile Ranquet + + warnings: fusion of complain and complain_at + These functions are very similar, and keeping them seperate makes + future improvements difficult, so merge them. + + This impacts 89 calls. + + * src/bootstrap.conf: Adjust. + * src/complain.c (complain, complain_at): Merge into... + (complain): this. + (complain_args): Adjust. + * src/complain.h, src/conflicts.c, src/files.c, src/getargs.c, + * src/gram.c, src/location.c, src/muscle-tab.c, src/parse-gram.y, + * src/reader.c, src/reduce.c, src/scan-code.l, src/scan-gram.l, + * src/scan-skel.l, src/symlist.c, src/symtab.c: + Adjust. + +2012-10-01 Theophile Ranquet + + warnings: remove spurious suffixes on context + Rectify a bug that introduced suffixes out of place. + + * src/complainc.c (complains): Handle all three special warning bits. + * src/scan-code.l (show_sub_message): Remove useless argument. + * tests/named-refs.at: Adjust. + +2012-10-01 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + headers: move CPP guards into YY_*_INCLUDED to avoid collisions + minor changes. + +2012-10-01 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + gnulib: update + errors: indent "user token number redeclaration" context + +2012-10-01 Akim Demaille + + headers: move CPP guards into YY_*_INCLUDED to avoid collisions + See . + + * data/c.m4 (b4_cpp_guard): Prepend YY_ and append _INCLUDED. + * tests/headers.at: Adjust. + * NEWS, doc/bison.texi: Document. + +2012-10-01 Akim Demaille + + minor changes. + * NEWS: Word changes. + * doc/bison.texi: Spell check. + Fix minor issues. + * tests/headers.at: Comment and formatting changes. + +2012-09-28 Akim Demaille + + gnulib: update + +2012-09-28 Theophile Ranquet + + errors: indent "user token number redeclaration" context + This is the continuation of the work on the readability of errors + context. + + * src/symtab.c (user_token_number_redeclaration): Use + complain_at_indent to output with increased indentation level. + * tests/input:at: Apply this change. + +2012-09-27 Theophile Ranquet + + errors: don't display "warnings treated as errors" + This line doesn't add any meaningful information anymore, the appended + [-Werror=CATEGORY] is enough. It is actually more insightful, as it + allows to distinguish warnings treated as errors from those that + aren't. This line is also removed by gcc 4.8. + + * src/complain.c (set_warnings_issued): The only action left was + checking if the error bit corresponding to the warning issued was set, + and that function was only called once. Therefore, remove it, and do + its job directly in the caller... + (complains): here. + * src/complains.h: Adjust. + * tests/input.at: Adjust. + * NEWS: Document this change. + +2012-09-27 Akim Demaille + + errors: change output, and improve -y coherence + The prefix of warnings treated as errors is now "error: ". Also, their + suffix now reflects the changes in the Werror option format. + + An output for -Werror=other used to be: + bison: warnings being treated as errors + input.y:1.1: warning: stray ',' treated as white space [-Wother] + + It is now: + bison: warnings being treated as errors + input.y:1.1: error: stray ',' treated as white space [-Werror=other] + + The line "warnings being treated as errors" no longer adds any info, + it will be removed in a forthcoming change. + + * NEWS: Add entry "Enhancement of the -Werror" + * doc/bison.texi: Move the warnings-as-error to a new bullet. + * src/complain.c (complains): Refactor, change the prefix of warnings + that are treated as errors. + (warnings_print_categories): Support for [-Werror=CATEGORY] display + * src/getargc.c (getargs): -y implies -Werror=yacc + * tests/input.at: Update expected --yacc output for coherence. + +2012-09-27 Theophile Ranquet + + errors: introduce the -Werror=CATEGORY option + This new option is a lot more flexible than the previous one. Its + details will be discussed in the NEWS and info file, in a forthcoming + change. + + If no category is specified (ie: used as simply "-Werror"), the + functionality is the same as before. + + * src/complain.c (errors_flag): New variable. + (set_warning_issued): Accept warning categories as an argument. + * src/complain.h (Wall): Better definition. + * src/getargs.c (flags_argmatch): Support for the new format. + (usage): Update -Werror to -Werror[=CATEGORY] format. + + * src/complain.c (errors_flag): New variable. + (set_warning_issued): Accept warning categories as an argument. + * src/complain.h (Wall): Better definition. + * src/getargs.c (flags_argmatch): Support for the new format. + (usage): Update -Werror to -Werror=[CATEGORY] format. + +2012-09-26 Akim Demaille + + Merge branch 'maint' + * maint: + warnings: introduce -Wdeprecated in the usage info + errors: prefix the output with "error: " + errors: indent "invalid value for %define" context + errors: indent "%define var" redefinition context + errors: indent "symbol redeclaration" context + errors: indent "result type clash" error context + +2012-09-26 Theophile Ranquet + + warnings: introduce -Wdeprecated in the usage info + The deprecated warning, introduced some time ago, was not displayed in + the usage message. This patch addresses the issue. + + * src/getargs.c (usage): Insert here. + +2012-09-26 Akim Demaille + + regen + +2012-09-26 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + regen + yacc: fix handling of CPP guards when no header is generated + gnulib: update + +2012-09-26 Theophile Ranquet + + errors: prefix the output with "error: " + This improves readability. This is also what gcc does. + + * NEWS: Document this change. + * src/complain.c (complain_at): Prefix all errors with "error: ". + (complain_at_indent, warn_at_indent): Do not prefix the context + information of errors, which are basically just indented errors. + * tests/conflicts.at, tests/glr-regression.at, tests/input.at, + tests/named-refs.at, tests/output.at, tests/push.at, + tests/regression.at, tests/skeletons.at: Apply this change. + +2012-09-26 Theophile Ranquet + + errors: indent "invalid value for %define" context + This is the continuation of the work on the readability of errors + context. + + For example, what used to be: + input.y:1.9-29: invalid value for %define variable 'foo' : 'bar' + input.y:1.9-29: accepted value: 'most' + + is now: + input.y:1.9-29: invalid value for %define variable 'foo' : 'bar' + input.y:1.9-29: accepted value: 'most' + + * src/muscle-tab.c (muscle_percent_define_check_values): Use + complain_at_indent to output with increased indentation level. + * tests/input:at: Apply this change. + +2012-09-26 Theophile Ranquet + + errors: indent "%define var" redefinition context + This is the continuation of the work on the readability of errors + context. + + For example, what used to be: + input.y:2.9-11: %define variable 'var' redefined + input.y:1.9-11: previous definition + + is now: + input.y:2.9-11: %define variable 'var' redefined + input.y:1.9-11: previous definition + + * src/muscle-tab.c (muscle_percent_define_insert): Use + complain_at_indent to output with increased indentation level. + * tests/input.at: Apply this change. + +2012-09-26 Theophile Ranquet + + errors: indent "symbol redeclaration" context + This is the continuation of the work on the readability of errors + context. + + For example, what used to be: + input.y:5.10-24: %printer redeclaration for + input.y:3.11-25: previous declaration + + is now: + input.y:5.10-24: %printer redeclaration for + input.y:3.11-25: previous declaration + + * NEWS: Document this change. + * src/symtab.c (symbol_redeclaration, semantic_type_redeclaration, + user_token_number_redeclaration, default_tagged_destructor_set, + default_tagless_destructor_set, default_tagged_printer_set, + default_tagless_printer_set): Use complain_at_indent to + output with increased indentation level. + * tests/input.at: Apply this change. + +2012-09-26 Theophile Ranquet + + errors: indent "result type clash" error context + This used to be the format of the error report: + + input.y:6.5-10: result type clash on merge function 'merge': [...] + input.y:2.4-9: previous declaration + + In order to distinguish the actual error from the context provided, we + rather this new output: + + input.y:6.5-10: result type clash on merge function 'merge': [...] + input.y:2.4-9: previous declaration + + Another patch will introduce an "error: " prefix to all non-indented + lines, giving yet better readability to the reports. + + * src/complain.h (SUB_INDENT): Move to here. + * src/reader.c (record_merge_function_type): Use complain_at_indent to + output with increased indentation level. + * src/scan-code.l (SUB_INDENT): Remove from here. + * tests/glr-regression.at: Apply this change. + +2012-09-25 Akim Demaille + + warnings: use the regular interface for s/r and r/r conflicts + The current routines used to display s/r and r/r conflicts are both + inconvenient from the programmer point of view (they do not use the + warning infrastructure) and for the user (the messages are rather + terse, not necessarily pleasant to read, and because they don't use + the same routines, they look different). + + It was due to the belief (dating back to the initial checked-in + version of Bison) that, at some point, POSIX Yacc mandated the format + for these messages. Today, the Open Group's manual page for Yacc, + , + explicitly states that the format of these messages is unspecified. + See commit be7280480c175bed203883f524c7dcd6cf37c13d and + . + + For a discussion on the chosen warning format, see + http://lists.gnu.org/archive/html/bison-patches/2012-09/msg00039.html + + In an effort to factor the handling of errors and warnings, use the + Bison warning routines to report these messages. + + * src/conflicts.c (conflicts_print): Rewrite with clearer sections + about S/R and then R/R conflicts. + (conflict_report): Remove, inlined in its sole + caller... + (conflicts_output): here. + * tests/conflicts.at, tests/existing.at, tests/glr-regression.at, + * tests/reduce.at, tests/regression.at: Adjust the expected results. + * NEWS: Update. + +2012-09-25 Akim Demaille + + regen + +2012-09-25 Akim Demaille + + yacc: fix handling of CPP guards when no header is generated + When no header was to be generated, Bison would issue: + + /* In a future release of Bison, this section will be replaced + by #include "". */ + #ifndef YY_ + # define YY_ + + It now properly generates nothing. + + * data/c.m4 (b4_cpp_guard_open, b4_cpp_guard_close): Issue nothing when + the file name is empty. + * data/yacc.c: Do not generate the above comment when there is no header + to generate. + * NEWS: Update. + +2012-09-25 Akim Demaille + + gnulib: update + +2012-09-21 Akim Demaille + + conflicts: refactor the counting routines + * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Rename as... + (count_sr_conflicts, count_rr_conflicts): these. + Use size_t for counts. + (count_sr_conflicts, count_rr_conflicts): New. + Use them. + +2012-09-21 Akim Demaille + + %expect-rr is for GLR only + * src/conflicts.c (conflicts_print): Complain about %expect-rr if not + in GLR mode, regardless of the number of reduce/reduce conflicts. + * tests/conflicts.at (%expect-rr non GLR): New test. + * NEWS: Update. + +2012-09-21 Akim Demaille + + TODO: lalr1.cc master vs maint + * TODO: here. + +2012-09-21 Akim Demaille + + c++: coding style fixes + * data/lalr1.cc, tests/c++.at: Formatting changes. + +2012-09-21 Akim Demaille + + Revert "introduced a GCC-like -Werror=type" + This reverts commit 981c53e257f1974854edc4f6ad0e88c7f18e2bea. + +2012-09-21 Akim Demaille + + Revert "made previous commit less hairy" + This reverts commit fd01e1d05ea3e627033d148b5400b99a18ac7ba3. + +2012-09-21 Akim Demaille + + Revert "new Werror report format fixed in a test" + This reverts commit 41511178a71ebaf81bde7ffc682c575537af45cb. + +2012-09-21 Theophile Ranquet + + new Werror report format fixed in a test + * tests/input.at : replaced [-Wyacc] with [-Werror=yacc] + + todo: fix the other failed test of the suite, tests/conflicts.at:1554 + +2012-09-21 Theophile Ranquet + + made previous commit less hairy + * src/getargs.c : here + +2012-09-20 Theophile Ranquet + + introduced a GCC-like -Werror=type + * src/complain.h : errors_flag variable + * src/complain.c : actual stuff happens here + * src/conflits.c : differentiated SR and RR conflicts + * src/getargs.c : flags_argmatch recognizes the new -Werror format + +2012-09-04 Akim Demaille + + regen + +2012-09-04 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: remove useless file + update files to ignore + remove useless include + use locale-indep. c_is* functions for parsing, not isspace, isprint etc + gnulib: update + --help: include a place to report translation issues + tests: style changes + tests: fix push-pull test + yacc.c: style changes + +2012-09-04 Akim Demaille + + maint: remove useless file + * externals/bootstrap.cfg: Remove. + This file was used by a specific build system. + It was added to the master repository by accident. + +2012-09-04 Akim Demaille + + update files to ignore + * doc/.gitignore: Don't ignore split info files as we don't split our + info file. + See . + +2012-09-04 Akim Demaille + + remove useless include + * src/system.h: Don't include sys/types.h. + Reported by Eric Blake, + . + (FUNCTION_PRINT): Remove, unused. + +2012-09-03 Jim Meyering + + use locale-indep. c_is* functions for parsing, not isspace, isprint etc + * src/parse-gram.y: Include "c-ctype.h". + (add_param): Parse with c_isspace, not isspace. + * src/parse-gram.c: Likewise. + * src/scan-gram.l: Include c-ctype.h, not ctype.h. + (SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER): Use c_isspace and c_isprint, + not ctype.h's locale-dependent functions. + +2012-09-03 Akim Demaille + + gnulib: update + +2012-09-03 Akim Demaille + + --help: include a place to report translation issues + http://lists.gnu.org/archive/html/bug-bison/2012-08/msg00007.html + shows that it is useful to help users report translation issues. + While at it, include other informative bits that the coreutils shows. + + * src/getargs.c (usage): Report more URLs where the user can + refer to. + Mostly copied/pasted from coreutils' emit_ancillary_info function. + +2012-09-03 Akim Demaille + + news: style changes + * NEWS: Minor improvements. + +2012-09-03 Akim Demaille + + use -Wdeprecated for obsolete %define variable names + * src/muscle-tab.c (muscle_percent_variable_update): Here. + * tests/input.at (%define backward compatibility): Update expectations. + +2012-09-03 Akim Demaille + + introduce -Wdeprecated + GCC seems to be using "deprecated" consistently over "obsoleted", so + use -Wdeprecated rather than -Wobsolete. + + * src/complain.h (warnings): Add Wdeprecated. + * src/complain.c (warnings_print_categories): Adjust. + * src/getargs.c: Likewise. + * doc/bison.texi: Document it. + + * src/scan-code.l: Use this category for the trailing ';' support. + * tests/actions.at: Adjust expected output. + +2012-09-03 Akim Demaille + + undefined but unused is a warning + * src/symtab.c (symbol_check_defined): Undeclared symbols are only + a warning. + * tests/input.at (Undeclared symbols used for a printer or destructor): + Rename as... + (Undefined symbols): this, and check this case. + * NEWS: Doc it. + +2012-09-03 Akim Demaille + + glr.cc: %defines is no longer mandatory + * data/glr.cc: No longer require %defines. + When it is not given, define the position and location classes instead + of including their headers. + (b4_shared_declarations): Use the original parse-params. + * data/glr.c (b4_shared_declarations): Define only if undefined. + * tests/actions.at, tests/calc.at: No longer force the use of %defines + for glr.cc. + * NEWS: Doc it. + +2012-09-03 Akim Demaille + + todo: check push parsers + +2012-09-03 Akim Demaille + + style: remove useless C++ provisio + * src/complain.h: here. + +2012-09-03 Akim Demaille + + parser: style changes + * src/parse-gram.y: Avoid deprecated directives. + +2012-09-03 Akim Demaille + + doc: address a fixme + * doc/bison.texi (Calc++ Parser): Add a cross-reference. + +2012-09-03 Akim Demaille + + style changes + * data/glr.cc, tests/actions.at: Fix comments. + * src/symtab.h, src/symtab.c: Fix indentation/comments. + * src/symlist.c: Fix indentation. + +2012-08-31 Akim Demaille + + tests: style changes + * tests/torture.at (AT_DATA_STACK_TORTURE): M4 style changes to + improve readability. + Fix an assertion which, because of a <= instead of ==, did not check + new_status as visibly meant. + (get_args): New. + +2012-08-31 Akim Demaille + + tests: fix push-pull test + * tests/torture.at: %push-pull-parser is no longer supported. + +2012-08-31 Akim Demaille + + yacc.c: style changes + * data/yacc.c: (yytoken): Define with initial value. + +2012-08-12 Akim Demaille + + refactoring: define variables with a value + * src/muscle-tab.c: Where possible, fuse definition and initial assignment. + +2012-08-12 Akim Demaille + + minor refactoring: shorten variable names + * src/scan-skel.l (at_directive_argc, at_directive_argv) + (AT_DIRECTIVE_ARGC_MAX): Rename as... + (argc, argv, ARGC_MAX): these, as there is no possible confusion. + (flags): New. + (QPUTS): Remove, inline its only use. + +2012-08-12 Akim Demaille + + obstacks: simplifications + * src/system.h (obstack_finish0): New. + Use it to simplify several uses. + * src/muscle-tab.h (MUSCLE_INSERTF): New. + * src/muscle-tab.c: Use obstack_printf where simpler. + +2012-08-12 Akim Demaille + + minor refactoring in user code scanning + * src/scan-code.l (show_sub_message, show_sub_messages): Instead of a + Boolean, take a "warnings" argument. + Avoid storing printf-like format strings in a variable, so that GCC + can check them. + +2012-08-12 Akim Demaille + + minor refactoring in user code scanning + * src/scan-code.l (show_sub_message): New, extracted from... + (show_sub_messages): here. + +2012-08-03 Akim Demaille + + tests: strengthen the trailing spaces check + * tests/calc.at: here. + * data/glr.c: Fix accordingly. + +2012-08-03 Akim Demaille + + regen + +2012-08-03 Akim Demaille + + Merge branch 'maint' + * origin/maint: + maint: post-release administrivia + version 2.6.2 + NEWS: update. + yacc: remove trailing end of line at end of file + thanks: fix a contributor name + gnulib: update + tests: synch line -> syncline, for consistency + tests: synclines: style changes + tests: synclines: fix perl invocation + regen + c++: trailing end-of-lines in %parse-param + tests: simplify + +2012-08-03 Akim Demaille + + regen + +2012-08-03 Akim Demaille + + remove support for lint + Basically revert commit 12ce2df60d16961eaa03a5aa009eeaa645e4e1cb. + http://lists.gnu.org/archive/html/bison-patches/2012-08/msg00004.html + + * data/c.m4, data/glr.c, data/yacc.c (YYID): Remove. + No longer use ARGSUSED. + * src/getargs.c: Restore simpler inclusion of getopt.h (anyway, since + then we now use gnulib which certainly protects us from such issues). + +2012-08-03 Akim Demaille + + skeletons: renamings after knr removal + * data/c.m4 (b4_yydestruct_generate, b4_yy_symbol_print_generate): + Rename as... + (b4_yydestruct_define, b4_yy_symbol_print_define): these, for consistency. + * data/glr.c, data/glr.cc, data/yacc.c: Adjust. + +2012-08-03 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-08-03 Akim Demaille + + version 2.6.2 + * NEWS: Record release date. + +2012-08-02 Akim Demaille + + c++: fix a comment + * data/c++.m4: Be sure to attach a ';' to its declaration, otherwise + it appears in the preceding comment. + +2012-08-02 Akim Demaille + + skeletons: simplify after knr removal + * data/c.m4 (b4_yydestruct_generate, b4_yy_symbol_print_generate): + They no longer need an argument, it has a single possible value. + * data/glr.c, data/yacc.c: Adjust. + +2012-08-02 Akim Demaille + + skeletons: renamings after knr removal + * data/c.m4 (b4_c_comment_, b4_c_args, b4_c_function_def) + (b4_c_function_decl, b4_c_formals, b4_c_call, b4_c_arg): Rename as... + (b4_comment, b4_args, b4_function_define, b4_function_declare, + b4_formals, b4_function_call, b4_arg): these. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Adjust. + +2012-08-02 Akim Demaille + + skeletons: b4_args -> b4_join to prepare forthcoming changes + * data/bison.m4 (b4_args, _b4_args): Rename as... + (b4_join, _b4_join): these. + * data/c++.m4, data/lalr1.cc, data/variant.hh: Adjust. + +2012-08-02 Akim Demaille + + regen + +2012-08-02 Akim Demaille + + YYPARSE_PARAM: drop support + * data/yacc.c: No longer support it. + * doc/bison.texi, tests/headers.at: Adjust. + * NEWS: Document. + +2012-08-02 Akim Demaille + + skeletons: remove K&R C support + * data/c.m4 (b4_c_modern, b4_c_knr_formal_names, b4_c_knr_formal_decls) + (b4_c_knr_formal_decl, b4_c_formal_names, b4_c_formal_decls) + (b4_c_formal_decl): Remove. + (b4_c_ansi_formal_names, b4_c_ansi_formal_decls, b4_c_ansi_formal_decl): + Rename as... + (b4_c_formal_names, b4_c_formal_decls, b4_c_formal_decl): + these. + * data/glr.c, data/glr.cc, data/yacc.c: Adjust. + +2012-08-02 Akim Demaille + + NEWS: update. + * NEWS: Catch up with the other changes from 2.6.1. + +2012-08-02 Akim Demaille + + yacc: remove trailing end of line at end of file + There are still spurious spaces at the end of some lines. But this is + addressed in the master branch, and I am reluctant to try to backport + this. + + * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: here. + * tests/calc.at (AT_CHECK_SPACES): New. + Use it. + Be sure not to introduce trailing empty lines in the *.y files. + * NEWS: Doc it. + * cfg.mk (syntax-check): Remove the exception. + +2012-08-02 Akim Demaille + + thanks: fix a contributor name + * THANKS: On his request. + +2012-08-01 Akim Demaille + + gnulib: update + +2012-08-01 Akim Demaille + + tests: synch line -> syncline, for consistency + * tests/synclines.at: Do it, as "syncline" is used consistently + everywhere else in Bison. + +2012-08-01 Akim Demaille + + tests: synclines: style changes + * tests/synclines.at (AT_TEST_SYNCLINE): Rename as... + (AT_TEST): this. + Use pushdef/popdef. + Formatting changes. + Use '+' instead of '*' where appropriate. + +2012-08-01 Akim Demaille + + tests: synclines: fix perl invocation + Reported by Summum Bonum. + + * tests/synclines.at: Fix Perl invocation: its -f is not like sed's. + +2012-08-01 Akim Demaille + + regen + +2012-08-01 Akim Demaille + + c++: trailing end-of-lines in %parse-param + * src/parse-gram.y (add_param): No only skip ' ' and '\t', skip all + leading and trailing spaces. + * tests/regression.at (Lex and parse params): Check it. + * NEWS: Document it. + +2012-08-01 Akim Demaille + + tests: simplify + * tests/regression.at: Remove useless compilations: AT_FULL_COMPILE + includes the compilation by bison. + +2012-07-31 Akim Demaille + + todo: more items + * TODO: $ in the epilogue, and obstack_copy. + +2012-07-31 Akim Demaille + + Merge branch 'maint' + * maint: + use obstack_printf + scanner: restore a missing start condition + gnulib: update + maint: post-release administrivia + version 2.6.1 + gnulib: update + maint: fix some syntax-check issues + tests: do not depend on __cplusplus to decide for C++ or C output + +2012-07-31 Akim Demaille + + tests: comment changes + * tests/actions.at, tests/input.at: here. + +2012-07-31 Akim Demaille + + tests: really check the set of generated files + * tests/output.at (AT_CHECK_OUTPUT): It used to check that the + expected files are indeed generated, but it did not check that + there are no additional ones. + Do that, and adjust expectations (in particular alphabetical order). + +2012-07-31 Akim Demaille + + lalr1.cc: do not create stack.hh without %defines + * data/stack.hh (b4_stack_define): New. + * data/lalr1.cc: Use it when %defines is not passed. + * tests/output.at: Adjust expected output. + +2012-07-31 Akim Demaille + + lalr1.cc: location.hh and position.hh are not generated without %defines + * data/location.cc (b4_position_define, b4_location_define): New. + (location.hh, position.hh): Generate only if %defines. + * data/lalr1.cc: therefore, define these classes when locations are + needed, but headers are not generated. + * tests/output.at: Check that these files are not generated. + * NEWS: Document. + +2012-07-31 Akim Demaille + + lalr1.cc: no longer require %defines. + * data/lalr1.cc: Generate the parser header only when %defines is + passed. + * tests/calc.at: Check it. + +2012-07-31 Akim Demaille + + skeletons: style changes + * data/glr.c, data/lalr1.cc: Use more consistent comments, + and YY_NULL declaration. + +2012-07-31 Akim Demaille + + glr.cc, lalr1.cc: define b4_shared_declarations + * data/glr.cc, data/lalr1.cc: here. + The name is no longer right, but at least it is consistent with + the other skeletons. + +2012-07-31 Akim Demaille + + glr.cc: no longer require location support + * data/glr.cc: Use b4_locations_if where appropriate. + * data/lalr1.cc: M4 quotation changes to highlight code duplication + with glr.cc. + * tests/calc.at: Check glr.cc with and without %location. + While at it, fuse multiple %parse-params into one. + * tests/actions.at: Simplify. + * NEWS: Doc this. + Some other wording changes. + +2012-07-31 Akim Demaille + + use obstack_printf + This is not just nicer, it is also much safer, since we were + using sprintf... + + * bootstrap.conf: Require it. + * src/system.h (obstack_fgrow1, obstack_fgrow2, obstack_fgrow3) + (obstack_fgrow4): Remove. + Adjust dependencies. + +2012-07-30 Akim Demaille + + scanner: restore a missing start condition + $ flex src/scan-skel.l + src/scan-skel.l:145: multiple <> rules for start condition SC_AT_DIRECTIVE_ARGS + src/scan-skel.l:145: multiple <> rules for start condition SC_AT_DIRECTIVE_SKIP_WS + This is warning, and it seems there are no means to make it an error. + + * src/scan-skel.l: Restore the start-condition INITIAL for an <> + clause. + +2012-07-30 Akim Demaille + + gnulib: update + +2012-07-30 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-07-30 Akim Demaille + + version 2.6.1 + * NEWS: Record release date. + +2012-07-30 Akim Demaille + + gnulib: update + +2012-07-27 Akim Demaille + + maint: fix some syntax-check issues + * cfg.mk: Nuke the following warnings which are confused by our + text reports (that state that the error token is number 256). + prohibit_magic_number_exit + ../../doc/bison.texi:8170:error (256) + ../../tests/conflicts.at:570:error (256) + ../../tests/conflicts.at:673:error (256) + ../../tests/conflicts.at:811:error (256) + ../../tests/conflicts.at:1154:error (256) + ../../tests/regression.at:281:error (256) + ../../tests/regression.at:582:error (256) + maint.mk: use EXIT_* values rather than magic number + +2012-07-27 Akim Demaille + + regen + +2012-07-27 Akim Demaille + + tests: do not depend on __cplusplus to decide for C++ or C output + Since we do support compiling C code with a C++ compiler. + + * tests/actions.at (Qualified $$ in actions): Use AT_SKEL_CC_IF. + +2012-07-27 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: (29 commits) + regen + synclines: remove spurious empty line + also support $$ in the %initial-action + skeletons: b4_dollar_pushdef and popdef to simpify complex definitions + regen + printer/destructor: translate only once + factor the handling of m4 escaping + news: schedule the removal of the ";" hack + style changes in the scanners + regen + support $$ in printers and destructors + scan-code: factor the handling of the type in $$ + muscles: fix another occurrence of unescaped type name + glr.cc: fix the handling of yydebug + gnulib: update + formatting changes + tests: fix an assertion + tests: adjust to GCC 4.8, which displays caret errors + be sure to properly escape type names + obstack_quote: escape and quote for M4 + muscles: shuffle responsabilities + muscles: make private functions static + muscles: rename private functions/macros + obstack_escape: escape M4 characters + remove dead macro + maint: style changes + doc: avoid problems with case insensitive file systems + configure: fix botched quoting + news: fix typo. + +2012-07-27 Akim Demaille + + regen + +2012-07-27 Akim Demaille + + synclines: remove spurious empty line + * data/bison.m4 (b4_syncline): Do not start with an empty line. + +2012-07-27 Akim Demaille + + also support $$ in the %initial-action + scan-code.l is already passing argument to b4_dollar_dollar for the + initial acton, but its definition (of b4_dollar_dollar) does not use + this argument. + + Generalize this definition, and use it for the %initial-action too. + + * data/c.m4 (b4_dollar_dollar_, b4_dollar_pushdef, b4_dollar_popdef): + Instead of expecting a pointer, require a value, and use ".". + Since they are now generic enough, move to... + * data/c-like.m4: this new file. + * data/c.m4, data/java.m4: Load it. + * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Use + b4_dollar_pushdef for the %initial-action. + * tests/actions.at: Check that. + * data/Makefile.am: Adjust. + * NEWS, doc/bison.texi: Document. + +2012-07-27 Akim Demaille + + skeletons: b4_dollar_pushdef and popdef to simpify complex definitions + M4 is really making it uselessly hard to define macros that define + macros. + * data/c.m4 (b4_dollar_pushdef, b4_dollar_popdef): New. + Use it. + +2012-07-27 Akim Demaille + + regen + +2012-07-27 Akim Demaille + + printer/destructor: translate only once + Currently "%printer {...} a b c d e f" translates the {...} six times. + Not only is this bad for time and space, it also issues six times the + same warnings. + + * src/symlist.h, src/symlist.c (symbol_list_destructor_set) + (symbol_list_printer_set): Take the action as code_props instead of + const char *. + * src/parse-gram.y: Translate these actions here. + * src/scan-code.h: Comment change. + * tests/input.at: Check that warnings are issued only once. + +2012-07-27 Akim Demaille + + factor the handling of m4 escaping + The conversion from @ to @@ and so forth is coded is too many + different places. Factor, a bit. + + * src/scan-code.l: Instead of duplicating the logic of obstack_escape, + use it. + It sure is less efficient, but the cost is negligible. + This allows to factor rules that are alike. + And to factor some start-condition clauses. + * tests/input.at (Stray $ or @): New. + * NEWS: Document it. + +2012-07-27 Akim Demaille + + news: schedule the removal of the ";" hack + scan-code.l is significantly more complex because of this. + + * NEWS: Doc it. + +2012-07-27 Akim Demaille + + style changes in the scanners + * src/scan-code.l, src/scan-skel.l: Use a more traditional indentation + style for start-conditions. + Prefer "continue" to a comment, for empty actions. + Strip useless {}. + Remove useless start-condition clauses. + +2012-07-26 Akim Demaille + + regen + +2012-07-26 Akim Demaille + + support $$ in printers and destructors + * src/scan-code.l (SC_SYMBOL_ACTION): Accept $$, not just $$. + * data/c.m4 (b4_dollar_dollar_): New. + (b4_symbol_actions): Let b4_dollar_dollar use b4_dollar_dollar_. + * NEWS, doc/bison.texi: Document it. + * tests/actions.at: Check this for C and C++. + +2012-07-26 Akim Demaille + + scan-code: factor the handling of the type in $$ + * src/scan-code.l (fetch_type_name): New. + (handle_action_dollar): Use it. + (gt_ptr): Remove, useless. + +2012-07-26 Akim Demaille + + muscles: fix another occurrence of unescaped type name + * src/output.c (quoted_output): Split into... + (quoted_output, string_output): these. + Use the former when outputting a type_name. + * tests/input.at: Check this case. + * src/symtab.h: Comment changes. + +2012-07-26 Akim Demaille + + glr.cc: fix the handling of yydebug + * data/glr.cc (yydebug_): Remove, unused. + (set_debug_level, debug_level): Work on yydebug instead. + * doc/bison.texi, NEWS: Document this. + +2012-07-26 Akim Demaille + + gnulib: update + +2012-07-26 Akim Demaille + + formatting changes + * src/symtab.h: here. + +2012-07-26 Akim Demaille + + tests: fix an assertion + * tests/local.at (AT_YYLEX_DEFINE): Be sure to check the array + against its length, not its size in bytes. + +2012-07-26 Akim Demaille + + tests: adjust to GCC 4.8, which displays caret errors + With GCC 4.8, the tests on synclines are skipped. Transform + + input.y:1:2: error: #error "1" + #error "1" + ^ + + into + + input.y:1: #error "1" + + * tests/synclines.at (AT_SYNCLINES_COMPILE): Do it, using Perl instead of + sed. + +2012-07-26 Akim Demaille + + be sure to properly escape type names + * src/scan-code.l: Use obstack_quote when passing type_name to m4. + * tests/input.at (Code injection): New. + * NEWS: Document it. + Thanks to Paul Eggert for the wording. + +2012-07-26 Akim Demaille + + obstack_quote: escape and quote for M4 + * src/system.h (obstack_quote): New. + * src/muscle-tab.c: Use it instead of obstack_escape where applicable. + * src/scan-code.l: Since obstack_quote supports NULL, leave type_name + as NULL instead of defaulting to "". + +2012-07-26 Akim Demaille + + muscles: shuffle responsabilities + * src/muscle-tab.c (muscle_boundary_grow): Be in charge of quotation, + instead of leaving this to the caller. + +2012-07-26 Akim Demaille + + muscles: make private functions static + * src/muscle-tab.h, src/muscle-tab.c (muscle_boundary_grow) + (muscle_location_grow): Now static. + +2012-07-26 Akim Demaille + + muscles: rename private functions/macros + * src/muscle-tab.c (MUSCLE_COMMON_DECODE, muscle_string_decode) + (muscle_location_decode): Not related to muscles, rename as... + (COMMON_DECODE, string_decode, location_decode): these. + +2012-07-26 Akim Demaille + + obstack_escape: escape M4 characters + * src/muscle-tab.h (MUSCLE_OBSTACK_SGROW): This is not related to + muscles, so move to, and rename as... + * src/system.h (obstack_escape): this. + Adjust dependencies. + +2012-07-26 Akim Demaille + + remove dead macro + * src/system.h (DEFAULT_TMPDIR): Remove, unused. + +2012-07-26 Akim Demaille + + maint: style changes + * src/scan-code.l: Remove useless braces. + Formatting changes. + Prefer NULL to 0. + * src/muscle-tab.c, src/system.h: Formatting changes. + +2012-07-24 Akim Demaille + + doc: avoid problems with case insensitive file systems + makeinfo --html generates index.html, and the node "Index" will result + in Index.html. On case insensitive file systems, such as on Mac OS X + by default, this results in a single, invalid, file (Texinfo 4.13). + See http://lists.gnu.org/archive/html/bug-texinfo/2012-07/msg00032.html + + * doc/bison.texi (Index): Rename as... + (Index of Terms): this. + +2012-07-24 Stefano Lattarini (tiny change) + + configure: fix botched quoting + * configure.ac: In the AC_SUBST call on 'VALGRIND_PREBISON'. Without + this change, when running ./configure, I see: + + ... + checking for valgrind... valgrind + ./configure: line 35221: -q: command not found + checking for Java compiler... gcj -C -fsource=1.3 -ftarget=1.4 + ... + +2012-07-24 Akim Demaille + + regen + +2012-07-24 Akim Demaille + + yystype, yyltype: remove. + * data/c.m4: here. + * NEWS: Doc it. + +2012-07-22 Akim Demaille + + regen + +2012-07-22 Akim Demaille + + YYFAIL: remove. + * data/lalr1.java, data/yacc.c, src/scan-code.l: Remove YYFAIL support. + * NEWS, TODO: Update. + +2012-07-22 Akim Demaille + + todo: update. + * TODO: obsolete items. + +2012-07-22 Akim Demaille + + regen. + +2012-07-22 Akim Demaille + + space changes. + * data/bison.m4 (b4_symbol_action): Remove spurious eol in the output. + +2012-07-22 Akim Demaille + + parser: fix %printer usage. + * src/parse-gram.y: Instead of stderr, using yyo. + +2012-07-22 Akim Demaille + + parser: factor the handling of code_props + * src/parse-gram.y: Now that %printer and %destructor are treated + equally, let... + (code_props_type): handle them. + +2012-07-22 Akim Demaille + + parser: factor handling of type tags + * src/parse-gram.y: Now that <*> and <> are processed like regular + tags, let... + (tag): handle them. + +2012-07-22 Akim Demaille + + regen. + +2012-07-22 Akim Demaille + + simplify the handling of <> and <*>'s code_props. + Currently they are treated in separated variables, contrary to other + code_props. This duplicates code (and messages for translators) + uselessly, as demonstrated by the fact that thanks to this patch, now + useless <*> and <> code_props are reported like the others. + + * src/parse-gram.y (generic_symlist_item): Treat "<*>" and "<>" as regular + type tags. + * src/symlist.h, src/symlist.c (symbol_list_default_tagged_new) + (symbol_list_default_tagless_new,SYMLIST_DEFAULT_TAGGED) + (SYMLIST_DEFAULT_TAGLESS): Remove. + * src/symtab.h, src/symtab.c (default_tagged_code_props) + (default_tagless_code_props, default_tagged_code_props_set) + (default_tagless_code_props_set): Remove. + (symbol_code_props_get): Default to <*> or <>'s code_props. + + * tests/actions.at: Complete expected errors: there are new warnings. + * tests/input.at: Likewise. + (Useless printers or destructors): Extend. + +2012-07-22 Akim Demaille + + allow modification on retrieved code_props. + The logic to compute the %printer or %destructor to used (i.e., a + code_props) is implemented twice: one, of course, in + symbol_code_props_get, and another time in symbol_check_defined to + record the fact that a code_props is used (so that we can reported + unused ones). Let the former use the latter. + + I would probably use "mutable" in C++ and keep these guys const, + but this is C. And casting away constness triggers warnings. + + * src/scan-code.h, src/scan-code.l (code_props_none): Is not const. + * src/symtab.h, src/symtab.c (symbol_code_props_get): The symbol + is not const. + (symbol_check_defined): Use it. + +2012-07-22 Akim Demaille + + maint: regen. + +2012-07-22 Akim Demaille + + maint: fix bison's own header guards. + Because I'm using a VPATH build with an absolute srcdir, I have + GRAM__USERS_AKIM_SRC_GNU_BISON_SRC_PARSE_GRAM_H. Before, I was using + a relative srcdir, and had GRAM_______SRC_PARSE_GRAM_H (coming from + ../../). Let it be GRAM_SRC_PARSE_GRAM_H. + + * tests/bison.in: Do not depend on the value of $top_srcdir for + Bison itself. + If we were to use relative paths from .c to .y, we would not have + this problem. + +2012-07-22 Akim Demaille + + maint: add missing const. + * src/symtab.h, src/symtab.c (symbol_print): here. + +2012-07-22 Akim Demaille + + style changes. + * src/parse-gram.y, src/symtab.c: Space changes. + * src/symtab.h: Comment changes. + +2012-07-22 Akim Demaille + + autoconf: update. + * submodules/autoconf: here. + No significant changes for our use of m4sugar.m4. + +2012-07-22 Akim Demaille + + output: no longer use b4_tokens. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, data/yacc.c: + Since the previous commit, b4_tokens_define and the like no longer need + b4_tokens. + * src/output.c (token_definitions_output): Remove. + +2012-07-22 Akim Demaille + + output: use the token list to define the yytokentype + There are currently two systems used to pass information about tokens to + m4: the original one, and another, which is used for instance for + printers and destructors, variants etc. Move to using only the latter. + + * data/bison.m4 (b4_symbol_map, b4_token_visible_if) + (b4_token_has_definition, b4_any_token_visible_if, b4_token_format): New. + * data/c++.m4, data/c.m4, data/glr.c, data/java.m4: Adjust to use them. + +2012-07-20 Akim Demaille + + tests: fix VPATH issue + * examples/test: With an absolute VPATH build, "../" is incorrect. + +2012-07-20 Akim Demaille + + news: fix typo. + * NEWS: here. + Reported by Ben Pfaff. + +2012-07-19 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: update gnu-web-doc-update. + maint: post-release administrivia + version 2.6 + maint: prepare for release 2.6 + maint: post-release administrivia + version 2.5.91 + maint: prepare NEWS. + maint: fix spaces. + tests: adjust to case where the C compiler is actually a C++ compiler + tests: fix dependencies + doc: fix Texinfo command + maint: Valgrind on OS X. + tests: be sure that backups are safe. + maint: dead comment. + tests: refactor for legibility. + tests: refactor the bison invocations. + maint: fix syntax-check ignore patterns. + gnulib: update + gnulib: update. + gnulib: update + +2012-07-19 Akim Demaille + + maint: update gnu-web-doc-update. + * gnulib: here. + +2012-07-19 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-07-19 Akim Demaille + + version 2.6 + * NEWS: Record release date. + +2012-07-19 Akim Demaille + + maint: prepare for release 2.6 + * NEWS: here. + +2012-07-18 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-07-18 Akim Demaille + + version 2.5.91 + * NEWS: Record release date. + +2012-07-18 Akim Demaille + + maint: prepare NEWS. + +2012-07-18 Akim Demaille + + maint: fix spaces. + * build-aux/Makefile.am: here. + +2012-07-18 Akim Demaille + + tests: adjust to case where the C compiler is actually a C++ compiler + * tests/atlocal.in (CC_IS_CXX): New. + * tests/headers.at (Several parsers): Use it. + +2012-07-18 Akim Demaille + + tests: fix dependencies + * tests/Makefile.am: we need atconfig and atlocal to be up to date + when calling testsuite. + +2012-07-18 Akim Demaille + + doc: fix Texinfo command + * doc/bison.texi: In parens, use @pxref. + +2012-07-18 Akim Demaille + + maint: Valgrind on OS X. + * configure.ac (VALGRIND_PREBISON): New. + * tests/Makefile.am (maintainer-check-valgrind): Use it. + * etc/darwin11.4.0.supp: New. + * configure.ac, etc/Makefile.am: Use it. + * configure.ac: Disable Valgrind on Mac OS X. + * README-hacking: Explain why. + +2012-07-17 Akim Demaille + + tests: be sure that backups are safe. + * tests/local.at (at_save_special_files): here. + +2012-07-17 Akim Demaille + + maint: dead comment. + * etc/README: here. + +2012-07-17 Akim Demaille + + tests: refactor for legibility. + * tests/local.at (AT_BISON_CHECK_WARNINGS, AT_BISON_CHECK_WARNINGS_): + New. + +2012-07-17 Akim Demaille + + tests: refactor the bison invocations. + * tests/local.at (m4_null_if, AT_BISON_CHECK_): New. + +2012-07-17 Akim Demaille + + maint: fix syntax-check ignore patterns. + * cfg.mk: here. + +2012-07-17 Akim Demaille + + gnulib: update + +2012-07-16 Akim Demaille + + gnulib: update. + * gnulib: Update so that gitlog-to-changelog support --srcdir. + * Makefile.am: Use it. + +2012-07-10 Akim Demaille + + gnulib: update + * bootstrap, build-aux/.gitignore, gnulib, m4/.gitignore: update. + +2012-07-06 Akim Demaille + + maint: minor fixes + * NEWS: restore missing entry. + * cfg.mk: Adjust to *.texinfo -> *.texi. + * src/symtab.c: Spaces fixes. + +2012-07-06 Akim Demaille + + tests: address g++-4.8 warnings. + list.yy: In function 'yy::parser::symbol_type yylex()': + list.yy:107:29: error: typedef 'token' locally defined but not used + [-Werror=unused-local-typedefs] + typedef yy::parser::token token; + ^ + + * tests/c++.at (AT_CHECK_VARIANTS): here. + +2012-07-06 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: update release instructions + maint: post-release administrivia + version 2.5.90 + build: fix gen-ChangeLog call. + gnulib: update. + tests: fix SKIP_IF for Java. + api.prefix: incompatible with %name-prefix. + api.prefix: strengthen the tests and fix push-parsers. + skeletons: style changes. + NEWS: minor changes. + api.prefix: improve the documentation for YYDEBUG. + gnulib: update. + +2012-07-06 Akim Demaille + + maint: update release instructions + * README-hacking: here. + +2012-07-05 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-07-05 Akim Demaille + + version 2.5.90 + * NEWS: Record release date. + +2012-07-05 Akim Demaille + + build: fix gen-ChangeLog call. + * Makefile.am: Be sure to catch errors, and fix option name + +2012-07-05 Akim Demaille + + gnulib: update. + * gnulib/build-aux/do-release-commit-and-tag: Fix. + +2012-07-05 Akim Demaille + + tests: fix SKIP_IF for Java. + * tests/local.at (AT_JAVA_COMPILE): here. + +2012-07-05 Akim Demaille + + api.prefix: incompatible with %name-prefix. + * data/bison.m4: Make it incompatible. + * tests/input.at: Check that it is. + +2012-07-05 Akim Demaille + + api.prefix: strengthen the tests and fix push-parsers. + * tests/calc.at: Check api.prefix in addition to %name-prefix. + * tests/headers.at: Check push parsers and pure interface. + * tests/local.at: Use YYLTYPE renamed. + * data/yacc.c (b4_declare_yyparse_push_): Handle api.prefix. + * doc/bison.texi: Style changes. + +2012-07-05 Akim Demaille + + skeletons: style changes. + * data/bison.m4: Define default values after having defined + the support macros. + Kill a dead comment. + +2012-07-05 Akim Demaille + + NEWS: minor changes. + * NEWS: style changes. + +2012-07-05 Akim Demaille + + api.prefix: improve the documentation for YYDEBUG. + * doc/bison.texi: Explain how api.prefix is applied to YYDEBUG. + +2012-07-05 Akim Demaille + + gnulib: update. + * bootstrap, gnulib: Update. + * cfg.mk (syntax-check): Don't check "error" usage in bison.texi. + +2012-07-04 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: headers.at: strengthen. + glr.cc: do not override C++ definitions by C macros. + YYLLOC_DEFAULT: factor, and don't export it in headers. + api.prefix: do not use #define to handle YYSTYPE_IS_TRIVIAL etc. + tests: portability fixes. + c++: fewer #includes in the headers. + glr.cc: formatting changes. + tests: more logs. + api.prefix: also rename YYDEBUG. + +2012-07-04 Akim Demaille + + tests: headers.at: strengthen. + * tests/headers.at (Several headers): Be stricter when checking + the exported macros. + +2012-07-04 Akim Demaille + + glr.cc: do not override C++ definitions by C macros. + * data/glr.c: here. + * data/glr.cc: Fix overquotation. + * tests/headers.at: Comment changes. + +2012-07-04 Akim Demaille + + YYLLOC_DEFAULT: factor, and don't export it in headers. + * data/c++.m4, data/c.m4 (b4_yylloc_default_define): New. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Use it. + * data/glr.cc: Do not define YYLLOC_DEFAULT in the header file, + but in the implementation one. + +2012-07-04 Akim Demaille + + api.prefix: do not use #define to handle YYSTYPE_IS_TRIVIAL etc. + The following mixture is insane: + + #define YYSTYPE_IS_TRIVIAL PREFIX_STYPE_IS_TRIVIAL + #if (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL) + + since, of course YYSTYPE_IS_TRIVIAL is defined. Instead we could + define YYSTYPE_IS_TRIVIAL as PREFIX_STYPE_IS_TRIVIAL only when the + later is defined, but let's avoid stacking CPP on top of M4: rather, use + + #if (defined PREFIX_STYPE_IS_TRIVIAL && PREFIX_STYPE_IS_TRIVIAL) + + * data/glr.c, data/yacc.c: Use YYSTYPE_IS_TRIVIAL, YYSTYPE_IS_DECLARED, + YYLTYPE_IS_TRIVIAL and YYLTYPE_IS_DECLARED under their api.prefix-renamed + name. + +2012-07-04 Akim Demaille + + tests: portability fixes. + Reported by Hydra. + + * tests/headers.at (Several headers): Be sure to include config.h + in the files to compile. + +2012-07-04 Akim Demaille + + c++: fewer #includes in the headers. + * data/lalr1.cc: Define YY_NULL in the *.cc file, it is not needed + in the header. + * data/location.cc: iosfwd suffices. + +2012-07-04 Akim Demaille + + glr.cc: formatting changes. + * data/glr.cc: here. + +2012-07-04 Akim Demaille + + tests: more logs. + * tests/headers.at (Several parsers): Here. + +2012-07-04 Akim Demaille + + api.prefix: also rename YYDEBUG. + The testsuite in master has shown weird errors for the "Mulitple + Parsers" tests: the caller of p5.parse() received some apparently + random value, while tracing p5.parse() showed that the function was + consistently returning 0. + + It happens when mixing several parser headers, some generated without + %debug, others with. In particular the C++ parser was generated with + %debug, i.e., with: + + #ifndef YYDEBUG + # define YYDEBUG 1 + #endif + + and compiled separatedly. Yet, its header was included after the one + of another parser, this time without %debug, i.e., with + + #ifndef YYDEBUG + # define YYDEBUG 0 + #endif + + in its header. As a result, the parser was compiled with YYDEBUG set, + but its header was used without. Since the layout of the objects are + then completely different, boom. + + Therefore, do not change the value of YYDEBUG. Rather, use it as a + default value for DEBUG. + + * data/c.m4 (b4_YYDEBUG_define): New. + (b4_declare_yydebug): Rename as... + (b4_yydebug_declare): this, for consistency. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Use it. + * NEWS: Document it. + +2012-07-02 Akim Demaille + + formatting changes. + * data/lalr1.cc: here. + +2012-07-02 Akim Demaille + + NEWS: spell fixes. + * NEWS: here. + Reported by Stefano Lattarini. + +2012-07-02 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + NEWS: spell check. + api.prefix. + +2012-07-02 Akim Demaille + + NEWS: spell check. + * NEWS: here. + +2012-06-29 Akim Demaille + + api.prefix. + * data/c.m4 (b4_api_prefix, b4_api_PREFIX): New. + (b4_prefix, b4_union_name, b4_token_enums, b4_declare_yylstype): Use them. + * data/glr.c, data/yacc.c, data/glr.cc, data/lalr1.cc: Use them to change + the prefix of exported preprocessor symbols. + * src/getargs.c (usage): Ditto. + * tests/headers.at (Several parsers): New. + * tests/local.at (AT_API_PREFIX): New. + AT_YYSTYPE, AT_YYLTYPE): Adjust. + * doc/bison.texi (Multiple Parsers): Move documentation of %name-prefix to... + (Table of Symbols): here. + (Multiple Parsers): Document api.prefix. + (%define Summary): Point to it. + Use @code for variable names. + (Bison Options): -p/--name-prefix are obsoleted. + * NEWS: Announce api.prefix. + +2012-06-29 Victor Santet + + warnings: display warnings categories + * src/complain.c (error_message): Call 'warnings_print_categories'. + * src/gram.c (grammar_rules_useless_report): Display itself warning + category. + * tests/actions.at, tests/conflicts.at, tests/existing.at, + tests/input.at, tests/named-refs.at, tests/output.at, tests/reduce.at, + tests/regression.at, tests/skeletons.at: Adjust. + * NEWS: Document this. + +2012-06-29 Victor Santet + + warnings: be ready to print warnings categories + A function to print warnings categories, like -Wyacc, -Wother, etc. + + * src/complain.h, src/complain.c (print_warning_categories): New function. + * src/output.c (ARRAY_CARDINALITY): Move it to file 'src/system.h'. + * src/complain.h (enum warnings): New value, 'silent', "complain" + must not display the warning type. + +2012-06-29 Akim Demaille + + maint: prepare forthcoming changes + * src/gram.c (rule_rhs_print): Do not print new line anymore. + (rule_print): Make it static. + * src/closure.c, src/derives.c, src/gram.c: Adjust. + +2012-06-29 Victor Santet + + style changes + * src/complain.c, src/reader.c, src/reduce.c, src/main.c: + Fix indentation. + Simplify a bit. + +2012-06-28 Akim Demaille + + regen. + +2012-06-28 Victor Santet + + warnings: factoring: complaints + * src/complain.c (error_message): Accept warning categories (an integer) as + argument. + Location is a 'const location *' instead of 'location *'. + (ERROR_MESSAGE): Delete it. + * src/complain.c, src/complain.h (complains): New function. + (complain, complain_at, complain_at_indent): Generic functions for + complaints. Call 'complains'. + (warn_at, warn_at_indent, warn, yacc_at, midrule_value_at) + (fatal_at, fatal): Delete them. Adjust dependencies. + * src/complain.h (enum warnings): New fields 'complaint' and 'fatal'. + * bootstrap.conf (XGETTEXT_OPTIONS): Adjust. + +2012-06-28 Victor Santet + + warnings: move them to complain.c. + * src/getargs.h, src/getargs.c (warnings, warnings_flags): Move to... + * src/complain.h, src/complain.c: Here. + +2012-06-28 Victor Santet + + warnings: rename the categories + Forthcoming changes will use the warning categories much more often, + so shortening them will improve readability. + + * src/complain.c, src/complain.h, src/conflicts.c, + * src/getargs.c, src/getargs.h, src/gram.c (enum warnings): + s/warnings_/W/g. + +2012-06-28 Akim Demaille + + fix merge. + * data/bison.m4: Use b4_error_verbose_if after it was defined. + +2012-06-28 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: use the generalized default yylex. + tests: AT_YYERROR_DEFINE: prepare for list of ints. + skeletons: no longer define YYLSP_NEEDED. + c++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE. + +2012-06-28 Akim Demaille + + tests: use the generalized default yylex. + * tests/actions.at, tests/glr-regression.at, tests/regression.at: here. + +2012-06-28 Akim Demaille + + tests: AT_YYERROR_DEFINE: prepare for list of ints. + * tests/local.at (AT_YYERROR_DEFINE): Don't add quotes, check their + presence to detect char/int types. + * tests/actions.at, tests/conflicts.at, tests/glr-regression.at, + * tests/push.at, tests/regression.at: Adjust. + +2012-06-27 Akim Demaille + + skeletons: no longer define YYLSP_NEEDED. + * data/c.m4, data/glr.cc: here. + * NEWS, TODO: Adjust. + +2012-06-27 Akim Demaille + + c++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE. + * src/output.c (prepare_symbols): Do not define b4_token_table. + (prepare): Define b4_token_table_flag. + * data/bison.m4 (b4_token_table_if): New. + Arm it when error-verbose. + * data/glr.c, data/yacc.c (YYTOKEN_TABLE): Remove. + Use m4. + * data/lalr1.cc: Likewise. + (YYERROR_VERBOSE): Remove. + * NEWS, doc/bison.texi: Document this. + +2012-06-26 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: use *.texi. + +2012-06-26 Akim Demaille + + maint: use *.texi. + This is more consistent with the other packages, and Automake-NG + supports only *.texi. + + * doc/bison.texinfo: Rename as... + * doc/bison.texi: this. + * doc/Makefile.am, examples/calc++/Makefile.am: Adjust. + +2012-06-26 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: do not output m4 set up. + tests: use the generic yyerror function. + tests: use assert instead of plain abort. + tests: improve the generic yylex implementation. + tests: generalize the compilation macros. + tests: fix confusion between api.prefix and name-prefix. + maint: gitignores. + yacc: work around the ylwrap limitation. + +2012-06-26 Victor Santet + + warnings: raise warning for useless printers or destructors + * src/scan-code.h (code_props): Add field 'is_used'. + (CODE_PROPS_NONE_INIT): Adjust. + * src/scan-code.l (code_props_plain_init, code_props_symbol_action_init) + (code_props_rule_action_init): Instead of implementing several + times the initialization of the code_props structures, + use code_props_none_init. + * src/symtab.c (symbol_check_defined): If a symbol does not have a + destructor (resp. printer) but has a type which has a destructor (resp. + printer), then set field 'is_used' to true. + (semantic_type_check_defined): If a type has a destructor (resp. printer) + but all symbols of this type have already a destructor (resp. printer), + then raise a warning. + * tests/input.at (Useless printers or destructors): New. + +2012-06-26 Akim Demaille + + tests: do not output m4 set up. + * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): + Use a diversion to avoid outputting comments etc. + Removes 17k lines from testsuite (10% of the number of lines). + +2012-06-26 Akim Demaille + + tests: use the generic yyerror function. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Factor. + Use AT_YYERROR_DEFINE. + Therefore, instead of using stdout, use and check stderr. + * tests/glr-regression.at (Uninitialized location when reporting ambiguity): + Use AT_YYERROR_DEFINE. + +2012-06-26 Akim Demaille + + tests: use assert instead of plain abort. + * tests/actions.at, tests/calc.at, tests/conflicts.at, + * tests/cxx-type.at, tests/glr-regression.at, tests/input.at, + * tests/named-refs.at, tests/regression.at, tests/torture.at, + * tests/local.at: + Prefer assert to abort. + +2012-06-26 Akim Demaille + + tests: improve the generic yylex implementation. + * tests/local.at (AT_YYSTYPE, AT_YYLTYPE): New. + (AT_YYLEX_FORMALS): Use them. + (AT_YYLEX_DEFINE): Be independent of the location implementation. + +2012-06-26 Akim Demaille + + tests: generalize the compilation macros. + * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): If OUTPUT ends with ".o", + then append the "natural" extension for the input file (.c or .cc). + If there is no source, pass -c. + * tests/headers.at, tests/input.at, tests/regression.at: Adjust. + +2012-06-26 Akim Demaille + + tests: fix confusion between api.prefix and name-prefix. + * tests/local.at (AT_NAME_PREFIX): Take api.prefix into account. + (AT_API_PREFIX): Rename as... + (AT_API_prefix): this. + Do not take %name-prefix into account. + Fix misuses. + +2012-06-26 Akim Demaille + + maint: gitignores. + +2012-06-25 Victor Santet + + warnings: useless semantic types + * src/symtab.h (symbol_list): Represent semantic types as structure + 'semantic_type'. + * src/symlist.c (symbol_list_type_new): Allocate this structure. + (symbol_list_code_props_set): Set this semantic type's status to used if it + was not declared. + * src/symtab.c (semantic_types_sorted): New. + (semantic_type_new): Set the new semantic type's location appropriately. + (symbol_check_defined): If a symbol has a type, then set this type's status + to "declared". + (semantic_type_check_defined, semantic_type_check_defined_processor): Same + as symbol_check_defined and symbol_check_defined_processor, but for semantic + types. + (symbol_check_defined): Check semantic types usefulness. + * src/symtab.h (semantic_type): New fields 'location' and 'status'. + * src/symtab.h, src/symtab.c (semantic_type_new) + (semantic_type_from_uniqstr, semantic_type_get): Accept a location as a + supplementary argument. + * tests/input.at (Unassociated types used for printer of destructor): New. + * tests/c++.at (AT_CHECK_VARIANTS): Fix an error caught by this commit. + +2012-06-25 Akim Demaille + + yacc: work around the ylwrap limitation. + * data/yacc.c (b4_shared_declarations): Include the header guards. + Do not include the header in the *.c file, duplicate it. + * NEWS (Future Changes): Extend, and announce the forthcoming change + about the use of the parser header. + +2012-06-25 Akim Demaille + + fix for printers and destructors. + The previous "code_props: factor more" patch sends has_%printer + etc. to m4, instead of has_printer. + + * src/output.c (prepare_symbol_definitions): Fix value of pname. + +2012-06-25 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: more uniformity. + tests: handle locations in a more generic way. + tests: handle locations in the generic yyerror functions. + tests: fix AT_CHECK_CALC. + tests: improve infrastructure + tests: factor. + skeletons: minor style changes + tests: AT_LANG. + c skeletons: factor the declaration of yylloc and yylval. + news: condemn YYPARSE_PARAM and YYLEX_PARAM. + maint: regen. + +2012-06-22 Akim Demaille + + code_props: factor more. + * src/symtab.h, src/symtab.c (code_props_type_string): No longer static. + * src/output.c (CODE_PROPS): Remove, we can now iterate on both the + destructor and the printer. + (SET_KEY2): New. + +2012-06-22 Victor Santet + + maint: factor the handling of %printer and %destructor + There is too much code duplication between %printer and %destructor. + We used to have two functions for each action: the first one for + destructors, the second one for printers. Factor using a + 'code_props_type', and an array of code_props instead of two + members. + + * src/symlist.h, src/symlist.c (symbol_list_destructor_set) + (symbol_list_printer_set): Fuse into... + (symbol_list_code_props_set): this. + * src/symtab.h, src/symtab.c (default_tagged_destructor) + (default_tagged_printer): Fuse into... + (default_tagged_code_props): this. + (default_tagless_destructor, default_tagless_printer) + (default_tagless_code_props): Likewise. + (code_props_type_string): new. + (symbol_destructor_set, symbol_destructor_get, semantic_type_destructor_set) + (default_tagged_destructor_set, default_tagless_destructor_set) + (symbol_printer_set, symbol_printer_get, semantic_type_printer_set) + (default_tagged_printer_set, default_tagless_printer_set): Replace by... + (symbol_code_props_set, symbol_code_props_get, semantic_type_code_props_set) + (default_tagged_code_props_set, default_tagless_code_props_set): these. + * src/parse-gram.y (grammar_declaration): Adjust. + * src/output.c (CODE_PROP, grammar_declaration): Ditto. + * src/reader.c (symbol_should_be_used): Ditto. + +2012-06-22 Akim Demaille + + tests: more uniformity. + * tests/local.at (AT_LEX_FORMALS, AT_LEX_ARGS, AT_LEX_PRE_FORMALS) + (AT_LEX_PRE_ARGS): Rename as... + (AT_YYLEX_FORMALS, AT_YYLEX_ARGS, AT_YYLEX_PRE_FORMALS) + (AT_YYLEX_PRE_ARGS): these, for consistency. + (AT_API_PREFIX): Take %name-prefix into account. + (AT_YYLEX_PROTOTYPE): New. + Use it. + * tests/actions.at, tests/calc.at, tests/cxx-type.at: Adjust to + use them. + +2012-06-22 Akim Demaille + + tests: handle locations in a more generic way. + * tests/local.at (AT_YYERROR_PROTOTYPE): New. + Use it. + * tests/cxx-type.at: Extensive revamp to use a more traditional + quotation scheme, and to use the generic yyerror implementation. + Prefer Autotest macros to CPP macros. + * tests/java.at: . + +2012-06-22 Akim Demaille + + tests: handle locations in the generic yyerror functions. + * tests/local.at (AT_YYERROR_DECLARE_EXTERN, AT_YYERROR_DECLARE) + (AT_YYERROR_DEFINE): Handle locations for C and C++. + * tests/calc.at: Use it for C++ (as C has extra arguments which + are not yet handled by AT_BISON_OPTION_PUSHDEFS). + * tests/actions.at: Adjust. + +2012-06-22 Akim Demaille + + tests: fix AT_CHECK_CALC. + * tests/calc.at (AT_CHECK_CALC): Contrary to its documentation, + the test was skipped if given a second argument. + Unused feature, remove it. + +2012-06-22 Akim Demaille + + tests: improve infrastructure + * tests/local.at (AT_LANG): Use c++ instead of cxx for C++. + Adjust dependencies. + (AT_YYERROR_DECLARE_EXTERN, AT_YYERROR_DECLARE): Issue nothing + for C++/Java. + (AT_YYERROR_DEFINE): Use m4_case. + (AT_JAVA_COMPILE): Use AT_SKIP_IF. + +2012-06-21 Akim Demaille + + tests: factor. + * tests/glr-regression.at, tests/output.at, tests/push.at, + * tests/regression.at, tests/torture.at, tests/actions.at: + Use AT_YYLEX_* and AT_YYERROR_*. + +2012-06-21 Akim Demaille + + skeletons: minor style changes + * data/glr.c, data/yacc.c: here. + +2012-06-21 Akim Demaille + + tests: AT_LANG. + * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): + Define/undefine AT_LANGE + (AT_LANG_COMPILE): New. + (AT_FULL_COMPILE): Use AT_LANG. + +2012-06-21 Victor Santet + + symtab: refactoring + Prepares forthcoming changes. + + * src/symtab.c (symbols_do): Accept the hash table and the sorted + list as arguments. Adjust dependencies. + +2012-06-21 Akim Demaille + + maint: address syntax-check issues. + * examples/calc++/local.mk: Space changes. + * src/files.c: Avoid unmarked_diagnostics. + * src/output.c: Remove useless include. + +2012-06-21 Akim Demaille + + c skeletons: factor the declaration of yylloc and yylval. + There is one difference: now, even without --defines, we generate + extern declarations for these variables. The factoring is worth it. + * data/c.m4 (b4_declare_yylstype): Declare them. + * data/glr.c, data/yacc.c: Adjust. + +2012-06-21 Akim Demaille + + news: condemn YYPARSE_PARAM and YYLEX_PARAM. + * NEWS: here. + (Bison 1.875): Add %parse-param and %lex-param. + * doc/bison.texinfo: Spello. + +2012-06-20 Akim Demaille + + fix warnings for useless %printer/%destructor + The previous commit, which turns into a warning what used to be an + error: + + %printer {} foo; + %% + exp: '0'; + + has two shortcomings: the warning is way too long (foo is reported + to be useless later), and besides, it also turns into a warning much + more serious errors: + + %printer {} foo; + %% + exp: foo; + + Reduce the amount to warnings in the first case, restore the error in + the second. + + * src/symtab.h (status): Add a new inital state: undeclared. + * src/symtab.c (symbol_new): Initialize to undeclared. + (symbol_class_set): Simplify the logic of the code that neutralize + the "redeclared" warning after the "redefined" one. + (symbol_check_defined): "undeclared" is also an error. + * src/reader.c (grammar_current_rule_symbol_append): Symbols appearing + in a rule are "needed". + * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set): + An unknown symbol appearing in a %printer/%destructor is "used". + * src/reduce.c (nonterminals_reduce): Do not report as "useless" symbols + that are not used (e.g., those that for instance appeared only in a + %printer). + * tests/input.at (Undeclared symbols used for a printer or destructor): + Improve the cover the cases described above. + +2012-06-20 Akim Demaille + + gitignore: test-driver. + +2012-06-20 Akim Demaille + + maint: style changes. + * src/reduce.c (reduce_grammar_tables): Define variables with their + initial value. + +2012-06-20 Akim Demaille + + news: fixes. + * NEWS: Fix spelling. + +2012-06-20 Victor Santet + + warnings: used but undeclared symbols are warnings + We used to raise an error if a symbol appears only in a %printer or + %destructor. Make it a warning. + + * src/symtab.h (status): New enum. + (symbol): Replace the binary "declared" with the three-state "status". + Adjust dependencies. + * src/symtab.c (symbol_check_defined): Needed symbols are an error, + whereas "used" are simply warnings. + * src/symlist.c (symbol_list_destructor_set, symbol_list_printer): Set + symbol status to 'used' when associated to destructors or printers. + * input.at (Undeclared symbols used for a printer or destructor): New. + +2012-06-20 Akim Demaille + + maint: regen. + * Makefile.am (regen): New target. + +2012-06-20 Akim Demaille + + regen. + +2012-06-20 Akim Demaille + + maint: regen. + * Makefile.am (regen): New target. + +2012-06-19 Akim Demaille + + tests: enhance AT_YYERROR_DEFINE. + * tests/local.at: Handle the fact that locations are no longer + needed with lalr1.cc. + +2012-06-19 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: formatting changes. + tests: support api.prefix. + tests: pacify font-lock-mode. + tests: remove test covered elsewhere. + tests: factor the declaration/definition of yyerror and yylex. + regen. + tests: portability issues. + tests: call the parser from another compilation unit. + glr.c, yacc.c: declare yydebug in the header. + skeletons: use header guards. + tests: improve AT_FULL_COMPILE. + tests: reorder. + tests: strengthen the test on generated headers inclusion + yacc.c: instead of duplicating y.tab.h inside y.tac.c, include it. + yacc.c: factor. + +2012-06-19 Akim Demaille + + maint: formatting changes. + * NEWS: Fix indentation of code snippets. + Untabify. + +2012-06-17 Akim Demaille + + tests: support api.prefix. + * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): + Define AT_API_PREFIX. + (AT_YYERROR_DEFINE, AT_YYERROR_DECLARE_EXTERN, AT_YYLEX_DECLARE_EXTERN) + (AT_YYLEX_DEFINE): Use it. + * tests/input.at, tests/regression.at, tests/torture.at: Add + AT_BISON_OPTION_PUSHDEFS/POPDEFS. + +2012-06-17 Akim Demaille + + tests: pacify font-lock-mode. + * tests/local.at: here. + +2012-06-17 Akim Demaille + + tests: remove test covered elsewhere. + * tests/headers.at (%union and --defines): Remove, pretty useless and + insignificant. + +2012-06-17 Akim Demaille + + tests: factor the declaration/definition of yyerror and yylex. + * tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DECLARE_EXTERN) + (AT_YYERROR_DEFINE, AT_YYLEX_DECLARE, AT_YYLEX_DECLARE_EXTERN) + (AT_YYLEX_DEFINE): New. + Must be used inside AT_BISON_OPTION_PUSHDEFS/POPDEFS pair. + * tests/actions.at, tests/conflicts.at, tests/glr-regression.at, + * tests/headers.at, tests/input.at, tests/named-refs.at, + * tests/regression.at, tests/skeletons.at, tests/synclines.at, + * tests/torture.at: Use them. + +2012-06-17 Akim Demaille + + regen. + +2012-06-17 Akim Demaille + + tests: portability issues. + * tests/calc.at (AT_CALC_MAIN): Missing include reported by Hydra. + +2012-06-15 Akim Demaille + + tests: call the parser from another compilation unit. + In order to improve the testing of %defines, which exports the + interface of the generated parser, change the calc.at tests so that + when %defines is passed, main will be in another compilation unit. It + loads the generated header. + + * tests/calc.at (AT_CALC_MAIN): New. + Includes the definition of the global variables. + Therefore, now declare them from the %requires section of the parser. + Adjust to yydebug and yyparse being renamed by %name-prefix. + +2012-06-15 Akim Demaille + + glr.c, yacc.c: declare yydebug in the header. + * data/c.m4 (b4_declare_yydebug): New. + * data/glr.c, data/yacc.c (b4_shared_declarations): Use it. + Remove the corresponding code from the parser body. + * NEWS: Doc this. + +2012-06-15 Akim Demaille + + skeletons: use header guards. + * data/glr.c, data/glr.cc, data/yacc.c: here. + * NEWS: Document it. + +2012-06-15 Akim Demaille + + tests: improve AT_FULL_COMPILE. + * tests/local.at: Accept a third argument. + Simplify quotation pattern. + Calls for better refactoring, but will suffice for a while. + +2012-06-15 Akim Demaille + + tests: reorder. + * tests/calc.at (power): Move its definition, as a preparation for + forthcoming changes. + And space changes. + +2012-06-15 Akim Demaille + + tests: strengthen the test on generated headers inclusion + * tests/headers.at (AT_TEST_CPP_GUARD_H): Accept Bison directives. + (Invalid CPP headers): Check glr. + +2012-06-15 Akim Demaille + + yacc.c: instead of duplicating y.tab.h inside y.tac.c, include it. + This is already what glr.c and lalr1.cc do. + + * data/yacc.c: here. + +2012-06-15 Akim Demaille + + maint: xfdopen, and scope reduction. + * src/files.h, src/files.c (xfdopen): New. + * src/output.c (output_skeleton): Use it. + Reduce the scope of argv. + +2012-06-15 Akim Demaille + + maint: space changes + * configure.ac, src/complain.c: space changes. + +2012-06-13 Akim Demaille + + yacc.c: factor. + yacc.c used to include two almost identical sections: one for the *.h + file, and another for the *.c file. The main difference is that in + the *.c file we used the yy* names (as %name-prefix is handled by + "#define yy* *" before), while the *.hh used * names. + Keep only the later. If this is troublesome, b4_shared_declarations + can easily take the desired prefix as argument. + + * data/yacc.c (b4_shared_declarations): New. + Use it to factor duplicated declarations. + +2012-06-13 Stefano Lattarini (tiny change) + + cosmetics: prettify names for compiled object for bison + * src/local.mk (src_bison_SHORTNAME): Define to "bison". + +2012-06-13 Akim Demaille + + lalr1.cc: spello. + * data/lalr1.cc: Reported by Gilles Espinasse. + +2012-06-13 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + skeletons: factor yacc.c and glr.c. + glr.c: minor refactoring. + tests: remove all the -On flags. + maint: fix spello. + maint: improve release procedure instructions. + gnulib: update readme-release. + maint: cfg.mk: manual title. + maint: cfg.mk: simplify + maint: post-release administrivia + +2012-06-12 Akim Demaille + + skeletons: factor yacc.c and glr.c. + yacc.c and glr.c share common declarations. Their YYLTYPE are exactly + equal, and their YYSTYPE are sufficiently alike to be fused (its + declaration was protected by YYSTYPE_IS_DECLARED in yacc.c, but not in + glr.c). Besides, yacc.c duplicated the definitions of YYLTYPE and + YYSTYPE (*.h/*.c). + + * data/c.m4 (b4_declare_yylstype): New. + * data/yacc.c, data/glr.c: Use it. + +2012-06-12 Akim Demaille + + glr.c: minor refactoring. + * data/glr.c (b4_shared_declarations): Move from the generated file + section, to the M4 prologue. + +2012-06-12 Akim Demaille + + tests: remove all the -On flags. + * tests/atlocal.in: Here. + Reported by Gilles Espinasse. + +2012-06-12 Akim Demaille + + maint: fix spello. + * README-hacking: Here. + * THANKS: Reported by Gilles Espinasse. + +2012-06-12 Akim Demaille + + maint: improve release procedure instructions. + * gnulib: Update, in particular (README-release). + * bootstrap.conf: don't require gendocs, provided by gnu-web-doc-update, + provided by readme-release. + * README-hacking: Update accordingly. + +2012-06-07 Akim Demaille + + gnulib: update readme-release. + * gnulib (readme-release): Now includes the modules it promotes. + * bootstrap.conf: Simplify accordingly. + +2012-06-07 Akim Demaille + + maint: cfg.mk: manual title. + * cfg.mk (manuel_title): New. + +2012-06-07 Akim Demaille + + maint: cfg.mk: simplify + * cfg.mk: Remove bits provided by maint.mk. + +2012-06-07 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-06-05 Akim Demaille + + maint: an envvar equal to "00" is 0. + * src/output.c (prepare): here. + Reported by Paul Eggert. + +2012-06-05 Akim Demaille + + maint: don't use mbsr?chr. + Basically, revert ba60c39547a445dee3e07920931b4d7a81843868's move to + mbs* functions, which was prompted by -DGNULIB_POSIXCHECK. See + + and following. + + * bootstrap.conf: No longer ask for them. + * src/files.c, src/getargs.c, src/location.c, + * src/parse-gram.c, src/parse-gram.y, src/scan-gram.l, + * src/symtab.c: s/mbs(r?chr)/str$1/g. + +2012-06-05 Akim Demaille + + maint: use xconcat-filename. + * bootstrap.conf (gnulib_modules): Request it. + * src/output.h, src/output.c (compute_pkgdatadir): Rename as... + (pkgdatadir): this. + Adjust dependencies. + * src/output.c (output_skeleton): Reduce the scope of "in". + Use xconcatenated_filename to simplify the construction of the + qualified paths to m4sugar.m4, bison.m4, and the selected skeleton. + There are a few minor differences: the new code uses strchr instead of + mbschr (but this was not really justified), and the new code does not + garantee a single slash even if $BISON_PKGDATADIR ends with several + (which was considered more accurate). See the discussion at + . + +2012-06-05 Akim Demaille + + maint: minor simplification + * src/output.c (prepare): Assign use_push_for_pull_flag's value at its + declaration. + +2012-06-05 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + version 2.5.1 + NEWS: prepare for 2.5.1. + maint: update release procedure + maint: fix comment typos + maint: post-release administrivia + +2012-06-05 Akim Demaille + + version 2.5.1 + * NEWS: Record release date. + +2012-06-05 Akim Demaille + + NEWS: prepare for 2.5.1. + * NEWS: Be compliant with do-release-commit-and-tag. + +2012-06-05 Akim Demaille + + maint: update release procedure + * bootstrap.conf: Request do-release-commit-and-tag and readme-release. + * README-hacking: Adjust. + +2012-06-05 Jim Meyering + + maint: fix comment typos + Using http://github.com/lyda/misspell-check, massage its + output into sed commands to perform the suggested changes. + Initially, I filtered out the THRU->Through changes, because + that failed to retain capitalization in the grammar token. + Instead, do this manually, beforehand: + + sed -i s/THRU/THROUGH/ tests/existing.at + git ls-files|misspellings -f -|perl -nl \ + -e '/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/ or next;' \ + -e '($file,$n,$l,$r)=($1,$2,$3,$4); $q="'\''"; $r=~s/$q/$q\\$q$q/g;'\ + -e 'print "sed -i $q${n}s!$l!$r!$q $file"'|bash + +2012-05-24 Akim Demaille + + build: regen. + +2012-05-24 Akim Demaille + + Merge tag 'v2.5.1_rc2' + Bison 2.5.1_rc2. + + * tag 'v2.5.1_rc2': (34 commits) + Bison 2.5.1_rc2. + doc: fixes. + build: fix ChangeLog generation. + c++: compute the header guards. + skeletons: remove support for unused directive. + lalr1.cc: improve Doxygen documentation. + lalr1.cc: extract stack.hh. + news: convert to double quotes. + space changes. + build: do not prototype flex-generated functions. + build: fix ChangeLog generation. + Bison 2.5.1_rc1. + tests: save/restore Autotest special files when checking XML support. + tests: AT_SAVE_SPECIAL_FILES / AT_RESTORE_SPECIAL_FILES. + tests: honor TESTSUITEFLAGS in all the check targets. + build: do not enable c++ warnings on 0 when nullptr is not supported. + maint: update gnulib. + build: config.in.h. + build: move silent rules. + glr.c: reduce variable scopes. + maint: maintainer-release-check. + maint: shush a syntax-check. + maint: prefer "commit message" to "log entry". + command line: fix minor leaks. + maint: we no longer maintain the ChangeLog. + maint: fix the generation of the synclines for bison's parser. + maint: regen. + maint: import the xmemdup0 gnulib module. + maint: remove left-over gnulib modules. + maint: ignore files imported by autopoint. + build: AC_PROG_LEX: use more readable variable names. + maint: regen src/parse-gram.[ch] + maint: simplify parse-gram.y + maint: s/strncpy/memcpy/, when equivalent + +2012-05-23 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2012-05-23 Akim Demaille + + Bison 2.5.1_rc2. + * NEWS: Update. + +2012-05-23 Akim Demaille + + doc: fixes. + * doc/bison.texinfo: Fix errors spotted by syntax-check. + +2012-05-23 Akim Demaille + + build: fix ChangeLog generation. + * gnulib: Update to get newest gitlog-to-changelog. + * bootstrap: Update. + * Makefile.am (gen-ChangeLog): Fix for Bison's git log style. + +2012-05-21 Akim Demaille + + c++: compute the header guards. + This is a frequent request. Recently pointed out by Wei Song, + . + + * data/c.m4 (b4_tocpp, b4_cpp_guard, b4_cpp_guard_open) + (b4_cpp_guard_close): New. + * data/lalr1.cc, data/location.cc, data/stack.hh: Use them. + * TODO (Header Guards): Move to... + * NEWS: here. + Formatting changes. + +2012-05-21 Akim Demaille + + skeletons: remove support for unused directive. + * src/scan-skel.l (@dir_prefix@): Remove support, has never been + used, not even in the commit that introduced it, + 2b81e969ea04c1a6502928ba7e847ec8ff7dcb2f. + +2012-05-21 Akim Demaille + + lalr1.cc: improve Doxygen documentation. + * data/location.cc: Qualify file names with directory name. + +2012-05-21 Akim Demaille + + lalr1.cc: extract stack.hh. + See commit 51bacae6b58fd5c6cce861f00440dc917384625e. + * data/stack.hh: New, extracted from... + * data/lalr1.cc: here. + * data/Makefile.am: Adjust. + +2012-05-21 Akim Demaille + + news: convert to double quotes. + * NEWS: Convert from `quoted' to "quoted". + Reported by Stefano Lattarini. + http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00039.html + +2012-05-21 Akim Demaille + + space changes. + * src/flex-scanner.h: Indent nested cpp directives. + +2012-05-21 Akim Demaille + + build: do not prototype flex-generated functions. + Some versions of Flex, possibly modified by the distribution package + maintainers, have incompatible signatures. Since newer versions of + Flex prototype their functions, avoid the conflicts in that case. + Reported by Stefano Lattarini. + . + + * src/flex-scanner.h (FLEX_VERSION_GT): New. + Use it to issue prototypes for flex-generated functions only for + versions up to 2.5.31, in accordance with the comment. + See commit dc9701e848f27ae64b6ddcf809580998667d60f2. + Use it to define yylex_destroy when needed. + +2012-05-16 Akim Demaille + + build: fix ChangeLog generation. + * Makefile.am (gen-ChangeLog): Fix for VPATH builds. + +2012-05-14 Akim Demaille + + Bison 2.5.1_rc1. + * NEWS: Update. + * src/parse-gram.c, src/parse-gram.h: Regen. + +2012-05-11 Akim Demaille + + tests: save/restore Autotest special files when checking XML support. + Currently the test 248, "parse-gram.y: LALR = IELR", fails + BISON_TEST_XML is set. + + * tests/local.at (AT_BISON_CHECK_XML): Belt: Save/restore files. + * tests/regression.at (parse-gram.y: LALR = IELR): Suspenders: Don't + rely on expout. + Each one of these changes suffices. + +2012-05-11 Akim Demaille + + tests: AT_SAVE_SPECIAL_FILES / AT_RESTORE_SPECIAL_FILES. + Some of our macros play with expout and other Autotest special files, + which may break their callers (e.g., currently TESTSUITEFLAGS='248 + BISON_TEST_XML=1' fails). + + There is already some support for this. Expand it to be ready to use + it elsewhere. + + * tests/local.at (AT_RESTORE_SPECIAL_FILES, AT_SAVE_SPECIAL_FILES) + (at_save_special_files, at_restore_special_files): New. + (AT_BISON_CHECK_NO_XML): Use them. + +2012-05-11 Akim Demaille + + tests: honor TESTSUITEFLAGS in all the check targets. + * tests/Makefile.am (installcheck-local): Simplify. + (maintainer-check-posix, maintainer-check-valgrind): Honor + $(TESTSUITEFLAGS). + +2012-05-11 Akim Demaille + + build: do not enable c++ warnings on 0 when nullptr is not supported. + * configure.ac (WARN_CXXFLAGS): Enable -Wzero-as-null-pointer-constant + only when nullptr is supported.. + +2012-05-11 Akim Demaille + + maint: update gnulib. + * bootstrap, gnulib: Update. + +2012-05-09 Akim Demaille + + build: config.in.h. + Historically we used config.hin (where everybody else used + config.h.in) to please DOS. Now that we use gnulib, there are already + tons of files with several dots, especially *.in.h. + + * configure.ac: Rename config.hin as config.in.h. + +2012-05-09 Akim Demaille + + build: move silent rules. + * tests/Makefile.am: In the generation of the test suite. + +2012-05-09 Akim Demaille + + glr.c: reduce variable scopes. + * data/glr.c: Where appropriate, fuse variable declarations followed + by assignments by variable declarations with a value. + Where appropriate, introduce new scopes to limit variable spans. + +2012-05-08 Akim Demaille + + maint: maintainer-release-check. + * tests/Makefile.am (maintainer-release-check): New. + * Makefile.am (MAINTAINER_CHECKS): New. + Support maintainer-release-check. + * README-hacking: Document it, and syntax-check too. + +2012-05-08 Akim Demaille + + maint: shush a syntax-check. + * cfg.mk: lib/timevar is not planned to be gnulib'ed, as it comes + from GCC. + +2012-05-08 Akim Demaille + + maint: prefer "commit message" to "log entry". + * README-hacking: here. + Suggested by Stefano Lattarini. + +2012-05-08 Akim Demaille + + command line: fix minor leaks. + * src/getargs.c (getargs): Free pointers before allocating them new + content. + +2012-05-08 Akim Demaille + + maint: we no longer maintain the ChangeLog. + * .gitattributes: No need to merge it. + * README-hacking: Update release instructions. + +2012-05-06 Akim Demaille + + maint: fix the generation of the synclines for bison's parser. + * tests/bison.in: Import from master the changes that make + this script generate synclines that are independant of the + builddir/srcdir user's set up. + +2012-05-06 Akim Demaille + + maint: regen. + * src/parse-gram.c, src/parse-gram.h: Regen. + +2012-05-06 Akim Demaille + + maint: import the xmemdup0 gnulib module. + * bootstrap.conf: Require this module. + * src/parse-gram.y: Include xmemdup0.h. + +2012-05-06 Akim Demaille + + maint: remove left-over gnulib modules. + * bootstrap.conf (gnulib_modules): Remove pipe-posix. + * lib/.gitignore, m4/.gitignore: Remove files that we no longer use. + +2012-05-06 Akim Demaille + + maint: ignore files imported by autopoint. + * m4/.gitignore: here. + +2012-05-06 Akim Demaille + + build: AC_PROG_LEX: use more readable variable names. + * m4/flex.m4 (AC_PROG_LEX): Prefer LEX_IS_FLEX to FLEX. + Prefer true/false to yes/no for such variables. + * configure.ac: Adjust. + +2012-05-06 Jim Meyering + + maint: regen src/parse-gram.[ch] + +2012-05-06 Jim Meyering + Akim Demaille + + maint: simplify parse-gram.y + * src/parse-gram.y (add_param): Use xmemdup0 in place of + xmalloc+memcpy, and strspn in place of an open-coded loop. + +2012-05-06 Jim Meyering + + maint: s/strncpy/memcpy/, when equivalent + * src/output.c (output_skeleton): Use memcpy, not strncpy, + since the source is known to fit in the destination buffer. + * src/parse-gram.y (%skeleton): Likewise. + +2012-05-04 Akim Demaille + + glr.c: formatting changes. + * data/glr.c: Fix indentation. + +2012-05-04 Akim Demaille + + Merge remote-tracking branch 'origin/master' + * origin/master: + glr.c: untabify. + glr.cc: untabify. + glr.cc: formatting changes. + glr.cc: remove unused signature. + glr.cc: properly declare locations are const where appropriate. + doc: fix @xref. + +2012-05-04 Akim Demaille + + glr.c: untabify. + * data/glr.c: here. + +2012-05-04 Akim Demaille + + glr.cc: untabify. + * data/glr.cc: here. + +2012-05-04 Akim Demaille + + glr.cc: formatting changes. + * data/glr.cc: Fit in 80 columns. + +2012-05-04 Akim Demaille + + glr.cc: remove unused signature. + * data/glr.cc (yydestruct_): Not used, remove. + It is yydestruct which is used. + +2012-05-04 Akim Demaille + + glr.cc: properly declare locations are const where appropriate. + * data/glr.cc (yyerror): The location is const. + +2012-05-04 Akim Demaille + + doc: fix @xref. + * doc/bison.texinfo: here. + +2012-05-04 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: (22 commits) + tests: ignore code coverage/profiling failure messages + doc: fix some invalid @ref. + build: fix previous commit. + install-pdf: fix. + NEWS: Update. + %printer: support both yyo and yyoutput. + doc: mfcalc: demonstrate %printer. + tests: style changes. + build: require Flex. + build: flex.m4: check for Flex. + build: flex.m4: quote properly. + build: flex.m4. + build: autoconf: update. + glr: eliminate last bits of unwanted locations. + NEWS: 2.6 will drop K&R. + TODO: remove dead items. + TODO: import from master. + gnulib: update. + maint: update NEWS. + doc: fix index. + doc: fix documentation of YYERROR. + c++: more YY_NULL + +2012-05-02 Akim Demaille + + tests: ignore code coverage/profiling failure messages + The Hydra buildfarm provides code coverage analysis. For some reason, + in some test cases, code coverage data seem to be incompatible, and + generate error messages at parser run-time. Ignore these messages so + that (i) these tests do pass, (ii) coverage results be provided by + Hydra. + + * tests/local.at (AT_PARSER_CHECK): Ignore messages for failed merges + of code coverage/profiling results. + +2012-04-16 Akim Demaille + + doc: fix some invalid @ref. + * doc/bison.texinfo: Fix incorrect @ref uses. + +2012-04-16 Akim Demaille + + build: fix previous commit. + * bootstrap: Update from gnulib. + +2012-04-16 Akim Demaille + + install-pdf: fix. + * gnulib: Fix install-pdf in po/ and runtime-po/. + Reported by Hans Aberg. + Fixed by Joel E. Denny. + http://lists.gnu.org/archive/html/bug-bison/2011-05/msg00008.html + +2012-04-16 Akim Demaille + + NEWS: Update. + * NEWS: Spell check. + (%printer): is now documented. + +2012-04-16 Akim Demaille + + %printer: support both yyo and yyoutput. + lalr1.cc used to support yyo, but not yyoutput. Support both, + but document only yyoutput (at least until there is some consensus + on this). + + * data/c.m4 (yy_symbol_value_print): Also support yyo. + * data/glr.cc (yy_symbol_value_print_): Support both yyo and yyoutput. + * data/lalr1.cc: Also support yyoutput. + * doc/bison.texinfo: Explicitly use yyoutput in the examples. + * examples/mfcalc/mfcalc.test: Test the -p option. + +2012-04-16 Akim Demaille + + doc: mfcalc: demonstrate %printer. + * doc/bison.texinfo (Printer Decl): New. + Number mfcalc.y snippets so that they are output in + the proper order. + (The mfcalc Main): Use yydebug. + (Debugging): Simplify the text. + (Enabling Traces, Mfcalc Traces, The YYPRINT Macro): New. + (Table of Symbols): Document YYPRINT and YYFPRINTF. + +2012-04-16 Akim Demaille + + tests: style changes. + * tests/input.at: Use "print" in %printer instead of "destroy". + It is unused, so we don't care, yet it is less surprising. + * tests/actions.at: Comment changes. + +2012-04-16 Akim Demaille + + %printer: support both yyo and yyoutput. + lalr1.cc used to support yyo, but not yyoutput. Support both, + but document only yyoutput (at least until there is some consensus + on this). + + * data/c.m4 (yy_symbol_value_print): Also support yyo. + * data/glr.cc (yy_symbol_value_print_): Support both yyo and yyoutput. + * data/lalr1.cc: Also support yyoutput. + * doc/bison.texinfo: Explicitly use yyoutput in the examples. + * examples/mfcalc/mfcalc.test: Test the -p option. + +2012-04-16 Akim Demaille + + doc: mfcalc: demonstrate %printer. + * doc/bison.texinfo (Printer Decl): New. + Number mfcalc.y snippets so that they are output in + the proper order. + (The mfcalc Main): Use yydebug. + (Debugging): Simplify the text. + (Enabling Traces, Mfcalc Traces, The YYPRINT Macro): New. + (Table of Symbols): Document YYPRINT and YYFPRINTF. + +2012-04-16 Akim Demaille + + tests: style changes. + * tests/input.at: Use "print" in %printer instead of "destroy". + It is unused, so we don't care, yet it is less surprising. + * tests/actions.at: Comment changes. + +2012-04-10 Akim Demaille + + build: require Flex. + * configure.ac: Require Flex. + +2012-04-10 Akim Demaille + + build: flex.m4: check for Flex. + * m4/flex.m4 (_AC_PROG_LEX_YYTEXT_DECL): Check that $LEX + supports some of the Flex options, and exclusive start conditions. + Define FLEX to 'yes'/'', as AC_PROG_CC does for GCC. + +2012-04-10 Akim Demaille + + build: flex.m4: quote properly. + * m4/flex.m4: Use quotes more systematically. + +2012-04-10 Akim Demaille + + build: flex.m4. + * m4/flex.m4: New. + An exact copy of what is in Autoconf currently. + +2012-04-10 Akim Demaille + + build: autoconf: update. + * submodules/autoconf: Update. + There are no changes in data/m4sugar/foreach.m4, and the + changes in data/m4sugar/m4sugar.m4 are minor. + +2012-04-10 Akim Demaille + + glr: eliminate last bits of unwanted locations. + * data/glr.c (YYLTYPE): Do not define when locations are + not demanded. + Adjust all dependencies. + +2012-04-10 Akim Demaille + + NEWS: 2.6 will drop K&R. + * NEWS: here. + (glr.c): Fix a spello. + +2012-04-09 Akim Demaille + + TODO: remove dead items. + * TODO (Documentation, %printer, Java): Remove, already done (or just + waiting for approval). + (Fortran, BTYacc): Remove, there does not seem to be demand. + +2012-04-09 Akim Demaille + + TODO: import from master. + * TODO: Copy the current version. + +2012-04-08 Akim Demaille + + tests: fix bison wrapper. + * tests/bison.in (PERL): Fix. + +2012-04-08 Akim Demaille + + doc: fix some invalid @ref. + * doc/bison.texinfo: Fix incorrect @ref uses. + +2012-04-08 Akim Demaille + + build: extexi: support out-of-order blocks. + * examples/extexi (%file_output): Remove. + (&process): Accept "FILE: BLOCK-NUM" requests. + +2012-04-08 Akim Demaille + + build: look for Perl in configure. + Bison uses "/usr/bin/perl" or "perl" in several places, and it does + not appear to be a problem. But, at least to make it simpler to + change PERL on the make command line, check for perl in configure. + + * configure.ac (PERL): New. + * doc/Doxyfile.in, doc/local.mk, examples/local.mk, + * tests/bison.in: Use it. + +2012-04-08 Akim Demaille + + maint: rewrite extexi in Perl. + * examples/extexi: Rewrite in Perl. + * examples/local.mk (extract): Adjust. + +2012-04-07 Akim Demaille + + build: simplify clean. + * doc/local.mk (CLEANFILES): Since the previous commit, + there a no longer such files. + * Makefile.in (CLEANFILES): Initialize here. + +2012-04-07 Akim Demaille + + gnulib: update. + * bootstrap.conf (bootstrap_sync): True again. + It was disabled while waiting for changes to be integrated + in gnulib's bootstrap, which was done long ago. + * bootstrap, gnulib: Update. + +2012-04-04 Akim Demaille + + maint: update NEWS. + * NEWS: Fix entry about __attribute__. + Reorder by "decreasing" order of importance. + +2012-04-04 Akim Demaille + + doc: fix index. + http://lists.gnu.org/archive/html/bison-patches/2012-04/msg00006.html + + * doc/bison.texinfo: Avoid using @def* variant with more + than the defined entity as main entity, as it results in + an incorrect index. For instance, don't document + {return YYERROR;}, which results in a single index entry + "return YYERROR;", but rather as typed function whose + return type is "type", and whose argument list is ";". + +2012-04-04 Akim Demaille + + doc: fix documentation of YYERROR. + * doc/bison.texinfo (Table of Symbols): Fix the documentation + of YYERROR by copying that from "Action Features". + +2012-04-01 Akim Demaille + + build: fix distcheck issues. + For some reason it seems that texi2dvi -o no longer forces --clean + mode, so we have stray TeX compilation files staying in top_builddir + since TeX is run from there. + + While at it, upgrade the generation of the (completely obsolete) + reference card. Target PDF. + + * doc/local.mk (TEXI2DVI): Pass --build-dir. + (CLEANDIRS): More accurate. + (doc/refcard.dvi): Replace with... + (doc/refcard.pdf): this. + Adjust dependencies. + +2012-04-01 Akim Demaille + + build: don't rely on $< in non-pattern rules. + * doc/local.mk, tests/local.mk: here. + Reported by Stefano Lattarini. + +2012-04-01 Akim Demaille + + doc: upgrade Doxyfile. + * doc/Doxyfile.in: Run doxygen -u. + Prompted by Tim Landscheidt. + +2012-04-01 Akim Demaille + + doc: help Doxygen find our files. + * doc/Doxyfile.in (INCLUDE_PATH): here. + +2012-04-01 Tim Landscheidt + + Fix Doxygen generation and clean-up. + * doc/Doxyfile.in: Amend OUTPUT_DIRECTORY. + * doc/local.mk (html-local): Amend working directory. + (CLEANDIRS): Fix "html", remove "latex". + +2012-04-01 Tim Landscheidt + + Fix Doxygen comment. + * src/InadequacyList.h: s###. + +2012-04-01 Akim Demaille + + c++: more YY_NULL + Caught by maintainer-check-g++. + * data/glr.c, data/lalr1.cc, data/yacc.c, tests/cxx-type.at, + * tests/glr-regression.at, tests/push.at: + When simple to do, avoid expliciting the null ptr. + Otherwise use YY_NULL. + +2012-04-01 Akim Demaille + + c++: more YY_NULL + Caught by maintainer-check-g++. + * data/glr.c, data/lalr1.cc, data/yacc.c, tests/cxx-type.at, + * tests/glr-regression.at, tests/push.at: + When simple to do, avoid expliciting the null ptr. + Otherwise use YY_NULL. + +2012-04-01 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + bump to 2012 in skeletons. + build: remove ancient Autoconf tests. + doc: c++: complete the location documentation. + c++: locations: provide convenience constructors. + c++: locations: remove useless "inline". + glr: do not use locations when they are not requested + c++: use nullptr for C++11. + build: simplify and improve the compiler warnings for tests. + gnulib: update. + maint: formatting changes. + NEWS: update. + Java: Fix syntax error handling without error token. + tests: beware of -pedantic on large #line numbers. + tests: when using the C++ compiler, use its flags too. + +2012-04-01 Akim Demaille + + bump to 2012 in skeletons. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, + * data/location.cc, data/yacc.c: Bump copyright year ranges. + +2012-04-01 Akim Demaille + + build: remove ancient Autoconf tests. + lib/subpipe.c was removed in 47fa574761319b0a422691223c9b8a9a72f36aa2. + + * m4/subpipe.m4: Remove. + * configure.ac (BISON_PREREQ_SUBPIPE): Remove. + +2012-03-31 Akim Demaille + + doc: c++: complete the location documentation. + * data/location.cc (position::initialize, location::initialize): + Also accept line and column, with default values. + * doc/bison.texinfo (C++ position, C++ location): New nodes. + Describe more thoroughly these classes. + Fix several Texinfo misuses. + +2012-03-31 Akim Demaille + + c++: locations: provide convenience constructors. + * data/location.cc (position::position): Accept file, line and + column as arguments with default values. + Always qualify initial line and column literals as unsigned. + (location::location): Provide convenience constructors. + +2012-03-31 Akim Demaille + + c++: locations: remove useless "inline". + * data/location.cc: "inline" is implicit when defining + methods in the class definition. + +2012-03-31 Akim Demaille + + glr: do not use locations when they are not requested + When the test suite runs with -O2 and warnings enabled, G++ + complains of locations being used, but not initialized. + The simplest is to not use locations. + + * data/glr.c (b4_locuser_formals, b4_locuser_args): New. + Use them when locations should not be used. + Use b4_locations_if where appropriate. + (yyuserAction): Modify the order to the arguments to make + it more alike the other routines, and to make use of + b4_locuser_args simpler. + +2012-03-31 Akim Demaille + + c++: use nullptr for C++11. + C++11 introduces "nullptr" which plays the role of C's NULL, in + replacement of "0". Fix the C++ skeletons to avoid warnings about + uses of "0" in place of "nullptr", and improve C skeletons to also use + this "nullptr" when compiled with a C++11 compiler. + + * configure.ac: More C++ warnings. + * NEWS (2.5.1): Document this. + * data/c++.m4, data/c.m4 (b4_null_define): New. + (b4_null): Use YY_NULL instead of 0. + * data/glr.c, data/lalr1.cc, data/location.cc, data/yacc.c: + Call b4_null_define/b4_null where appropriate. + Use YY_NULL instead of NULL. + * data/location.cc (initialize): Accept a default argument, + YY_NULL. + * tests/actions.at, tests/calc.at: Adjust. + + * data/glr.c, lib/libiberty.h, src/system.h (__attribute__): + Do not disable it when __STRICT_ANSI__ is defined, as, for + instance, it disables the __attribute__((unused)) which + protects us from some compiler warnings. + This was already done elsewhere in Bison, in 2001, see + 4a0d89369599a2cea01f4fbdf791f426a02cb5a3. + * tests/regression.at: Adjust output. + +2012-03-30 Akim Demaille + + build: simplify and improve the compiler warnings for tests. + * configure.ac (warn_common, warn_c, warn_cxx): New. + Use them to compute independently the options supported + by the C and C++ compilers. + Don't AC_SUBST the variables passed to gl_WARN_ADD: it + does it for us. + (WARN_CFLAGS_TEST, WARN_CXXFLAGS_TEST): Don't aggregate + $WARN_CFLAGS and $WARN_CXXFLAGS in them now, leave it + to atlocal.in. + (O0CFLAGS, O0CXXFLAGS): Move their definition to... + * tests/atlocal.in: here. + Be more systematic between C and C++. + Reorder to factor between variables. + Propagate all of the variables when --compile-c-with-cxx. + +2012-03-30 Akim Demaille + + gnulib: update. + +2012-03-30 Akim Demaille + + maint: formatting changes. + * src/system.h: Indent CPP directives using cppi. + +2012-03-27 Akim Demaille + + NEWS: update. + * NEWS: Java fixes, more about the doc changes, liby issues. + +2012-03-27 Tim Landscheidt + + Java: Fix syntax error handling without error token. + * data/lalr1.java (YYParser::parse): Here. + * tests/java.at: Add test case. + +2012-03-24 Akim Demaille + + tests: beware of -pedantic on large #line numbers. + * tests/local.at (AT_TEST_TABLES_AND_PARSE): Don't pass -pedantic + when compiling large canonical-LR parsers. + Reported by Tys Lefering. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00025.html + +2012-03-24 Akim Demaille + + tests: when using the C++ compiler, use its flags too. + * tests/local.at: Go for colors. + (--compile-c-with-cxx): New option. + We used to pass "CC=$CXX" as command line argument, + but it was not possible to adjust CFLAGS accordingly + in atlocal, since it is loaded before assignments on + the command line are honored (so that the command line + takes precedence). + * tests/atlocal.in: Implement it. + * tests/local.mk: Use it. + +2012-03-24 Akim Demaille + + tests: style changes in the Makefile. + * tests/local.mk: Prefer passing variable assignment by + the command line, instead of the environment, so that it + is reported in the logs. + Prefer single quotes for shell literal strings. + +2012-03-24 Akim Demaille + + tests: beware of -pedantic on large #line numbers. + * tests/local.at (AT_TEST_TABLES_AND_PARSE): Don't pass -pedantic + when compiling large canonical-LR parsers. + Reported by Tys Lefering. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00025.html + +2012-03-24 Akim Demaille + + tests: when using the C++ compiler, use its flags too. + * tests/local.at: Go for colors. + (--compile-c-with-cxx): New option. + We used to pass "CC=$CXX" as command line argument, + but it was not possible to adjust CFLAGS accordingly + in atlocal, since it is loaded before assignments on + the command line are honored (so that the command line + takes precedence). + * tests/atlocal.in: Implement it. + * tests/local.mk: Use it. + +2012-03-24 Akim Demaille + + tests: fix dependencies. + * tests/local.mk (check_SCRIPTS): Add atlocal and atconfig so + that they are properly updated before running tests. + (RUN_TESTSUITE_deps): New. + Use it to factor the dependencies of "*-check" targets, + especially those that don't bounce to the regular + "check-local" target, since then they don't benefit from the + proper dependencies (such as atlocal). + +2012-03-19 Akim Demaille + + Merge remote-tracking branch 'fsf/maint' + * fsf/maint: (404 commits) + doc: update the --verbose report format. + doc: spell check. + doc: stmt, not stmnt. + doc: save width. + doc: reformat grammar snippets. + doc: use only @example, not @smallexample. + doc: style changes. + doc: minor fixes to "Understanding" section + tests: minor fixes/simplifications + tests: be robust to quote style. + maint: update gnulib. + tests: be robust to POSIXLY_CORRECT being defined. + doc: fix environment issues. + regen. + tests: fix regressions. + glr: fix ambiguity reports. + doc: stylistic improvements. + maint: address sc_prohibit_doubled_word. + maint: address sc_prohibit_always-defined_macros. + maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC. + ... + +2012-03-19 Akim Demaille + + doc: spell fix. + * doc/bison.texinfo: here. + Reported by Tim Landscheidt. + +2012-03-19 Akim Demaille + + doc: update the --verbose report format. + * doc/bison.texinfo (Understanding): Adjust to match the + current format. + +2012-03-19 Akim Demaille + + doc: spell check. + * doc/bison.texinfo: here. + +2012-03-19 Akim Demaille + + doc: stmt, not stmnt. + * doc/bison.texinfo: s/stmnt/stmt/g. This is a + much more common abbreviation for "statement". + +2012-03-19 Akim Demaille + + doc: save width. + * doc/bison.texinfo (Language and Grammar): Use the same + layout for an example in all the versions, i.e., keep + as general case what used to be used only for Info. + +2012-03-19 Akim Demaille + + doc: reformat grammar snippets. + * doc/bison.texinfo: Convert the grammar examples to + use a narrower style. This helps fitting into the + @smallbook constraints. + http://lists.gnu.org/archive/html/bison-patches/2012-03/msg00011.html + +2012-03-19 Akim Demaille + + doc: use only @example, not @smallexample. + * doc/bison.texinfo: Convert all @smallexamples into @examples. + Adjust layout where needed. + +2012-03-19 Akim Demaille + + doc: style changes. + * doc/bison.texinfo: Avoid line width issues with TeX. + Upgrade ancient messages. + Move some comments to better looking places. + Add more @group. + (Mfcalc Symbol Table): Reduce variable scopes. + Prefer size_t for sizes. + Prefer declarations with an initial value. + Fix a @group environment. + +2012-03-19 Paul Eggert + + doc: minor fixes to "Understanding" section + * doc/bison.texinfo (Understanding): Minor wording fixes and + improvements. Fixes problems reported in + . + +2012-03-19 Akim Demaille + + doc: update the --verbose report format. + * doc/bison.texinfo (Understanding): Adjust to match the + current format. + +2012-03-19 Akim Demaille + + doc: spell check. + * doc/bison.texinfo: here. + +2012-03-19 Akim Demaille + + doc: stmt, not stmnt. + * doc/bison.texinfo: s/stmnt/stmt/g. This is a + much more common abbreviation for "statement". + +2012-03-19 Akim Demaille + + doc: save width. + * doc/bison.texinfo (Language and Grammar): Use the same + layout for an example in all the versions, i.e., keep + as general case what used to be used only for Info. + +2012-03-19 Akim Demaille + + doc: reformat grammar snippets. + * doc/bison.texinfo: Convert the grammar examples to + use a narrower style. This helps fitting into the + @smallbook constraints. + http://lists.gnu.org/archive/html/bison-patches/2012-03/msg00011.html + +2012-03-19 Akim Demaille + + doc: use only @example, not @smallexample. + * doc/bison.texinfo: Convert all @smallexamples into @examples. + Adjust layout where needed. + +2012-03-19 Akim Demaille + + doc: style changes. + * doc/bison.texinfo: Avoid line width issues with TeX. + Upgrade ancient messages. + Move some comments to better looking places. + Add more @group. + (Mfcalc Symbol Table): Reduce variable scopes. + Prefer size_t for sizes. + Prefer declarations with an initial value. + Fix a @group environment. + +2012-03-19 Akim Demaille + + c.m4: better newline control with b4_parse_param_use. + * data/c.m4: Use m4_ifvaln instead of m4_ifval where + applicable. + (b4_parse_param_use): Switch order between two nested + "if"s to avoid useless empty lines. + Adjust callers to avoid useless lines. + +2012-03-19 Akim Demaille + + glr.c: remove (broken) support for YYPRINT. + YYPRINT uses yytoknum which glr does not define. Since YYPRINT + is considered obsolete, and did not work, don't fix its support, + remove it from glr.c. + + * data/c.m4 (yy_symbol_value_print): Use YYPRINT only for yacc.c. + * TODO: Done. + +2012-03-17 Paul Eggert + + doc: minor fixes to "Understanding" section + * doc/bison.texinfo (Understanding): Minor wording fixes and + improvements. Fixes problems reported in + . + +2012-03-15 Akim Demaille + + TODO: update. + +2012-03-15 Akim Demaille + + gnulib: update. + +2012-03-13 Akim Demaille + + tests: minor fixes/simplifications + * tests/local.at (AT_BISON_CHECK_NO_XML): Simplify sed programs, + quotation, and default value assignments. + Ensure a proper value to the numeric variables. + Reported by Lie Yan. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html + +2012-03-13 Akim Demaille + + maint: fix distcheck. + * examples/local.mk (MAINTAINERCLEANFILES): Complete, and rename as... + (CLEANFILES): this, + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk (CLEANFILES): Add the generated files. + +2012-03-13 Akim Demaille + + tests: minor fixes/simplifications + * tests/local.at (AT_BISON_CHECK_NO_XML): Simplify sed programs, + quotation, and default value assignments. + Ensure a proper value to the numeric variables. + Reported by Lie Yan. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html + +2012-03-09 Akim Demaille + + tests: be robust to POSIXLY_CORRECT being defined. + * tests/local.at (AT_BISON_CHECK_NO_XML): Check if + POSIXLY_CORRECT is defined, not if it is defined to 1. + Reported by Lie Yan. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html + +2012-03-09 Akim Demaille + + tests: be robust to quote style. + See . + + * src/main.c (main): Define the quoting style we use. + * tests/atlocal.in: Use ASCII style quotes during the tests. + +2012-03-09 Akim Demaille + + maint: update gnulib. + * gnulib: update. + * src/scan-gram.l: Don't use the (former version of) STREQ. + +2012-03-09 Akim Demaille + + tests: remove quote magic from the bison test wrapper. + Basically, revert 4c4d35394d1bdb4dc3392482ab002bc111a3378f. + + * tests/bison.in: Leave bison's stderr as is. + +2012-03-09 Akim Demaille + + tests: be robust to quote style. + See . + + * src/main.c (main): Define the quoting style we use. + * tests/atlocal.in: Use ASCII style quotes during the tests. + +2012-03-09 Akim Demaille + + avoid direct strncmp calls. + Before this change, bison would accept either .tab and _tab equivalently, + whatever the current platform. Besides, it was not obeying everywhere + to the possible definition of TAB_EXT to something else than .tab. + + For consistency, handle only TAB_EXT (".tab" on non DJGPP platforms). + Support for "_tab" is neither documented, nor tested. + + * src/system.h (STRNCMP_LIT): New. + From Jim Meyering. + (STRPREFIX_LIT): New. + * src/files.c, src/getargs.c: Use it. + +2012-03-06 Akim Demaille + + tests: be robust to POSIXLY_CORRECT being defined. + * tests/local.at (AT_BISON_CHECK_NO_XML): Check if + POSIXLY_CORRECT is defined, not if it is defined to 1. + Reported by Lie Yan. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html + +2012-02-24 Akim Demaille + + build: comment changes. + * Makefile.am, examples/calc++/local.mk, examples/local.mk, + * examples/mfcalc/local.mk, examples/rpcalc/local.mk, + * lib/local.mk, src/local.mk, tests/local.mk: + Make the copyright licenses more uniform. + +2012-02-24 Akim Demaille + + build: fix more example extraction issues. + * Makefile.am (dist_TESTS): New. + (TESTS, EXTRA_DIST): Run and ship them. + * examples/calc++/local.mk: examples/calc++/calc++.stamp no longer + exists, don't try to ship it. + (.yy.stamp): New recipe. + Use it. + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk: + Don't ship the sources. + Adjust the CPPFLAGS: there is nothing left in srcdir. + (MAINTAINERCLEANFILES): Remove, now we are in builddir. + (TESTS): Rename as... + (dist_TESTS): this. + +2012-02-24 Akim Demaille + + maint: fix example extraction issues. + calc++: don't rely on Automake to compile a C++ parser. + + Basically, revert commit 609b3d8096fb0cc1fa4d908b6e1a860ced260bda, + Automake 1.11.3 is not safe enough for C++ parser. + + * examples/calc++/calc++-parser.hh: Remove. + * examples/calc++/local.mk (examples/calc++/calc++-parser.stamp): + New. + + examples: factor the extractions into a single step + + extexi had to be run in the extraction directory. Now, it can be + given the files with expected output directory. This allows to + use $(*_extracted) variables (before we had to list again their + members, but limited to their base names). In turn, this also + allows fusing the extraction recipes into a single one. + + Also, it is currently too hard (or requires too much duplication, + since Make wants all the occurrences of the files to be prefixed with + $(srcdir)/, which is something Automake cannot support for *_SOURCES) + to work in the source tree. So extract, and compile scanners and parsers + in the build tree. + + * examples/extexi (basename): New. + (BEGIN): Now "file_wanted" maps base name to extracted file name. + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk: Fuse extraction rules into... + * examples/local.mk: Here. + (extract, extracted): New. + +2012-02-23 Akim Demaille + + maint: use STREQ/STRNEQ. + * doc/bison.texinfo: Space change. + * src/system.h (STREQ, STRNEQ): New. + * src/files.c, src/ielr.c, src/lalr.c, src/muscle-tab.c, + * src/output.c, src/print.c, src/print_graph.c, + * src/reader.c, src/scan-skel.l, src/tables.c, + * src/uniqstr.c: + Use them. + * src/scan-gram.l: Do not use streq.h, use system.h's STREQ. + * cfg.mk: The documentation is an exception. + +2012-02-23 Akim Demaille + + doc: fix environment issues. + * doc/bison.texinfo: Do not use @verbatim, in particular when + we use @group inside. + Use @quotation instead of @display for frequently asked questions, + it looks much nicer. + +2012-02-23 Akim Demaille + + doc: fix environment issues. + * doc/bison.texinfo: Do not use @verbatim, in particular when + we use @group inside. + Use @quotation instead of @display for frequently asked questions, + it looks much nicer. + +2012-02-23 Akim Demaille + + regen. + * src/parse-gram.h, src/parse-gram.c: regen. + +2012-02-23 Akim Demaille + + tests: fix regressions. + Exit status 63 is documented for version-mismatch. + * bootstrap.conf (gnulib_modules): Remove sysexits. + * src/system.h (EX_MISMATCH): Define. + * src/parse-gram.y (version_check): Use it instead of EX_CONFIG. + + Missing includes. + * tests/calc.at, tests/named-refs.at: Include assert.h. + +2012-02-22 Akim Demaille + + maint: gitignore. + * examples/mfcalc/.gitignore, examples/rpcalc/.gitignore: Fix. + +2012-02-21 Akim Demaille + + regen. + * src/parse-gram.c, src/parse-gram.h: regen. + +2012-02-21 Akim Demaille + + tests: fix regressions. + Exit status 63 is documented for version-mismatch. + * bootstrap.conf (gnulib_modules): Remove sysexits. + * src/system.h (EX_MISMATCH): Define. + * src/parse-gram.y (version_check): Use it instead of EX_CONFIG. + + Missing includes. + * tests/calc.at, tests/named-refs.at: Include assert.h. + +2012-02-21 Akim Demaille + + tests: post-process stderr to normalize quotes. + * tests/bison.in: Save bison's stderr, and convert gettextized + quotes to plain ASCII. + +2012-02-21 Akim Demaille + + glr: fix ambiguity reports. + * tests/glr-regression.at (Ambiguity reports): New. + +2012-02-21 Akim Demaille + + glr: fix ambiguity reports. + Fix a regression introduced in commit + 783aa653f4ca70a75919c8516b950494c612cbfe. + + * tests/glr-regression.at (Ambiguity reports): New. + * data/glr.c (yyreportTree): Fix an offset error. + +2012-02-19 Akim Demaille + + doc: stylistic improvements. + * doc/bison.texinfo: Prefer "continue" to empty loop bodies. + Add some @group/@end group to avoid poor page breaks. + +2012-02-19 Akim Demaille + + maint: address sc_prohibit_doubled_word. + * data/yacc.c, doc/bison.texinfo: Reword to avoid having to + disable that check. + * cfg.mk: No longer skip this test. + +2012-02-19 Akim Demaille + + maint: address sc_prohibit_always-defined_macros. + * cfg.mk: No longer skip it, except where EXIT_SUCCESS is used + as a witness for stdlib.h. + Skip this test when appropriate. + * data/yacc.c: Drop a note about why EXIT_SUCCESS is defined here. + +2012-02-19 Akim Demaille + + maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC. + * bootstrap.conf (gnulib_modules): Require progname. + * src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it. + * cfg.mk (exclude): New. + Use it. + Skip lib/main.c for bindtextdomain and set_program_name. + +2012-02-19 Akim Demaille + + maint: remove stray file. + * config.hin: Remove. + +2012-02-19 Akim Demaille + + doc: stylistic improvements. + * doc/bison.texinfo: Prefer "continue" to empty loop bodies. + Add some @group/@end group to avoid poor page breaks. + +2012-02-19 Akim Demaille + + doc: check the rpcalc. + * doc/bison.texinfo: Tag rpcalc.y snippets. + Add missing includes. + (Rpcalc Rules): Don't issue leading tabs. + Complete an Info menu. + Use @result. + * examples/rpcalc/local.mk: New. + * examples/rpcalc/rpcalc.test: New. + * examples/local.mk: Use them. + * examples/mfcalc/mfcalc.test: Remove dup test. + * examples/test: Disable debug traces. + +2012-02-19 Akim Demaille + + regen. + * src/parse-gram.c, src/parse-gram.h: Regen. + +2012-02-19 Akim Demaille + + maint: address sc_prohibit_doubled_word. + * data/yacc.c, doc/bison.texinfo: Reword to avoid having to + disable that check. + * cfg.mk: No longer skip this test. + +2012-02-19 Akim Demaille + + maint: address sc_prohibit_always-defined_macros. + * cfg.mk: No longer skip it, except where EXIT_SUCCESS is used + as a witness for stdlib.h. + Skip this test when appropriate. + * data/yacc.c: Drop a note about why EXIT_SUCCESS is defined here. + +2012-02-19 Akim Demaille + + maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC. + * bootstrap.conf (gnulib_modules): Require progname. + * src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it. + * cfg.mk (exclude): New. + Use it. + Skip lib/main.c for bindtextdomain and set_program_name. + +2012-02-19 Akim Demaille + + maint: remove stray file. + * config.hin: Remove. + +2012-02-19 Akim Demaille + + bitset: fix an incorrect error message. + * lib/bitset_stats.c: here. + Reported by Stefano Lattarini. + +2012-02-19 Akim Demaille + + maint: address some syntax-issues remaining after cherry-picking from master. + * cfg.mk: Skip bison generated files, 2.5 is generating trailing + blanks. This is already fixed in master. + * tests/conflicts.at, tests/java.at: Fix white space issues. + +2012-02-19 Akim Demaille + + regen. + * src/parse-gram.c, src/parse-gram.h: Regen. + +2012-02-19 Akim Demaille + + bitset: fix an incorrect error message. + * lib/bitset_stats.c: here. + Reported by Stefano Lattarini. + +2012-02-19 Jim Meyering + + maint: reenable sc_m4_quote_check + * cfg.mk (local-checks-to-skip): Reenable sc_m4_quote_check. + * m4/dmalloc.m4: Add quotes. + +2012-02-19 Akim Demaille + + maint: remove trailing empty lines. + * cfg.mk: No longer skip sc_prohibit_empty_lines_at_EOF, except + for parse-gram.h (generated). + * examples/mfcalc/.gitignore, lib/.gitignore, m4/.gitignore, + * po/.gitignore, runtime-po/.gitignore: Remove trailing/leading + empty lines. + +2012-02-19 Akim Demaille + + maint: avoid "magic number exit". + * cfg.mk (local-checks-to-skip): No longer skip it. + * bootstrap.conf (gnulib_modules): Add sysexits. + * doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y, + * src/system.h, tests/calc.at, tests/named-refs.at: Use assert + where appropriate instead of "if (...) exit". + Use symbolic exit status elsewhere. + +2012-02-19 Akim Demaille + + maint: fix some syntax-check issues. + * cfg.mk (local-checks-to-skip): Remove + sc_prohibit_quotearg_without_use, sc_prohibit_strcmp, + sc_unmarked_diagnostics, sc_useless_cpp_parens. + (sc_unmarked_diagnostics): Skip DJGPP. + * data/yacc.c, src/LR0.c, src/closure.c, + * src/flex-scanner.h, src/gram.c, src/lalr.c, + * src/print-xml.c, src/print.c, src/print_graph.c, + * src/reader.c, src/reduce.c, src/tables.c: + Don't use parens with cpp's defined. + Remove useless includes. + +2012-02-19 Akim Demaille + + maint: address a couple of syntax-check errors. + * cfg.mk (local-checks-to-skip): Remove sc_error_message_period + and sc_error_message_uppercase. + Address the uncovered issues. + * po/POTFILES.in: Add missing files. + * src/symtab.c: Remove useless includes. + * lib/bitset_stats.c, src/files.c, tests/glr-regression.at: Use + conformant error messages. + +2012-02-19 Akim Demaille + + maint: gnulib: upgrade. + +2012-02-18 Akim Demaille + + maint: remove trailing empty lines. + * cfg.mk: No longer skip sc_prohibit_empty_lines_at_EOF, except + for parse-gram.h (generated). + * examples/mfcalc/.gitignore, lib/.gitignore, m4/.gitignore, + * po/.gitignore, runtime-po/.gitignore: Remove trailing/leading + empty lines. + +2012-02-18 Akim Demaille + + maint: regen. + * src/parse-gram.c, src/parse-gram.h: regen. + +2012-02-18 Akim Demaille + + maint: avoid "magic number exit". + * cfg.mk (local-checks-to-skip): No longer skip it. + * bootstrap.conf (gnulib_modules): Add sysexits. + * doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y, + * src/system.h, tests/calc.at, tests/named-refs.at: Use assert + where appropriate instead of "if (...) exit". + Use symbolic exit status elsewhere. + +2012-02-18 Akim Demaille + + maint: fix some syntax-check issues. + * cfg.mk (local-checks-to-skip): Remove + sc_prohibit_quotearg_without_use, sc_prohibit_strcmp, + sc_unmarked_diagnostics, sc_useless_cpp_parens. + (sc_unmarked_diagnostics): Skip DJGPP. + * data/yacc.c, src/LR0.c, src/closure.c, + * src/flex-scanner.h, src/gram.c, src/lalr.c, + * src/print-xml.c, src/print.c, src/print_graph.c, + * src/reader.c, src/reduce.c, src/tables.c: + Don't use parens with cpp's defined. + Remove useless includes. + +2012-02-18 Akim Demaille + + maint: address a couple of syntax-check errors. + * cfg.mk (local-checks-to-skip): Remove sc_error_message_period + and sc_error_message_uppercase. + Address the uncovered issues. + * po/POTFILES.in: Add missing files. + * src/symtab.c: Remove useless includes. + * lib/bitset_stats.c, src/files.c, tests/glr-regression.at: Use + conformant error messages. + +2012-02-18 Akim Demaille + + maint: gnulib: upgrade. + +2012-02-17 Akim Demaille + + doc: mfcalc: fix includes. + * doc/bison.texinfo: math.h is needed early. + +2012-02-17 Akim Demaille + + examples: factor the test suite. + * examples/mfcalc/test, examples/calc++/test: Extract the + common bits into... + * examples/test: here. + (cwd): New. + Use it to avoid a race on the temporary directory. + Reported by Jim Meyering. + * examples/mfcalc/test, examples/calc++/test: Rename into... + * examples/mfcalc/mfcalc.test, examples/calc++/calc++.test: these. + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/local.mk: Adjust. + +2012-02-17 Akim Demaille + + examples: fix the test suites. + * examples/calc++/test, examples/mfcalc/test (me): Be more + meaningfull: include the example name. + (prog): Factor. + (run): Avoid printf, use echo. + Add missing parens. + (cleanup): New. + Call it on trap. + Remove the previous "rm" that did the cleanup. + Move into a private directory to avoid concurrency issues. + Reported by Jim Meyering. + +2012-02-17 Jim Meyering + + examples: link mfcalc with -lm for uses of pow, cos, atan, etc. + * examples/mfcalc/local.mk (examples_mfcalc_mfcalc_LDADD): Define. + +2012-02-16 Akim Demaille + + mfcalc: extract and exercise. + * examples/mfcalc/local.mk, examples/mfcalc/test: New, + based on calc++'s ones. + * examples/local.mk: Include mfcalc/local.mk. + +2012-02-16 Akim Demaille + + calc++: factor for other extracted tests. + * Makefile.am (TESTS, check_PROGRAMS): Initialize here. + * examples/local.mk (doc, extexi): Define here. + * examples/calc++/local.mk: Adjust accordingly. + * configure.ac: Ask for parallel-tests (for the way the logs + are handled). + * examples/calc++/test: As a consequence, always be verbose. + ($prog): New. + (run): Use it. + Sort the tests in a more natural order (simplest first). + +2012-02-16 Akim Demaille + + doc: mfcalc: send errors to stderr. + * doc/bison.texinfo (Mfcalc Lexer): New. + (Mfcalc Main): Move the definition of main and yyerror here, for + clarity. + Let yyerror report on stderr. + +2012-02-16 Akim Demaille + + doc: fix mfcalc code. + * doc/bison.texinfo (Multi-function Calc): Add missing includes. + Fix the rendering of the result: use @result and remove the + initial tabulation in the actual code. + Fix stylistic issues: avoid the , operator. + Add extexi mark-up. + * examples/extexi: Also support @smallexample. + +2012-02-16 Akim Demaille + + tests: c++: stylistic changes. + * tests/c++.at: Don't use void for incoming arguments. + Prefer cstdlib to stdlib.h. + +2012-02-16 Jim Meyering + + tests: avoid c++ failure due to lack of getenv decl + * tests/c++.at (Syntax error as exception): Avoid spurious failure + at least when compiling with g++-4.7.x due to lack of declaration + of getenv. Include . + +2012-02-15 Akim Demaille + + maint: rely on Automake for parsers. + * Makefile.am (AM_YFLAGS): Automake looks for "-d" alone. + Move other options in here. + (BISON): New. + (YACC): Use it. + (bison_SOURCES): Now that automake can see `-d' in AM_YFLAGS, + we can rely on it to compile and ship the parser header + files. + + Based on commit 737406a32c201471699bfa0843d1f432f3ec29ab and + commit 3d6ca339083c278d907c9f030f4ba6bc5ecb07f2. + +2012-02-15 Akim Demaille + + maint: trust Automake for parser headers. + * examples/calc++/local.mk, src/local.mk: Now that automake + can see `-d' in AM_YFLAGS, we can rely on it to compile + and ship the parser header files. + +2012-02-15 Akim Demaille + + maint: help Automake reading Yacc flags. + * Makefile.am (AM_YFLAGS): Automake looks for "-d" alone. + +2012-02-15 Akim Demaille + + calc++: rely on Automake. + Rely on $(YACC) being the bison being built, and let Automake do the + rest. It turned out to be much more difficult than anticipated, for + various reasons, including some bad behavior from Automake 1.11.2 + which (i) generates calc++-parser.h instead of calc++-parser.hh, and + (ii) leaves an #include "y.tab.h" in the generated parser instead + of #include "calc++-parser.h". + + The authors of Automake appear to be aware of the problem, + http://lists.gnu.org/archive/html/automake/2011-05/msg00008.html + so a simple work around will suffice for the time being. + + * examples/calc++/y.tab.h, examples/calc++/calc++-parser.hh: New. + To work around Automake 1.11.2 issues. + * examples/calc++/local.mk: Remove all the rules for compilation + with bison, leave them to Automake. + So provide it with "calc++-parse.yy" as a source file. + (calc_sources_generated, calc_sources_extracted): Rename as. + (calc_generated, calc_extracted): these. + (calc_sources): New. + Fix them. + +2012-02-14 Akim Demaille + + maint: tidy the Makefile a bit. + * src/local.mk: Put yacc related variables together. + (AUTOMAKE_OPTIONS): Move to... + * Makefile.am: here. + Remove an old Emacs mode request which disables Automake support. + * src/local.mk (YACC, AM_YFLAGS): Move to... + * Makefile.am: here, as they will be used by other local.mks. + +2012-02-14 Akim Demaille + + maint: de-recurse the handling of examples + The directory was still using a local Makefile.am because it provides + "scoped" Make variables: these examples are not meant to use the same + CPPFLAGS etc. If we were to use the same -I set, we'd pick up + gnulib's stdio.h for instance, which we do not want for these simple + examples. + + Yet, as a result, the dependencies are less accurate, there is code + duplication, etc. This is especially perceptible when trying to + extract more examples from the documentation, as will be done in + forthcoming changes. + + In order to make the tuning of CPPFLAGS easier, discard the predefined + -I from Automake. + + * examples/calc++/Makefile.am: Rename as... + * examples/calc++/local.mk: this. + Adjust the paths which are now rooted in top_srcdir/top_builddir. + Handle BISON_CXX_WORKS here, instead of the too crude previous + approach that completely discarded the whole directory. + ($(BISON)): Remove now useless bouncing recipe. + (calc___CPPFLAGS): New. + Stay away from -Ilib. + * Makefile.am, configure.ac, examples/local.mk, + * examples/calc++/test: Adjust. + + * configure.ac: Pass nostdinc to Automake. + * src/local.mk, lib/local.mk (AM_CPPFLAGS): Move to... + * Makefile.am: here. + + * src/local.mk, examples/calc++/Makefile.am (BISON, BISON_IN): Factor + to... + * Makefile.am: here. + * tests/local.mk: Use it. + +2012-02-14 Akim Demaille + + variant: fix the example. + * examples/variant.yy: Adjust to "assert" being now + "parse.assert". + +2012-02-14 Akim Demaille + + maint: more authors. + * AUTHORS: here. + Suggested by Tys Lefering. + +2012-02-14 Akim Demaille + + maint: add license headers. + * examples/calc++/test, examples/variant.yy, AUTHORS, THANKS, + * tests/atlocal.in, tests/bison.in: Add license headers. + Reported by Tys Lefering. + +2012-02-14 Akim Demaille + + maint: remove obsolete file. + * etc/make-ChangeLogs: Remove (used for rcs to cvs migration!). + Reported by Tys Lefering. + +2012-02-14 Akim Demaille + + maint: more authors. + * AUTHORS: here. + Suggested by Tys Lefering. + +2012-02-14 Akim Demaille + + maint: add license headers. + * examples/calc++/test, examples/variant.yy, AUTHORS, THANKS, + * tests/atlocal.in, tests/bison.in: Add license headers. + Reported by Tys Lefering. + +2012-02-14 Akim Demaille + + maint: remove obsolete file. + * etc/make-ChangeLogs: Remove (used for rcs to cvs migration!). + Reported by Tys Lefering. + +2012-02-10 Akim Demaille + + lalr1.cc: also handle syntax_error when calling yylex. + * data/lalr1.cc (parse): Catch syntax_error around yylex and + forward them to errlab1. + * tests/c++.at (Syntax error as exception): Check support for + syntax exceptions raised by the scanner. + * NEWS, doc/bison.texinfo: Document it. + +2012-02-10 Akim Demaille + + tests: lalr1.cc: check syntax_error. + * tests/c++.at (Syntax error as exception): New. + +2012-02-10 Akim Demaille + + tests: don't require locations uselessly. + * tests/c++.at (Syntax error discarding no lookahead): Contrary to + 2.5, C++ parsers can work without locations. + +2012-02-10 Akim Demaille + + maint: more silent rules. + * tests/local.mk (TESTSUITE_AT): Include plackage.m4. + Adjust dependencies. + Make testsuite.at its first argument. + (package.m4): Be silent. + (testsuite): Be silent. + Use $<. + +2012-02-10 Akim Demaille + + skeletons: simplify the protections against "unused" warnings. + * data/c.m4 (b4_parse_param_use): Also accept optional arguments + to "use". + Simplify callers. + * data/glr.c (yyuserAction): Simplify use of b4_parse_param_use. + (yy_reduce_print): Don't use b4_parse_param_use, as all the arguments + _are_ used. + * data/lalr1.cc (YY_SYMBOL_PRINT): Even when disabled, "use" the + symbol argument. + This neutralizes a warning in yypush_ when there are no symbols + with a semantic values. + (yy_destroy_): Remove useless "use" of yymsg. + +2012-02-10 Akim Demaille + + glr: formatting changes. + * data/glr.c: Split long strings. + +2012-02-08 Akim Demaille + + use a more consistent quoting style. + See . + Use quotearg as often as possible instead of leaving the choice of + the quotes to the translators. Use shorter messages. Factor similar + messages to a single format, to make localization easier. + + * src/files.c, src/getargs.c, src/muscle-tab.c, src/reader.c + * src/scan-code.l, src/scan-gram.l, src/symtab.c: + Use quote() or quotearg_colon() on printf arguments instead of + quotes in the format string. + * data/bison.m4: Keep sync with the changes in muscle-tab.c. + + * tests/skeletons.at, tests/input.at, tests/regression.at: Adjust + expected messages. + +2012-02-08 Akim Demaille + + use a more consistent quoting style. + See . + Use quotearg as often as possible instead of leaving the choice of + the quotes to the translators. Use shorter messages. Factor similar + messages to a single format, to make localization easier. + + * src/files.c, src/getargs.c, src/muscle-tab.c, src/reader.c + * src/scan-code.l, src/scan-gram.l, src/symtab.c: + Use quote() or quotearg_colon() on printf arguments instead of + quotes in the format string. + * data/bison.m4: Keep sync with the changes in muscle-tab.c. + + * tests/skeletons.at, tests/input.at, tests/regression.at: Adjust + expected messages. + +2012-01-31 Jim Meyering + + maint: reenable sc_m4_quote_check + * cfg.mk (local-checks-to-skip): Reenable sc_m4_quote_check. + * m4/dmalloc.m4: Add quotes. + +2012-01-31 Jim Meyering + + maint: force "make syntax-check" to pass by skipping failing tests + * cfg.mk (local-checks-to-skip): Skip all currently-failing tests. + Remove changelog-check; it's long gone. + +2012-01-31 Akim Demaille + + maint: remove stray debug code. + * src/Makefile.am (echo): Remove. + +2012-01-31 Akim Demaille + + maint: space changes. + * src/Makefile.am: Use 2 leading spaces for variable definition + spreading over several lines. + +2012-01-31 Akim Demaille + + maint: more silent-rules. + * doc/local.mk, src/local.mk, examples/calc++/Makefile.am: Use + $(AM_V_GEN) and $(AM_V_at) where appropriate. + +2012-01-31 Jim Meyering + + do not ignore errors like ENOSPC,EIO when writing to stdout + Standard output was never explicitly closed, so we could not + detect failure. Thus, bison would ignore the errors of writing + to a full file system and getting an I/O error on write, but only + for standard output, e.g., for --print-localedir, --print-datadir, + --help and some verbose output. + Now, "bison --print-datadir > /dev/full" reports the write failure: + bison: write error: No space left on device + Before, it would exit 0 with no diagnostic, implying success. + This is not an issue for "--output=-" or the other FILE-accepting + command-line options, because unlike most other GNU programs, + an output file argument of "-" is treated as the literal "./-", + rather than standard output. + * bootstrap.conf (gnulib_modules): Add closeout. + * src/main.c: Include "closeout.h". + Use atexit to ensure we close stdout. + * .gitignore: Ignore new files pulled in via gnulib-tool. + +2012-01-31 Akim Demaille + + maint: more silent-rules. + * doc/local.mk, src/local.mk, examples/calc++/Makefile.am: Use + $(AM_V_GEN) and $(AM_V_at) where appropriate. + +2012-01-29 Jim Meyering + + do not ignore errors like ENOSPC,EIO when writing to stdout + Standard output was never explicitly closed, so we could not + detect failure. Thus, bison would ignore the errors of writing + to a full file system and getting an I/O error on write, but only + for standard output, e.g., for --print-localedir, --print-datadir, + --help and some verbose output. + Now, "bison --print-datadir > /dev/full" reports the write failure: + bison: write error: No space left on device + Before, it would exit 0 with no diagnostic, implying success. + This is not an issue for "--output=-" or the other FILE-accepting + command-line options, because unlike most other GNU programs, + an output file argument of "-" is treated as the literal "./-", + rather than standard output. + * bootstrap.conf (gnulib_modules): Add closeout. + * src/main.c: Include "closeout.h". + Use atexit to ensure we close stdout. + * .gitignore: Ignore new files pulled in via gnulib-tool. + +2012-01-26 Akim Demaille + + tests: fix expected output. + * tests/actions.at (YYBACKUP): here. + +2012-01-26 Akim Demaille + + tests: fix expected output. + * tests/actions.at (YYBACKUP): here. + +2012-01-26 Akim Demaille + + maint: fix configure.ac + Fix commit 1890a2a816dab86c23cc1d0af8fac3986335deb7. + + * configure.ac: Fix variable assignment. + +2012-01-26 Akim Demaille + + yacc: fix YYBACKUP. + Reported by David Kastrup: + https://lists.gnu.org/archive/html/bug-bison/2011-10/msg00002.html. + + * data/yacc.c (YYBACKUP): Accept rhs size. + Restore the proper state value. + * TODO (YYBACKUP): Make it... + * tests/actions.at: a new test case. + * NEWS, THANKS: Update. + +2012-01-26 Akim Demaille + + maint: update TODO. + * TODO (Labeling the symbols): Remove, it's done ("Name references"). + +2012-01-26 Akim Demaille + + maint: update THANKS. + * THANKS: Update Tys's address, on his request. + +2012-01-26 Akim Demaille + + maint: fix --gcc-warnings support. + * configure.ac: Use enable_gcc_warnings instead of enableval, + which is valid only with AC_ARG_ENABLE. + +2012-01-26 Akim Demaille + + maint: silent-rules. + * configure.ac: Ask for silent-rules support. + Enable it by default. + +2012-01-26 Akim Demaille + + maint: remove trailing blanks. + * src/scan-code.l: Here. + +2012-01-26 Akim Demaille + + yacc: fix YYBACKUP. + Reported by David Kastrup: + https://lists.gnu.org/archive/html/bug-bison/2011-10/msg00002.html. + + * data/yacc.c (YYBACKUP): Accept rhs size. + Restore the proper state value. + * TODO (YYBACKUP): Make it... + * tests/actions.at: a new test case. + * NEWS, THANKS: Update. + +2012-01-25 Akim Demaille + + maint: update TODO. + * TODO (Labeling the symbols): Remove, it's done ("Name references"). + +2012-01-25 Akim Demaille + + maint: update THANKS. + * THANKS: Update Tys's address, on his request. + +2012-01-25 Akim Demaille + + maint: fix --gcc-warnings support. + * configure.ac: Use enable_gcc_warnings instead of enableval, + which is valid only with AC_ARG_ENABLE. + +2012-01-25 Akim Demaille + + maint: silent-rules. + * configure.ac: Ask for silent-rules support. + Enable it by default. + +2012-01-25 Paul Eggert + + tests: port to Solaris 10 'diff -u' + * tests/regression.at (parse-gram.y: LALR = IELR): Port to Solaris 10, + where "diff -u X X" outputs "No differences encountered" + instead of outputting nothing. Reported by Tomohiro Suzuki in + . + +2012-01-25 Jim Meyering + + build: avoid possibly-replaced fprintf in liby-source, yyerror.c + * lib/yyerror.c (yyerror): Use fputs and fputc rather than fprintf + with a mere "%s\n" format. Always return 0 now, on the assumption + that the return value was never used anyway. + Don't include after all. This avoids a problem + reported by Thiru Ramakrishnan in + http://lists.gnu.org/archive/html/help-bison/2011-11/msg00000.html + * cfg.mk: Exempt lib/yyerror.c from the sc_require_config_h_first test. + * THANKS: Update. + +2012-01-24 Paul Eggert + + tests: port to Solaris 10 'diff -u' + * tests/regression.at (parse-gram.y: LALR = IELR): Port to Solaris 10, + where "diff -u X X" outputs "No differences encountered" + instead of outputting nothing. Reported by Tomohiro Suzuki in + . + +2012-01-24 Jim Meyering + + maint: generate ChangeLog from git log + * Makefile.am (gen-ChangeLog): New rule. + (dist-hook): Depend on it. + (EXTRA_DIST): Distribute the two ChangeLog-* files. + * bootstrap.conf (gnulib_modules): Add gitlog-to-changelog. + (bootstrap_post_import_hook): Ensure that ChangeLog exists. + * build-aux/git-log-fix: New file. + * ChangeLog-2012: Renamed ... + * ChangeLog: ... from this. + * ChangeLog-1998: Renamed ... + * OChangeLog: ...from this + * .gitignore: Add ChangeLog. + +2012-01-24 Jim Meyering + + change more quotes in source, and adjust tests to match + Run this command to change each `%s' to '%s' in source directories: + git grep -l '`%s'\' src djgpp data \ + |xargs perl -pi -e '$q="'\''";s/`%s$q/$q%s$q/g' + * data/bison.m4: Affected per the above. + * djgpp/subpipe.c: Likewise. + * src/files.c: Likewise. + * src/getargs.c: Likewise. + * src/muscle-tab.c: Likewise. + * src/reader.c: Likewise. + * tests/glr-regression.at: Adjust to match. + * tests/input.at: Likewise. + * tests/push.at: Likewise. + * tests/skeletons.at: Likewise. + +2012-01-23 Jim Meyering + + quote consistently and make tests pass with new quoting from gnulib + Updating to gnulib pulled in new quote and quotarg modules, + by which quoting is now done like 'this' rather than `this'. + That change induces many "make check" test failures. This change + adapts code and tests so that "make check" passes once again. + * src/scan-code.l: Quote like 'this', not like `this'. + * src/scan-gram.l: Likewise. + * src/symtab.c: Likewise. + * tests/actions.at: Adjust tests to match. + * tests/input.at: Likewise. + * tests/named-refs.at: Likewise. + * tests/output.at: Likewise. + * tests/regression.at: Likewise. + * lib/.gitignore: Regenerate. + * m4/.gitignore: Likewise. + +2012-01-23 Jim Meyering + + build: avoid possibly-replaced fprintf in liby-source, yyerror.c + * lib/yyerror.c (yyerror): Use fputs and fputc rather than fprintf + with a mere "%s\n" format. Always return 0 now, on the assumption + that the return value was never used anyway. + Don't include after all. This avoids a problem + reported by Thiru Ramakrishnan in + http://lists.gnu.org/archive/html/help-bison/2011-11/msg00000.html + * cfg.mk: Exempt lib/yyerror.c from the sc_require_config_h_first test. + * THANKS: Update. + +2012-01-23 Jim Meyering + + build: update gnulib and autoconf submodules to latest (cherry picked from commit 728415f885e5cb8e518c8576fa6e1f541e384130) + +2012-01-23 Jim Meyering + + build: manually update bootstrap from gnulib, and adapt + Updating to the latest bootstrap from gnulib involves more of a + change than usual, and updating to the latest gnulib would involve + its own set of challenges with the upcoming quoting changes, so + we update bootstrap manually and separately. + * bootstrap: Update from gnulib. + * lib/Makefile.am: Initialize more variables to empty, so that gnulib.mk + can append to them with "+=". + * bootstrap.conf (gnulib_mk_hook): Remove. No longer honored. + (gnulib_tool_option_extras): Generate gnulib.mk. + +2012-01-23 Jim Meyering + + maint: include first + * cfg.mk (exclude_file_name_regexp--sc_require_config_h_first): + Exempt data/glr.c and data/yacc.c from the include-config.h-first + requirement. + +2012-01-23 Jim Meyering + + build: include from lib/yyerror.c + * lib/yyerror.c: Include . + +2012-01-23 Jim Meyering + + maint: list djgpp/subpipe.c in po/POTFILES.in + * po/POTFILES.in: Add djgpp/subpipe.c. + +2012-01-23 Jim Meyering + + maint: placate the space-TAB syntax-check + * cfg.mk (exclude_file_name_regexp--sc_space_tab): Exempt + tests/input.at and tests/c++.at, since they appear to use + SP-TAB sequences deliberately. + * OChangeLog: Remove space-before-TAB. + +2012-01-23 Jim Meyering + + doc: correct typo: s/can not/cannot/ + * doc/bison.texinfo (Bug Reports): s/can not/cannot/ + And remove trailing blanks. + +2012-01-23 Jim Meyering + + build: generalize etc/prefix-gnulib-mk + This script hard-coded "libbison" and lib/gnulib.mk. + Adjust the script to require a --lib-name=$gnulib_name option + and a FILE argument like lib/$gnulib_mk. + Also add support for --help and --version. + * etc/prefix-gnulib-mk: Generalize. + * bootstrap.conf (bootstrap_post_import_hook): Update its invocation. + +2012-01-22 Jim Meyering + + maint: get gpl-3.0 from gnulib + * bootstrap.conf (gnulib_modules): Add gpl-3.0. + * doc/gpl-3.0.texi: Remove from version control, now that + we get it via gnulib. + * doc/.gitignore: Ignore it. + +2012-01-20 Akim Demaille + + maint: be more robust to gnulib's FOO_H variables. + * configure.ac: Instead of listing gnulib's variables, look for + them among AC_SUBST variables. + +2012-01-20 Jim Meyering + + maint: generate ChangeLog from git log + * Makefile.am (gen-ChangeLog): New rule. + (dist-hook): Depend on it. + (EXTRA_DIST): Distribute the two ChangeLog-* files. + * bootstrap.conf (gnulib_modules): Add gitlog-to-changelog. + (bootstrap_post_import_hook): Ensure that ChangeLog exists. + * build-aux/git-log-fix: New file. + * ChangeLog-2012: Renamed ... + * ChangeLog: ... from this. + * ChangeLog-1998: Renamed ... + * OChangeLog: ...from this + * .gitignore: Add ChangeLog. + +2012-01-19 Jim Meyering + + change more quotes in source, and adjust tests to match + Run this command to change each `%s' to '%s' in source directories: + git grep -l '`%s'\' src djgpp data \ + |xargs perl -pi -e '$q="'\''";s/`%s$q/$q%s$q/g' + * data/bison.m4: Affected per the above. + * djgpp/subpipe.c: Likewise. + * src/files.c: Likewise. + * src/getargs.c: Likewise. + * src/muscle-tab.c: Likewise. + * src/reader.c: Likewise. + * tests/glr-regression.at: Adjust to match. + * tests/input.at: Likewise. + * tests/push.at: Likewise. + * tests/skeletons.at: Likewise. + +2012-01-19 Jim Meyering + + quote consistently and make tests pass with new quoting from gnulib + Updating to gnulib pulled in new quote and quotarg modules, + by which quoting is now done like 'this' rather than `this'. + That change induces many "make check" test failures. This change + adapts code and tests so that "make check" passes once again. + * src/scan-code.l: Quote like 'this', not like `this'. + * src/scan-gram.l: Likewise. + * src/symtab.c: Likewise. + * tests/actions.at: Adjust tests to match. + * tests/input.at: Likewise. + * tests/named-refs.at: Likewise. + * tests/output.at: Likewise. + * tests/regression.at: Likewise. + * lib/.gitignore: Regenerate. + * m4/.gitignore: Likewise. + +2012-01-19 Jim Meyering + + build: update gnulib and autoconf submodules to latest + +2012-01-19 Jim Meyering + + build: manually update bootstrap from gnulib, and adapt + Updating to the latest bootstrap from gnulib involves more of a + change than usual, and updating to the latest gnulib would involve + its own set of challenges with the upcoming quoting changes, so + we update bootstrap manually and separately. + * bootstrap: Update from gnulib. + * Makefile.am: Initialize more variables to empty, so that gnulib.mk + can append to them with "+=". + * bootstrap.conf (gnulib_mk_hook): Remove. No longer honored. + (bootstrap_post_import_hook): Instead, run the same command, + etc/prefix-gnulib-mk lib/$gnulib_mk, via slightly different API. + Temporarily disable "bootstrap_sync=true". + * etc/prefix-gnulib-mk: Don't prepend "lib/" to tokens like -I$(... + or "\". + +2012-01-19 Jim Meyering + + maint: include first + * cfg.mk (exclude_file_name_regexp--sc_require_config_h_first): + Exempt data/glr.c and data/yacc.c from the include-config.h-first + requirement. + +2012-01-19 Jim Meyering + + build: include from lib/yyerror.c + * lib/yyerror.c: Include . + +2012-01-19 Jim Meyering + + maint: list djgpp/subpipe.c in po/POTFILES.in + * po/POTFILES.in: Add djgpp/subpipe.c. + +2012-01-19 Jim Meyering + + maint: placate the space-TAB syntax-check + * cfg.mk (exclude_file_name_regexp--sc_space_tab): Exempt + tests/input.at and tests/c++.at, since they appear to use + SP-TAB sequences deliberately. + * OChangeLog: Remove space-before-TAB. + +2012-01-19 Jim Meyering + + maint: remove final trailing space + * src/scan-gram.l (%): Remove single space at end of line. + +2012-01-19 Jim Meyering + + maint: get gpl-3.0 from gnulib + * bootstrap.conf (gnulib_modules): Add gpl-3.0. + * doc/gpl-3.0.texi: Remove from version control, now that + we get it via gnulib. + * doc/.gitignore: Ignore it. + +2012-01-19 Jim Meyering + + doc: correct typo: s/can not/cannot/ + * doc/bison.texinfo (Bug Reports): s/can not/cannot/ + And remove trailing blanks. diff --git a/ChangeLog-1998 b/ChangeLog-1998 new file mode 100644 index 0000000..f34e2a3 --- /dev/null +++ b/ChangeLog-1998 @@ -0,0 +1,1500 @@ +1998-01-04 J.J. van der Heijden + + * src/files.c (openfiles) [_WIN32 && !__CYGWIN32__]: Use TEMP or + Temp to find a temporary directory, if possible. Do not unlink + files while they are open. + +1997-08-25 Richard Stallman + + * src/reader.c (stack_offset;): Change some warni to warns. + + * src/lex.c (literalchar): Use warns, not warni. + +1997-06-28 Richard Stallman + + * src/bison.simple: Add a Bison version comment. + + * Makefile.in (bison_version): New variable. + (dist): Use that variable. + (bison.s1): Substitute the Bison version into bison.simple. + + * src/main.c (fatal, warn, berror): Use program_name. + +1997-06-18 Richard Stallman + + * Makefile.in: new.h renamed to alloc.h. + * src/*.c: src/new.h renamed to src/alloc.h. + + * src/alloc.h: Renamed from src/new.h. + +1997-06-15 Richard Stallman + + * src/main.c (fatal, warn, berror): Make error messages standard. + (toomany): Improve error message text. + +1997-05-24 Richard Stallman + + * src/lex.c (literalchar): Fix the code for escaping \, " and '. + +1997-05-23 Richard Stallman + + * src/lex.c (lex): Avoid trouble when there are many chars + to discard in a char literal with just several chars in it. + +1997-05-17 Richard Stallman + + * src/bison.simple: Use malloc, if using alloca is troublesome. + (YYSTACK_USE_ALLOCA): New flag macro. + Define it for some systems and compilers. + (YYSTACK_ALLOC): New macro. + (yyparse): Use YYSTACK_ALLOC to allocate stack. + If it was malloc'd, free it. + +1997-05-02 Richard Stallman + + * src/bison.simple [_AIX]: Don't include malloc.h. + +1997-04-23 Richard Stallman + + * src/bison.simple (alloca) [__hpux]: Always define as + __builtin_alloca. + +1997-04-22 Richard Stallman + + * src/bison.simple (__yy_memcpy): Declare arg `count' as unsigned + int. + (yyparse): Cast third arg to __yy_memcpy to unsigned int. + + * src/bison.simple (alloca) [__hpux]: Include alloca.h (right for + HPUX 10) instead of declaring alloca (right for HPUX 9). + +1997-01-02 Richard Stallman + + * src/allocate.c [__STDC__ or _MSC_VER]: + Declare calloc and realloc to return void *. + + * Makefile.in (dist): Explicitly check for symlinks, and copy them. + +1996-12-17 Paul Eggert + + * src/bison.simple (yyparse): If __GNUC__ and YYPARSE_PARAM are + both defined, declare yyparse to have a void * argument. + +1996-12-17 Richard Stallman + + * src/system.h [_MSC_VER]: Include stdlib.h and process.h. + [_MSC_VER] (getpid): Define as macro--translate it to _getpid. + + * src/reduce.c (nbits): Add some casts. + + * src/main.c (main): Return FAILURE as a value. + (printable_version): Declare arg as int, not char. + + * src/files.c [_MSC_VER] (XPFILE, XPFILE1): Define, if not already + defined. + +1996-12-16 Richard Stallman + + * src/main.c (printable_version): Use type `int' for the arg. + +1996-08-12 Richard Stallman + + * src/bison.simple: Test _MSDOS as well as _MSDOS_. + +1996-07-31 Richard Stallman + + * src/bison.simple [__sun && __i386]: Include alloca.h. + +1996-07-30 Richard Stallman + + * src/bison.simple: Test _MSDOS_, not MSDOS. + +1996-06-01 Richard Stallman + + * All files: Insert `_' macro around many string constants. + + * src/system.h [HAVE_LOCALE_H]: Include locale.h. + [! HAVE_LOCALE_H] (setlocale): Define as no-op. + [ENABLE_NLS]: Include libintl.h. + [ENABLE_NLS] (gettext): Define. + [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions. + (N_, PACKAGE, LOCALEDIR): New macros. + + * src/main.c (main): Call setlocale, bindtextdomain and textdomain. + + * POTFILES.in: New file. + + * Makefile.in (allocate.o): Define target explicitly. + +1996-06-01 Jim Meyering + + * Makefile.in (CFLAGS): Set to @CFLAGS@. + (LDFLAGS): Set to @LDFLAGS@. + (configure): Run autoconf only if preceding `cd' succeeds. + (src/bison.s1): Redirect output to temporary file then move the + temporary to the target, rather than redirecting directly to + src/bison.s1. + (clean): Remove config.status and config.log. + (distclean): Don't remove config.status here. + +1996-05-12 Jim Meyering + + * src/bison.simple (__yy_memcpy) [__cplusplus]: Reorder declarations + of variables f and t. + +1996-05-11 Richard Stallman + + * Version 1.25 released. + + * Makefile.in (dist): Don't use $(srcdir). + + * src/bison.simple (__yy_memcpy): Really reorder the args, as was + supposedly done on Feb 14 1995. + (yyparse): Calls changed accordingly. + +1996-01-24 Richard Stallman + + * src/output.c (output_rule_data): Test YYERROR_VERBOSE in the + conditional around the definition of ttyname. + +1995-12-28 Richard Stallman + + * src/bison.simple: Fix line numbers in #line commands. + +1995-12-24 Richard Stallman + + * src/bison.simple (YYPARSE_PARAM_DECL): In C++, make it always + null. + (YYPARSE_PARAM_ARG): New macro. + (yyparse): Use YYPARSE_PARAM_ARG. + +1995-10-15 Richard Stallman + + * src/version.c: Version now 1.25. + + * src/main.c (warn): Set `failure'. + +1995-08-01 Wilfred J. Hansen + + * src/bison.cld, src/getargs.c, src/vmsgetargs.c: Added -n, -k, + and -raw switches. + (noparserflag, toknumflag, rawtoknumflag): New variables. + + * src/conflicts.c (resolve_sr_conflict): Remove use of alloca. + + * src/files.c (openfiles, open_extra_files, done): Add faction flag + and actfile file. Handle noparserflag. Both for -n switch. + + * src/lex.c: Include getopt.h. Add some extern decls. + (safegetc): New function to deal with EOF gracefully. + (literalchar); new function to deal with reading \ escapes. + (lex): Use literalchar. + (lex): Implemented "..." tokens. + (literalchar, lex, parse_percent_token): Made tokenbuffer + always contain the token. This includes growing the token + buffer while reading an integer. + (parse_percent_token): Replaced if-else statement with percent_table. + (parse_percent_token): Added % declarations as another + way to specify the flags -n, -l, and -r. Also added hooks for + -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires + major changes to src/files.c. + (lex) Retain in the incoming stream a character following + an incorrect '/'. + (skip_white_space, lex): Revised most error messages + and changed fatal to warn to avoid aborting. + (percent_table): Added %thong declarations. + + * src/lex.h: Added THONG and NOOP for alias processing. + Added SETOPT for the new code that allows setting options with %flags. + + * src/main.c (main): If reader sees an error, don't process the + grammar. + (fatals): Updated to not use VARARGS1. + (printable_version, int_to_string, warn, warni, warns, warnss) + (warnsss): New error reporting functions. Avoid abort for error. + + * src/output.c (output_headers, output_trailers, output, output_gram) + (output_rule_data): Implement noparserflag variable. + Implement toknumflag variable. + (output): Call reader_output_yylsp to output LTYPESTR. + + * src/reader.c (reader_output_yylsp): New function. + (readgram): Use `#if 0' around code that accepted %command inside + grammar rules: The documentation doesn't allow it, and it will + fail since the %command processors scan for the next %. + (parse_token_decl): Extended the %token declaration to allow a + multi-character symbol as an alias. + (parse_thong_decl): New function. + (read_declarations): Added %thong declarations. + (read_declarations): Handle NOOP to deal with allowing % + declarations as another means to specify the flags. + (readgram): Allow %prec prior to semantics embedded in a rule. + (skip_to_char, read_declarations, copy_definition) + (parse_token_decl, parse_start_decl, parse_type_decl) + (parse_assoc_decl, parse_union_decl, parse_expect_decl) + (get_type_name, copy_guard, copy_action, readgram) + (get_type, packsymbols): Revised most error messages. Changed + `fatal' to `warnxxx' to avoid aborting for error. Revised and use + multiple warnxxx functions to avoid using VARARGS1. + (read_declarations): Improve the error message for an invalid + character. Do not abort. + (read_declarations, copy_guard, copy_action): Use + printable_version to avoid unprintable characters in printed + output. + (parse_expect_decl): Error if argument to %expect exceeds 10 + digits. + (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type): + Allow the type of a non-terminal can be given more than once, as + long as all specifications give the same type. + + * src/reduce.c (reduce_grammar): Revise an error message. + (print_notices): Remove final `.' from error message. + + * src/symtab.h (SALIAS): New #define for adding aliases to %token. + (struct bucket): Added `alias' field. + +1995-05-03 Richard Stallman + + * src/bison.simple: Change distribution terms. + + * src/version.c: Version now 1.23. No, 1.24. + +1995-02-23 Richard Stallman + + * src/files.c: Test __VMS_POSIX as well as VMS. + +1995-02-14 Jim Meyering + + * src/bison.simple (__yy_memcpy): Renamed from __yy_bcopy to avoid + confusion. Reverse FROM and TO arguments to be consistent with + those of memcpy. + +1994-11-10 David J. MacKenzie + + * Makefile.in (DISTFILES): Include install-sh, not install.sh. + Include NEWS. + + * configure.in: Update to Autoconf v2 macro names. + +1994-10-04 David J. MacKenzie + + * Makefile.in (prefix, exec_prefix): Let configure set them. + +1994-09-28 David J. MacKenzie + + * Makefile.in: Set datadir to $(prefix)/share. + +1994-07-12 Richard Stallman + + * src/reader.c (reader): Rename undefined-token token to + `$undefined.'. + +1994-05-05 David J. MacKenzie + + * Makefile.in (DISTFILES): Add install.sh. + (install): Remove chmod commands. + +1994-03-26 Richard Stallman + + * src/bison.simple: Fix #line commands. + +1994-03-24 Richard Stallman + + * src/conflicts.c (print_reductions): Increment both fp1 and fp2 + while printing reductions in multi-rule case. + +1994-01-02 Richard Stallman + + * Makefile.in (LDFLAGS): Make it empty by default. + (bison): Use CFLAGS. + +1993-11-21 Richard Stallman + + * src/bison.simple (YYLEX): Take notice of YYLEX_PARAM. + +1993-10-18 Richard Stallman + + * src/bison.simple (YYPARSE_PARAM_DECL): Always define this. + +1993-10-14 Richard Stallman + + * src/bison.simple (yyparse): Support YYPARSE_PARAM. + +1993-09-13 Noah Friedman + + * Makefile.in (check): New target. + +1993-09-10 Richard Stallman + + * src/conflicts.c (alloca): #undef before defining. + + * src/system.h (bcopy): Don't define if already defined. + +1993-09-06 Noah Friedman + + * Version 1.22 released. + + * mkinstalldirs: New file. + + * Makefile.in (dist): Use .gz for extension, not .z. + (DISTFILES): New variable. + (dist): Use it instead of explicit file list. + Try to link each file separately, then copy file if ln fails. + (installdirs): Use mkinstalldirs script. + +1993-07-29 David J. MacKenzie + + * Makefile.in (config.status): Run config.status --recheck, not + configure, to get the right args passed. + +1993-07-24 Richard Stallman + + * src/bison.simple (yyparse): Init yychar1 to avoid warning. + +1993-07-04 Richard Stallman + + * src/bison.simple (yyparse): Don't set yyval when yylen is 0. + +1993-06-26 David J. MacKenzie + + * src/getargs.c (getargs): Exit after printing the version number. + Add --help and -h options. + (usage): New function. + +1993-06-25 Richard Stallman + + * src/getargs.c (longopts): Allow `output' as an alternative. + +1993-06-16 Richard Stallman + + * src/bison.simple (yyparse): Conditionalize the entire call to + yyoverflow, not just two arguments in it. + +1993-06-03 Richard Stallman + + * src/bison.simple [__hpux] (alloca): Don't specify arg types. + +1993-05-07 Noah Friedman + + * Makefile.in (install): Depend on `uninstall' and `installdirs'. + (installdirs): New target. + +1993-04-28 Noah Friedman + + * src/reader.c: Remove declaration of atoi. + +1993-04-23 Noah Friedman + + * src/new.h [!__STDC__] (FREE): Check x != 0. + Make expr to call `free' evaluate to 0. + +1993-04-20 David J. MacKenzie + + * src/files.c [MSDOS]: Use xmalloc, not malloc. + * src/allocate.c (xmalloc): Renamed from mallocate. Remove old + wrapper. + * src/conflicts.c, src/symtab.c, src/files.c, src/LR0.c, + src/new.h: Change callers. + * src/allocate.c (xrealloc): New function. + * src/new.h: Declare it. + * src/lex.c, src/reader.c: Use it. + +1993-04-18 Noah Friedman + + * Version 1.21 released. + + * src/reader.c : Don't declare `realloc'. + + * Makefile.in (bison.s1): use `rm -f' since it's quieter. + (dist): make gzipped tar file. + +1993-04-16 Noah Friedman + + * Makefile.in (Makefile, config.status, configure): New targets. + +1993-04-15 Richard Stallman + + * src/main.c: Don't declare `abort'. + + * src/files.c: Don't declare `exit'. + +1993-04-15 Noah Friedman + + * configure.in: Add AC_CONST. + +1993-04-14 Richard Stallman + + * Makefile.in (all): Depend on bison.s1. + +1993-04-13 Richard Stallman + + * Version 1.20 released. + +1993-03-24 Richard Stallman + + * src/output.c (output_headers): Rename yynerrs if -p. + +1993-03-18 Noah Friedman + + * src/system.h: Don't try to include stdlib.h unless HAVE_STDLIB_H + is defined. + + * configure.in: Check for stdlib.h. + +1993-03-17 Richard Stallman + + * src/bison.simple [__hpux, not __GNUC__]: Declare alloca. + (yyparse): When printing the expected token types for an error, + Avoid negative indexes in yycheck and yytname. + +1993-03-13 Richard Stallman + + * Makefile.in (files.o, .c.o): Put CPPFLAGS and CFLAGS last. + +1993-03-01 Richard Stallman + + * src/bison.simple: Test __sgi like __sparc. + +1993-02-17 Richard Stallman + + * src/conflicts.c (resolve_sr_conflict): Add extra parens in + alloca call. + + * src/bison.simple [__GNUC__] (yyparse): Declare with prototype. + +1993-01-15 Richard Stallman + + * src/conflicts.c (print_reduction): Near end, increment fp2 when + mask recycles. + +1993-01-13 Richard Stallman + + * Makefile.in (bison.s1): New target. Modifies bison.simple. + (install): Install bison.s1, without changing it. + (clean): Delete bison.s1. + +1993-01-04 Richard Stallman + + * src/reader.c (reader): Put Bison version in comment in output + file. + +1992-12-22 Richard Stallman + + * src/files.c (openfiles): Use .output, not .out, for outfile, + regardless of spec_name_prefix. + +1992-12-15 Richard Stallman + + * src/output.c (output_gram): Include yyrhs in the same #if as + yyprhs. + +1992-12-15 Noah Friedman + + * src/output.c (output): output directives checking for + __cplusplus as well as __STDC__ to determine when to define + "const" as an empty token. (Patch from Wolfgang Glunz + ) + +1992-12-08 David J. MacKenzie + + * src/system.h, src/conflicts.c: Replace USG with HAVE_STRING_H + and HAVE_MEMORY_H. + +1992-11-21 David J. MacKenzie + + * Makefile.in: Set and use $(MAKEINFO). + +1992-11-20 Richard Stallman + + * src/files.c (done) [MSDOS]: Delete the tmpdefsfile with the + rest. + +1992-10-08 Richard Stallman + + * Makefile.in (dist): Put configure.bat in the distribution. + +1992-10-01 David J. MacKenzie + + * Makefile.in (install): cd to $(srcdir) before installing info + files. + +1992-09-30 Richard Stallman + + * Makefile.in (files.o): Supply $(DEFS), and $(CPPFLAGS). + +1992-09-25 Richard Stallman + + * Version 1.19 released. + + * src/reader.c (parse_union_decl): Fix ending of C++ comment; + don't lose the char after the newline. + + * configure.bat: New file. + +1992-09-24 Richard Stallman + + * src/conflicts.c: Check for using alloca.h as getopt.c does. + +1992-09-06 Karl Berry + + * src/files.c (openfiles): open `fdefines' after we have assigned + a name to `tmpdefsfile', and only if `definesflag' is set. + (done): only create the real .tab.h file if `definesflag' is set. + * src/reader.c (packsymbols): don't close `fdefines' here. + +1992-09-05 Richard Stallman + + * src/files.c (openfiles): Open fdefines as temp file, like + ftable. + (done): Copy temp defines file to real one, like main output file. + +1992-08-21 Richard Stallman + + * Makefile.in (dist): Don't release mergedir.awk + (install): Use sed, not awk. Don't depend on mergedir.awk. + * mergedir.awk: File effectively deleted. + +1992-07-29 Richard Stallman + + * src/bison.simple: Test __sparc along with __sparc__. + +1992-07-11 Richard Stallman + + * src/lex.c (skip_white_space): Count \n just once at end of c++ + comment. + +1992-06-26 Richard Stallman + + * src/bison.simple: Comment fix; #line command updated. + +1992-06-24 Richard Stallman + + * Makefile.in (install): Specify full new file name for the + executable. + +1992-06-22 Richard Stallman + + * Makefile.in (dist): Include bison.rnh in distribution. + +Sun Jun 21 22:42:13 1992 Eric Youngdale + + Clean up rough edges in VMS port of bison, add support for + remaining command line options. + + * src/bison.cld: Add /version, /yacc, /file_prefix, and + /name_prefix switches. + + * src/build.com: General cleanup: add logic to automatically sense + which C compiler is present; add code to cwd to the directory that + contains bison sources; do not define XPFILE, XPFILE1 + (correct defaults are applied in src/file.c). + + * src/files.c: Append _tab, not .tab when using /file_prefix under + VMS. + + * src/system.h: Include string.h instead of strings.h (a la USG). + + * src/vmsgetargs.c: Add support for all switches added to + src/bison.cld. + +1992-06-21 Richard Stallman + + * Makefile.in (install): Always specify new file name for install. + Redirect awk output to temp file and install that. + +1992-05-27 Richard Stallman + + * src/bison.simple (yyparse): Make yybackup and yyerrlab1 always + be used. + +1992-05-22 Richard Stallman + + * Makefile.in (dist): Depend on bison.info + (bison.info): Delete spurious <. + +1992-05-17 Richard Stallman + + * Makefile.in (.c.o): New rule. Use $(DEFS) directly. + (CFLAGS): Use just -g by default. + (CDEBUG): Variable deleted. + +1992-05-07 Richard Stallman + + * src/reader.c (copy_guard): Fix typo skipping comment. + +1992-05-04 Richard Stallman + + * Version 1.18. + + * src/getargs.c (getargs): Change '0' to 0 in case for long + options. + +1992-04-19 Richard Stallman + + * src/reader.c (packsymbols): Handle -p when declaring yylval. + +1992-04-18 Richard Stallman + + * src/output.c (output_gram): Output #endif properly at end of + decl. + +1992-03-30 Richard Stallman + + * Version 1.17. + + * Makefile.in (clean): Don't delete configuration files or TAGS. + (distclean): New target; do delete those. + +1992-03-28 Richard Stallman + + * src/output.c (output_gram): Conditionalize yyprhs on YYDEBUG. + + * src/LR0.c (augment_automaton): If copying sp->shifts to insert + new shift, handle case of inserting at end. + +1992-03-21 Richard Stallman + + * src/lex.c (skip_white_space): Handle C++ comments. + * src/reader.c (copy_definition, parse_union_decl, copy_guard): + (copy_action): Likewise. + +1992-03-08 Richard Stallman + + * src/bison.simple (YYPOPSTACK): Fix typo. + +1992-02-29 Richard Stallman + + * Makefile.in (install): Install bison.info* files one by one. + +1992-02-28 David J. MacKenzie + + * src/bison.1: Document long options as starting with `--', not + `+'. + +1992-02-01 Richard Stallman + + * src/getargs.c (getargs): Accept value 0 from getopt_long. + +1992-01-30 Richard Stallman + + * Makefile.in (mostlyclean): Renamed from `clean'. + (clean): Renamed from 'distclean'. Dep on mostlyclean, not + realclean. + (realclean): Dep on clean. + +1992-01-27 Richard Stallman + + * src/bison.simple: Use malloc, not xmalloc, and handle failure + explicitly. + +1992-01-26 Richard Stallman + + * src/conflicts.c (total_conflicts): Delete unused arg to fprintf. + +1992-01-21 Richard Stallman + + * Version 1.16. + +1992-01-06 Richard Stallman + + * Makefile (distclean): Depend on clean, not realclean. Don't rm + TAGS. + (realclean): rm TAGS here. + + * src/symtab.c (free_symtab): Don't free the type names. + +1991-12-29 Richard Stallman + + * src/machine.h: MSDOS has 32-bit ints if __GO32__. + +1991-12-25 David J. MacKenzie + + * src/bison.simple [_AIX]: Indent `#pragma alloca', so old C + compilers don't choke on it. + +1991-12-23 Richard Stallman + + * src/getopt.c, src/getopt1.c, src/getopt.h: Link them to standard + source location. + * src/alloca.c: Likewise. + * Makefile.in (dist): Copy those files from current dir. + + * src/getargs.c: Update usage message. + + * src/LR0.c (augment_automaton): Put new shift in proper order. + +1991-12-20 Richard Stallman + + * src/conflicts.c: Use memcpy if ANSI C library. + + * src/closure.c (set_fderives): Delete redundant assignment to + vrow. + + * src/closure.c (print_firsts): Fix bounds and offset checking + tags. + + * src/closure.c (tags): Declare just once at start of file. + + * src/LR0.c (allocate_itemsets): Eliminate unused var max. + (augment_automaton): Test sp is non-null. + + * src/lalr.c (initialize_LA): Make the vectors at least 1 element + long. + + * src/reader.c (readgram): Remove separate YYSTYPE default for + MSDOS. + +1991-12-18 Richard Stallman + + * src/print.c (print_grammar): Don't print disabled rules. + +1991-12-17 Richard Stallman + + * src/lex.c (lex): Parse hex escapes properly. + Handle \v when filling token_buffer. + + * src/lex.c: Include new.h. + (token_buffer): Change to a pointer. + (init_lex): Allocate initial buffer. + (grow_token_buffer): New function. + (lex, parse_percent_token): Use that. + + * src/reader.c (read_declarations): Call open_extra_files just + once. + (parse_token_decl): Don't free previous typename value. Don't + increment nvars if symbol is already a nonterminal. + (parse_union_decl): Catch unmatched close-brace. + (parse_expect_decl): Null-terminate buffer. + (copy_guard): Set brace_flag for {, not for }. + + * src/reader.c: Fix %% in calls to fatal. + + * src/reader.c (token_buffer): Just one extern decl, at top level. + Declare as pointer. + + * src/symtab.c (free_symtab): Free type_name fields. Free symtab + itself. + +1991-11-25 Richard Stallman + + * src/bison.simple: Handle alloca for AIX. + + * Makefile.in (mandir): Compute default using manext. + +1991-11-02 David J. MacKenzie + + * Update all files to GPL version 2. + +1991-09-06 Richard Stallman + + * src/bison.simple (__yy_bcopy): Use builtin if GCC version 2. + +1991-08-26 Richard Stallman + + * src/reader.c (parse_assoc_decl): Error if same symbol gets two + precs. + +1991-08-26 David J. MacKenzie + + * Makefile.in, configure: Only put $< in Makefile if using VPATH, + because older makes don't understand it. + +1991-08-23 David J. MacKenzie + + * src/conflicts.c [_AIX]: #pragma alloca. + * src/reduce.c: Don't define TRUE and FALSE if already defined. + +1991-08-12 Richard Stallman + + * Makefile.in: Add deps on system.h. + (install): Add some deps. + +1991-08-02 David J. MacKenzie + + * Makefile.in (dist): Include texinfo.tex. + + * configure: Create config.status. Remove it and Makefile if + interrupted while creating them. + +1991-08-01 David J. MacKenzie + + * configure: Check for +srcdir etc. arg and look for + Makefile.in in that directory. Set VPATH if srcdir is not `.'. + * Makefile.in (prefix): Renamed from DESTDIR. + +1991-07-31 Richard Stallman + + * src/print.c (print_grammar): Make output prettier. Break lines. + +1991-07-30 Richard Stallman + + * src/print.c (print_grammar): New function. + (verbose): Call it instead of printing token names here. + +1991-07-22 Richard Stallman + + * src/vmsgetargs.c (spec_name_prefix, spec_file_prefix): Define + variables. + +1991-07-10 David J. MacKenzie + + * configure, Makefile.in: $(INSTALLPROG) -> $(INSTALL), + $(INSTALLTEXT) -> $(INSTALLDATA). + +1991-07-09 David J. MacKenzie + + * src/bison.simple: Don't include malloc.h if __TURBOC__. + +1991-07-06 David J. MacKenzie + + * Replace Makefile with configure and Makefile.in. Update README + with current compilation instructions. + +1991-07-01 Richard Stallman + + * src/reader.c (reader): Make the output define YYBISON. + +1991-06-20 David J. MacKenzie + + * Makefile (MANDIR, MANEXT): Install man page in + /usr/local/man/man1/bison.1 by default, instead of + /usr/man/manl/bison.l, for consistency with other GNU programs. + * Makefile: Rename BINDIR et al. to lowercase to conform to + GNU coding standards. + (install): Make man page non-executable. + +1991-05-31 Richard Stallman + + * Makefile (bison.info): New target. + (realclean): New target. + +1991-05-02 Richard Stallman + + * src/bison.simple: Use YYPRINT to print a token, if it's defined. + +1991-04-29 Richard Stallman + + * src/lalr.c (transpose): Rename R to R_arg. + (initialize_LA): Avoid shadowing variable j. + + * src/reader.c (packsymbols): Avoid shadowing variable i. + + * src/files.c: Declare exit and perror. + + * src/machine.h: Define MAXSHORT and MINSHORT for the eta-10. + +1991-04-02 Richard Stallman + + * src/allocate.c (mallocate): Always allocate at least one byte. + +1991-03-19 Richard Stallman + + * Makefile (dist): Put alloca.c into distribution. + +1991-03-06 Richard Stallman + + * src/print.c (print_actions): Nicer output for final states. + +1991-02-21 Richard Stallman + + * src/output.c (output_rule_data): Break lines in yytline based on + hpos. + +1991-02-07 Richard Stallman + + * src/bison.simple (yyparse): Move decl of yylsa before use. + +1991-01-15 Richard Stallman + + * Version 1.14. + + * src/output.c (output_rule_data): Handle NULL in tags[i]. + +1991-01-11 Richard Stallman + + * src/bison.simple: On MSDOS, include malloc.h. + +1990-12-29 David J. MacKenzie + + * src/files.c: Use `mallocate' instead of `xmalloc' so no extra + decl is needed. + +1990-12-19 Richard Stallman + + * src/reader.c (readgram): Alternate YYSTYPE defn for MSDOS. + * src/files.c [MSDOS]: Declare xmalloc. + +1990-12-13 Richard Stallman + + * src/output.c (output_rule_data): Put all symbols in yytname. + + * src/bison.simple (yyparse): Delete extra fprintf arg + when printing a result of reduction. + +1990-12-10 Richard Stallman + + * src/reader.c (packsymbols): Don't declare yylval if pure_parser. + +1990-10-30 Richard Stallman + + * Version 1.12. + + * src/LR0.c (augment_automaton): Fix bugs adding sp2 to chain of + shifts. + +1990-10-23 Richard Stallman + + * src/bison.simple: Don't define alloca if already defined. + +1990-10-21 Richard Stallman + + * src/getopt.c: On VMS, use string.h. + + * src/main.c (main): Return type int. + +1990-09-10 Richard Stallman + + * src/output.c (output_headers): Output macro defs for -p. + + * src/reader.c (readgram): Handle consecutive actions. + + * src/getargs.c (getargs): Rename -a to -p. + * src/files.c (openfiles): Change names used for -b. + +1990-08-27 Richard Stallman + + * src/reduce.c (reduce_grammar_tables): Don't map rlhs of disabled + rule. + +1990-08-26 Richard Stallman + + * src/closure.c (print_firsts, print_fderives): Use BITISSET to + test bits. + +1990-08-23 Richard Stallman + + * src/closure.c (print_firsts): vrowsize => varsetsize. + (print_fderives): rrowsize => rulesetsize. + +1990-08-10 Richard Stallman + + * src/bison.simple (alloca): Don't define if already defined. + (__yy_bcopy): Alternate definition for C++. + +1990-07-11 David J. MacKenzie + + * src/getargs.c (getargs): Mention +yacc in usage message. + +1990-07-10 Richard Stallman + + * src/reader.c (parse_token_decl, copy_action): Set + value_components_used if appropriate. + (readgram): Inhibit output of YYSTYPE definition in that case. + +1990-06-30 Richard Stallman + + * src/output.c (output_parser): Define YYPURE if pure, and not + otherwise. Don't define YYIMPURE. + * src/bison.simple: Adjust conditionals accordingly. + * src/bison.simple (YYLEX): If locations not in use, don't pass + &yylloc. + +1990-06-28 Richard Stallman + + * src/getargs.c (longopts): Add `yacc'. + +1990-06-28 David J. MacKenzie + + * src/getargs.c (getargs): Add long options. + * Makefile: Link with getopt1.o and add getopt1.c and getopt.h to + dist. + + * Move version number and description back into version.c from + Makefile and getargs.c. + * Makefile (dist): Extract version number from version.c. + +1990-06-26 Richard Stallman + + * src/output.c (output): Always call output_gram. + * src/bison.simple (yyparse): Print rhs and lhs symbols of + reduction rule. + +1990-06-21 David J. MacKenzie + + * src/main.c: New global var `program_name' to hold argv[0] for + error messages. + * src/allocate.c, src/files.c, src/getargs.c, src/reader.c: Use + `program_name' in messages instead of hardcoded "bison". + +1990-06-20 David J. MacKenzie + + * Makefile: Specify Bison version here. Add rule to pass it to + version.c. Encode it in distribution directory and tar file names. + * src/version.c: Use version number from Makefile. + * src/getargs.c (getargs): Print additional text that used to be + part of version_string in version.c. Use -V instead of -version + to print Bison version info. Print a usage message and exit if + given an invalid option. + +1990-06-19 Richard Stallman + + * src/bison.simple: Fix a #line. + + * Makefile (INSTALL): New parameter. + (install): Use that. + (CFLAGS): Move definition to top. + +1990-06-17 Richard Stallman + + * src/reader.c (parse_type_decl): Ignore semicolon. + Remove excess % from error messages. + +1990-06-16 Richard Stallman + + * Version 1.11. + + * Makefile (install): Ensure installed files readable. + +Tue Jun 12 12:50:56 EDT 1990 Jay Fenlason + + * src/getargs.c: Declare spec_file_prefix + + * src/lex.c (lex): \a is '\007' instead of '007' + + * src/reader.c: include machine.h + + * src/files.h: Declare extern spec_name_prefix. + + Trivial patch from Thorsten Ohl + +1990-05-31 Richard Stallman + + * Version 1.10. + + * src/bison.simple (YYBACKUP, YYRECOVERING): New macros. + (YYINITDEPTH): This is what used to be YYMAXDEPTH. + (YYMAXDEPTH): This is what used to be YYMAXLIMIT. + If the value is 0, use the default instead. + (yyparse): Return 2 on stack overflow. + +1990-05-30 Richard Stallman + + * src/bison.simple (YYERROR): Jump to new label; don't print error + message. + (yyparse): Define label yyerrlab1. + +1990-05-16 Richard Stallman + + * src/files.c (openfiles): Support -b. + * src/getargs.c (getargs): Likewise. + + * src/reader.c (readgram): Error if too many symbols. + + * src/lex.c (lex): Handle \a. Make error msgs more reliable. + * src/reader.c (read_declarations): Make error msgs more reliable. + +1990-05-13 Richard Stallman + + * Version 1.09. + + * src/reduce.c (reduce_grammar_tables): Fix backward test. + +1990-05-12 Richard Stallman + + * Makefile (bison-dist.*): Rename targets and files to bison.*. + (bison.tar): Make tar file to unpack into subdirectory named `bison'. + +1990-04-30 Richard Stallman + + * src/reduce.c (reduce_grammar_tables): Set rlhs to -1 for useless + rules. + * src/nullable.c (set_nullable): Ignore those rules. + * src/derives.c (set_derives): Likewise. + +1990-04-23 Richard Stallman + + * src/bison.simple (yyparse): Mention rule number as well as line + number. + +1990-03-29 Richard Stallman + + * src/bison.simple (__yy_bcopy): New function. + (yyparse): Use that, not bcopy. + +1990-03-28 Richard Stallman + + * src/print.c (print_actions): Don't alter i and j spuriously when + errp==0. + +1990-03-12 Jim Kingdon + + * src/bison.simple [__GNUC__]: Use builtin_alloca. + +1990-03-07 Richard Stallman + + * Makefile (install): Use mergedir.awk to process bison.simple + for installation. + + * src/bison.simple (yyparse): New feature to include possible valid + tokens in parse error message. + +1990-03-03 Richard Stallman + + * Version 1.08. + +1990-02-26 Jim Kingdon + + * src/print.c (print_actions) + * src/conflicts.c (print_reductions): Change "shift %d" to + "shift, and go to state %d" and "reduce %d" to "reduce using rule %d" + and "goto %d" to "go to state %d". + * src/print.c (print_core): Change "(%d)" to "(rule %d)". + +1990-02-20 Jay Fenlason + + * src/bison.simple: Comment out unused yyresume: label. + +1990-02-09 Jay Fenlason + + * src/bison.simple : surround all declarations and (remaining) + uses of yyls* and yylloc with #ifdef YYLSP_NEEDED This will + significantly cut down on stack usage, and gets rid of + unused-variable msgs from GCC. + +1990-01-31 Richard Stallman + + * src/files.c (done) [VMS]: Don't delete files that weren't used. + [VMS]: Let user override XPFILE and XPFILE1. + +1990-01-03 Richard Stallman + + * Version 1.07. + +1989-12-16 Richard Stallman + + * src/gram.c (dummy): New function. + + * src/reader.c (readgram): Detect error if two consec actions. + +1989-11-15 Richard Stallman + + * src/reduce.c (reduce_grammar_tables): Update rline like other + tables. + + * Makefile (install): Install the man page. + +1989-11-11 Richard Stallman + + * src/output.c (output_rule_data): Write #if YYDEBUG around yyrline. + +1989-10-18 Richard Stallman + + * Version 1.06. + + * src/vmsgetargs.c (getargs): Downcase specified output file name. + +1989-10-13 Richard Stallman + + * src/reader.c (readgram): Warn if there is no default to use for + $$ and one is needed. + +1989-09-29 Richard Stallman + + * Version 1.05. + + * src/vmsgetargs.h (getargs): Process outfile option. + +1989-09-08 Richard Stallman + + * Version 1.04. + + * src/reader.c (parse_union_decl): Count newlines even in + comments. + +1989-09-06 Richard Stallman + + * src/files.c (openfiles): short_base_length was always == + base_length. + +1989-08-24 Richard Stallman + + * Version 1.03. + + * src/files.c (openfiles): Write output into same dir as input, by + default. + +1989-08-23 Jay Fenlason + + * Makefile: Include system.h in bison-dist.tar + +1989-08-15 Richard Stallman + + * version 1.03. + + * src/reader.c (reader): Output LTYPESTR to fdefines + only after reading the grammar. + +1989-08-06 Richard Stallman + + * src/reader.c (read_declarations): Put space before comment + to avoid bug in Green Hills C compiler. + +1989-06-19 Richard Stallman + + * src/allocate.c (xmalloc): New function. + +1989-06-16 Richard Stallman + + * src/build.com: Compile and link reduce.c. + +1989-06-09 Richard Stallman + + * src/reduce.c (reduce_grammar_tables): Adjust start_symbol when + #s change. + +1989-05-27 Richard Stallman + + * src/reader.c (copy_definition, copy_guard): Don't object to + \-newline inside strings. + +1989-05-22 Richard Stallman + + * src/files.c (openfiles): Alternate file names for MSDOS. + (open_extra_files): Likewise. + (done): On MSDOS, unlink temp files here, not in openfiles. + + * src/machine.h (BITS_PER_WORD): 16 on MSDOS. + (MAXTABLE): Now defined in this file. + + * src/system.h: New file includes system-dependent headers. + All relevant .c files include it. + +1989-04-27 Richard Stallman + + * src/version.c: Version 1.01. + +1989-04-18 Randall Smith + + * src/conflicts.c (total_conflicts): Fixed typo in yacc style + output; mention conflicts if > 0. + +1989-04-15 Richard Stallman + + * src/reader.c (packsymbols): Start new symbols after 256. + +1989-04-12 Richard Stallman + + * src/reader.c (reader): Always assign code 256 to `error' token. + Always set `translations' to 1 so this code gets handled. + * src/bison.simple (YYERRCODE): Define it. + +1989-04-11 Richard Stallman + + * src/conflicts.c: If GNU C, use builtin alloca. + + * Makefile (install): Delete parser files before copying them. + +1989-03-30 Richard Stallman + + * src/getargs.c (getargs): Turn off checking of name Bison was + invoked by. + + * Makefile (dist): Include ChangeLog in distrib. + +1989-03-23 Jay Fenlason + + * src/LR0.c src/closure.c src/conflicts.c src/derives.c + src/files.c src/getargs.c src/lalr.c src/lex.c src/main.c + src/nullable.c src/output.c src/print.c src/reader.c src/reduce.c + src/symtab.c src/warshall.c: A first pass at getting gcc -Wall to + shut up. Mostly declared functions as void, etc. + + * src/reduce.c moved 'extern int fixed_outfiles;' into print_notices + where it belongs. + +1989-03-01 Randall Smith + + * src/types.h, src/symtab.h, src/state.h, src/new.h, + src/machine.h, src/lex.h, src/gram.h, src/files.h, src/closure.c, + src/vmsgetargs.c, src/warshall.c, src/symtab.c, src/reduce.c, + src/reader.c, src/print.c, src/output.c, src/nullable.c, + src/main.c, src/lex.c, src/lalr.c, src/gram.c, src/getargs.c, + src/files.c, src/derives.c, src/conflicts.c, src/allocate.c, + src/LR0.c, Makefile, src/bison.simple: Changed copyright notices + to be in accord with the new General Public License. + * COPYING: Made a link to the new copying file. + +1989-02-22 Richard Stallman + + * src/new.h (FREE): Alternate definition for __STDC__ avoids error + if `free' returns void. + +1989-02-21 Richard Stallman + + * src/reader.c (read_declarations): Double a `%' in a format string. + (copy_definition, parse_start_decl, parse_token_decl): Likewise. + (parse_type_decl, parse_union_decl, copy_guard, readgram, get_type). + (copy_action): change a `fatal' to `fatals'. + + * src/lalr.c (map_goto): Initial high-end of binary search was off + by 1. + +1989-02-18 Richard Stallman + + * src/bison.simple [sparc]: Include alloca.h. + +1989-02-15 Richard Stallman + + * src/reader.c (packsymbols): Write decl of yylval into .tab.h file. + +1989-01-28 Richard Stallman + + * src/bison.simple: Avoid comments on `#line' lines. + + * src/reader.c (LTYPESTR): Rearrange to avoid whitespace after + \-newline. + +1989-01-09 Richard Stallman + + * src/conflicts.c (total_conflicts): if -y, use output syntax + POSIX wants. + * src/reduce.c (print_notices): likewise. + + * src/lex.c (lex): Handle \v, and \x hex escapes. + + * src/reader.c (reader): Merge output_ltype into here. Don't + output YYLTYPE definition to .tab.h file unless the @ construct is + used. + + * src/bison.simple: Define YYERROR, YYABORT, YYACCEPT here. + * src/reader.c (output_ltype): Don't output them here. + + * src/bison.simple: YYDEBUG now should be 0 or 1. + * src/output.c (output): For YYDEBUG, output conditional to define it + only if not previously defined. + +1989-01-02 Richard Stallman + + * src/bison.simple (yyparse) [YYPURE]: Add local yynerrs. + (yydebug): Declare global, but don't initialize, regardless of + YYPURE. + (yyparse): Don't declare yydebug here. + +1988-12-22 Richard Stallman + + * src/reduce.c (print_notices): Typo in message. + +1988-12-11 Richard Stallman + + * src/output.c (pack_table): Free only nonzero the elts of froms & + tos. + +1988-12-08 Richard Stallman + + * src/gram.c (rprecsym): New vector indicates the %prec symbol for + a rule. + * src/reader.c (packgram): Allocate it and fill it in. + * src/reduce.c (inaccessable_symbols): Use it to set V1. + * src/reduce.c (print_results): Don't complain about useless token + if it's in V1. + +1988-12-05 Richard Stallman + + * src/machine.h (RESETBIT, BITISSET): New macros. + (SETBIT, WORDSIZE): Change to use BITS_PER_WORD. + + * src/reduce.c: New file, by David Bakin. Reduces the grammar. + * Makefile: Compile it, link it, put it in dist. + + * src/main.c (main): Call reduce_grammar (in reduce.c). + +1988-11-17 Richard Stallman + + * src/conflicts.c: Don't declare alloca if including alloca.h. + + * src/bison.cld: Define qualifiers `nolines', `debug'. + * src/vmsgetargs.c (getargs): Handle them. + + * src/output.c (output_program): Notice `nolinesflag'. + + * src/output.c (output_parser): Simplify logic for -l and #line. + Avoid writing EOF char into output. + +1988-10-12 Richard Stallman + + * Implement `-l' option. + * src/getopt.c: Set flag `nolinesflag'. + * src/reader.c (copy_definition, parse_union_decl, copy_guard, + copy_action) Obey that flag; don't generate #line. + * src/output.c (output_parser): Discard #line's when copying the + parser. + +1988-09-12 Richard Stallman + + * src/reader.c (copy_guard): Fix brace-counting for + brace-surrounded guard. + +1988-09-08 Richard Stallman + + * src/bison.simple: Correct number in #line command. + (yyparse): Call YYABORT instead of YYERROR, due to last change in + output_ltype. + +1988-09-05 Richard Stallman + + * Makefile: New variable LIBS. Alternatives for USG. + * src/conflicts.c [USG]: Define bcopy. + * src/symtab.c [USG]: Include string.h instead of strings.h. + + * src/conflicts.c [sparc]: Include alloca.h. + +1988-08-02 Richard Stallman + + * src/reader.c (parse_token_decl): Ignore commas. + +1988-06-25 Richard Stallman + + * src/reader.c (output_ltype): Make YYERROR yacc-compatible (like + YYFAIL). + +1988-06-24 Richard Stallman + + * src/getargs.c (getargs): -t sets debugflag. + Eliminate upper case duplicate options. + * src/output.c (output): If debugflag, output `#define YYDEBUG'. + +1988-05-26 Richard Stallman + + * src/allocate.c (mallocate): New name for `allocate' (which loses + in VMS). Calls changed in LR0.c, conflicts.c, symtab.c, new.h. + + * src/getargs.c (getargs): If argv[0] is "yacc", set fixed_outfiles. + +1988-05-17 Richard Stallman + + * src/conflicts.c: Declare alloca. + * src/reader.c: Declare realloc. + * src/warshall.c (TC): Fix one arithmetic op that was omitted last + time. + +1988-05-05 Richard Stallman + + * src/bison.simple: Conditionalize most refs to yylsp on + YYLSP_NEEDED. + * src/reader.c (copy_guard, copy_action): Notice if `@' is used. + (reader): If it was, output `#define YYLSP_NEEDED'. + +1988-04-18 Richard Stallman + + * src/bison.simple: New variable yynerr counts calls to yyerror. + + * src/lex.c (lex, case '='): Update lineno when skipping a newline. + + * src/reader.c (parse_expect_decl): ungetc the char that ends the + number; don't read any further. This handles multi-line comments + right and avoids incorrect lineno. + + * src/reader.c: Delete duplicate decl of symval. + + * src/warshall.c (RTC, TC): Cast ptrs to char *, not unsigned, for + arith. diff --git a/ChangeLog-2012 b/ChangeLog-2012 new file mode 100644 index 0000000..abc1adb --- /dev/null +++ b/ChangeLog-2012 @@ -0,0 +1,26741 @@ +2012-01-15 Akim Demaille + + java: fix reduction traces. + * data/lalr1.java (yy_reduce_print): Fix state index. + Reported by Tim Landscheidt. + +2012-01-12 Jim Meyering + + build: avoid warning from coverity about lbitset_elt_find + * lib/lbitset.c (lbitset_elt_find): Remove unnecessary test of "elt", + at a point where we know it is non-NULL, due to prior dereference. + +2012-01-13 Jim Meyering + + maint: get fdl.texi from gnulib + * bootstrap.conf (gnulib_modules): Add fdl. + * doc/fdl.texi: Remove file. + * doc/.gitignore: Add it here. + + maint: spell "file system" as two separate words + * doc/Doxyfile.in: Spell it "file system", to avoid a + "make syntax-check" failure. + + maint: avoid "the the" + * djgpp/README.in: s/the the/the/ + * src/parse-gram.c (lloc_default): Likewise. + * src/parse-gram.y (lloc_default): Likewise, and remove a + trailing space. + +2012-01-13 Akim Demaille + + maint: factor copyright year. + * configure.ac: Use $PACKAGE_COPYRIGHT_YEAR instead of repeating it. + +2012-01-13 Akim Demaille + + maint: catch missing gnulib macros. + * configure.ac: Add m4_pattern_forbid. + +2012-01-11 Tim Landscheidt + + java: remove used variable. + * data/lalr1.java (yyresult): remove, unused. + +2012-01-11 Akim Demaille + + scanner: fix typo. + * src/scan-skel.l (@`): s/emtpy/empty/. + Reported by Tim Landscheidt. + +2012-01-06 Jim Meyering + + build: avoid warnings about set-but-not-used variables + * lib/bitset_stats.c (bitset_stats_list): Remove declaration + and set of unused local, "type". + * lib/ebitset.c (ebitset_init): Likewise, for "size". + * lib/lbitset.c (lbitset_not): Likewise, for "elt". + +2011-08-21 Joel E. Denny + + lalr1.cc: remove trailing comma from enumerator list. + * data/lalr1.cc (yy::parser): Here. This suppresses a -pedantic + warning. + +2011-08-21 Joel E. Denny + + tests: add -pedantic for --enable-gcc-warnings. + This should help to avoid some portability problems. For example, + it would have revealed the empty unions fixed by the last patch + * configure.ac (WARN_CFLAGS_TESTS, WARN_CXXFLAGS_TEST): Implement. + * tests/synclines.at (AT_TEST_SYNCLINE): Avoid -pedantic warning + about an empty translation unit. + +2011-08-21 Joel E. Denny + + tests: fix empty unions. + Empty unions are not accepted by the ISO C99 grammar or by at + least some versions of Sun Studio. Reported by Wolfgang S. Kechel + at + . + * NEWS (2.5.1): Document fix. + * THANKS (Wolfgang S. Kechel): Add. + * tests/existing.at (GNU Cim Grammar) + (GNU pic (Groff 1.18.1) Grammar.): Remove empty %union. + +2011-07-24 Joel E. Denny + + global: remove unnecessary horizontal tabs. + This change was made by applying emacs' untabify function to + nearly all files in Bison's repository. Required tabs in make + files, ChangeLog, regexps, and test code were manually skipped. + Other notable exceptions and changes are listed below. + * bootstrap: Skip because we sync this with gnulib. + * data/m4sugar/foreach.m4 + * data/m4sugar/m4sugar.m4: Skip because we sync these with + Autoconf. + * djgpp: Skip because I don't know how to test djgpp properly, and + this code appears to be unmaintained anyway. + * README-hacking (Hacking): Specify that tabs should be avoided + where not required. + +2011-07-10 Joel E. Denny + + build: avoid YACC typo inherited from Autoconf. + The typo shows up in the `configure --help' output. Reported by + W.C.A. Wijngaards and Paul Eggert at + . + * README-hacking (Release Procedure): Remind about updating + maintainer tools before a release. + * THANKS (W.C.A. Wijngaards): Add. + * configure.ac (AC_PREREQ): Set to 2.68, which fixes the YACC + typo. + +2011-07-10 Joel E. Denny + + build: create xz instead of bzip2 tarballs. + Suggested by Jim Meyering at + . + * README-hacking (Release Procedure): Update example. + * configure.ac (AM_INIT_AUTOMAKE): Replace dist-bzip2 with + dist-xz. + +2011-05-29 Joel E. Denny + + doc: clean up references to `Locations Overview'. + * doc/bison.texinfo (Locations Overview): Rename node to... + (Locations): ... this, which is its section name. Update menus to + match that and not to use the title `Tracking Locations', which is + a different section. + +2011-05-29 Joel E. Denny + + doc: clean up references to `Tracking Locations'. + * doc/bison.texinfo (Locations): Rename node to... + (Tracking Locations): ... this, which is its section name, and + update all cross references. The trouble is that there is another + node about locations. Its section name is `Locations', which was + easily confused with the node name of this node. Moreover, its + node name is `Locations Overview', which was mistakenly used to + label some cross references to this node. + +2011-05-29 Joel E. Denny + + doc: clean up `Named References' a little. + * doc/bison.texinfo (Named References): Rename section to match + the node name, and update all cross references. Don't use the + acronyms RHS and LHS given that we don't expand them anywhere in + the manual. Try to use @samp and @code properly. Mention that + named references are experimental as we've already stated in NEWS. + (Destructor Decl): Expand the only remaining use of RHS or LHS. + +2011-05-29 Joel E. Denny + + doc: motivate named references. + Suggested by Hans Aberg at + . + * doc/bison.texinfo (Named References): Explain briefly how + they're better than the traditional positional references. + +2011-05-29 Joel E. Denny + + doc: discuss named references after locations. + Reported by Hans Aberg at + . + * NEWS (2.5.1): Document. + * doc/bison.texinfo (Named References): Because it discusses + locations in addition to semantic values, move this subsection out + of the section `Defining Language Semantics', where locations have + not yet been introduced, to be a new section after the following + section, `Tracking Locations'. + +2011-05-29 Joel E. Denny + + Prepare for the possibility of a 2.5.1 release. + * NEWS (2.5.1): New heading. + +2011-05-14 Joel E. Denny + + Version 2.5. + * NEWS (2.5): Set date. + +2011-05-14 Joel E. Denny + + Don't use IF_LINT in Bison sources. + It creates unnecessary differences between the sources that Bison + maintainers build and test (given that maintainers normally + configure with --enable-gcc-warnings) and the sources that Bison + users build. Instead, use PACIFY_CC, which doesn't. This change + fixes compiler warnings reported by Tys Lefering at + . + * configure.ac: Don't AC_DEFINE lint regardless of the configure + options. This change affects imported gnulib sources, where + IF_LINT still appears and depends on lint. + * src/scan-gram.l, src/scan-skel.l: Replace uses of IF_LINT with + PACIFY_CC. + * src/system.h (IF_LINT): Remove cpp macro. + (PACIFY_CC): New cpp macro. + +2011-05-01 Joel E. Denny + + Fix precedence for end token. + Since Bison 2.3b, which restored the ability of precedence + directives to assign user token numbers, doing so for user token + number 0 has produced an assertion failure. + * NEWS (2.5): Document fix. + * src/symtab.c (symbol_user_token_number_set): In the case of the + end token, don't decrement ntokens if it was never incremented. + * tests/regression.at (Token number in precedence declaration): + Extend. + +2011-05-01 Joel E. Denny + + Pacify -DGNULIB_POSIXCHECK. + * bootstrap.conf (gnulib_modules): Add all modules suggested by + -DGNULIB_POSIXCHECK. + * src/files.c (file_name_split) + * src/getargs.c (getargs) + * src/location.c (boundary_set_from_string) + * src/output.c (output_skeleton) + * src/parse-gram.y (prologue_declaration) + * src/scan-gram.l (handle_syncline) + * src/symtab.c (symbol_new): Use mbschr and mbsrchr instead of + strchr and strrchr. In the cases of command-line options, file + names, and thus locations, functionality may be improved. In the + case of symbol names, there should be no functional difference as + all characters are ASCII, so the intended benefit is just warning + suppression. + +2011-05-01 Joel E. Denny + + * NEWS (2.5): Fix minor typos. + +2011-05-01 Joel E. Denny + + doc: clean up quotation style in NEWS. + * NEWS (2.5): For multi-character tokens in example grammar rules, + use "token" not 'token'. In English, use a consistent quotation + style; we might as well follow the precedent seen in info pages: + `quote' not "quote". + +2011-04-16 Joel E. Denny + + tests: pacify gcc 4.6.0's -Wunused-but-set-variable. + Reported by Jim Meyering at + . + * tests/actions.at + (Default %printer and %destructor for mid-rule values): Define + YYLLOC_DEFAULT so that it uses its Rhs argument. + +2011-04-16 Joel E. Denny + + glr.c: omit yyresolveLocations when locations are disabled. + This prevents gcc 4.6.0's -Wunused-but-set-variable from warning + about yyresolveLocations's local yyrhsloc. When locations are + enabled, there's no such warning because YYLLOC_DEFAULT then uses + yyrhsloc. Reported by Jim Meyering at + . + * data/glr.c (yyresolveLocations): Omit definition when locations + are disabled. + (yyresolveValue): Omit yyresolveLocations invocation when + locations are disabled. + +2011-04-16 Joel E. Denny + + gnulib, autoconf: update. + * README-hacking (Updating a submodule): Give advice on how to + determine the versions of gnulib and autoconf to which we should + update. + (Release Procedure): Note that submodules should be updated. + * bootstrap.conf (gnulib_modules): Rename pipe to spawn-pipe as + suggested in updated gnulib NEWS. + * gnulib: Choose a stable snapshot according to advice in Bison's + README-hacking. + * po/POTFILES.in (lib/pipe.c): Rename to... + (lib/spawn-pipe.c): ... this. + * src/output.c: Update to include spawn-pipe.h. + * submodules/autoconf: Update to latest for improvement in m4.m4 + that excludes M4 with buggy strstr. The only other changes to + files that we use are copyright updates. + +2011-04-09 Joel E. Denny + + Fix missing updates to GPLv3. + Reported by Tys Lefering at + . + * src/print-xml.c, src/print-xml.h: In these files. + +2011-03-27 Joel E. Denny + + Add -Wconflicts-sr and -Wconflicts-rr. + Thus, conflict reports are now affected by -Werror and -Wnone + (unless %expect or %expect-rr is specified). Reported by George + Neuner at + . + * NEWS (2.5): Document. + * doc/bison.texinfo (Bison Options): Document. + * src/complain.c, src/complain.h (set_warning_issued): Export + function. + * src/conflicts.c (conflicts_print): Suppress conflict report + based on -Wno-conflicts-sr and -Wno-conflicts-rr, and treat + conflicts as errors if -Werror. + * src/getargs.c (warnings_flag): Initialize with + warnings_conflicts_sr and warnings_conflicts_rr as well. + (warnings_args, warnings_types): Add entries for + warnings_conflicts_sr and warnings_conflicts_rr. + (usage): Update. + * src/getargs.h (enum warnings): Add entries for + warnings_conflicts_sr and warnings_conflicts_rr. + * tests/conflicts.at (-W versus %expect and %expect-rr): New test + group. + * tests/local.at (AT_BISON_CHECK_NO_XML): Update now that the + conflict report can produce a "warnings being treated as errors" + message. Also, check that stderr is now fully scrubbed by -Wnone + when the exit status is 0. + +2011-03-27 Joel E. Denny + + Pacify maintainer-check-posix. + Adding command-line options after the grammar file name is not + permitted, so disable checks that do that when + maintainer-check-posix is running. + * tests/local.at (AT_BISON_CHECK_NO_XML): Don't run the + problematic checks when POSIXLY_CORRECT=1. Also, for readability, + remove an unnecessary m4_if. + +2011-03-27 Joel E. Denny + + Add -Wother so -Wnone suppresses all warnings. + Reported by George Neuner at + . + * NEWS (2.5): Document. + * THANKS (George Neuner): Add. + * doc/bison.texinfo (Bison Options): Document. + * src/complain.c, src/complain.h + (warn_at, warn_at_indent, warn): Suppress warning if -Wno-other. + (midrule_value_at): New warning function, similar to yacc_at in + that it's controlled by its own warning category. + * src/getargs.c (warnings_flag): Initialize to warnings_other. + (warnings_args, warnings_types): Add entry for warnings_other. + (usage): Update. + * src/getargs.h (enum warnings): Add entry for warnings_other. + * src/gram.c (grammar_rules_useless_report): If -Wno-other, then + don't print useless rules. + * src/reader.c (symbol_should_be_used): Rather than adjusting the + return value based on whether midrule value warnings are enabled, + accept a new parameter for telling the caller whether true is + being returned for a potential midrule warning. + (grammar_rule_check): Use midrule_value_at for midrule value + warnings, and continue to use warn_at for all other warnings. Let + them check whether the warnings are enabled. + * tests/local.at (AT_BISON_CHECK): Update documentation. + (AT_BISON_CHECK_NO_XML): Check that -Wnone and --warnings=none + disable all warnings exercised in the test suite. + +2011-03-27 Joel E. Denny + + Don't let -Wnone disable -Werror. + Discussed at + . + * NEWS (2.5): Document. + * src/getargs.c (flags_argmatch): Accept a new argument that + specifies what flags "all" and thus "none" affect. + (FLAGS_ARGMATCH): Update flags_argmatch invocation. + * tests/input.at (-Werror is not affected by -Wnone and -Wall): + New test group. + +2011-03-27 Joel E. Denny + + * NEWS (2.5): Document fix for -Wno-CATEGORY. + +2011-03-20 Joel E. Denny + + doc: fix confusing citation of LAC publication. + Suggested by Akim Demaille. + * doc/bison.texinfo (LAC): Here. + +2011-03-20 Joel E. Denny + + lr.default-reductions: rename "full" value to "most". + Unlike "consistent" and "accepting", "full" doesn't answer the + question of "which states". + * doc/bison.texinfo (%define Summary): Update. + (Default Reductions): Update. + * src/print.c (print_reductions): Update. + * src/reader.c (prepare_percent_define_front_end_variables): + Update. + * src/tables.c (action_row): Update. + * tests/input.at (%define enum variables): Update. + * tests/reduce.at (%define lr.default-reductions): Update. + +2011-03-13 Joel E. Denny + + * src/parse-gram.c, src/parse-gram.h: Regenerate. + +2011-03-09 Akim Demaille + + named references: fix double free. + In `rhs[name]: "a" | "b"', do not free "name" twice. + Reported by Tys Lefering. + + * src/named-ref.h, src/named-ref.c (named_ref_copy): New. + * src/parse-gram.y (current_lhs): Rename as... + (current_lhs_symbol): this. + (current_lhs): New function. Use it to free the current lhs + named reference. + * src/reader.c: Bind lhs to a copy of the current named reference. + * src/symlist.c: Rely on free (0) being valid. + * tests/named-refs.at: Test this. + +2011-03-09 Akim Demaille + + tests: style changes. + * tests/named-refs.at (Redundant words in LHS brackets) + (Unresolved references): here. + +2011-03-06 Joel E. Denny + + java: fix parser tracing bug. + * NEWS (2.5): Document. + * data/lalr1.java (YYParser::YYStack::print): Don't skip top + element. + +2011-03-06 Joel E. Denny + + java: finish fixing parser stack popping bug. + * NEWS (2.5): Document. + * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error + in clearing the location stack. Also fix pop function that + accepts no arguments. + +2011-03-06 Angelo Borsotti (tiny change) + + java: fix parser stack popping bug. + Reported at + . + * THANKS (Angelo Borsotti): Add. + * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error + in clearing the value stack. Previously, the top element of the + stack wasn't cleared and so the value was not garbage collected. + +2011-03-06 Joel E. Denny + + doc: cite publication for LAC. + * doc/bison.texinfo (LAC): Here. + +2011-03-06 Joel E. Denny + + doc: clean up terminology for mysterious conflicts. + * doc/bison.texinfo (Mystery Conflicts): Rename node to... + (Mysterious Conflicts): ... this, which is already the section + title and the name used in the index. Update all cross-references + to this node. Also, don't imply that R/R conflicts are the only + kind of mysterious conflict. + +2011-03-06 Joel E. Denny + + lr.default-reductions: rename "all" value to "full". + States that shift the error token do not have default reductions, + and GLR disables some default reductions, so "all" was a misnomer. + * doc/bison.texinfo (%define Summary): Update. + (Default Reductions): Update. + * src/print.c (print_reductions): Update. + * src/reader.c (prepare_percent_define_front_end_variables): + Update. + * src/tables.c (action_row): Update. + * tests/input.at (%define enum variables): Update. + * tests/reduce.at (%define lr.default-reductions): Update. + +2011-03-06 Joel E. Denny + + doc: create a new Tuning LR section in the manual. + And clean up all other documentation of the features described + there. + * NEWS (2.5): Tweak wording of lr.type and parse.lac entries a + bit, update the cross-references to the manual, and point out that + LAC has caveats. Don't be so adamant that IELR+LAC=canonical LR. + That is, as the referenced section in the manual documents, LAC + does not fix infinite parsing loops on syntax errors. + * doc/bison.texinfo: Consistently drop the "(1)" suffix from LALR, + IELR, and LR in @cindex. + (%define Summary): Condense the entries for lr.default-reductions, + lr.keep-unreachable-states, lr.type, and parse.lac into brief + summaries, and cross-reference the appropriate subsections of + Tuning LR. For parse.lac, mention that it's only implemented for + deterministic parsers in C. In parse.error entry, mention LAC, + and add cross-reference to the LAC section. + (Error Reporting): When mentioning parse.error, mention LAC, and + add cross-reference to the LAC section. + (Tuning LR): New section with an extended version of the + documentation removed from %define Summary. Change all + cross-references in the manual to point here instead of there. + (Calc++ Parser): When mentioning parse.error, mention LAC, and add + cross-reference to the LAC section. + (Table of Symbols): In %error-verbose entry, add cross-reference + to Error Reporting. + (Glossary): Capitalize entry titles consistently. Add definitions + for "defaulted state" and "unreachable state". Expand IELR + acronym in IELR's entry. + +2011-02-20 Joel E. Denny + + doc: add bibliography to manual. + * doc/bison.texinfo (Mystery Conflicts): Cross-reference + bibliography instead of citing publications directly. + (Generalized LR Parsing): Likewise. + (Bibliography): New section. Not all entries are cross-referenced + yet, but that will come in future patches. + +2011-02-19 Joel E. Denny + + java: test and document previous bug fix. + * NEWS (2.5): Document it. + * tests/java.at (_AT_DATA_JAVA_CALC_Y): To one of the yyerror + invocations, pass a location that spans multiple tokens. Change + yyerror to report all of a location rather than just the begin + position. Extend yylex and Position to count tokens on a line. + Remove getHashCode as it's unused. Update all expected output. + +2011-02-19 Bernd Kiefer (tiny change) + + java: fix location handling bug. + Reported at + . + * data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix + reversed access to location stack. + * THANKS (Bernd Kiefer): Add. + +2011-02-13 Joel E. Denny + + doc: fix some minor inconsistencies. + * doc/bison.texinfo (%define Summary): Fix mislabeled entry for + lex_symbol. + (%code Summary): For consistency with the variable list in the + %define Summary, enclose the list of %code qualifiers in a table + instead of an itemize. + +2011-02-06 Joel E. Denny + + doc: clean up new subsections in manual. + * doc/bison.texinfo (%define Summary): Reword so it reads well as + a separate section. For example, add an intro, and move most of + the text outside of the @deffn so it is not indented so far. + (%code Summary): Likewise. + (Table of Symbols): Reword %code entry to match the %code entry in + Decl Summary. + +2011-02-06 Joel E. Denny + + doc: finish splitting apart the manual's Decl Summary section. + Suggested by Akim Demaille at + . + * doc/bison.texinfo (Decl Summary): Extract most of the %define + entry into... + (%define Summary): ... this new subsection, and update all + cross-references. For readability of the patches, rewriting of + the text so it makes sense as a separate subsection will come in a + later patch. Moreover, the majority of the text describing the + various new LR features should likely move to another new section + somewhere. + +2011-02-06 Joel E. Denny + + doc: begin to split apart the manual's Decl Summary section. + Discussed in thread starting at + . + * doc/bison.texinfo (Decl Summary): Extract most of the %code + entry into... + (%code Summary): ... this new subsection, and update all + cross-references. For readability of the patches, rewriting of + the text so it makes sense as a separate subsection will come in a + later patch. + +2011-02-06 Joel E. Denny + + doc: clean up naming of various Bison files. + The Bison manual's names for various files associated with a Bison + parser has devolved into inconsistency. This patch makes the + naming consistent for the most important files. First, it chooses + "grammar file" over "input file". The former appears to be more + traditional in the Bison manual, and Bison has other input + files (skeletons). Second, it chooses "parser implementation + file" over names like "parser file", "parser source file", "parser + source code file", and "parser output file". The new name makes + it clearer where Bison generates the main parser implementation, + and it is easily distinguishable from "parser header file". + * doc/bison.texinfo: Implement throughout. + +2011-02-06 Joel E. Denny + + doc: give credit to more of Bison's developers. + * doc/bison.texinfo (Introduction): Don't imply that only Robert + Corbett, Richard Stallman, and Wilfred Hansen have contributed to + Bison. However, I don't have time to write a full history, so + just point readers to THANKS and ChangeLog. + +2011-02-06 Joel E. Denny + + doc: document experimental features better. + * doc/bison.texinfo (Introduction): Say that IELR(1) and canonical + LR(1) are experimental. Mention Java. Normally experimental + features probably shouldn't be mentioned in the introduction. + However, if Bison's limitations to LALR(1), C, and C++ are so + important that they should be mentioned here, then it's important + to point out that Bison is beginning to escape those limitations. + Moreover, these particular experimental features have very little + chance of being removed. + * src/getargs.c (usage): Say that IELR(1) and canonical LR(1) are + experimental. + +2011-01-29 Joel E. Denny + + Do not allow identifiers that start with a dash. + This cleans up our previous fixes for a bug whereby Bison + discarded `.field' in `$-1.field'. The previous fixes were less + restrictive about where a dash could appear in an identifier, but + the restrictions were hard to explain. That bug was reported and + this final fix was originally suggested by Paul Hilfinger. This + also fixes a remaining bug reported by Paul Eggert whereby Bison + parses `%token ID -123' as `%token ID - 123' and handles `-' as an + identifier. Now, `-' cannot be an identifier. Discussed in + threads beginning at + , + . + * NEWS (2.5): Update entry describing the dash extension to + grammar symbol names. Also, move that entry before the named + references entry because the latter mentions the former. + * doc/bison.texinfo (Symbol): Update documentation for symbol + names. As suggested by Paul Eggert, mention the effect of periods + and dashes on named references. + (Decl Summary): Update documentation for unquoted %define values, + which, as a side effect, can no longer start with dashes either. + * src/scan-code.l (id): Implement. + * src/scan-gram.l (id): Implement. + * tests/actions.at (Exotic Dollars): Extend test group to exercise + bug reported by Paul Hilfinger. + * tests/input.at (Symbols): Update test group, and extend to + exercise bug reported by Paul Eggert. + * tests/named-refs.at (Stray symbols in brackets): Update test + group. + ($ or @ followed by . or -): Likewise. + * tests/regression.at (Invalid inputs): Likewise. + +2011-01-24 Joel E. Denny + + * data/yacc.c: Fix last apostrophe warning from xgettext. + +2011-01-09 Paul Eggert + + Fix minor problems encountered by a fresh bootstrap. + * data/glr.c, data/yacc.c: Do not use apostrophes in '#' comments, + as they confuse xgettext, which tries to parse them as C character + constants in a preprocessor directive. + * data/yacc.c (yy_lac): Don't use printf %d format on *yyesp, as + that expression might not promote to int on some platforms. + * src/parse-gram.c, src/parse-gram.h: Regenerate. + +2011-01-09 Joel E. Denny + + Improve error messages for `$' or `@' followed by `.' or `-'. + Previously, for this special case of an invalid reference, the + usual "symbol not found in production:" was printed. However, + because the symbol name was parsed as the empty string, that + message was followed immediately by a newline instead of a symbol + name. In reality, this is a syntax error, so the reference is + invalid regardless of the symbols actually appearing in the + production. Discussed at + . + * src/scan-code.l (parse_ref): Report the above case as a syntax + error. Other than that, continue to handle this case like any + other invalid reference that Bison manages to parse because + "possibly meant" messages can still be helpful to the user. + * tests/named-refs.at ($ or @ followed by . or -): New test group. + +2011-01-08 Joel E. Denny + + doc: don't use @acronym. + Lately, many GNU packages are dropping it. See + . + * doc/bison.texinfo: Remove all uses. + +2011-01-05 Alex Rozenman + + Do not allow identifiers that start with a negative number. + Reported by Paul Hilfinger as a side effect of named references + support at + . + Suggested by Paul Eggert. + * src/scan-code.l ({letter}, {id}): Adjust lexical definitions. + * src/scan-gram.l ({letter}, {id}): Likewise. + +2011-01-03 Joel E. Denny + + * ChangeLog (2011-01-02): improve description. + +2011-01-03 Joel E. Denny + + maint: don't update copyright years in bootstrap. + * .x-update-copyright: Add entry for bootstrap. + * bootstrap: Remove 2011 from copyright years. The bootstrap + version we're currently using comes from an older version of + gnulib. + * bootstrap.conf (bootstrap_sync): Add comments explaining this + issue. + +2011-01-02 Joel E. Denny + + maint: run "make update-copyright". + +2011-01-02 Joel E. Denny + + maint: prepare to use year ranges in copyright notices. + * README (Copyright statements): New section explaining the range + notation. The GNU maintainers document requires this explanation: + . + I copied our explanation from coreutils. + * build-aux/update-b4-copyright: Revert 2010-06-17 changes that + disabled Bison's automated use of ranges. + * cfg.mk (update-copyright-env): Likewise. + +2011-01-02 Joel E. Denny + + Correct my email address. + * ChangeLog: In all recent entries. + * THANKS (Joel E. Denny): Here. + +2010-12-19 Joel E. Denny + + doc: cleanup. + * NEWS (2.5): Try to sort entries according to how interesting + users might find them. + +2010-12-19 Joel E. Denny + + doc: cleanup. + * NEWS (2.5): Make some minor improvements to wording, and format + entries more consistently. + * doc/bison.texinfo (Language and Grammar): Point out that IELR + and canonical LR are experimental features. + (Decl Summary): In list of %define variables, make wording more + consistent. Improve discussion of using LALR for GLR. + +2010-12-19 Joel E. Denny + + parse.lac: document. + * NEWS (2.5): Add entry for LAC, and mention LAC in entry for + other corrections to verbose syntax error messages. + * doc/bison.texinfo (Decl Summary): Rewrite entries for + lr.default-reductions and lr.type to be clearer, to mention + %nonassoc's effect on canonical LR, and to mention LAC. Add entry + for parse.lac. + (Glossary): Add entry for LAC. + +2010-12-11 Joel E. Denny + + parse.lac: implement exploratory stack reallocations. + * data/yacc.c: Rename %define variable parse.lac.es-capacity to + parse.lac.es-capacity-initial. Accept parse.lac.memory-trace + with values of "failures" (default) or "full". + (b4_declare_parser_state_variables): Add yyesa, yyes, and + yyes_capacity variables. + (YYSTACK_USE_ALLOCA): Ignore it if LAC requested. + (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if + LAC requested. + (YYCOPY_NEEDED): New cpp macro. + (YYCOPY): Define if LAC requested. + (yy_lac_stack_realloc): New function implementing stack + reallocations. Use YYMAXDEPTH for maximum stack size given that + the stack should never need to grow larger than the main state + stack needs to grow without LAC. + (YY_LAC_ESTABLISH): Update yy_lac invocation. + (yy_lac): Add arguments for exploratory stack memory data + recorded in the main parser. Invoke yy_lac_stack_realloc when + reallocation is necessary. + (yysyntax_error): Add the same new arguments and pass them to + yy_lac. + (yypstate_delete): Free yyes if necessary. + (yyesa, yyes, yyes_capacity): #define these to yypstate members + in the case of push parsing. + (yyparse, yypush_parse): Initialize yyes and yyes_capacity. + Update yysyntax_error invocations. At yyreturn, free yyes if + necessary. + * src/parse-gram.y: %define parse.lac full. + * tests/input.at (LAC: errors for %define): Extend for + parse.lac-memory-trace. + * tests/regression.at (LAC: Exploratory stack): Extend to check + that stack reallocs happen when expected. + (LAC: Memory exhaustion): Update to use YYMAXDEPTH and + parse.lac.es-capacity-initial. + +2010-12-11 Joel E. Denny + + parse.lac: implement as %define variable. + LAC = lookahead correction. See discussion at + . + However, one point there must be corrected: because of %nonassoc, + LAC is *not* always redundant for lr.type=canonical-lr. + * data/yacc.c: Accept values of "none" (default) or "full" for + parse.lac. Accept %define parse.lac.es-capacity to specify + capacity of LAC's temporary exploratory stack. It defaults to 20 + and, for now, will not grow dynamically. + (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for + parse.lac!=none. + (YYBACKUP): Invoke YY_LAC_DISCARD. + (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke + yy_lac and track when it needs to be invoked + (yy_lac): New function that, given the current stack, determines + whether a token can eventually be shifted. Return status mimics + yyparse return status. + (yysyntax_error): Change yystate argument to yyssp so stack top + can be passed to yy_lac. If LAC is requested, build expected + token list by invoking yy_lac for every token instead of just + checking the current state for lookaheads. Return 2 if yy_lac + exhausts memory. + (yyparse, yypush_parse): Use local variable yy_lac_established and + cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC. + Update yysyntax_error invocation. Add yyexhaustedlab code if LAC + is requested. + * tests/conflicts.at (%nonassoc and eof): Extend to check the + effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full. + (parse.error=verbose and consistent errors): Likewise. + (LAC: %nonassoc requires splitting canonical LR states): New test + group demonstrating how LAC can fix canonical LR. + * tests/input.at (LAC: Errors for %define): New test group. + * tests/regression.at (LAC: Exploratory stack): New test group. + (LAC: Memory exhaustion): New test group. + +2010-11-21 Joel E. Denny + + build: use gnulib's new bootstrap_sync option. + Now, whenever we update bison's copy of gnulib, bootstrap will + update itself the next time it's run. + * bootstrap: Copy from latest gnulib for bootstrap_sync support. + * bootstrap.conf (bootstrap_sync): Set to true. + * gnulib: Update to latest so bootstrap is in sync now. + +2010-11-07 Joel E. Denny + + yysyntax_error: fix for consistent error with lookahead. + * NEWS (2.5): Document. + * data/yacc.c (yysyntax_error): In a verbose syntax error + message while in a consistent state with a default action (which + must be an error action given that yysyntax_error is being + invoked), continue to drop the expected token list, but don't + drop the unexpected token unless there actually is no lookahead. + Moreover, handle that internally instead of returning 1 to tell + the caller to do it. With that meaning of 1 gone, renumber + return codes more usefully. + (yyparse, yypush_parse): Update yysyntax_error usage. Most + importantly, set yytoken to YYEMPTY when there's no lookahead. + * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the + unexpected token unless there actually is no lookahead. + * data/lalr1.cc (yy::parser::parse): If there's no lookahead, + pass yyempty_ not yyla.type to yysyntax_error_. + (yy::parser::yysyntax_error_): Again, don't drop the unexpected + token unless there actually is no lookahead. + * data/lalr1.java (YYParser::parse): If there's no lookahead, + set yytoken to yyempty_ before invoking yysyntax_error. + (YYParser::yysyntax_error): Again, don't drop the unexpected + token unless there actually is no lookahead. + * tests/conflicts.at (parse.error=verbose and consistent + errors): Extend test group to further reveal how the previous + use of the simple "syntax error" message was too general. Test + yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected + failure. + * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move + to... + * tests/local.at: ... here. + (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition. + (AT_BISON_OPTION_POPDEFS): Pop it. + (AT_FULL_COMPILE): Extend to handle Java. + +2010-11-07 Joel E. Denny + + yysyntax_error: more preparation for readability of next patch. + There are no behavioral changes here. + * data/glr.c (yyreportSyntaxError): Reorganize. + * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize. + * tests/conflicts.at (parse.error=verbose and consistent errors): + Reorganize. + +2010-11-07 Joel E. Denny + + yysyntax_error: prepare for readability of next patches. + These are purely whitespace changes that result in ugly code + but that make the next couple of patches much easier to read. + * data/glr.c (yyreportSyntaxError): Reindent. + * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent. + * data/lalr1.java (YYParser::yysyntax_error): Reindent. + * data/yacc.c (yysyntax_error): Reindent. + +2010-10-31 Joel E. Denny + + Fix memory leak. + * src/output.c (prepare_rules): Free temporary array. + +2010-10-31 Joel E. Denny + + yysyntax_error: improve invocation readability. + * data/yacc.c (yyparse, yypush_parse): For yysyntax_error + invocation, get rid of the while loop, which is misleading + because there are really at most two iterations. + +2010-10-31 Joel E. Denny + + * ChangeLog: Correct some errors in previous entries. + +2010-10-17 Joel E. Denny + + maint: re-anchor all .gitignore entries. + * bootstrap: Copy from gnulib's latest for the fix to + automatically anchor entries it constructs. + * gnulib: Update to latest just so it has the same bootstrap. + * .gitignore, build-aux/.gitignore, doc/.gitignore: + * lib/.gitignore, m4/.gitignore, po/.gitignore: + * runtime-po/.gitignore: Re-anchor all entries. + +2010-10-08 Paul Eggert + + Fix portability problem on OpenBSD 4.7. + + Jim Meyering reported this in + . + * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h, + not _STDLIB_H. EXIT_SUCCESS has been defined by the standard + for quite some time. + * src/parse-gram.c, src/parse-gram.h: Regenerate. + * tests/regression.at: Tamper with the renamed witness. + + Adjust to recent changes to gnulib bootstrap. + + * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore: + * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore: + * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore: + * tests/.cvsignore: Remove; I don't use CVS to maintain Bison + anymore and don't know of anybody else who does. If someone needs + these files, they can resurrect them. + * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore: + * m4/.gitignore, po/.gitignore, runtime-po/.gitignore: + Omit leading '/', since bootstrap omits it. + Adjust file names to match current contents better. + * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook + installed just for us. + * bootstrap.conf (excluded_files): Don't exclude codeset.m4, + glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now + needed somehow. Don't have time to look into why. + (gnulib_modules): Change malloc to malloc-gnu. Do we really assume + the GNU malloc behavior, where malloc (0) != NULL unless we're + out of storage? If not, we can omit malloc-gnu; but for now I left + it in to be safe. + (vc_ignore): Remove. + (gnulib_mk_hook): New function. + * README-hacking: Renamed from HACKING, since gnulib bootstrap now + uses that convention. + +2010-09-09 Paul Hilfinger + + * data/glr.c (yySymbol): Define as int to avoid compiler warnings about + possible change of value. + +2010-09-08 Paul Hilfinger + + * data/glr.c (yy_reduce_print): Change yyrhsVals to yyvsp to remove + compiler errors when using %debug. + Add declaration of yylow when locations in use to avoid compilation + error. + (yyglrReduce): Conditionalize message "Parse ... rejected by rule..." + on whether we are in split mode, for consistency with behavior of + non-GLR parsing. + +2010-09-01 Akim Demaille + + Address GCC warnings about shadowed local variables (yyflag). + * data/glr.c (YYCHK): Rename yyflag as yychk_flag. + (yyprocessOneStack): Reduce the scope of yyaction, yyconflicts, + yyrule, and yyflag. + +2010-08-05 Joel E. Denny + + Version 2.4.3. + * NEWS (2.4.3): Set date. + +2010-08-04 Joel E. Denny + + maint: add gettext version to release announcements. + Suggested by Paul Hilfinger at + + . + * cfg.mk (bootstrap-tools): Add gettext. + +2010-08-04 Joel E. Denny + + doc: fix -W and %expect documentation some. + * NEWS (2.4.3): Mention that there are documentation fixes. + * doc/bison.texinfo (Expect Decl): Make it clear that %expect + turns conflicts into errors not warnings. + (Shift/Reduce): Likewise. + (Bison Options): Don't mention -Wsyntax. It doesn't exist. + +2010-08-01 Joel E. Denny + + -Werror: fix for rules useless in parser after conflicts. + * NEWS (2.4.3): Document fix. + * src/complain.c (error_message): Extend to handle incomplete + error messages so warn and warn_at can be used in more cases. + * src/gram.c (grammar_rules_useless_report): Use warn_at so that + -Werror is always obeyed. + * src/reduce.c (reduce_print): Use warn so that the "warnings + being treated as errors" message is printed consistently before + the first warning message. This makes testing easier. + * tests/local.at (AT_BISON_WERROR_MSG): New macro. + (AT_BISON_CHECK_NO_XML): Extend to check -Werror and + --warnings=error when warnings appear in bison's stderr. + +2010-07-29 Joel E. Denny + + maint: enable gnits only at stable releases. + * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a + version string should disable gnits. Explain in comments. + +2010-07-28 Joel E. Denny + + i18n: update. + * po/POTFILES.in: Add src/graphviz.c. + +2010-07-28 Joel E. Denny + + i18n: fix for gnulib. + * po/POTFILES.in: Add remaining gnulib files that have + translatable strings. + +2010-07-25 Joel E. Denny + + build: fix our adjustments for gnulib files in lib. + * configure.ac: For prepending lib/ to the values of config + variables, fix detection of empty values. Also, due to recent + gnulib changes, add LIBUNISTRING_UNITYPES_H and + LIBUNISTRING_UNIWIDTH_H to the list of those variables. + +2010-07-25 Joel E. Denny + + maint: use announce-gen's new --mail-headers. + * HACKING (Announce): Update instructions. + * cfg.mk (announcement_Cc_): Define. + * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as + required by latest gnulib. + * gnulib: Update to latest. + +2010-07-24 Joel E. Denny + + tests: handle Valgrind that complains about >&-. + * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests. + (Output files: -dv >&-): Skip test group if running + maintainer-check-valgrind. + +2010-07-23 Paul Hilfinger + + * NEWS: Describe new semantic-predicate feature. + * data/c.m4 (b4_predicate_case): New definition. + * data/java.m4 (b4_predicate_case): New definition. + * data/glr.c (yyimmediate): Add definition. + (yydoAction): Remove comment, now obsolete. + Do YY_REDUCE_PRINT here. + (yyglrReduce): Alter comment to indicate that semantic values + need not be deferred. + Remove YY_REDUCE_PRINT from here; done in yydoAction. + (yyprocessOneStack): Pass immediate flag. + Delete stacks rejected by predicates in newly split-off parsers. + Change handling of yyerr so that only current stack gets deleted + when semantic predicate fails. + (yyfillin): Don't crash if a semantic value is unresolved (as may + happen in predicate rules). + Copy lr state as well in debugging mode. + Update comment on setting of yysval to include yyloc as well. + (yy_reduce_print): Add yynormal argument. Perform fillin properly. + Report unresolved RHS values. + (yyimmediate): New table. + * src/gram.h (struct rule): Add is_predicate field. + * src/output.c (user_actions_output): Use b4_predicate_case for + predicates. + (prepare_symbols): Output yyimmediate. + * src/scan-gram.l: Add %? token, SC_PREDICATE state. + * src/scan-code.l (code_props_rule_action_init): Add is_predicate + argument. + * src/scan-code.h (struct code_props): Add is_predicate field. + (code_props_rule_action_init): New interface. + * src/parse-gram.y (%?{...}): New token. + (rhs): Add %?{...} rule. + * src/parse-gram.c: Regenerate. + * src/parse-gram.h: Regenerate. + * src/reader.c (grammar_current_rule_action_append): Add + immediate argument. + (grammar_midrule_action): Use new interface for + code_props_rule_action_init. + (grammar_current_rule_action_append): Ditto. + (packgram): Transfer is_predicate value. + * src/reader.h (grammar_current_rule_action_append): New interface. + * doc/bison.texinfo: Document semantic predicates (%?). + + * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction) + (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet) + (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted) + (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce) + (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction) + (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter + names in comments and mention all parameters. + (struct yyGLRState): Fix description of yyposn field. + (yyresolveLocations): Correct comment so as not to imply action when + yyn1==0. + +2010-06-17 Paul Eggert + + Update from GFDL GFDL 1.2 to 1.3. + * doc/bison.texinfo: Update GFDL version number. + * doc/fdl.texi: Update to version 1.3, taken from: + http://www.gnu.org/licenses/fdl.texi + + Do not use date ranges in copyright notices. + See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices + + * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha: + * TODO, bootstrap, bootstrap.conf: + * build-aux/update-b4-copyright, cfg.mk, configure.ac: + * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4: + * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc: + * data/java-skel.m4, data/java.m4, data/lalr1.cc: + * data/lalr1.java, data/local.mk, data/location.cc: + * data/stack.hh, data/variant.hh, data/xslt/bison.xsl: + * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl: + * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint: + * djgpp/README.in, djgpp/config.bat, djgpp/config.sed: + * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat: + * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h: + * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk: + * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk: + * examples/calc++/Makefile.am, examples/extexi: + * examples/local.mk, lib/abitset.c, lib/abitset.h: + * lib/bbitset.h, lib/bitset.c, lib/bitset.h: + * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c: + * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h: + * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c: + * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h: + * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c: + * lib/timevar.def, lib/timevar.h, lib/vbitset.c: + * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4: + * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4: + * src/AnnotationList.c, src/AnnotationList.h: + * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c: + * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c: + * src/assoc.h, src/closure.c, src/closure.h, src/complain.c: + * src/complain.h, src/conflicts.c, src/conflicts.h: + * src/derives.c, src/derives.h, src/files.c, src/files.h: + * src/flex-scanner.h, src/getargs.c, src/getargs.h: + * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c: + * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk: + * src/location.c, src/location.h, src/main.c: + * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c: + * src/named-ref.h, src/nullable.c, src/nullable.h: + * src/output.c, src/output.h, src/parse-gram.y: + * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h: + * src/print_graph.c, src/print_graph.h, src/reader.c: + * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c: + * src/relation.h, src/scan-code.h, src/scan-code.l: + * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h: + * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c: + * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h: + * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h: + * tests/actions.at, tests/atlocal.in, tests/c++.at: + * tests/calc.at, tests/conflicts.at, tests/cxx-type.at: + * tests/existing.at, tests/glr-regression.at: + * tests/headers.at, tests/input.at, tests/java.at: + * tests/local.at, tests/local.mk, tests/named-refs.at: + * tests/output.at, tests/push.at, tests/reduce.at: + * tests/regression.at, tests/sets.at, tests/skeletons.at: + * tests/synclines.at, tests/testsuite.at, tests/torture.at: + Don't use date ranges in copyright notices. + +2010-05-11 Akim Demaille + + lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT. + * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the + header file to the implementation file, after the user %code + sections. + * NEWS (2.5): Document this. + +2010-05-11 Akim Demaille + + doc: please Emacs. + * doc/bison.texinfo (Local Variables): Move this after the + LocalWords, since the latter are looked for in the whole document, + while the former are looked for only at its end. + Require american spell checking. + +2010-05-10 Akim Demaille + + doc: fix lalr1.cc documentation. + * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature. + (C++ Bison Interface): Fix lalr1.cc skeleton name. + (C++ Parser Interface): Fix semantic_type and location_type names. + Document yy::parser::token. + Reported by Jerry Quinn. + +2010-05-10 Akim Demaille + + c++: use YYRHSLOC. + * data/lalr1.cc (YYRHSLOC): New. + (YYLLOC_DEFAULT): Use it. + * data/glr.cc: If location_type was user defined, do not include + location.hh, and do not produce location.hh and position.hh. + * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC. + Check that glr.cc supports user defined location_type. + * NEWS: Document this. + +2010-05-07 Akim Demaille + + doc: fix typo. + * tests/synclines.at: here. + +2010-05-04 Akim Demaille + + tests: enhance AT_SYNCLINES_COMPILE. + * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns. + (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already + taken care of in AT_SYNCLINES_COMPILE. + +2010-05-04 Akim Demaille + + lalr1.cc: don't generate location.hh when location_type is defined + * data/bison.m4 (b4_percent_define_get): Accept a default value. + * data/c++.m4: Do not provide a default value for the %define + variable location_type, rather, use b4_percent_define_get with a + default argument where its value is needed. + * data/lalr1.cc: Do not load location.cc (which outputs both + location.hh and position.hh) if the user defined location_type. + Do not include location.hh either. + +2010-05-04 Akim Demaille + + lalr1.cc: minor refactoring. + * data/lalr1.cc: Don't issue empty namespaces. + +2010-05-04 Akim Demaille + + tests: fix %printer. + Currently, there is no check that %printer ... (nor + %destructor) is about an existing type. This C++ test had + it wrong (<::std::string> vs. ). + + * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the + pretty-printing of lists into something better for parser traces. + Update the expected output. + Fix correspondance between %type/%token and %printer. + +2010-05-04 Akim Demaille + + lalr1.cc: location_type: make sure we don't depend on loc.(begin|end). + * tests/calc.at (Span): Instead of begin/end, as in the built-in + location class, use first and last. + Define YYLLOC_DEFAULT to adjust to these changes. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the + location_type changes. + +2010-05-01 Joel E. Denny + + tests: fix maintainer-xml-check. + * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"): + Update output to include comments now produced by --graph. + (xsl:template match="automaton"): As for --graph, name the + digraph after the grammar file. + * src/print-xml.c (escape_bufs): Enlarge array. + (print_xml): Add bug-report and url attributes to + bison-xml-report element. + +2010-05-01 Joel E. Denny + + In DOT output, convert from "/*" comments to "//" comments. + This handles the possibility that a "*/" might appear in + variable portions of those comments at some point in the future. + * src/graphviz.c (start_graph): Implement. + +2010-04-30 Joel E. Denny + + Document that undefined %prec identifier warnings will remain. + * NEWS (2.4.3): Here. + (2.4.2): Here. + +2010-04-30 Joel E. Denny + + Revert 2009-12-30 change for undefined %prec token complaints. + That is, keep them as warnings because that should be sufficient + to satisfy POSIX without creating backward compatibility issues. + Suggested by Richard Stallman at + . + * NEWS (2.5): Remove mention of complaint. + * src/reader.c (grammar_rule_check): Convert complaint back to + warning. + * tests/input.at (%prec's token must be defined): Update. + +2010-04-25 Joel E. Denny + + build: don't require src/bison during bootstrap. + Suggested by Eric Blake at + . + * bootstrap.conf (bootstrap_epilogue): New function to make sure + src/parse-gram.[ch] are stamped later than src/parse-gram.y. + +2010-04-25 Joel E. Denny + + i18n: fix untranslatable string. + Reported by Goran Uddeborg at + . + * src/muscle-tab.c (muscle_percent_define_insert): Here. + +2010-04-13 Akim Demaille + + tests: calc: minor refactoring. + * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex. + +2010-04-13 Akim Demaille + + tests: calc: simplify location management. + * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New. + (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to + define the appropriate AT_LOC accessors. + * tests/calc.at: Use AT_LOC accessors. + +2010-04-13 Akim Demaille + + test location_type. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): + Define AT_LOCATION_TYPE_IF. + (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF. + * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is + used, provide a user location type and use it. + (Simple LALR1 C++ Calculator): Add a test case for location_type. + +2010-04-13 Akim Demaille + + tests: check fclose's return value. + * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status. + +2010-04-13 Akim Demaille + + tests: don't depend on the actual location type. + * tests/calc.at: Use yy::parser::location_type rather than + yy::location, since the former is always right, and might point to + another type than the latter. + +2010-04-13 Akim Demaille + + formatting changes. + * tests/calc.at: Formatting changes. + +2010-04-13 Akim Demaille + + lalr1.cc: remove useless forward declaration. + * data/lalr1.cc: Include location.hh before stack.hh. + Remove the useless forward declarations of position and location. + Reported by Chris Morley. + * data/glr.cc: Likewise. + +2010-04-11 Joel E. Denny + + * NEWS (2.4.3): Mention fix for Sun Studio C++. + +2010-04-10 Joel E. Denny + + tests: fix for newer Sun Studio C++. + Reported by Dagobert Michelsen at + . + * THANKS (Dagobert Michelsen): Add. + * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest + Autoconf macro for handling the restrict keyword. + * gnulib: Update to latest, which no longer overrides that macro + from Autoconf. + +2010-04-03 Joel E. Denny + + portability: fix pointer arithmetic to conform to C standard. + Reported by Tys Lefering at + . + This fix is already implemented in glr.c and does not apply to + lalr1.java. + * data/lalr1.cc (yy::parser::parse): Increase size of + yyerror_range and adjust subscripting so you don't have to + subtract one from the beginning of the array. + * data/yacc.c (b4_declare_parser_state_variables, + yyparse, yypush_parse): Likewise. + +2010-04-05 Akim Demaille + + remove useless include. + * src/graphviz.h: Don't include stdbool.h. + +2010-04-05 Akim Demaille + + graph: sign the output file. + * src/graphviz.c (start_graph): Issue comments about Bison. + Suggested by Tys Lefering. + +2010-03-31 Joel E. Denny + + portability: fix test suite for GCC 4.5's new #error message. + Reported by Tys Lefering at + . + * NEWS (2.4.3): Mention. + * tests/synclines.at (AT_TEST_SYNCLINE): Implement. + +2010-03-30 Akim Demaille + + fix comments. + * src/graphviz.h: Add missing license notice. + Document. + +2010-03-25 Akim Demaille + + tests: fix 250: parse.error=verbose overflow. + * tests/regression.at (parse.error=verbose overflow): Avoid the + double inclusion of stdlib.h as it triggers hard errors. + +2010-03-23 Joel E. Denny + + portability: fix for BSD make. + Reported by Johan van Selst at + . + * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in + this dependency list as in package.m4's target rule. + +2010-03-23 Joel E. Denny + + portability: fix spawning on at least FreeBSD 8 and FreeBSD 9. + Reported by Johan van Selst at + . + * NEWS (2.4.3): New. + * THANKS (Johan van Selst): Add. + * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile + targets so that gnulib's new c++defs.h is matched. + * gnulib: Update to latest. + +2010-03-20 Joel E. Denny + + maint: update for changes to gnulib's announce-gen. + * HACKING (Announce): RELEASE_TYPE=major must now be written + RELEASE_TYPE=stable. + +2010-03-20 Joel E. Denny + + Version 2.4.2. + * NEWS (2.4.2): Set version and date. For the recent test suite + portability fixes, don't be so optimistic about their success + given the lack of feedback on the affected platforms. + +2010-02-22 Joel E. Denny + + tests: fix maintainer-xml-check for recent changes. + * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use + AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an + output file whose name conflicts with a previous output file + is now never generated. + +2010-02-22 Joel E. Denny + + portability: fix several issues with M4 subprocess. + + M4's output pipe was not being drained upon fatal errors during + scan_skel. As a result, broken-pipe messages from M4 were seen + on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a + failure in the test suite. The problem was that, on platforms + where the default disposition for SIGPIPE is ignore instead of + terminate, M4 sometimes saw fwrite fail with errno=EPIPE and + then reported it. However, there's some sort of race condition, + because the new test group occasionally succeeded. + Reported by Albert Chin at + . + + There were also problems with the test suite livelocking on + Tru64 5.1b. Reported by Didier Godefroy at + . + Switching to create_pipe_bidi suggested by Akim Demaille. + + To attempt to solve both of these problems, switch to gnulib's + create_pipe_bidi and register M4 process as a slave. Along the + way, clean up file name conflict handling, which was affected by + the broken-pipe problem before the switch. + * NEWS (2.4.2): Document. + * THANKS (Didier Godefroy): Add. + * bootstrap.conf (gnulib_modules): Add pipe. + * gnulib: Update to latest to make sure we have all the latest + fixes. + * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and + subpipe.c. + * po/POTFILES.in (lib/subpipe.c): Remove. + * src/files.c (compute_output_file_names): Update invocations + of output_file_name_check. + (output_file_name_check): In the case that the grammar file + would be overwritten, use complain instead of fatal, but replace + the output file name with /dev/null. Use the /dev/null solution + for the case of two conflicting output files as well because it + seems safer in case Bison one day tries to open both files at + the same time. + * src/files.h (output_file_name_check): Update prototype. + * src/output.c (output_skeleton): Use create_pipe_bidi and + wait_subprocess. Assert that scan_skel completely drains the + pipe. + * src/scan-skel.l (at_directive_perform): Update + output_file_name_check invocation. + * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the + grammar file actually isn't overwritten. + (Conflicting output files: -o foo.y): Update expected output. + * tests/skeletons.at (Fatal errors but M4 continues producing + output): New test group. + +2010-02-04 Joel E. Denny + + Update POTFILES. + * HACKING (Release Procedure): Add reminder about keeping + POTFILES files up-to-date. + * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add. + +2010-02-01 Joel E. Denny + + Code cleanup. + * tests/atlocal.in (abs_top_srcdir): Remove shell variable, + which is already defined in atconfig. + +2010-01-22 Joel E. Denny + + tests: fix missing include caught by g++ 4.4.1. + Reported by Tys Lefering. + * HACKING (Release checks): Add note about trying a recent GCC. + * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include + cstdlib for abort. + (_AT_DATA_EXPECT2_Y): Likewise. + +2010-01-21 Joel E. Denny + + * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory. + +2010-01-21 Joel E. Denny + + maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it. + * HACKING (Release Procedure): Update notes on copyright years. + * Makefile.am (update-package-copyright-year): New target rule. + * build-aux/update-package-copyright-year: New file. + * cfg.mk (update-copyright): Add update-package-copyright-year + as a dependency. + +2010-01-19 Joel E. Denny + + * bootstrap: Import improvements from latest gnulib. + +2010-01-19 Joel E. Denny + + build: require Automake 1.11.1 to avoid a security flaw. + * HACKING (Release Procedure): Don't document Automake security + flaw here. + * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain + why here. + +2010-01-19 Joel E. Denny + + gnulib: update to latest. + +2010-01-19 Joel E. Denny + + ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c. + +2010-01-15 Joel E. Denny + + Thank the developer of the initial push parser implementation. + This unfortunate oversight is several years old. + * THANKS (Odd Arild Olsen): Add. + +2010-01-04 Joel E. Denny + + Fix some comments concerning LR(0) versus LALR(1). + + Stop equating LR(0) with nondeterminism and LALR(1) with + determinism. That is, if all states are consistent, then LR(0) + tables are deterministic. On the other hand, LALR(1) tables + might be nondeterministic before conflict resolution, and GLR + permits LALR(1) tables to remain nondeterministic. + * src/LR0.c, src/LR0.h: Here. + * src/lalr.c, src/lalr.h: Here. + * src/main.c (main): Here. + * src/state.c, src/state.h: Here. + + * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1) + parser tables. + +2010-01-04 Joel E. Denny + + maint: run "make update-copyright" + +2009-12-30 Joel E. Denny + + POSIX: complain if %prec's token was not defined. + * NEWS (2.5): Document. + * src/reader.c (grammar_rule_check): Convert warning to + complaint. + * tests/input.at (%prec's token must be defined): Update. + +2009-12-30 Joel E. Denny + + POSIX: warn if %prec's token was not defined. + Reported by Florian Krohm at + . + * NEWS (2.4.2): Document. + * src/reader.c (grammar_rule_check): Implement. + (grammar_current_rule_prec_set): Add comments explaining that we + here assume a %prec identifier is a token, but we still manage + to support POSIX. + * tests/input.at (%prec's token must be defined): New test + group. + +2009-12-31 Joel E. Denny + + * HACKING (Release Procedure): Recommend a secure automake. + +2009-12-29 Joel E. Denny + + portability: `<' and `>' are not always defined on addresses. + Specifically, don't sort objects by their memory addresses when + they're not allocated in the same array or other object. Though + I haven't found a test case where that fails on my platform, C + says the behavior is undefined. + * src/AnnotationList.c (AnnotationList__insertInto): Remove + FIXME. Use new id field of InadequacyList nodes rather than + their memory addresses when sorting. + (AnnotationList__compute_from_inadequacies): Add + inadequacy_list_node_count argument to pass to + InadequacyList__new_conflict. + * src/AnnotationList.h + (AnnotationList__compute_from_inadequacies): Update prototype + and documentation for new argument. + * src/InadequacyList.c (InadequacyList__new_conflict): Add + node_count argument and use it to assign a unique ID. + * src/InadequacyList.h (InadequacyListNodeCount): New typedef. + (InadequacyList): Add id field. + (InadequacyList__new_conflict): Update prototype and + documentation for new argument. + * src/ielr.c (ielr_compute_annotation_lists): Update + AnnotationList__compute_from_inadequacies invocation. + +2009-12-20 Joel E. Denny + + Fix handling of yychar manipulation in user semantic actions. + The problem was that yacc.c didn't always update the yychar + translation afterwards. However, other skeletons appear to be + fine. glr.c appears to already translate yychar before every + use. lalr1.cc does not define yychar and does not document its + replacement, yyla, for users. It does provide yyclearin, but + that does not manipulate yyla and thus requires no translation + update. In lalr1.java, yychar is out of scope during semantic + actions. + * NEWS (2.5): Document. + * data/yacc.c (YYBACKUP): Don't bother translating yychar into + yytoken here. + (yyparse, yypush_parse): Instead, translate before every use of + yytoken, and add comments explaining this approach. + * tests/actions.at (Destroying lookahead assigned by semantic + action): New test group checking that translation happens before + lookahead destructor calls at parser return. Previously, + incorrect destructors were called. + * tests/conflicts.at (parse.error=verbose and consistent + errors): New test group checking that translation happens at + syntax error detection before the associated verbose error + message and the associated lookahead destructor calls. While + the destructor call is fixed by this patch, the verbose error + message is currently incorrect due to another bug (see + comments in test group), so this is an expected failure for now. + +2009-12-21 Joel E. Denny + + YYFAIL: warn about uses and remove from lalr1.java. + * NEWS (2.5): Document. + * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB, + and make it private. Update all uses. + * src/scan-code.l (SC_RULE_ACTION): Implement warning. + +2009-12-21 Joel E. Denny + + YYFAIL: deprecate. + * NEWS (2.4.2): Document deprecation and the phase-out plan. + * data/lalr1.java (YYParser::YYFAIL): Add comment about + deprecation. + * data/yacc.c (YYFAIL): Likewise, and suppress warnings about + YYFAIL from GCC cpp's -Wunused-macros. + * doc/bison.texinfo (Java Action Features): Remove YYFAIL + documentation. + (LocalWords): Remove YYFAIL. + +2009-12-20 Joel E. Denny + + tests: cleanup. + * tests/c++.at (Syntax error discarding no lookahead): Don't + ignore stderr. Instead, eliminate remaining warnings. + +2009-12-18 Joel E. Denny + + lalr1.cc: don't discard non-existent lookahead on syntax error. + * data/lalr1.cc (yy::parser::parse): Check yyempty first. + * tests/c++.at (Syntax error discarding no lookahead): New test + group. + +2009-12-17 Joel E. Denny + + Code cleanup. + * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove + function, which is no longer used. + +2009-12-16 Joel E. Denny + + Add gcc's -Wundef to test suite and fix another warning from it. + * NEWS (2.4.2): Update description of -Wundef fix. + * configure.ac (WARN_CXXFLAGS_TEST): New substitution. + (WARN_CFLAGS_TEST): New substitution. + * data/glr.c: Avoid warning about __STRICT_ANSI__. + * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of + WARN_CFLAGS. + (NO_WERROR_CFLAGS): Likewise. + (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS. + +2009-12-16 Joel E. Denny + + * data/yacc.c: Reformat m4 a little. + +2009-12-16 Joel E. Denny + + Document gcc -Wundef fix. + * NEWS (2.4.2): Here. + * THANKS (Jonathan Nieder): Add. + +2009-12-15 Jonathan Nieder (tiny change) + + Simplify y.tab.c when location tracking is disabled. + * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location + tracking is not enabled. Instead, unconditionally define + YY_LOCATION_PRINT as a no-op for backward compatibility. + +2009-12-15 Jonathan Nieder (tiny change) + + Avoid warnings from gcc -Wundef y.tab.c. + * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are + defined before using them. + * data/lalr1.cc: Likewise. + * data/yacc.c: Likewise. + +2009-12-15 Joel E. Denny + + autoconf: update to latest for fix of M4 detection. + Reported by Eric Blake. + * submodules/autoconf: Update. + +2009-12-15 Joel E. Denny + + portability: use -DGNULIB_POSIXCHECK. + Reported by Eric Blake. See discussions at + + and + . + * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK. + * bootstrap.conf (gnulib_modules): Add all the printf modules + suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as + suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c. + (excluded_files): Remove m4/printf-posix.m4. + * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add + lib/libbison.a so gnulib libraries can be linked. + +2009-12-15 Joel E. Denny + + gnulib: update for fix of fprintf-posix, which we'll use soon. + * etc/prefix-gnulib-mk (prefix): Adjust regex for make file + targets so that gnulib's new arg-nonnull.h and link-warning.h + are matched. + * gnulib: Update. + +2009-12-14 Joel E. Denny + + Enable assertion output and --disable-assert for configure. + * bootstrap.conf (gnulib_modules): Add assert module. + * src/system.h (aver): Define as assert, and summarize the + discussion on this issue. + +2009-12-14 Joel E. Denny + + Expand GLR acronym in summary of Bison. + Based on discussion with Akim Demaille starting at + . + * doc/bison.texinfo (Introduction): Here. + * src/getargs.c (usage): Here. + +2009-10-03 Alex Rozenman + + Document named references. + * doc/bison.texinfo (Actions): Add new example and xref to + Using Named References node. + (Using Named References): New node. + +2009-10-16 Joel E. Denny + + cleanup. + * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead + of char*. + (Sbitset__isEmpty): Use Sbitset instead of char*. + * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char + instead of char. This helps to avoid casting errors. + (Sbitset__or): Use Sbitset instead of char*. + +2009-10-16 Joel E. Denny + + portability: don't assume 8-bit bytes. + That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff. + * src/Sbitset.h (Sbitset__nbytes): Here. + (Sbitset__byteAddress): Here. + (Sbitset__bit_mask): Here. + (Sbitset__last_byte_mask): Here. + (Sbitset__ones): Here. + (SBITSET__FOR_EACH): Here. + +2009-10-11 Joel E. Denny + + portability: use va_start and va_end in the same function. + * src/complain.c (error_message): Move va_end from here... + (ERROR_MESSAGE): ... to here. + +2009-10-08 Joel E. Denny + + * data/bison.m4: Update comments for rename to muscle-tab.h. + +2009-10-07 Joel E. Denny + + Minor code cleanup. + * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and + replace all uses with UNIQSTR_CONCAT. + * src/uniqstr.c (uniqstr_vsprintf): New function. + * src/uniqstr.h (uniqstr_vsprintf): Add prototype. + (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New + macros. + +2009-10-06 Joel E. Denny + + * TODO (Complaint submessage indentation): New. + +2009-10-04 Joel E. Denny + + Minor code cleanup. + * src/parse-gram.y: Clean up sorting of declarations. + Use types to simplify %printer declarations where possible. + Provide %printer for BRACKETED_ID and symbol.prec. + * src/symtab.c: Whitespace change. + +2009-10-04 Joel E. Denny + + tests: skip tests of file names that platform does not support. + Reported by Michael Raskin at + . + * THANKS (Michael Raskin): Add. + * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used + to fail at least for file names containing ":" or "\". + +2009-09-23 Joel E. Denny + + yysyntax_error: avoid duplicate lookahead collection. + Except when memory reallocation is required, this change + eliminates the need to invoke yysyntax_error twice and thus to + repeat the collection of lookaheads. It also prepares for + future extensions that will make those repetitions more + expensive and that will require additional memory management in + yysyntax_error. Finally, it fixes an obscure bug already + exercised in the test suite. + * data/yacc.c (yysyntax_error): Add arguments for message + buffer variables stored in the parser. Instead of size, return + status similar to yyparse status but indicating success of + message creation. Other than the actual reallocation of the + message buffer, import and clean up memory management code + from... + (yyparse, yypush_parse): ... here. + * tests/regression.at (parse.error=verbose overflow): No longer + an expected failure. + +2009-09-23 Joel E. Denny + + yysyntax_error: test memory management more. + * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro. + * tests/regression.at (parse.error=verbose and + YYSTACK_USE_ALLOCA): New test group. + (parse.error=verbose overflow): New test group that reveals an + obscure bug. Expected fail for now. + +2009-10-04 Joel E. Denny + + benchmarks: use %debug consistently among grammars. + * etc/bench.pl.in (generate_grammar_triangular): Do not activate + %debug by default. It can affect the timings even if yydebug=0. + (generate_grammar_calc): For consistency with other grammars, + use YYDEBUG environment variable to set yydebug. + +2009-10-03 Joel E. Denny + + Remove dead code. + * src/symtab.c (symbol_pack): Here because every symbol's number + is always defined by this time. + +2009-10-03 Alex Rozenman + + Add additional space after periods in NEWS. + * NEWS (2.5): here. + +2009-09-29 Joel E. Denny + + Use the correct conversion specifier for size_t. + Reported by Jim Meyering. + * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu" + because Sbitset__Index is size_t. + * src/Sbitset.c (Sbitset__fprint): Use it instead of %d. + +2009-09-27 Joel E. Denny + + tests: don't abuse AT_BISON_CHECK. + * tests/regression.at (parse-gram.y: LALR = IELR): Move + additional shell commands outside of AT_BISON_CHECK. + +2009-09-26 Joel E. Denny + + tests: check that parse-gram.y's IELR and LALR are identical. + * tests/atlocal.in (abs_top_srcdir): New shell variable. + * tests/regression.at (parse-gram.y: LALR = IELR): New test + group. + +2009-09-19 Alex Rozenman + + Keep sub-messages aligned. Fix strings for translation. + * src/location.h (location_print): Add return value. + * src/location.c (location_print): Return number of printed + characters. + * src/complain.h (complain_at_indent, warn_at_indent): Prototype + new functions. + * src/complain.cpp (indent_ptr): New static variable. + (error_message, complain_at_indent, warn_at_indent): Implement + the alignment mechanism. + * src/scan-code.l (parse_ref, show_sub_messages): Fix strings + for translations. Use new alignment mechanism. + * tests/named-ref.at: Adjust test-cases. + * NEWS (2.5): Add an announcement about named references. + +2009-09-17 Akim Demaille + + doc: fixes. + * doc/bison.texinfo: here. + Reported by Alex Rozenman. + +2009-09-16 Akim Demaille + + doc: lalr1.cc and variants. + * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and + "variant" %define variables. + (C++ Semantic Values): Split into... + (C++ Unions, C++ Variants): these. + The latter is new. + (C++ Parser Interface): Fix type names. + Document parser::syntax_error. + Document the fact that locations are not mandatory. + (C++ Scanner Interface): Split into... + (Split Symbols, Complete Symbols): these. + The later is new. + (Calc++ Parsing Driver): Use variants. + Add more comments. + Adjust style. + (Calc++ Parser): Declare all the tokens, no + longer accept raw characters. + Remove %union. + Adjust types and printers. + Remove destructors. + (Calc++ Scanner): Use make_ functions. + Use strerror in error message. + +2009-09-16 Akim Demaille + + doc: spell checking. + * doc/bison.texinfo: here. + +2009-09-16 Akim Demaille + + doc: comment changes. + * doc/bison.texinfo: Comment changes. + +2009-09-16 Akim Demaille + + lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS. + * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the + constructor to take a token_type instead of the (internal) symbol + number. + Call yytranslate_. + * data/variant.hh (b4_symbol_constructor_define_): Therefore, + don't call yytranslate_ here. + +2009-09-16 Akim Demaille + + TODO: statistics. + * TODO (Figures): New. + +2009-09-13 Joel E. Denny + + tests: clean up push.at test group titles. + * tests/push.at: Remove "Push Parsing: " from test group titles + because these are already under the banner "Push Parsing Tests". + +2009-09-12 Alex Rozenman + + Provide an additional sub-message for clarity. + Add "symbol not found in production" error message when + an "invalid reference" is detected in named references + resolution. + * src/scan-code.l: Update "invalid reference" case. + * tests/named-ref.at: Adjust test-cases. + +2009-09-10 Joel E. Denny + + Clean up yacc.c a little. + * data/yacc.c: Clean up M4 for readability, and make output + whitespace more consistent. For the main parse function + comment, instead of saying "yyparse or yypush_parse", say either + "yyparse" or "yypush_parse" depending on which it actually is. + +2009-09-10 Joel E. Denny + + Fix --enable-gcc-warnings. + * src/parse-gram.y (%printer ): Handle param_none. + +2009-09-09 Akim Demaille + + lalr1.cc: syntax_error as exceptions. + It is common to use sort of factories in the user actions. These + factories may check some "syntactic" constraints that are not + enforced by the grammar itself. This is possible using YYERROR + within the action itself. Provide the user with a means to throw + a syntax_error exception. + + * data/c++.m4 (b4_public_types_declare, b4_public_types_define): + Declare and define yy::parser::syntax_error. + * data/lalr1.cc: Include stdexcept. + (yy::parser::parse): Wrap the user action within a try/catch. + * data/glr.cc: Include stdexcept. + +2009-09-09 Akim Demaille + + lalr1.cc: add missing "inline". + * data/c++.m4 (b4_public_types_define): Add missing inline to + implementations provided in headers. + +2009-09-09 Akim Demaille + + %param: documentation. + * NEWS (2.6): Document %param, %lex-param, and %parse-param + changes. + * doc/bison.texinfo: Document that %lex-param and %parse-param + are n-ary. + Changes some examples to demonstrate it. + (Calc++ Parser): Use %param. + +2009-09-09 Akim Demaille + + Regen. + +2009-09-09 Akim Demaille + + style changes. + * src/parse-gram.y (add_param): Scope changes. + +2009-09-09 Akim Demaille + + %parse: support several arguments. + * src/parse-gram.y (current_param): New. + (param_type): Add param_none. + (params): New nonterminal. + Use it. + +2009-09-09 Akim Demaille + + Regen. + +2009-09-09 Akim Demaille + + %param. + Provide a means to factor lex-param and parse-param common + declarations. + + * src/parse-gram.y (param_type): New. + Define a %printer for it. + (add_param): Use it. + (%parse-param, %lex-param): Merge into... + (%parse): this new token. + Adjust the grammar to use it. + * src/scan-gram.l (RETURN_VALUE): New. + (RETURN_PERCENT_FLAG): Use it. + (RETURN_PERCENT_PARAM): New. + Use it to support %parse-param, %lex-param and %param. + +2009-09-03 Joel E. Denny + + Use aver not assert. + * src/output.c: Don't include assert.h. + (output_skeleton): Use aver not assert. + * src/system.h (aver): In documentation of why, add links to + Paul Eggert's explanations in the mailing lists. + +2009-09-05 Alex Rozenman + + Use "Unresolved reference" error message when no symbols were found + in a symbolic reference resolution. Remove .expr and -expr from + the shown reference when the reference is unresolved. + * src/scan-code.l: Change the error message, adjust location columns, + rename variable "exact_mode" to "explicit_bracketing". + * tests/named-ref.at: Adjust existing tests and add a new one. + +2009-09-04 Akim Demaille + + Adjust synclines in src/parse-gram.[ch]. + * tests/bison.in: Do some magic (including working around issues + with ylwrap) when this wrapper is used to compile + src/parse-gram.y. + +2009-09-03 Joel E. Denny + + Complain about unused %define variables and %code qualifiers. + * NEWS (2.5): Document. + * data/bison.m4 (b4_check_user_names): Complain instead of warn. + * doc/bison.texinfo (Decl Summary): Document complaint, and + improve %define documentation a little otherwise. + * tests/input.at (Reject unused %code qualifiers): Update. + (%define errors): Update. + (%define, --define, --force-define): Update. + (%define backward compatibility): Update. + (Unused %define api.pure): Update. + * tests/push.at (Push Parsing: Unsupported Skeletons): Update. + +2009-09-03 Joel E. Denny + + Don't suppress warnings about unused parse.error. + * data/bison.m4 (b4_error_verbose_flag): Don't examine value of + %define variable parse.error unless b4_error_verbose_flag is + actually expanded in a skeleton. + +2009-09-03 Akim Demaille + + * NEWS (2.4.2): Add "Internationalization" item. + +2009-09-03 Akim Demaille + + bootstrap: fix/improve find_tool. + * bootstrap (find_tool): Improve error messages. + Fix typo about find_tool_names. + +2009-08-29 Joel E. Denny + + Fix gcc 3.4.4 shadowing warning reported by Eric Blake. + See + . + * src/scan-code.h (code_props_rule_action_init): Rename + named_ref arg to name so it doesn't shadow named_ref type. This + makes it consistent with the function definition in scan-code.l + anyway. + +2009-08-28 Joel E. Denny + + %define: accept unquoted values. + * NEWS (2.5): Group all %define changes together, and document + this one. Remove quotes in IELR and canonical LR entry. + * doc/bison.texinfo: Remove quotes in most examples throughout. + (Decl Summary): Update %define documentation. + (Table of Symbols): Likewise. + * src/ielr.c (LrType): Update documentation. + * src/parse-gram.y (content.opt): Add production for ID. + * tests/actions.at: Remove quotes in most tests. + * tests/calc.at: Likewise. + * tests/existing.at: Likewise. + * tests/input.at: Likewise. + * tests/local.at: Likewise. + * tests/push.at: Likewise. + * tests/reduce.at: Likewise. + * tests/torture.at: Likewise. + +2009-08-28 Joel E. Denny + + %define lr.type: make values lowercase IDs. + That is, "LALR" => "lalr", "IELR" => "ielr", and + "canonical LR" => "canonical-lr". + * NEWS (2.5): Update documentation. + * doc/bison.texinfo (Decl Summary): Likewise. + * src/ielr.c (ielr): Use new values. + * src/ielr.h (ielr): Update documentation. + * src/reader.c (prepare_percent_define_front_end_variables): Use + and validate new values. + * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test + grammars. + * tests/reduce.at (AT_TEST_LR_TYPE): Likewise. + +2009-08-27 Eric Blake + + scan-gram: avoid portability trap with ctype usage. + * src/scan-gram.l (): + Avoid compiler warning. + +2009-08-27 Joel E. Denny + + tests: use perl for printing special sequences to files. + And skip tests if perl is not available. This is better than + playing tricks with shell portability. Suggested by Akim + Demaille. + * tests/input.at (Bad character literals): Use it here for + omitting final newlines. + (Bad escapes in literals): Use it here for special characters. + +2009-08-26 Joel E. Denny + + tests: show a use of %define lr.default-reductions "consistent" + * tests/conflicts.at (%nonassoc and eof): Extend to test that it + prevents the omission of expected tokens for %error-verbose. + +2009-08-26 Akim Demaille + + tests: portability fix. + * tests/input.at (Bad escapes in literals): Don't expect "echo + '\0'" to output \ then 0. + +2009-08-26 Joel E. Denny + + Actually handle the yytable zero value correctly this time. + * data/bison.m4 (b4_integral_parser_tables_map): Don't mention + zero values in the YYTABLE comments. + * data/glr.c (yytable_value_is_error): Don't check for zero + value. + * data/lalr1.cc (yy_table_value_is_error_): Likewise. + * data/yacc.c (yytable_value_is_error): Likewise. + * data/lalr1.java (yy_table_value_is_error_): Likewise. + (yysyntax_error): Fix typo in code: use yytable_ not yycheck_. + * src/tables.h: In header comments, explain why it's useless to + check for a zero value in yytable. + +2009-08-25 Joel E. Denny + + More fixes related to last two patches. + * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE + comments: zero indicates syntax error not default action. + * data/c.m4 (b4_table_value_equals): Comment that YYID must be + defined. + * data/glr.c (yyis_pact_ninf): Rename to... + (yypact_value_is_default): ... this. + (yyisDefaultedState): Update for rename. + (yyis_table_ninf): Rename to... + (yytable_value_is_error): ... this, and check for value zero + besides just YYTABLE_NINF. + (yygetLRActions): Check for default value from yypact. It + appears that this check is always performed before this function + is invoked, and so adding the check here is probably redundant. + However, the code may evolve after this subtlety is forgotten. + Also, update for rename to yytable_value_is_error. Because that + macro now checks for zero, a different but equivalent branch of + the if-then-else here is evaluated. + (yyreportSyntaxError): Update for rename to + yytable_value_is_error. The zero condition was mishandled + before. + (yyrecoverSyntaxError): Update for renames. No behavioral + changes. + * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_): + New function. + (yy_table_value_is_error_): New function. + (parse): Use new functions where possible. No behavioral + changes. + (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_. + The zero condition was mishandled before. + * data/yacc.c (yyis_pact_ninf): Rename to... + (yypact_value_is_default): ... this. + (yyis_table_ninf): Rename to... + (yytable_value_is_error): ... this, and check for value zero + besides just YYTABLE_NINF. + (yysyntax_error): Update for rename to yytable_value_is_error. + The zero condition was mishandled before. + (yyparse): Update for renames. No behavioral changes. + * src/tables.h: Improve comments about yypact, yytable, etc. + more. Most importantly, say yytable value of zero means syntax + error not default action. + +2009-08-25 Joel E. Denny + + Fix %error-verbose for conflicts resolved by %nonassoc. + * NEWS (2.5): Document. + * data/glr.c (yyreportSyntaxError): Fix this by checking + yyis_table_ninf. + * data/yacc.c (yysyntax_error): Likewise. + * data/lalr1.cc (yysyntax_error_): Fix this by checking + yytable_ninf_. + * data/lalr1.java (yysyntax_error): Likewise. + * tests/conflicts.at (%nonassoc and eof): Update expected output + and remove FIXME. + +2009-08-25 Joel E. Denny + + Some code and documentation improvements. + * data/c.m4 (b4_table_value_equals): New macro to capture + some repeated code. + * data/glr.c (yyis_pact_ninf): Use it here. + (yyis_table_ninf): Likewise. + (yyreportSyntaxError): Improve internal comments. + * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c. + Use it everywhere possible. + (yyis_table_ninf): Likewise. + (yysyntax_error): Improve internal comments. + * data/lalr1.cc (yysyntax_error_): Likewise. + * data/lalr1.java (yysyntax_error): Likewise. + * src/tables.h: Improve comments about yypact, yytable, etc. + +2009-08-21 Joel E. Denny + + Use locale when quoting. + * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use + quote rather than implementing quoting here. + +2009-08-20 Eric Blake + + Make previous patch more robust. + * src/output.c (ARRAY_CARDINALITY): New macro, copied from + argmatch.h. + (output_skeleton): Use it. + Suggested by Akim Demaille. + + Import latest m4/m4.m4. + * submodules/autoconf: Update to autoconf 2.64. + * configure.ac (M4_GNU_OPTION): New define. + * src/output.c (output_skeleton): Use it to resolve FIXME. + * NEWS: Mention this. + +2009-08-19 Joel E. Denny + + Fix complaints about escape sequences. + Discussed starting at + . + * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): + For a \0 and similar escape sequences meaning the null + character, report an invalid escape sequence instead of an + invalid null character because the latter does not actually + appear in the user's input. + In all escape sequence complaints, don't escape the initial + backslash, and don't quote when the sequence appears at the end + of the complaint line unless there's whitespace that quotearg + won't escape. + Consistently say "invalid" not "unrecognized". + Consistently prefer "empty character literal" over "extra + characters in character literal" warning for invalid escape + sequences; that is, consistently discard those sequences. + * tests/input.at (Bad escapes in literals): New. + +2009-08-19 Akim Demaille + + doc: fixes. + * doc/bison.texinfo: Fix minor Texinfo errors. + +2009-08-19 Akim Demaille + + tests: distcc compliance. + * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's + error messages from the output. + +2009-08-19 Akim Demaille + + variables: simplify the upgrade of namespace into api.namespace. + + This patch simplifies "variables: rename namespace as + api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c. + Suggested by Joel E. Denny in + http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html + + * src/muscle-tab.c (muscle_percent_variable_update): New. + (muscle_percent_define_insert): Use it in replacement of the + previous tr invocation. + Remove variable_tr, no longer needed. + * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy): + Remove. + * data/c++.m4: No longer handle namespace -> api.namespace. + * tests/input.at (%define backward compatibility): Check that + namespace is treated as api.namespace. + +2009-08-19 Akim Demaille + + doc: %initial-action to initialize yylloc. + Reported by Bill Allombert. + * doc/bison.texinfo: Set fill-column to 76. + (Location Type): Document the use of %initial-action to initialize + yylloc. + +2009-08-19 Akim Demaille + + lalr1.cc: use state_type. + * data/lalr1.cc (yysyntax_error_): Use state_type. + Move argument names into yy*. + +2009-08-19 Akim Demaille + + lalr1.cc: get rid of yyparse's yystate. + yystate and yystack_[0].state are equal, keep only the latter. + The former was also used as a temporary variable to compute the + post-reduction state. Move this computation into an auxiliary + function. + + * data/glr.c (yyLRgotoState): Fuse variable definition and first + assignment. + * data/lalr1.cc (yy_lr_goto_state_): New. + (yyparse): Use it. + Replace remaining uses of yystate by yystate_[0].state. + Remove the former. + +2009-08-19 Akim Demaille + + lalr1.cc: destroy $$ when YYERROR is called. + * data/lalr1.cc (yyreduce): Compute the resulting state before + running the user action so that yylhs is a valid symbol. + (yyerrorlab): Since yylhs is complete (it knows its type), we can + simply call yy_destroy_ to destroy $$ on YYERROR invocations. + * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants. + +2009-08-18 Joel E. Denny + + maint: update for gnulib's recent update-copyright changes + * gnulib: Update. + * .x-update-copyright (COPYING): Add as it's no longer implied + when .x-update-copyright is present. + * cfg.mk (update-copyright-local): Remove, now ignored. + (update-copyright): Declare update-b4-copyright as a dependency. + +2009-08-17 Akim Demaille + + build: require gettext 0.17. + + Suggested by Bruno Haible. + http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html + * configure.ac: require gettext 0.17 to ensure compatibility with + gnulib. + +2009-08-17 Akim Demaille + + build: lower gettext requirements. + + Bison was uselessly requiring the formatstring macros from + gettext, which resulted in mo files not being installed on systems + that perfectly supported Bison mo files. Lower the requirement. + http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html + + * configure.ac: Require need-ngettext instead of + need-formatstring-macros. + Reported by Martin Jabocs. + Suggested by Bruno Haible. + * INSTALL: Restructure. + (Internationalization): New. + +2009-08-14 Joel E. Denny + + maint: fix use of copyright year intervals. + * gnulib: Update. + * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu + as now recommended in gnulib/NEWS. + * build-aux/update-b4-copyright: Fix. + * cfg.mk (update-copyright-env): Configure update-copyright. + +2009-08-13 Joel E. Denny + + Make it easier to write deterministic tests. + Continues Akim's work from his 2009-06-10 commits. + * src/reader.c (check_and_convert_grammar): Don't add any + symbols after the first symbols_do invocation. + * src/symtab.c (symbols_sorted): New static global. + (user_token_number_redeclaration): Update comments. + (symbol_from_uniqstr): If a new symbol is being created, assert + that symbols_sorted hasn't been allocated yet. + (symbols_free): Free symbols_sorted. + (symbols_cmp, symbols_cmp_qsort): New functions. + (symbols_do): Sort symbol_table into symbols_sorted on first + invocation. + * tests/input.at (Numbered tokens): Recombine tests now that the + output should be deterministic across multiple numbers. + +2009-08-12 Akim Demaille + + tests: GCC 4.5 compliance. + * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's + messages about #error. + +2009-08-12 Akim Demaille + + build: fix the generation of the documentation. + Some of our targets use "bison --help", but they can't depend on + "bison" itself (to avoid additional requirements on the user), so + they used to call "make src/bison" in the commands. Then + concurrent builds may fail: one make might be aiming one of its + jobs at compiling src/bison, and another job at generating the man + page. If the latter is faster than the former, then we have two + makes that concurrently try to compile src/bison. + + This might also be a more convincing explanation for the failure + described in the patch "build: fix paths". + + * Makefile.am (SUFFIXES): Initialize. + * build-aux/move-if-change: New, symlink to gnulib's. + * build-aux/local.mk: Ship it. + * doc/common.x: Remove, merged into... + * doc/bison.x: here. + * doc/local.mk (doc/bison.help): New. + ($(CROSS_OPTIONS_TEXI)): Depend on it. + Use src/bison. + (.x.1): Replace with... + (doc/bison.1): this explicit, simpler, target. + (common_dep): Remove, inlined where appropriate. + (SUFFIXES, PREPATH): Remove, unused. + +2009-08-12 Akim Demaille + + gnulib: improve prefixing. + * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather, + change the value of... + (gl_LIBOBJS): this. + Adjust more variables. + * etc/prefix-gnulib-mk (prefix_assignment): Don't rename + gl_LIBOBJS. + (prefix): Also transform rules whose targets have slashes. + Use $prefix liberally. + Map @MKDIR_P@ to $(MKDIR_P). + Prefix directories that are mkdir'd. + +2009-08-12 Akim Demaille + + build: fix paths. + When using $(top_builddir) inconsistently, Make (including GNU + Make) is sometimes confused. As a result it may want to build + lib/libbison.la and $(top_builddir)/lib/libbison.la (the same + file, different names) concurrently, which, amusingly enough, + might end with: + + ranlib lib/libbison.a + ranlib lib/libbison.a + make[2]: *** [lib/libbison.a] Segmentation fault + + on OS X. + + * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not + needed. + +2009-08-12 Akim Demaille + + distcheck: fix. + + * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp. + +2009-08-10 Joel E. Denny + + * tests/local.mk (TESTSUITE_AT): Add named-refs.at. + +2009-08-10 Joel E. Denny + + Miscellaneous code readability improvements. + + * src/reader.c (reader): Move %define front-end variable + defaults and checking into... + (prepare_percent_define_front_end_variables): ... this new + function. + + * src/scan-gram.l (INITIAL): For consistency with string + literals, don't store open quote on character literal. It's + discarded before returning anyway. + (SC_ESCAPED_CHARACTER): Similarly, don't store close quote. + Make length test more readable, and make the character stored + for an empty literal more obvious while consistent with the + previous behavior. + + * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to + USER_NUMBER_HAS_STRING_ALIAS throughout. + * src/symtab.c (symbol_make_alias): Remove comment from symtab.c + that is repeated in symtab.h. Improve argument names to make it + clear which side of the symbol-string alias pair is which. + (symbol_check_alias_consistency): Improve local variable names + for the same purpose. + * src/symtab.h (struct symbol): Make comments about aliases + clearer. + (symbol_make_alias): Improve comments and argument name. + * src/output.c (token_definitions_output): Update for rename to + USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases. + +2009-08-08 Alex Rozenman + + Convert "misleading reference" messages to warnings. + * src/scan-code.l: New function 'show_sub_messages', more + factoring. + * tests/named-ref.at: Adjust tests. + +2009-08-06 Joel E. Denny + + maint: run "make update-copyright" + +2009-08-06 Joel E. Denny + + maint: make update-b4-copyright easier to use + * build-aux/update-b4-copyright: In warnings, report line + numbers rather than character positions. + * cfg.mk (update-copyright-local): Set to update-b4-copyright so + that update-copyright runs it. + * gnulib: Update. + +2009-08-05 Joel E. Denny + + maint: clean up update-b4-copyright code + * build-aux/update-b4-copyright: Do not accept 2-digit + UPDATE_COPYRIGHT_YEAR, which was not handled correctly. + Don't accept a `[' in a b4_copyright argument. + Format code more consistently. + Don't assume b4*copyright never occurs. + +2009-08-04 Joel E. Denny + + maint: automate b4_copyright updates. + * Makefile.am (update-b4-copyright): New target rule. + * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright. + * build-aux/update-b4-copyright: New. + * data/yacc.c: Remove stray characters around b4_copyright + invocations. + +2009-08-04 Joel E. Denny + + maint: automate annual package-wide copyright-year update. + * .x-update-copyright: New. + * Makefile.am (EXTRA_DIST): Remove maint.mk. + * bootstrap.conf (gnulib_modules): Add maintainer-makefile and + update-copyright. Remove gnumakefile, which is implied by + maintainer-makefile. + * cfg.mk (bootstrap-tools): Copy from old maint.mk. + * gnulib: Update. + * maint.mk: Remove, now copied from gnulib. + * examples/extexi: Add missing "(C)" in copyright statement so + update-copyright can recognize it. + * src/LR0.h: Likewise. + * src/print.h: Likewise. + * src/print_graph.h: Likewise. + * src/gram.c: Add missing comma in copyright statement. + * src/gram.h: Likewise. + +2009-08-04 Joel E. Denny + + Fix "make distcheck". + * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead + of just calc.stamp. + +2009-08-01 Joel E. Denny + + Pacify "gcc -Wunused" for the input function from Flex. + Reported by Alex Rozenman. This warning shows up with gcc-4.3.0 + and later. + * src/scan-code.l: Add "%option noinput", which I cannot find in + the Flex manual, but which Flex has supported since at least as + far back as 2.5.4. However, if any of our developers still use + Flex 2.5.4, they'll need to stop configuring with + --enable-gcc-warnings because "%option noinput" didn't work + correctly until Flex 2.5.6. + * src/scan-gram.l: Likewise. + * src/scan-skel.l: Likewise. + +2009-07-31 Alex Rozenman + + Fix --enable-gcc-warnings problems. + * src/reader.c: Adjust variable names. + * src/scan-code.l: Fix prototypes and adjust names. + * src/named-ref.c: Remove redundant "if". + +2009-07-29 Joel E. Denny + + Fix a --enable-gcc-warnings problem. + * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length + variable. + +2009-07-24 Joel E. Denny + + Warn about character literals not of length one. + * NEWS (2.5): Document. + * src/scan-gram.l (INITIAL): Remove comment that we don't check + the length. + (SC_ESCAPED_CHARACTER): Warn if length is wrong. + * tests/input.at (Bad character literals): New test group. + +2009-07-24 Alex Rozenman + + Fix some memory leaks. + * src/named-ref.c: Add a pointer check (named_ref_free). + * src/scan-code.l: New function (variant_table_free). Called in + code_scanner_free. + * src/symlist.c: Call to named_ref_free (symbol_list_free). + +2009-07-24 Joel E. Denny + + * src/lalr.c (state_lookahead_tokens_count): Correct comment. + +2009-07-22 Joel E. Denny + + Some M4 cleanup in the testsuite. + Suggested by Eric Blake at + . + * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not + complicate the code by distinguishing between a missing value + and an empty string value for an optional argument. This fix is + allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below. + * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into... + (AT_TEST_TABLES_AND_PARSE): ... this now that the special + arguments are not needed because of the following changes. + Fix stale comments. + Bison developers should use GNU M4 and should not use + POSIXLY_CORRECT when building the test suite, so do not + complicate the code by avoiding $10 and above. + Do not quote an empty string value for an optional argument, and + do not distinguish between a missing value and an empty string + value. + +2009-07-15 Joel E. Denny + + Revert unnecessary column realignment in --help output. + Reported by Akim Demaille at + . + * src/getargs.c (usage): Here. + +2009-07-04 Alex Rozenman + + Alphabetical order in src/local.mk. + * src/local.mk: Adjust. + +2009-07-04 Alex Rozenman + + Style changes and factoring. + * src/named-ref.h: Add comments. + * src/parse-gram.y: Readability and style changes. + * src/reader.c: Factoring: assign_named_ref function. + * src/scan-code.l: Factoring and style changes. Rename + parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib. + Use "unsigned" type for variant index. Improve readablity. + * src/scan-gram.l: Change error messages and add comments. + * src/symlist.h: symbol_list_null: New function decl. + * src/symlist.c: symbol_list_null: Implement here. + * tests/named-refs.at: Adjust for new error messages. + +2009-06-29 Eric Blake + + scan-code: avoid compiler warnings + * src/scan-code.l (parse_named_ref): Use correct specifiers. + +2009-06-29 Akim Demaille + + build: avoid concurrent extraction of calc++. + * examples/calc++/Makefile.am (calc.stamp): New. + Depend on it to create the sources of calc++ so that concurrent + builds don't launch several "extexi" in parallel. + Not only this is inefficient, this also builds incorrect sources + with several extractions mixed together. + +2009-06-29 Akim Demaille + + parse.error: fix. + * data/bison.m4: Move code related to specific variables after the + definition of the variable-maintaining macros so that we don't + "invoke" b4_percent_define_check_values before it is defined. + +2009-06-29 Akim Demaille + + variables: parse.error + + Implement, document, and test the replacement of %error-verbose + by %define parse.error "verbose". + * data/bison.m4 (b4_error_verbose_if): Reimplement to track the + values of the parse.error variable. + Make "simple" its default value. + Check the valid values. + * src/parse-gram.y: Use %define parse.error. + (PERCENT_ERROR_VERBOSE): New token. + Support it. + * src/scan-gram.l: Support %error-verbose. + + * doc/bison.texinfo (Decl Summary): Replace the documentation of + %define error-verbose by that of %define parse.error. + * NEWS: Document it. + + * tests/actions.at, tests/calc.at: Use parse.error instead of + %error-verbose. + +2009-06-27 Alex Rozenman + + Implement support for named symbol references. + * src/parse-gram.y: Add new syntax (named_ref.opt). + * src/reader.c: Store named refs in symbol lists. + * src/reader.h: New argument for symbol_append and + action_append functions. + * src/scan-code.h: Add new field (named_ref) into + code_props data structure. Keeps named ref of midrule + actions. + * src/scan-code.l: Support for named refs in semantic + action code. New function 'parse_named_ref'. + * src/scan-gram.l: Support bracketed id. + * src/symlist.c: Store named refs in symbol lists. + * src/symlist.h: New field in symbol list: named_ref. + * src/named-ref.h: New file, a struct for named_ref. + * src/named-ref.cp: New file, named_ref_new function. + * src/local.mk: Add two new files. + * tests/testsuite.at: Include new test group: + * tests/named-refs.at: this new file. + +2009-06-25 Akim Demaille + + hash: check insertion for memory exhaustion. + * src/uniqstr.c (uniqstr_new): New. + +2009-06-24 Akim Demaille + + variables: rename namespace as api.namespace. + Discussed in + http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html + + * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy): + New. + (b4_percent_define_use): New. + Use it where applicable. + * data/c++.m4: Replace uses of the variable "namespace" by + "api.namespace". + Default the latter to the former. + * doc/bison.texinfo (Decl Summary): Document "namespace" as + obsolete. + Document api.namespace. + Use @samp to document %define uses, keep @code for identifiers. + * NEWS: Likewise. + * tests/c++.at, tests/input.at: Test api.namespace instead of + namespace. (The tests passed with namespace.) + +2009-06-11 Akim Demaille + + style changes. + * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes. + * src/print-xml.c: Style changes. + * tests/conflicts.at: Comment changes. + +2009-06-11 Akim Demaille + + xml: beware of user strings used to give a %prec to rules. + * tests/conflicts.at (%prec with user strings): New. + * src/gram.c (grammar_rules_print_xml): Escape the precedence for + XML output. + +2009-06-11 Akim Demaille + + hash: check insertion for memory exhaustion. + * src/muscle-tab.c (muscle_insert, muscle_grow) + * src/state.c (state_hash_insert): Check the return value of + hash_insert. + +2009-06-11 Akim Demaille + + tests: honor TESTSUITEFLAGS in every check target. + * tests/local.mk (RUN_TESTSUITE): New. + (check-local, installcheck-local, maintainer-check-g++) + (maintainer-check-posix, maintainer-check-valgrind): Use it. + +2009-06-10 Akim Demaille + + deterministic test suite. + Some consistency checks on symbols are performed after all the + symbols were read, by an iteration over the symbol table. This + traversal is nondeterministic, which can be a problem for test + cases. + Avoid this. + Addresses another form of nondeterminism reported by Joel E. Denny. + http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html + + * tests/input.at (Numbered tokens): Split the hexadecimal/decimal + test in two. + Use different file names for the three tests to make the + maintenance easier. + +2009-06-10 Akim Demaille + + gnulib: update. + * gnulib: Update to latest. + * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, + * m4/.gitignore: Regen. + * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr): + Call xalloc_die on hash_insert failures. + Requested by the new __warn_unused_result__ attribute of + hash_insert. + +2009-06-10 Akim Demaille + + deterministic user-token-number redeclaration errors. + Address nondeterminism reported by Joel E. Denny. + http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html + + * src/uniqstr.h: Comment changes. + * src/location.h (boundary_cmp, location_cmp): New. + * src/symtab.c (user_token_number_redeclaration): New. + (symbol_translation): Use it. + * tests/input.at (Numbered tokens): Adjust the expected output. + +2009-05-25 Akim Demaille + + build: avoid ignored errors. + * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored + errors, they pollute the output. + +2009-05-22 Joel E. Denny + + Convert multiple variable definition warnings to complaints. + * NEWS (2.5): Add a new entry for that change. + * doc/bison.texinfo (Decl Summary): Update %define entry. + (Bison Options): Update -D/--define/-F/--force-define entry. + * src/muscle-tab.c (muscle_percent_define_insert): Implement. + * src/muscle-tab.h (muscle_percent_define_insert): Update + comments. + * tests/input.at (`%define errors'): Update. + (`%define, --define, --force-define'): Update. + +2009-05-22 Joel E. Denny + + -F/--force-define and relative %define/-D/--define priorities. + * NEWS (2.5): Add documentation to -D/--define entry. + * build-aux/cross-options.pl: Hard-code association of + --force-define with %define. + * doc/bison.texinfo (Decl Summary): In %define entry, + cross-reference command-line options. + (Bison Options): Add documentation to -D/--define entry. + (Option Cross Key): Widen column for --force-define row. + * src/getargs.c (usage): Document -F/--force-define. Realign + options in output. + (short_options, long_options, getargs): Parse -F/--force-define, + and update muscle_percent_define_insert invocations. + * src/muscle-tab.h (muscle_percent_define_how): New enum type. + (muscle_percent_define_insert): Add argument with that type. + * src/muscle-tab.c (muscle_percent_define_insert): Implement + -F/--force-define behavior and priorities. + (muscle_percent_define_ensure): Update + muscle_percent_define_insert invocation. + * src/parse-gram.y (prologue_declaration): Update + muscle_percent_define_insert invocations. + * tests/input.at (`%define, --define'): Rename to... + (`%define, --define, --force-define'): ... this and extend. + +2009-05-22 Joel E. Denny + + Update some comments to make sense for -D. + * data/bison.m4 (b4_check_user_names): In header comments, say + "user occurrence" instead of "grammar occurrence". + * src/muscle-tab.h (muscle_percent_define_insert): Likewise. + (muscle_percent_code_grow): Likewise just for consistency. + +2009-05-20 Joel E. Denny + + * data/c++.m4 (b4_namespace_close): Simplify slightly. + +2009-05-19 Joel E. Denny + + Handle a trailing `:' in a user-supplied C++ namespace better. + * data/c++.m4 (b4_namespace_close): Don't let it be printed + among the closing braces here. This fix might make the + generated code easier to debug, but otherwise it should be + insignificant because a trailing `:' is a C++ error already. + +2009-05-19 Akim Demaille + + remove useless variable. + * src/getargs.c (skeleton_arg): Remove now useless variable. + Should help the compiler see that this printf-like call is sane. + +2009-05-15 Akim Demaille + + Rename token.prefix as api.tokens.prefix. + Discussed here. + http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html. + + * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo, + * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at + (token.prefix): Rename as... + (api.tokens.prefix): this. + +2009-05-11 Akim Demaille + + doc: use C++ headers. + * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C + headers. + +2009-05-11 Akim Demaille + + doc: token.prefix + * doc/bison.simple (Decl Summary): Document token.prefix. + (Calc++ Parser): Various fixes. + Formatting changes. + Use token.prefix. + Introduce a macro TOKEN to shorten the code and make it more + readable. + (Calc++ Scanner): Adjust. + * NEWS (Variable token.prefix): New. + +2009-05-04 Akim Demaille + + bison: catch bad symbol names. + * src/scan-gram.l({int}{id}): Report as an invalid identifier. + * tests/input.at: Adjust. + +2009-05-04 Akim Demaille + + identifiers: dashes are letters. + Dashes can now start identifiers (symbols and directives). + + * src/scan-gram.l ({letter}): Add dash. + ({id}): Remove it. + * tests/input.at (Symbols): Adjust. + Remove stray comment. + * tests/regression.at (Invalid inputs): Adjust error message. + * doc/bison.texinfo (Symbols): Update. + +2009-05-01 Joel E. Denny + + Declare %code to be a permanent feature. + * NEWS (2.4.2): Here. + * doc/bison.texinfo (Prologue Alternatives): Don't say it's + experimental. + (Decl Summary): Likewise. + +2009-04-30 Joel E. Denny + + Convert underscores to dashes in some %define variable names. + For now, just api.push-pull and lr.keep-unreachable-states. + Maintain old names for backward compatibility. + * NEWS (2.5): Document. + * data/c.m4 (b4_identification): Update comment. + * data/yacc.c: Update access. + * doc/bison.texinfo: Update. + * etc/bench.pl.in (bench_push_parser): Update use. + * src/files.c (tr): Move to... + * src/getargs.c, src/getargs.h (tr): ... here because I can't + think of a better place to expose it. My logic is that, for all + uses of tr so far, command-line arguments can be involved, and + getargs.h is already included. + * src/main.c (main): Update access. + * src/muscle_tab.c (muscle_percent_define_insert): Convert old + variable names to new variable names before assigning value. + * src/reader.c (reader): Update setting default. + * tests/calc.at: Update uses. + * tests/conflicts.at (Unreachable States After Conflict + Resolution): Update use. + * tests/input.at (%define enum variables): Update use. + (%define backward compatibility): New test group. + * tests/push.at: Update uses. + * tests/reduce.at: Update uses. + * tests/torture.at: Update uses. + +2009-04-30 Joel E. Denny + + Set all front-end %define defaults in one place. + * src/main.c (main): Move lr.keep_unreachable_states default... + * src/reader.c (reader): ... to here. + +2009-04-29 Joel E. Denny + + Rename lr.default_reductions to lr.default-reductions. + * NEWS (2.5): Here. + * doc/bison.texinfo: Here. + * src/lalr.c (initialize_LA): Here. + * src/print.c (print_reductions): Here. + * src/reader.c (reader): Here. + * src/tables.c (action_row): Here. + * tests/input.at (%define enum variables): Here. + * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here. + +2009-04-29 Joel E. Denny + + Pacify ./configure --enable-gcc-warnings. + * tests/input.at (Symbols): Prototype yyerror and yylex. + +2009-04-29 Joel E. Denny + + Document how `%define "var" "value"' is not M4-friendly. + * src/parse-gram.y (variable): In comments here. + +2009-04-24 Joel E. Denny + + Clean up recent patches a little. + Reported by Akim Demaille. + * doc/bison.texinfo (Understanding): Fix typos. + * src/print.c (print_reductions): Don't use negated variable. + +2009-04-24 Joel E. Denny + + List accepted values for a %define enum variable with an invalid value. + Suggested by Akim Demaille at + . + * data/bison.m4 (_b4_percent_define_check_values): Implement. + * src/muscle-tab.c (muscle_percent_define_check_values): Implement. + * tests/input.at (%define lr.default_reductions invalid values): Merge + into... + (%define enum variables): ... here, and update output. + +2009-04-23 Joel E. Denny + + Rename "default rule" to "default reduction". + This includes changing variable names in code, changing + comments, and renaming %define lr.default_rules to %define + lr.default_reductions. + * NEWS (2.5): Update IELR documentation. + * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT + documentation. + * data/glr.c, data/lalr1.java: Sync copyright dates. + * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions + and lr.type documentation. Make some other wording + improvements. + (Glossary): Adjust cross-references and Default Reduction + definition. + * src/lalr.c (state_lookahead_tokens_count): Adjust code. + Remove a confusing comment pointed out by Akim Demaille. + (initialize_LA): Adjust code. + * src/print-xml.c (print_reductions): Adjust code. + * src/print.c (print_reductions): Adjust code. + * src/reader.c (reader): Adjust code. + * src/tables.c (action_row): Adjust code. + (token_actions): Adjust code. + * src/tables.h: Adjust YYDEFACT documentation. + * tests/input.at (%define lr.default_rules invalid values): + Rename test group to... + (%define lr.default_reductions invalid values): ... this, and + update grammar file and expected output. + * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to... + (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update. + +2009-04-21 Akim Demaille + + tests: check the use of dashes and periods in symbols. + * tests/input.at (Symbol): New test group. + +2009-04-21 Joel E. Denny + + Document %define lr.type and lr.default_rules. + * NEWS (2.5): Add an entry. + * src/getargs.c (usage): Mention IELR(1) and canonical LR(1) + besides just LALR(1) and GLR(1). + * doc/bison.texinfo (Introduction): Likewise. + (Language and Grammar): Bison is no longer limited to LALR(1) + restrictions. + (GLR parsing): Say deterministic or LR(1) rather than LALR(1) + when trying to distinguish from GLR. Talk about LR(1) grammars + rather than LALR(1) grammars. + (Decl Summary): In %define api.push_pull entry, say it applies + to deterministic parsers in C rather than LALR(1) parsers in C. + Add lr.default_rules entry. + Add lr.type entry. + (Mystery Conflicts): Bison is no longer limited to LALR(1) + restrictions. + (Generalized LR Parsing): Same changes as for the previous GLR + section. + (Memory Management): Say deterministic rather than LALR(1). + (Understanding): Correct some bison output. + Index discussion of "accepting state". + Say deterministic rather than LALR(1). + (Bison Options): In --yacc entry, say deterministic rather than + LALR(1). + In --report, --graph, and --xml entries, just don't mention + LALR(1). + (C++ Parsers): Say deterministic rather than LALR(1). + (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry. + (Glossary): Add Accepting State, Consistent State, Default Rule, + and IELR(1) definitions. + In Generalized LR (GLR) definition, make same changes as in + previous GLR sections. + In LALR(1) definition, say Bison uses LALR(1) by default rather + than implying Bison is limited to LALR(1). + (LocalWords): Add IELR. + +2009-04-21 Joel E. Denny + + Finish implementing %define lr.type. + Its value can be "LALR", "IELR", or "canonical LR". + * lib/timevar.def (TV_IELR_PHASE1): New var. + (TV_IELR_PHASE2): New var. + (TV_IELR_PHASE3): New var. + (TV_IELR_PHASE4): New var. + * src/Makefile.am (bison_SOURCES): Add AnnotationList.c, + AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c, + Sbitset.h, ielr.h, and ielr.c. + * src/getargs.h, src/getargs.c (enum trace, trace_args, + trace_types): Add trace_ielr. + * src/lalr.h, src/lalr.c (ngotos): Export it. + (F): Rename to... + (goto_follows): ... this, update all uses, and export it. + (set_goto_map): Export it. + (map_goto): Export it. + (compute_lookahead_tokens): Don't free goto_follows yet. Now + handled in ielr. + (initialize_LA): Export it. Move lookback allocation to... + (lalr): ... here because, for canonical LR, initialize_LA must + be invoked but lookback and much of the rest of LALR isn't + needed. + * main.c (main): Instead of lalr, invoke ielr, which invokes + lalr. + * src/reader.c (reader): Default lr.type to "LALR". + Default lr.default_rules to "accepting" if lr.type is "canonical + LR". Leave the default as "all" otherwise. + Check for a valid lr.type value. + * src/state.h, src/state.c (struct state_list): Add state_list + member. + (state_new): Initialize state_list member to NULL. + (state_new_isocore): New function, exported. + * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that + exercises all values of lr.type. + (GNU AWK Grammar): Rename test group to... + (GNU AWK 3.1.0 Grammar): ... this, and extend to use + AT_TEST_EXISTING_GRAMMAR. + (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR. + (GNU pic Grammar): Rename test group to... + (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use + AT_TEST_EXISTING_GRAMMAR. + * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises + all values of lr.type. + (Single State Split): New test groups using AT_TEST_LR_TYPE. + (Lane Split): Likewise. + (Complex Lane Split): Likewise. + (Split During Added Lookahead Propagation): Likewise. + +2009-04-21 Joel E. Denny + + Add new files for IELR and canonical LR implementation. + * src/AnnotationList.c: New. + * src/AnnotationList.h: New. + * src/InadequacyList.c: New. + * src/InadequacyList.h: New. + * src/Sbitset.c: New. + * src/Sbitset.h: New. + * src/ielr.c: New. + * src/ielr.h: New. + +2009-04-20 Joel E. Denny + + Implement %define lr.default_rules. + Its value describes the states that are permitted to contain + default rules: "all", "consistent", or "accepting". + * src/reader.c (reader): Default lr.default_rules to "all". + Check for a valid lr.default_rules value. + * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules + is "accepting", then only mark the accepting state as + consistent. + (initialize_LA): Tell state_lookahead_tokens_count whether + lr.default_rules is "accepting". + * src/tables.c (action_row): If lr.default_rules is not "all", + then disable default rules in inconsistent states. + * src/print.c (print_reductions): Use this opportunity to + perform some assertions about whether lr.default_rules was + obeyed correctly. + * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that + helps with checking the parser tables for a grammar. + * tests/input.at (%define lr.default_rules invalid values): New + test group. + * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using + AT_TEST_TABLES_AND_PARSE. + (`no %define lr.default_rules'): New test group generated by + AT_TEST_LR_DEFAULT_RULES. + (`%define lr.default_rules "all"'): Likewise. + (`%define lr.default_rules "consistent"'): Likewise. + (`%define lr.default_rules "accepting"'): Likewise. + +2009-04-20 Akim Demaille + + Formatting change. + +2009-04-20 Akim Demaille + + bison: factoring. + * src/output.c (token_definitions_output): Use symbol_id_get + instead of duplicating its logic. + * TODO (YYERRCODE): Extend. + +2009-04-20 Akim Demaille + + variables: prefer error-verbose to error_verbose. + * data/bison.m4 (b4_error_verbose_if): Based on error-verbose + instead of error_verbose. + * src/scan-gram.l (%error-verbose): Map to the error-verbose + variable. + * doc/bison.texinfo: Promote %define error-verbose instead of + %error-verbose. + * tests/actions.at: Prefer %define error-verbose to %error-verbose. + +2009-04-15 Akim Demaille + + variables: accept dashes. + * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to + underscores. + * src/scan-gram.l ({id}): Also accept dashes after the initial + letter. + ({directive}): Use {id}. + * src/parse-gram.y: Comment and formatting changes. + * doc/bison.texinfo (Symbols): Adjust the lexical definitions of + symbols. + * src/complain.h, src/complain.c (yacc_at): New. + * src/symtab.c (symbol_new): Use yacc_at to report inappropriate + symbol names. + * src/output.c (token_definitions_output): Do not #define token + names with dashes. + +2009-04-20 Akim Demaille + + Consistently refer to Yacc, not YACC. + * src/getargs.c (usage, warnings_args): s/YACC/Yacc/. + +2009-04-17 Joel E. Denny + + Pacify make maintainer-check-posix. + * tests/input.at (%define, --define): Move bison command-line + options before grammar file name. + +2009-04-04 Joel E. Denny + + Document semicolon warnings. + * NEWS (2.5): Here. + +2009-04-14 Akim Demaille + + variables: use `parse.assert' instead of `assert'. + * TODO (assert): Remove. + * data/bison.m4 (b4_assert_if): Replace with... + (b4_parse_assert_if): this. + * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust. + * doc/bison.texinfo (Decl Summary): Document parse.assert. + +2009-04-14 Akim Demaille + + variables: use `parse.trace' instead of `debug'. + * src/getargs.c (getargs): Map -t to %define trace.parse. + * src/scan-gram.l (%debug): Map to %define trace.parse. + * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable + names to `_' in macro names. + (b4_debug_if): Replace with... + (b4_parse_trace_if): this. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, + * data/yacc.c: Adjust. + * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted. + Use @code to label the variable list. + Document the variable parse.trace. + (Tracing): Promote the parse.trace variable. + * TODO: %printer is not documented. + +2009-04-14 Akim Demaille + + doc: minor fixes. + * doc/bison.texinfo (Decl Summary): Fix entry about %debug. + (Table of Symbols): Remove duplicate entry for %debug. + +2009-04-10 Eric Blake + + submodules: update to latest + * submodules/autoconf: Use latest upstream Autoconf. + +2009-04-06 Eric Blake + + Work around autoconf 2.63b bug in testsuite. + * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping + autoconf bug related to # in test. + +2009-04-06 Joel E. Denny + + * NEWS (2.5): New section. Describe new -D/--define feature. + +2009-04-06 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2009-04-06 Akim Demaille + + rename muscle_tab.* as muscle-tab.* for consistency. + * src/muscle_tab.h, src/muscle_tab.c: Rename as... + * src/muscle-tab.h, src/muscle-tab.c: these. + * src/getargs.c, src/local.mk, src/main.c, src/output.c, + * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust. + +2009-04-06 Akim Demaille + + Makefile: introduce $(BISON). + * src/local.mk (BISON): New. + (YACC): Use it. + +2009-04-06 Akim Demaille + + parser: handle %locations as %define locations. + * src/getargs.h, src/getargs.c (locations_flag): Remove. + * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure + to set "locations" to true. + * src/output.c (prepare): Don't output "locations". + * src/scan-gram.l (%locations): Handle it as a %. + * src/parse-gram.y: It's no longer a token. + Don't handle it. + * data/bison.m4 (b4_locations_if): Define it with + b4_percent_define_if_define. + * data/c.m4, data/glr.cc: Adjust. + +2009-04-06 Akim Demaille + + Regen. + * src/parse-gram.c: Regen. + +2009-04-06 Akim Demaille + + muscle: factor the handling of obsolete of obsolete directives. + Suggested by Joel E. Denny. + + * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure): + New, extracted from... + * src/parse-gram.y (prologue_declaration: pure-parser): here. + Remove it. + (prologue_declaration: "%"): Use + muscle_percent_define_ensure. + (%error-verbose, %pure-parser): No longer tokens. + * src/scan-gram.l (pure-parser): Return as a %. + +2009-04-06 Joel E. Denny + + Fix options documentation. + * build-aux/cross-options.pl: As in --help output, write optional + arguments as [=ARG] not =[ARG]. + * doc/bison.texinfo (Bison Options): Add -W/--warnings argument. + +2009-04-04 Joel E. Denny + + Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4. + If the first m4 in $PATH is wrong, it keeps looking. Moreover, its + requirements for a correct m4 are stricter. + * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4. + * configure.ac: Update to use AC_PROG_GNU_M4. + Reported by Eric Blake. + +2009-04-03 Joel E. Denny + + Help with updating web manual. + * HACKING: Incorporate instructions from gnulib/doc/README. + * bootstrap.conf (gnulib_modules): Add gendocs. + +2009-04-03 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2009-04-03 Akim Demaille + + Factor %FLAG at scan level. + * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token + definitions and associated rules, replaced by.... + (PERCENT_FLAG): this new token type, and rule. + * src/scan-gram.l (RETURN_PERCENT_FLAG): New. + Use it for %debug and %error-verbose. + +2009-04-03 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2009-04-03 Akim Demaille + + Treat %debug as %define debug. + * data/bison.m4 (b4_debug_if): New. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c, + * data/lalr1.java: Use it instead of b4_debug_flag. + * src/getargs.h, src/getargs.c (debug_flag): Remove. + * src/output.c (prepare): Don't output it. + * src/parse-gram.y: Treat %debug as %define debug. + +2009-04-03 Akim Demaille + + Treat %error-verbose as %define error_verbose. + This allows to pass -Derror_verbose on the command line. Better + yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with + ERROR_VERBOSE being defined as false or true. + * data/bison.m4 (b4_percent_define_if_define): Instead of relying + on b4_percent_define_ifdef, for does not check the defined value, + but only whether the symbol is defined, rely on + b4_percent_define_flag_if, so that a value of "false" is processed + as a false. + If not defined, define the flag to "false". + (b4_error_verbose_if): New. + * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of + b4_error_verbose_flag. + * src/getargs.h, src/getargs.c (error_verbose_flag): Remove. + * src/output.c (prepare): Don't output it. + * src/parse-gram.y (%error-verbose): Treat as %define error_verbose. + +2009-04-03 Joel E. Denny + + Fix strange %define locations for default values. + Reported by Akim Demaille at + + and discussed again starting at + . + * data/bison.m4 (b4_percent_define_default): Leave syncline blank + because location information is bogus. + Use angle brackets to delimit fake file name because square brackets + look like underexpanded m4. Choose a better fake file name. + Use negative line numbers. + * src/muscle_tab.c (muscle_percent_define_default): Likewise. + * src/location.c (location_print): If line for a boundary is negative, + only print that boundary's file name. + * src/location.h: Document that. + * tests/skeletons.at (%define Boolean variables: invalid skeleton + defaults): Update output. + +2009-04-03 Joel E. Denny + + Pacify ./configure --enable-gcc-warnings. + * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files + in lib won't compile with it. + * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only. + +2009-03-31 Akim Demaille + + bootstrap: --help to stdout. + * bootstrap (usage): Don't send --help to stderr. + Use a here doc instead of a long string. + +2009-03-31 Akim Demaille + + bootstrap: README-hacking no longer exists + * bootstrap (checkout_only_file): Set to HACKING. + +2009-03-26 Akim Demaille + + doc: merge HACKING and README-hacking. + Two files is confusing. + Reported by Alexandre Duret-Lutz. + + * README-hacking: Merge into... + * HACKING (Working from the repository): here. + +2009-03-26 Akim Demaille + + doc: update README-hacking. + * README-hacking: We now use git and git submodules. + Reported by Ralf Wildenhues and Alexandre Duret-Lutz. + +2009-03-26 Akim Demaille + + lalr1.cc: avoid GCC 4.3 warnings. + GCC 4.3 now warns about "a || b && c" and asks for explicit + parentheses. + Reported by Alexandre Duret-Lutz. + * data/location.cc: Update copyright years. + (Position::operator==): Use parens to make precedence explicit. + Compare lines and columns first, as they are more likely to be + different, and they are faster to compare. + +2009-03-26 Akim Demaille + + gnulib: update. + * gnulib: Update to latest. + * src/local.mk (AM_CFLAGS): Move to... + * Makefile.am: here. + * etc/prefix-gnulib-mk (prefix_assignment): Also transform + AM_CFLAGS. + +2009-03-02 Akim Demaille + + Comment changes. + +2009-03-02 Akim Demaille + + Share b4_yytranslate_define. + * data/lalr1.cc (b4_yytranslate_define): Move to... + * data/c++.m4: here. + +2009-03-02 Akim Demaille + + Use locations in the variant example. + Yes, this obfuscates the point of this example, variants only. + But glr.cc cannot work (yet?) without locations. This change + makes it easier to use this example with glr.cc. + + * examples/variant.yy (assert): %define it. + (locations): Request them. + (yylex): Bind the location to the stage. + +2009-03-02 Akim Demaille + + Dub make_TOKEN as a public type interface. + * data/c++.m4 (b4_symbol_constructor_declare) + (b4_symbol_constructor_define): New empty stubs. + (b4_public_types_declare, b4_public_types_define): Use them. + * data/lalr1.cc (b4_symbol_constructor_declare) + (b4_symbol_constructor_declare_) + (b4_symbol_constructor_define_, b4_symbol_constructor_define): + Move to... + * data/variant.hh: here. + Remove the "b4_variant_if" parts, as variant.hh is loaded only if + needed. + * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and + b4_symbol_constructor_declare, as it is now done by + b4_public_types_define and b4_public_types_declare. + +2009-03-02 Akim Demaille + + Coding style changes. + * data/lalr1.cc (b4_symbol_constructor_declaration_) + (b4_symbol_constructor_declarations) + (b4_symbol_constructor_definition_) + (b4_symbol_constructor_definitions) + (b4_yytranslate_definition): Rename as... + (b4_symbol_constructor_declare_) + (b4_symbol_constructor_declare) + (b4_symbol_constructor_define_) + (b4_symbol_constructor_define) + (b4_yytranslate_define): these. + * data/variant.hh (b4_variant_definition): Rename as... + (b4_variant_define): this. + +2009-03-02 Akim Demaille + + Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if. + * data/bison.m4 (b4_percent_define_if_define): New. + * data/c++.m4 (b4_variant_if): Move to... + * data/bison.m4: Here, using b4_percent_define_if_define. + * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to... + * data/bison.m4: Here, using b4_percent_define_if_define. + +2009-03-02 Akim Demaille + + Dub symbol_type_base as a public type. + * data/c++.m4 (b4_public_types_declare): Now define + symbol_type_base and symbol_type. + (b4_public_types_define): New. + In both cases, the definitions are taken verbatim from lalr1.cc. + * data/lalr1.cc: Adjust. + +2009-03-02 Akim Demaille + + b4_public_types_declare. + * data/c++.m4 (b4_public_types_declare): New. + * data/glr.cc, data/lalr1.cc: Use it. + +2009-03-02 Akim Demaille + + b4_semantic_type_declare. + * data/c++.m4 (b4_semantic_type_declare): New. + Factors and generalizes what was in glr.cc and lalr1.cc. + * data/variant.hh (b4_semantic_type_declare): Redefine it for + variants. + * data/lalr1.cc, data/glr.cc: Use it. + +2009-02-26 Akim Demaille + + Upgrade gnulib. + * gnulib: Upgrade from master. + * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore: + Regen. + +2009-02-25 Akim Demaille + + Remove useless arguments. + * data/glr.c (yy_reduce_print): $$ and @$ are not used and not + relevant. + +2009-02-25 Akim Demaille + + Comment changes. + * data/lalr1.cc: here. + +2009-02-25 Akim Demaille + + Fix glr.cc's debug level handling. + * data/glr.cc (yydebug_): Remove, as it is actually yydebug from + glr.c which is used. + (debug_level, set_debug_level): Adjust. + +2009-02-25 Akim Demaille + + Copyright years. + * data/glr.c: Add 2007 and 2008 here, consistenly with the comments. + +2009-02-25 Akim Demaille + + Style changes. + * etc/bench.pl.in (generate_grammar_list): Consitently use + location_type, not yy::location. + +2009-02-25 Akim Demaille + + Comment change. + * data/lalr1.cc: here. + +2009-02-19 Akim Demaille + + Make yyparser::error public. + * data/lalr1.cc: here. + There is no good reason to keep it private (and it is convenient + to use it from the scanner for instance). It is already public in + glr.cc. + +2009-02-19 Akim Demaille + + Comment changes. + * data/glr.cc: here. + +2009-02-19 Akim Demaille + + Remove trailing blanks. + The epilogue has its own ending \n, no need to add another. + + * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the + epilogue. + * data/glr.cc: dnl when extending the epilogue. + Remove stray "private:". + +2009-02-19 Akim Demaille + + Use b4_c_modern. + * data/c.m4 (b4_c_function_decl): Here. + +2009-02-19 Akim Demaille + + Comment changes. + * data/lalr1.cc: here. + +2009-02-19 Akim Demaille + + Extract variant.hh + * data/variant.hh: New, extracted from... + * data/lalr1.cc: here. + Adjust. + * data/local.mk: Adjust. + +2009-02-19 Akim Demaille + + Extract stack.hh from lalr1.cc. + * data/stack.hh: New. + * data/lalr1.cc: Extract from here. + * data/local.mk: Adjust. + +2009-02-03 Joel E. Denny + + Add reminder about uploading public key to keys.gnupg.net. + * HACKING (Release Procedure): Here. + +2009-01-28 Akim Demaille + + * NEWS: Update information about 2.4.1 and 2.4.2. + +2008-11-04 Akim Demaille + + Reformat NEWS. + * NEWS: Use more outline-mode markup. + Suggested by Jim Meyering. + +2009-01-08 Akim Demaille + + Fix grep portability issues. + Grep on Solaris does not support -q. + Reported by Summum Bonum. + + * NEWS: Add a stub for 2.4.2. + * THANKS: Add Summum Bonum. + * tests/atlocal.in (EGREP): New. + (CC, CXX, XSLTPROC): Make it possible to override them via + envvars. + * tests/java.at: Use $EGREP instead of egrep. + Use AT_CHECK's ignore instead of grep's -q. + +2008-12-11 Akim Demaille + + Pass the token type to yysyntax_error. + * data/yacc.c (yysyntax_error): Take the transated token instead + of the raw number. + Adjust callers. + * TODO: Update. + +2008-12-11 Akim Demaille + + Formatting changes. + * data/glr.c: Formatting changes. + +2008-12-11 Akim Demaille + + Propagate i18n changes into glr.c. + * TODO: Update. + * data/glr.c (yyreportSyntaxError): Use "switch" instead of + building the error message format dynamically. + * data/lalr1.java: Formatting changes. + +2008-12-11 Akim Demaille + + Use testsuite -C. + * tests/local.mk: Replace "cd && testsuite" by "testsuite -C". + Solves problems when top_srcdir is an absolute path. + Suggested by Eric Blake. + * configure.ac: Require Autoconf 2.62. + +2008-12-11 Akim Demaille + + Simplify the i18n of the error messages. + * data/lalr1.cc: Comment changes. + * data/yacc.c (yysyntax_error): Rewrite, using a switch as in + lalr1.cc instead of building dynamically the format string. + +2008-12-08 Akim Demaille + + Fix portability issue in the test suite. + * tests/local.at (AT_MATCHES_CHECK): New. + Based on Perl instead of Sed. Sed has too many portability + pitfalls, not ever Sed is GNU Sed. + * tests/actions.at (Fix user actions without a trailing semicolon): + Use it. + +2008-12-08 Akim Demaille + + Update data/README. + * data/README: Document glr.cc, lalr1.java, m4sugar and xslt. + +2008-12-08 Akim Demaille + + Install autoconf as a submodule to get m4sugar. + * .gitmodules: Add submodules/autoconf. + * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into + submodules/autoconf. + +2008-12-08 Akim Demaille + + Test token.prefix in all the skeletons. + * data/java.m4 (b4_token_enum): Use the token.prefix. + * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX. + * tests/calc.at (_AT_DATA_CALC_Y): Use it. + Add checks for yacc.c, glr.c, lalr1.cc and glr.cc. + * tests/java.at: Comment changes. + (AT_CHECK_JAVA_MINIMAL): Define the END token. + (Java parser class and package names): Add token.prefix check. + +2008-12-08 Akim Demaille + + Fix regeneration of atconfig. + * tests/local.mk (tests/atconfig): The rule was incorrect, but + remove it: now that there is no tests/Makefile.am, the top-level + Makefile properly updates atconfig when needed. + +2008-12-07 Di-an Jan + + Implement the FIXME that ends an user action with a semicolon + if it seems necessary. + * src/scan-code.l (flex rules section): Flag cpp directive from + any `#' to the first unescaped end-of-line. Semicolon is not + needed after `;', `{', '}', or cpp directives and is needed after + any other token (whitespaces and comments have no effect). + * tests/actions.at (Fix user actions without a trailing semicolon): + New test. + * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to + to make user actions complete statements. + Adjust column numbers in error messages. + * tests/regression.at (Fix user actions without a trailing semicolon): + Remove. Covered by new test. + +2008-12-07 Akim Demaille + + Update gnulib. + * gnulib: Update from master. + +2008-12-05 Eric Blake + + Avoid compiler warning. + * src/output.c (muscle_insert_item_number_table): Delete unused + function. + +2008-12-02 Eric Blake + + Build testsuite with newer autoconf. + * tests/output.at (m4_expand): Don't override in newer autoconf, + where the underlying implementation changed. + * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT) + (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT) + (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR) + (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings, + since some of them contain unbalanced ')'. + +2008-12-01 Akim Demaille + + Use b4_symbol for printers and destructors everywhere. + * data/bison.m4 (b4_symbol_action_location): New. + * data/c.m4 (b4_symbol_actions): Remove. + Adjust all callers to use by b4_symbol_foreach and the corresponding + b4_symbol_printer/destructor macro. + * data/glr.cc: Adjust. + * data/lalr1.java: Adjust the %destructor sanity check. + * src/output.c (symbol_code_props_output): Remove, we no longer + need the b4_symbol_printers/destructors tables. + +2008-12-01 Akim Demaille + + Use b4_symbol_case_. + * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use + b4_symbol_case_. + +2008-12-01 Akim Demaille + + Move b4_symbol based macro to bison.m4. + * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if) + (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer) + (b4_symbol_case_, b4_symbol_foreach, b4_type_action_) + (b4_type_foreach): Move to... + * data/bison.m4: Here. + * data/lalr1.cc (b4_symbol_action): Specialize for C++: use + b4_symbol_value_template instead of b4_symbol_value. + +2008-12-01 Akim Demaille + + b4_symbol/type_foreach. + * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New. + Use them. + +2008-12-01 Akim Demaille + + Use the symbol properties to output the printer/destructor for lalr1.cc. + Instead of defining complex list of tuples to define various + properties of the symbols, we now prefer to define symbols as + "structs" in m4: using the symbol key (its number), and the + property name, b4_symbol gives it value. Use this to handle + destructors and printers. + + * src/output.c (CODE_PROP): New. + (prepare_symbol_definitions): Use it to define the printer and + destructor related attributes of the symbols. + * data/lalr1.cc (b4_symbol_actions): Rename as... + (b4_symbol_action): this. + Use b4_symbol instead of 6 arguments. + (b4_symbol_printer, b4_symbol_destructor): New. + Use them instead of b4_symbol_actions. + +2008-12-01 Akim Demaille + + Avoid capturing variables too easily. + * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use + v__ and p__ instead of v and p. + +2008-12-01 Akim Demaille + + Remove spurious empty line before syncline. + * data/bison.m4 (b4_syncline): Don't output an empty line before + the output. + +2008-11-26 Akim Demaille + + Convert lib/Makefile.am into lib/local.mk. + The real problem is rather gnulib.mk, which itself is extracted + from a Makefile.am that gnulib expects to the "recursive". The + tool prefix-gnulib-mk converts such a gnulib.mk to be + non-recursive. Also, some AC_SUBST variables need to be adjusted. + + * etc/prefix-gnulib-mk: New. + * bootstrap (slurp): Use it to convert further gnulib.mk. + No longer try to avoid re-creation of lib/gnulib.mk as the changes + are deeper. + * lib/Makefile.am: Rename as... + * lib/local.mk: this. + Adjust to be prefixed. + * Makefile.am, configure.ac: Adjust. + * src/local.mk (AM_CPPFLAGS): Extend it, don't define it. + +2008-11-26 Akim Demaille + + s/_FLAGS/FLAGS/. + * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as... + (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS. + Reported by Eric Blake. + +2008-11-26 Akim Demaille + + Use b4_parser_tables_define in glr.cc. + * data/glr.c: Use b4_parser_tables_define instead of defining the + (deterministic integral) tables by hand. + +2008-11-26 Akim Demaille + + Use b4_parser_tables_define in Java. + * data/java.m4 (b4_typed_parser_table): Rename as... + (b4_typed_parser_table_define): this, for consistency. + Accept a comment as $4. + Move $2 into yy*_. + (b4_integral_parser_table): Rename as... + (b4_integral_parser_table_define): this. + * data/lalr1.java: Adjust all uses. + Use b4_parser_tables_define instead of generation by hand. + +2008-11-26 Akim Demaille + + Prepare the convergence bw C style and Java table generation. + * data/bison.m4 (b4_tables_map, b4_tables_declare) + (b4_tables_define): Rename as... + (b4_integral_parser_tables_map, b4_parser_tables_declare) + (b4_parser_tables_define): these. + * data/c.m4 (b4_table_define): Rename as... + (b4_integral_parser_table_define): this. + * data/lalr1.cc: Adjust. + (b4_table_define, b4_table_declare): Rename as... + (b4_integral_parser_table_define) + (b4_integral_parser_table_declare): these. + (yyrline_): Move the comment where it is actually used. + * data/yacc.c: Adjust. + (yyrline): Use b4_integral_parser_table_define. + +2008-11-26 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2008-11-26 Akim Demaille + + Factor the generation of the (integral) tables bw yacc.c and lalr1.cc. + * data/lalr1.cc (b4_tables_map): Move to... + * data/bison.m4: here. + Update the comment for yytable during the flight. + (b4_tables_declare, b4_tables_define): New. + * data/lalr1.cc: Use them. + * data/c.m4 (b4_table_define): New. + * data/yacc.c: Use b4_tables_define instead of output the tables + by hand. + * tests/regression.at (Web2c Actions): Adjust the expected output, + the order of the tables changed. + +2008-11-26 Akim Demaille + + Get rid of (yy)rhs and (yy)prhs. + These tables are no longer needed in the parsers, and they don't seem to + be useful. They are not documented either. + + * src/output.c (prepare_rules): Get rid of rhs and prhs. + Adjust the computation of (yy)r2. + +2008-11-26 Akim Demaille + + Rule length is unsigned. + * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t. + +2008-11-26 Akim Demaille + + Get rid of lalr1-split.cc. + It was no longer maintainer. + + * data/lalr1-split.cc: Remove. + * etc/bench.pl.in (bench_fusion_parser): Remove. + Adjust. + +2008-11-26 Akim Demaille + + Use yy* consistently. + * data/glr.c: Now that yyrhs no longer exists as a global + variable, rename local "rhs" variables into "yyrhs" for + consistency. + +2008-11-25 Akim Demaille + + Get rid of yyrhs and yyprhs in glr.c. + * data/glr.c (yyrhs, yyprhs): Remove. + Instead, use the state stack and yystos. + +2008-11-25 Akim Demaille + + Flag glr tests. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it + as an Autotest keyword. + +2008-11-25 Akim Demaille + + Prefer TESTSUITE_FLAGS. + TESTSUITEFLAGS is barely readable. + + * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS) + for backward compatibility. + Use the former instead of the latter. + +2008-11-25 Akim Demaille + + Get rid of yyrhs and yyprhs in larl1.java. + * data/lalr1.java (yyrhs_, yyprhs_): Remove. + (yy_reduce_print): Rather, use yystos_ and the state stack. + +2008-11-25 Akim Demaille + + Formatting changes. + +2008-11-25 Akim Demaille + + Get rid of yyrhs and yyprhs in yacc.c. + They were used to get the symbol types, given a rule number, when + displaying the top of the stack before a reduction. But the + symbol type is available from the state stack. This has two be + benefits: two tables less in the parser (making it smaller), and a + more consistent use of the three stacks which will help to fuse + them. + + * data/yacc.c (yyprhs, yyrhs): Remove. + (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print. + (yy_reduce_print): Take yyssp as argument. + Use it, together with yystos, to get the symbol type. + * tests/regression.at (Web2c Report): Remove these tables from the + expected output. + +2008-11-25 Akim Demaille + + b4_tables_map. + The point is to factor the generation of the tables across skeletons. + This is language dependant. + + * data/c.m4 (b4_comment_): New. + Should be usable to define how to generate tables independently of + the language. + (b4_c_comment): New. + (b4_comment): Bounce to b4_c_comment. + Now support $2 = [PREFIX] for indentation. + * data/lalr1.cc (b4_table_declare): Don't output a comment if + there is no comment. + Indent it properly when there is one. + Output the ending semicolon. + (b4_table_define): Space changes. + Output the ending semicolon. + (b4_tables_map): New. + Use it twice instead of declaring and defining the (integral) + tables by hand. + +2008-11-25 Akim Demaille + + b4_table_declare. + * data/lalr1.cc (b4_table_declare): New. + Use it to declare the tables defined with b4_table_define. + (b4_table_define): Declare a third arg to match b4_table_declare + signature. + Move all the comments around invocations of b4_table_define into + the invocations itselves. + Move things around to have the order for declarations and + definitions. + +2008-11-25 Akim Demaille + + Formatting changes. + * data/lalr1.java: here. + +2008-11-25 Akim Demaille + + b4_args is more general than only C++. + * data/lalr1.cc (b4_args, _b4_args): Move to... + * data/bison.m4: here. + +2008-11-21 Di-an Jan + + Implement no-XXX arguments for --warnings, --report, --trace. + * src/getargs.c (flags_argmatch): Handles no-XXX. + Fix typo in doxygen comment. + +2008-11-21 Akim Demaille + + Display the changes in cross-options.texi. + * build-aux/cross-options.pl ($sep): New, to separate items. + * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the + changes. + +2008-11-20 Di-an Jan + + Improves options in the manual. + * doc/bison.texinfo (-g, -x): Add space before argument. + (Option Cross Key): Implement FIXME: listing directives also. + * build-aux/cross-options.pl: Read from rather than <>. + (Short Option): Special case -d. Put arguments inside @option. + (Bison Directive): Add column, automatically extracted from + src/scan-gram.l (actual name passed as the first argument) + with special case for %define. + * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l + to build-aux/cross-options.pl. + * src/getargs.c (usage): Document limitations of cross-options.pl. + * src/scan-gram.l: Likewise. + +2008-11-18 Joel E. Denny + + Fix unexpanded macros in GLR defines file. + Reported by Csaba Raduly at + . + * THANKS (Csaba Raduly): Add. + * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc. + * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate + lexer in a separate module that includes the defines file. + (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer + source. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF. + Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX. + (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF. + (AT_DATA_SOURCE_PROLOGUE): New. + (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE. + (AT_DATA_SOURCE): New. + (AT_FULL_COMPILE): Extend to support an additional source file. + +2008-11-18 Akim Demaille + + More TODO. + * TODO: More short term issues. + +2008-11-18 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2008-11-18 Akim Demaille + + Use b4_subtract where possible. + * data/lalr1.cc (b4_subtract): Move to... + * data/bison.m4: here. + * data/glr.c (b4_rhs_data): Use it. + * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it. + +2008-11-18 Akim Demaille + + Remove incorrect mode specification. + * data/glr.cc: Don't pretend it's C code. + +2008-11-17 Joel E. Denny + + Simplify last patch slightly. + * src/getargs.c (getargs): Here. + +2008-11-17 Joel E. Denny + + Fix last warning from --enable-gcc-warnings. + * src/getargs.c (getargs): Don't assign const address to non-const + pointer. + +2008-11-17 Joel E. Denny + + Don't let maintainer-*-check targets force a version update. + * cfg.mk (_is-dist-target): Implement. maintainer-check* was already + handled. + +2008-11-17 Di-an Jan + + * doc/bison.texinfo: Synchronize ``Detail Node Listing''. + Align menus. Adjust word wrapping. Use node names for menu names. + (Examples): Don't abbreviate node names. + (LocalWords): Remove abbreviations. + (Copying): Make description a sentence. + (Java Action Features): Remove period to match the rest of menu. + +2008-11-17 Di-an Jan + + Handles several --enable-gcc-warnings. + * src/getargs.c (command_line_location): Set parameters to void. + * src/output.c (symbol_type_name_cmp): Make static. + (symbols_by_type_name): Set parameters to void. + (symbol_definitions_output): Remove unused parameter. Rename as... + (prepare_symbol_definitions): this. + (muscles_output): Move symbol_definitions_output to... + (output): here as prepare_symbol_definitions. + * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main. + (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed. + +2008-11-17 Di-an Jan + + * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202. + Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests. + +2008-11-16 Akim Demaille + + Add missing $(EXEEXT). + * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is + "src/bison$(EXEEXT)". + Reported by Di-an Jan. + +2008-11-15 Akim Demaille + + * TODO: Update. + +2008-11-15 Akim Demaille + + Formatting changes. + * tests/input.at: here. + +2008-11-15 Akim Demaille + + Remove duplicate header inclusion. + * src/LR0.c: here. + +2008-11-15 Akim Demaille + + * src/parse-gram.h, src/parse-gram.c: Regen. + +2008-11-15 Akim Demaille + + Support parametric types. + + There are two issues to handle: first scanning nested angle + bracket pairs to support types such as std::pair< std::string, + std::list > >. + + Another issue is to address idiosyncracies of C++: do not glue two + closing angle brackets together (otherwise it's operator>>), and + avoid sticking blindly a TYPE to the opening <, as it can result + in '<:' which is a digraph for '['. + + * src/scan-gram.l (brace_level): Rename as... + (nesting): this. + (SC_TAG): New. + Implement support for complex tags. + (tag): Accept + , but not <. + * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template) + (b4_symbol_variant): Leave space around types as parameters. + * examples/variant.yy: Use nested template types and leading ::. + * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt): + Rename as... + (TAG, TAG_ANY, TAG_NONE, tag.opt): these. + * tests/c++.at: Test parametric types. + +2008-11-15 Akim Demaille + + Test token.prefix. + This is not sufficient, but we test at least that the make_SYMBOL + interface is not affected by token.prefix. A more general test + will be implemented when the support of token.prefix is generalized + to more skeletons. + + * tests/c++.at: One more variant test, using token.prefix. + +2008-11-15 Akim Demaille + + Test the make_TOKEN interface. + * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations. + Factor the common code in yylex. + Use it to test "%define lex_symbol". + +2008-11-15 Akim Demaille + + Formatting change. + +2008-11-15 Akim Demaille + + Simplify code for variants bench marks. + * etc/bench.pl.in (&generate_grammar_list): Define and use + location_type. + Factor the common code in yylex. + +2008-11-15 Akim Demaille + + Better error message. + * bootstrap (find_tool): Fix the error message. + +2008-11-15 Akim Demaille + + Update variant.yy to newest interface. + * examples/variant.yy: Define lex_symbol. + Adjust. + +2008-11-15 Akim Demaille + + Don't use locations in variant.yy. + * examples/variant.yy: Adjust to not using locations. + +2008-11-15 Akim Demaille + + Comment changes. + * data/local.mk, etc/local.mk, examples/local.mk: Use Automake + comments for the license. + +2008-11-15 Akim Demaille + + Remove tests/Makefile.am. + * tests/Makefile.am: Rename as... + * tests/local.mk: this. + * Makefile.am, configure.ac: Adjust. + * Makefile.am (DISTCLEANFILES): Define. + (maintainer-check, maintainer-xml-check, maintainer-push-check): + Remove, we no longer need to bounce to the real targets. + +2008-11-15 Akim Demaille + + Comment changes. + +2008-11-15 Akim Demaille + + djgpp/local.mk. + * Makefile.am (EXTRA_DIST): Move djgpp related part to... + * djgpp/local.mk: this new file. + +2008-11-15 Akim Demaille + + Remove doc/Makefile.am. + * doc/Makefile.am: Rename as... + * doc/local.mk: this. + Adjust paths + * Makefile.am, configure.ac: Adjust. + * Makefile.am (MOSTLYCLEANFILES): New. + * src/local.mk: Adjust. + +2008-11-15 Akim Demaille + + Move sc_tight_scope into maint.mk. + It does not work, and I don't know how it was supposed to work: it + seems to be looking for sources in the build tree. I just moved + it at a better place, fixing it is still required. + + * src/local.mk (echo): Remove. + (sc_tight_scope): Move to... + * maint.mk: here. + +2008-11-15 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.h: Regen. + +2008-11-15 Akim Demaille + + Remove src/Makefile.am. + * src/Makefile.am: Rename as... + * src/local.mk: this. + Prefix all the paths with src/. + (AUTOMAKE_OPTIONS): Build object files in the sub dirs. + (AM_CPPFLAGS): Find find in builddir/src. + (YACC): Move the flags into... + (AM_YFLAGS): here. + * maint.mk (sc_tight_scope): Disable. + It used to bounce to the version in src/Makefile.am which is now + part of this very Makefile. + * Makefile.am, configure.ac: Adjust. + * src/scan-code-c.c, src/scan-code.l: We can no longer rely on + include "..." to find files "here": we are no longer in src/, so + qualify the includes with src/. + * doc/Makefile.am (PREPATH): No longer include the top_builddir + prefix. + (.x.1): Adjust to be able to create src/foo from the top level + Makefile, instead of going bounce to src/Makefile the creation of + foo. + +2008-11-15 Akim Demaille + + Remove useless variable. + * doc/Makefile.am (srcsrcdir): Remove. + +2008-11-15 Akim Demaille + + Remove data/Makefile.am. + * data/Makefile.am: Rename as... + * data/local.mk: this. + Adjust paths. + * Makefile.am, configure.ac: Adjust. + +2008-11-15 Akim Demaille + + Remove etc/Makefile.am. + * etc/Makefile.am: Rename as... + * etc/local.mk: this. + Adjust. + * Makefile.am, configure.ac: Adjust. + +2008-11-15 Akim Demaille + + Remove examples/local.mk. + examples/calc++/Makefile.am might be interesting to keep as is, since + it is an example in itself. + + * examples/Makefile.am: Rename as... + * examples/local.mk: this. + Adjust. + * Makefile.am, configure.ac: Adjust. + +2008-11-15 Akim Demaille + + Remove build-aux/Makefile.am. + Recursive Makefiles are really way too slow, let's get rid of some of + them. + + * build-aux/Makefile.am: Rename as... + * build-aux/local.mk: this. + Adjust paths. + * Makefile.am, configure.ac: Adjust. + +2008-11-15 Akim Demaille + + Provide convenience constructors for locations and positions. + * data/location.cc (position::position): Accept file, line and + column as arguments with default values. + Always qualify initial line and column literals as unsigned. + (location::location): Provide convenience constructors. + +2008-11-15 Akim Demaille + + Instead of using make_symbol, generate make_FOO for each + token type. + Using template buys us nothing, and makes it uselessly complex to + construct a symbol. Besides, it could not be generalized to other + languages, while make_FOO would work in C/Java etc. + + * data/lalr1.cc (b4_symbol_): New. + (b4_symbol): Use it. + (b4_symbol_constructor_declaration_) + (b4_symbol_constructor_definition_): Instead of generating + specializations of an overloaded template function, just generate + several functions whose names are forged from the token names + without the token.prefix. + (b4_symbol_constructor_declarations): Generate them for all the + symbols, not just by class of symbol type, now that instead of + specializing a function template by the token, we generate a + function named after the token. + (b4_symbol_constructor_specialization_) + (b4_symbol_constructor_specializations): Remove. + * etc/bench.pl.in: Adjust to this new API. + +2008-11-13 Akim Demaille + + %define token.prefix. + Provide a means to add a prefix to the name of the tokens as + output in the generated files. Because of name clashes, it is + good to have such a prefix such as TOK_ that protects from names + such as EOF, FILE etc. But it clutters the grammar itself. + + * data/bison.m4 (token.prefix): Empty by default. + * data/c.m4 (b4_token_enum, b4_token_define): Use it. + * data/lalr1.cc (b4_symbol): Ditto. + +2008-11-13 Akim Demaille + + Compute at M4 time some of the subtractions. + * data/lalr1.cc (b4_subtract): New. + (b4_rhs_data): Use it. + +2008-11-13 Akim Demaille + + symbol::token. + This allows the user to get the type of a token returned by yylex. + + * data/lalr1.cc (symbol::token): New. + (yytoknum_): Define when %define lex_symbol, independently of + %debug. + (yytoken_number_): Move into... + (symbol::token): here, since that's the only use. + The other one is YYPRINT which was not officially supported + by lalr1.cc, and anyway it did not work since YYPRINT uses this + array under a different name (yytoknum). + +2008-11-13 Akim Demaille + + YYERRCODE. + * TODO (YYERRCODE): Mention the case of $undef. + +2008-11-13 Akim Demaille + + TODO: YYPRINT. + * TODO (YYPRINT): New. + +2008-11-13 Akim Demaille + + Comment changes. + * data/lalr1.cc, data/yacc.c: Fix the description of the + yytranslate and yytoknum tables. + +2008-11-13 Akim Demaille + + Define make_symbol in the header. + To reach good performances these functions should be inlined (yet + this is to measure precisely). To this end they must be available + to the caller. + + * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify + location_type with the class name. + Since will now be output in the header, declare "inline". + No longer use b4_symbol_constructor_specializations, but + b4_symbol_constructor_definitions in the header. + Don't call it in the *.cc file. + +2008-11-13 Akim Demaille + + Define yytranslate in the header for lex_symbol. + * data/lalr1.cc: Move the invocation of b4_yytranslate_definition + into the header file when using %define lex_symbol. + (yytranslate_): Declare inline. + +2008-11-13 Akim Demaille + + Define the constructors of symbol_type in + b4_symbol_constructor_definitions. + The constructors are called by the make_symbol functions, which a + forthcoming patch will move elsewhere. Hence the interest of + putting them together. + + The stack_symbol_type does not need to be moved, it is used only + by the parser. + + * data/lalr1.cc: Move symbol_type and symbol_base_type + constructors into... + (b4_symbol_constructor_definitions): here. + Adjust. + +2008-11-13 Akim Demaille + + Make it easier to move the definition of yytranslate_. + Forthcoming changes will make it possible to use yytranslate_ + from outside the parser implementation file. + + * data/lalr1.cc (b4_yytranslate_definition): New. + Use it. + +2008-11-13 Akim Demaille + + Remove useless class specification. + * data/lalr1.cc (b4_symbol_constructor_specialization_): No need + to refer to the class name to use a type defined by the class for + arguments of member functions. + +2008-11-13 Akim Demaille + + Finer input type for yytranslate. + This patch is debatable: the tradition expects yylex to return an int + which happens to correspond to token_number (which is an enum). This + allows for instance to return characters (such as '*' etc.). But this + goes against the stronger typing I am trying to have with the new + lex interface which return a symbol_type. So in this case, feed + yytranslate_ with a token_type. + + * data/lalr1.cc (yytranslate_): When in %define lex-symbol, + expect a token_type. + +2008-11-13 Akim Demaille + + Honor lex-params in %define lex_symbol mode. + * data/lalr1.cc: Use b4_lex_param. + +2008-11-13 Akim Demaille + + Simplify names. + * src/output.c (symbol_definitions_output): Rename symbol + attributes type_name and has_type_name as type and has_type. + * data/lalr1.cc: Adjust uses. + +2008-11-13 Akim Demaille + + Use b4_type_names for the union type. + The union used to compute the size of the variant used to iterate + over the type of all the symbols, with a lot of redundancy. Now + iterate over the lists of symbols having the same type-name. + + * data/lalr1.cc (b4_char_sizeof_): New. + (b4_char_sizeof): Use it. + Adjust to be called with a list of numbers instead of a single + number. + Adjust its caller for new-line issues. + +2008-11-13 Akim Demaille + + Define the "identifier" of a symbol. + Symbols may have several string representations, for instance if + they have an alias. What I call its "id" is a string that can be + used as an identifier. May not exist. + + Currently the symbols which have the "tag_is_id" flag set are + those that don't have an alias. Look harder for the id. + + * src/output.c (is_identifier): Move to... + * src/symtab.c (is_identifier): here. + * src/symtab.h, src/symtab.c (symbol_id_get): New. + * src/output.c (symbol_definitions_output): Use it to define "id" + and "has_id". + Remove the definition of "tag_is_id". + * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and + "tag_is_id" were used to produce code. + We still use "tag" for documentation. + +2008-11-11 Akim Demaille + + Locations are no longer required by lalr1.cc. + * data/lalr1.cc (_b4_args, b4_args): New. + Adjust all uses of locations to make them optional. + * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations. + (AT_CHECK_NAMESPACE): Check the use of locations. + * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or + without locations with lalr1.cc. + Test these cases. + * tests/output.at: Check lalr1.cc with and without location + support. + * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y): + Don't use locations. + +2008-11-11 Akim Demaille + + AT_FULL_COMPILE. + * tests/local.at (AT_FULL_COMPILE): New. + * tests/actions.at, tests/calc.at, tests/regression.at: Use it. + +2008-11-11 Akim Demaille + + Support parens in calc++. + * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens. + * examples/calc++/test (run): Check the expected output. + Adjust callers. + Check parens too. + +2008-11-11 Akim Demaille + + Simplify lalr1.cc since %defines is mandatory. + * data/lalr1.cc: Remove useless calls to b4_defines_if. + +2008-11-11 Akim Demaille + + TODO: yyfmt. + * TODO (yysyntax_error): New item. + +2008-11-11 Akim Demaille + + Prefer M4 to CPP. + * data/lalr1.cc: Use b4_error_verbose_if instead of #if + YYERROR_VERBOSE. + +2008-11-11 Akim Demaille + + Support i18n of the parse error messages. + * TODO (lalr1.cc/I18n): Remove. + * data/lalr1.cc (yysyntax_error_): Support the translation of the + error messages, as done in yacc.c. + Stay within the yy* pseudo namespace. + +2008-11-11 Akim Demaille + + More TODO. + * TODO (single stack, yysyntax_error): New. + +2008-11-11 Akim Demaille + + Make it possible to return a symbol_type from yylex. + * data/lalr1.cc (b4_lex_symbol_if): New. + (parse): When lex_symbol is defined, expected yylex to return the + complete lookahead. + * etc/bench.pl.in (generate_grammar_list): Extend to support this + yylex interface. + (bench_variant_parser): Exercise it. + +2008-11-11 Akim Demaille + + Remove useless bench case. + * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is + no longer used. + +2008-11-11 Akim Demaille + + Improve display of directives. + * etc/bench.pl.in (parse_term): Don't add useless eol. + +2008-11-11 Akim Demaille + + Use string_cast in the bench. + * etc/bench.pl.in (generate_grammar_list): Define and use + string_cast. + +2008-11-11 Akim Demaille + + Replace yychar with a Boolean. + * data/lalr1.cc (parse::yychar): Replace by... + (parse::yyempty): this. + +2008-11-11 Akim Demaille + + Factor the tables. + * TODO: New item. + +2008-11-11 Akim Demaille + + Let yytranslate handle the eof case. + * data/lalr1.cc (yytranslate_): Handle the EOF case. + Adjust callers. + No longer expect yychar to be equal to yyeof_, rather, test the + lookahead's (translated) kind. + +2008-11-11 Akim Demaille + + yychar cannot be empty in yyerrlab. + * TODO (yychar == yyempty_): New. + * data/lalr1.cc: Remove the handling of this case. + This eases forthcoming changes related to yychar and yytranslate. + +2008-11-11 Akim Demaille + + Bench: syntactic sugar for %define/#define. + * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments. + (&bench_push_parser, bench_variant_parser): Use this feature. + (&eat): New. + Use it. + +2008-11-11 Akim Demaille + + Less memory pressure on the "list" bench. + * etc/bench.pl.in (generate_grammar_list): Do not accumulate all + the values, to limit memory pressure. + +2008-11-11 Akim Demaille + + Introduce make_symbol. + make_symbol provides a means to construct a full symbol (kind, + value, location) in a single shot. It is meant to be a Symbol + constructor, parameterized by the symbol kind so that overloading + would prevent incorrect kind/value pairs. Unfortunately + parameterized constructors do not work well in C++ (unless the + parameter also appears as an argument, which is not acceptable), + hence the use of a function instead of a constructor. + + * data/lalr1.cc (b4_symbol_constructor_declaration_) + (b4_symbol_constructor_declarations) + (b4_symbol_constructor_specialization_) + (b4_symbol_constructor_specializations) + (b4_symbol_constructor_definition_) + (b4_symbol_constructor_definitions): New. + Use them where appropriate to generate declaration, declaration of + the specializations, and implementations of the templated + overloaded function "make_symbol". + (variant::variant): Always define a default ctor. + Also provide a copy ctor. + (symbol_base_type, symbol_type): New ctor overloads for value-less + symbols. + (symbol_type): Now public, so that functions such as yylex can use + it. + +2008-11-11 Akim Demaille + + Inform m4 whether a tag is a valid id. + * src/output.c (is_identifier): New. + (symbol_definitions_output): Use it to define tag_is_id. + But maybe this should be done at m4 level? + +2008-11-11 Akim Demaille + + Test 214 was failing: it greps with a pattern containing [ ]* + which obviously meant to catch spaces and tabs, but contained only + spaces. Tabulations in sources are a nuisance, so to simplify the + matter, get rid of all the tabulations in the Java sources. The + other skeletons will be treated equally later. + + * data/java.m4, data/lalr1.java: Untabify. + * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations: + tabulations are no longer generated. + +2008-11-11 Paolo Bonzini + + * bootstrap.conf: Replace m4/warning.m4 with warnings module. + * configure.ac: Adjust usage. + * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS). + * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS). + * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS). + +2008-11-10 Di-an Jan + + Workaround Java's ``code too large'' problem for parser tables + in most cases, by using one function per initialization. + * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New. + * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_, + yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_ + yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table. + (yytname_): Use b4_typed_parser_table. + * doc/bison.texinfo (Java Bison Interface): Add note on Java's + ``code too large'' error. + +2008-11-10 Di-an Jan + + * NEWS: Document them. + + General Java skeleton improvements. + * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows + using gcj < 4.3 in the testsuite, according to comments in + gnulib/m4/javacomp.m4. + * data/java.m4 (stype, parser_class_name, lex_throws, throws, + location_type, position_type): Remove extraneous brackets from + b4_percent_define_default. + (b4_lex_param, b4_parse_param): Remove extraneous brackets from + m4_define and m4_define_default. + * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue, + which marks the end of user code with appropriate syncline, like all + the other skeletons. + (b4_user_post_prologue): Add. Don't silently drop. + (yylex): Remove. + (parse): Inline yylex. + * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document. + (%{...%}): Fix typo of %code imports. + * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword. + + Support annotations on parser class with %define annotations. + * data/lalr1.java (annotations): Add to parser class modifier. + * doc/bison.texinfo (Java Parser Interface): Document + %define annotations. + (Java Declarations Summary): Document %define annotations. + * tests/java.at (Java parser class modifiers): Test annotations. + + Do not generate code for %error-verbose unless requested. + * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose. + Make private. Make conditional on %error-verbose. + (getErrorVerbose, setErrorVerbose): New. + (yytnamerr_): Make conditional on %error-verbose. + (yysyntax_error): Make some code conditional on %error-verbose. + * doc/bison.texinfo (Java Bison Interface): Remove the parts + about %error-verbose having no effect. + (getErrorVerbose, setErrorVerbose): Document. + + Move constants for token names to Lexer interface. + * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here. + * data/java.m4 (b4_token_enum): Indent for move to Lexer interface. + (parse): Qualify EOF to Lexer.EOF. + * doc/bison.texinfo (Java Parser Interface): Move documentation of + EOF and token names to Java Lexer Interface. + * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier. + + Make yyerror public. + * data/lalr1.java (Lexer.yyerror): Use longer parameter name. + (yyerror): Change to public. Add Javadoc comments. Use longer + parameter names. Make the body rather than the declarator + conditional on %locations. + * doc/bison.texinfo (yyerror): Document. Don't mark as protected. + + Allow user to add code to the constructor with %code init. + * data/java.m4 (b4_init_throws): New, for %define init_throws. + * data/lalr1.java (YYParser.YYParser): Add b4_init_throws. + Add %code init to the front of the constructor body. + * doc/bison.texinfo (YYParser.YYParser): Document %code init + and %define init_throws. + (Java Declarations Summary): Document %code init and + %define init_throws. + * tests/java.at (Java %parse-param and %lex-param): Adjust grep. + (Java constructor init and init_throws): Add tests. + +2008-11-10 Akim Demaille + + Update TODO. + * TODO (-D): is implemented. + (associativity): Same precedence must have the same associativity. + For instance, how can a * b / c be parsed if * is %left and / is + %right? + (YYERRORCODE, YYFAIL, YYBACKUP): New. + +2008-11-10 Akim Demaille + + Formatting changes. + +2008-11-10 Akim Demaille + + More information about the symbols. + * src/output.c (type_names_output): Document all the symbols, + including those that don't have a type-name. + (symbol_definitions_output): Define "is_token" and + "has_type_name". + * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty + type-name, now that they are defined too in b4_type_names. + +2008-11-10 Akim Demaille + + Regen. + +2008-11-10 Akim Demaille + + Make parser::yytranslate static. + Small speedup (1%) on the list grammar. And makes yytranslate_ + available in non member functions. + + * data/lalr1.cc (yytranslate_): Does not need to be a instance + function. + +2008-11-10 Akim Demaille + + Avoid trailing spaces. + * data/c.m4: b4_comment(TEXT): Don't indent empty lines. + * data/lalr1.cc: Don't indent before rule and symbol actions, as + they can be empty, and anyway this incorrectly indents the first + action. + +2008-11-10 Akim Demaille + + Comment changes. + +2008-11-10 Akim Demaille + + Use "enum" for integral constants. + This is just nicer to read, I observed no speedup. + + * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_) + (yterror_, yyerrcode_, yyntokens_): Define as members of an enum. + (yyuser_token_number_max_, yyundef_token_): Move into... + (yytranslate_): here. + +2008-11-10 Akim Demaille + + Shortcuts in bench directives. + * etc/bench.pl.in (parse_dirs): New. + Use it. + (bench_variant_parser, bench_fusion_parser): Use %s and %d. + Create the benches in "benches/". + +2008-11-10 Akim Demaille + + Formatting changes. + * data/lalr1.cc: here. + +2008-11-10 Akim Demaille + + Adjust verbose message to using emacs. + * etc/bench.pl.in: Inform compilation-mode when we change the + directory. + (generate_grammar_list): Recognize %define "variant" in addition + to %define variant. + +2008-11-10 Akim Demaille + + Classify symbols by type-name. + * src/uniqstr.h (UNIQSTR_CMP): New. + * src/output.c (symbol_type_name_cmp, symbols_by_type_name) + (type_names_output): New. + (muscles_output): Use it. + * data/lalr1.cc (b4_symbol_action_): Remove. + (b4_symbol_case_, b4_type_action_): New. + Adjust uses of b4_symbol_action_ to use b4_type_action_. + +2008-11-10 Akim Demaille + + Change the handling of the symbols in the skeletons. + Before we were using tables which lines were the symbols and which + columns were things like number, tag, type-name etc. It is was + difficult to extend: each time a column was added, all the numbers had + to be updated (you asked for colon $2, not for "tag"). Also, it was + hard to filter these tables when only a subset of the symbols (say the + tokens, or the nterms, or the tokens that have and external number + *and* a type-name) was of interest. + + Now instead of monolithic tables, we define one macro per cell. For + instance "b4_symbol(0, tag)" is a macro name which contents is + self-decriptive. The macro "b4_symbol" provides easier access to + these cells. + + * src/output.c (type_names_output): Remove. + (symbol_numbers_output, symbol_definitions_output): New. + (muscles_output): Call them. + (prepare_symbols): Define b4_symbols_number. + +2008-11-10 Akim Demaille + + --trace=muscles + * src/getargs.h, src/getargs.c (trace_muscle): New. + (trace_types, trace_args): Support it. + * src/output.c (output_skeleton): Use it. + +2008-11-10 Akim Demaille + + muscles_output. + * src/output.c (muscles_output): New, extracted from... + (output_skeleton): here. + Adjust. + +2008-11-10 Akim Demaille + + Formatting changes. + +2008-11-10 Akim Demaille + + Update the variant example. + * examples/variant.yy: Formatting changes. + One stage build. + +2008-11-10 Akim Demaille + + Support constructor with an argument. + This improves the "list" bench by 2%. + + * data/lalr1.cc (variant::build): Add an overloaded version with + an argument. + * tests/c++.at (AT_CHECK_VARIANT): Check it. + +2008-11-10 Akim Demaille + + Test variants. + * tests/c++.at (AT_CHECK_VARIANTS): New. + Use it with and without %define assert. + +2008-11-10 Akim Demaille + + Add %precedence support. + Unfortunately it is not possible to reuse the %prec directive. This + is because to please POSIX, we do not require to end the rules with a + semicolon. As a result, + + foo: bar %prec baz + + is ambiguous: either a rule which precedence is that of baz, or a rule, + and then a declaration of the precedence of the token baz. + + * doc/bison.texinfo: Document %precedence. + (Precedence Only): New. + * src/assoc.h, src/assoc.c (precedence_assoc): New. + * src/conflicts.c (resolve_sr_conflict): Support it. + * src/scan-gram.l, src/parse-gram.y (%precedence): New token. + Parse it. + * tests/calc.at: Use %precedence for NEG. + * tests/conflicts.at (%precedence does not suffice) + (%precedence suffices): New tests. + +2008-11-09 Akim Demaille + + Make benches in a sub dirs. + * etc/bench.pl.in ($dir): New. + Use it. + Check the use of constructors with an argument. + (bench_variant_parser): Fix. + +2008-11-09 Akim Demaille + + fix eof condition + +2008-11-09 Akim Demaille + + Fix --help. + +2008-11-09 Akim Demaille + + Require the generation of parse-gram.output. + * src/Makefile.am (YACC): Pass --report=all. + +2008-11-09 Akim Demaille + + Formatting changes. + +2008-11-09 Akim Demaille + + Update TODO. + * TODO: Remove obsolete items. + Update others. + +2008-11-09 Akim Demaille + + Enhance bench.pl. + * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact) + (@token, $grammar, $bench): New. + (generate_grammar_variant): Rename as... + (generate_grammar_list): this. + (generate_grammar): Adjust. + (bench_grammar): Rename as... + (bench): this. + Use it in the various bench-marking routines. + (-b, -g): New options. + +2008-11-09 Akim Demaille + + Use a static hierarchy for symbols in the C++ parser. + * data/lalr1.cc (symbol_base_type, symbol_type) + (stack_symbol_type): Make it a static hierarchy. + Adjust dependencies. + +2008-11-09 Akim Demaille + + bench.pl -d, --directive. + * etc/bench.pl.in (@directive): New. + (&bench_grammar): Use it. + (&bench_list_grammar): New, to provide access to the "variant" + grammar. + Use it. + (getopts): Support -d, --directive. + +2008-11-09 Akim Demaille + + Use inline for small operations. + * data/lalr1.cc (symbol_base_type, symbol_type) + (stack_symbol_type): Declare constructor and other operations as + inline. + (yy_destroy_): Inline. + +2008-11-09 Akim Demaille + + Introduce a hierarchy for symbols. + * data/lalr1.cc (symbol_base_type, symbol_type): New. + (data_type): Rename as... + (stack_symbol_type): this. + Derive from symbol_base_type. + (yy_symbol_value_print_): Merge into... + (yy_symbol_print_): this. + Rename as... + (yy_print_): this. + (yydestruct_): Rename as... + (yy_destroy_): this. + (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust. + (parser::parse): yyla is now of symbol_type. + Use its type member instead of yytoken. + +2008-11-09 Akim Demaille + + Rename data_type and stack_symbol_type. + * data/lalr1.cc (data_type): Rename as... + (stack_symbol_type): this. + +2008-11-09 Akim Demaille + + Handle semantic value and location together. + * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to + yydata.value and yydata.location. + (yy_symbol_value_print_, yy_symbol_print_, yydestruct_) + (YY_SYMBOL_PRINT): Now take semantic value and location as a + single arg. + Adjust all callers. + (yydestruct_): New overload for a stack symbol. + +2008-11-09 Akim Demaille + + Push a complete symbol, not connected parts. + * data/lalr1.cc (yypush_): Take a data_type&, not disconnected + state, value and location. + Adjust callers. + +2008-11-09 Akim Demaille + + Agregate yylval and yylloc. + * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by... + (parser::yyla): this. + +2008-11-09 Akim Demaille + + Rely on the state stack to display reduction traces. + To display rhs symbols before a reduction, we used information + about the rule reduced, which required the tables yyrhs and + yyprhs. Now use rely only on the state stack to get the same + information. + + * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New. + Use them. + (parser::yyrhs_, parser::yyprhs_): Remove. + (parser::yy_reduce_print_): Use the state stack. + +2008-11-09 Akim Demaille + + Fuse yyval and yyloc into yylhs. + * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using + yylhs. + (parse): Replace yyval and yyloc with yylhs.value and + yylhs.location. + After a user action, compute yylhs.state earlier. + (yyerrlab1): Do not play tricks with yylhs.location, rather, use a + fresh error_token. + +2008-11-09 Di-an Jan + + Remove unused variable. + * src/output.c (type_names_output): Remove unused variable sep. + +2008-11-09 Paolo Bonzini + + Change tests/output.at quoting. + * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when + expanding arguments. + +2008-11-07 Joel E. Denny + + Don't add a semicolon to actions for %skeleton or %language. + It breaks Java test cases as reported by Akim Demaille. + * src/scan-code.l: Implement. + +2008-11-07 Joel E. Denny + + Clean up %skeleton and %language priority implementation. + * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and + remove static qualifier because others will soon need to see it. + (language_prio): Likewise. + (getargs): Use command_line_prio rather than 0. + * src/getargs.h (command_line_prio, grammar_prio, default_prio): New + enum fields. + (skeleton_prio): Extern it. + (language_prio): Extern it. + * src/parse-gram.y: Use grammar_prio rather than 1. + +2008-11-07 Akim Demaille + + Moving push traces into yypush_. + * data/lalr1.cc (yypush_): Now takes a optional trace message. + Adjust all uses. + +2008-11-07 Akim Demaille + + The single-stack C++ parser is now the standard one. + * data/lalr1.cc: Rename as... + * data/lalr1-split.cc: this. + * data/lalr1-fusion.cc: Rename as... + * data/lalr1.cc: this. + * etc/bench.pl.in: Adjust. + +2008-11-07 Akim Demaille + + Avoid empty-if warnings. + Reported by Quentin Hocquet. + + * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT) + (YY_STACK_PRINT): Provide some contents even when !YYDEBUG. + +2008-11-07 Akim Demaille + + Pass command line location to skeleton_arg and language_argmatch. + * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch): + The location argument is now mandatory. + Adjust all dependencies. + (getargs): Use command_line_location. + +2008-11-07 Akim Demaille + + -D, --define. + * src/getargs.c (usage): Document -D. + Fix help string for --locations. + (command_line_location): New. + (short_options, long_options, getargs): Support -D, --define. + (getargs): Move -d support at the right place. + * doc/bison.texinfo (Bison Options): Update. + * tests/input.at (%define, --define): New. + +2008-11-07 Akim Demaille + + Initialize the muscle table before parsing the command line. + * src/getargs.c (quotearg.h, muscle_tab.h): Include. + (getargs): Define file_name. + * src/main.c (main): Initialize muscle_tab before calling + getargs. + * src/muscle_tab.c (muscle_init): No longer define file_name, as + its value is not available yet. + +2008-11-07 Akim Demaille + + Locations without columns for command line arguments. + * src/location.c (location_print): Don't display negative columns. + * src/location.h: Document this. + +2008-11-07 Akim Demaille + + Fix --help. + * src/getargs.c (usage): Fix help string for -W. + +2008-11-07 Akim Demaille + + Handle more general types of option arguments. + * build-aux/cross-options.pl: The argument ends at the first + space, not the first non-symbol character. + Use @var for each word appearing the argument description. + +2008-11-07 Akim Demaille + + Destroy the variants that remain on the stack in case of error. + * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's + destructor. + Display the value only if yymsg is nonnull. + (yyreduce): Invoke yydestruct_ when popping lhs symbols. + +2008-11-07 Akim Demaille + + Add "%define assert" to variants. + This is used to help the user catch cases where some value gets + ovewritten by a new one. This should not happen, as this will + probably leak. + + Unfortunately this uncovered a bug in the C++ parser itself: the + lookahead value was not destroyed between two calls to yylex. For + instance if the previous lookahead was a std::string, and then an int, + then the value of the std::string was correctly taken (i.e., the + lookahead was now an empty string), but std::string structure itself + was not reclaimed. + + This is now done in variant::build(other&) (which is used to take the + value of the lookahead): other is not only stolen from its value, it + is also destroyed. This incurs a new performance penalty of a few + percent, and union becomes faster again. + + * data/lalr1-fusion.cc (variant::build(other&)): Destroy other. + (b4_variant_if): New. + (variant::built): New. + Use it whereever the status of the variant changes. + * etc/bench.pl.in: Check the penalty of %define assert. + +2008-11-07 Akim Demaille + + Use "%define variant" in bench.pl. + * etc/bench.pl.in: No longer use the pseudo directive %variants, + just use %define variants. + +2008-11-07 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2008-11-04 Joel E. Denny + + Fix user actions without a trailing semicolon. + Reported by Sergei Steshenko at + . + * THANKS (Sergei Steshenko): Add. + * src/scan-code.l (SC_RULE_ACTION): Fix it. + * tests/regression.at (Fix user actions without a trailing semicolon): + New test case. + +2008-11-04 Akim Demaille + + Use b4_copyright_years. + * data/yacc.c (b4_copyright_years): New. + Fix its value according to the comments in the file. + Use it and undefine it. + +2008-11-04 Akim Demaille + + Formatting changes. + * data/lalr1-fusion.cc, src/parse-gram.y: here. + +2008-11-04 Akim Demaille + + Formatting changes. + * data/lalr1-fusion.cc: here. + +2008-11-04 Akim Demaille + + Use strict on bench.pl. + * etc/bench.pl.in (&run, &generate_grammar): New. + Rename the grammar generating functions for consistency. + Change the interface so that the list of benches to run is passed + as (optionless) arguments. + (&compile): Use &run. + +2008-11-04 Akim Demaille + + Remove spurious initial empty lines. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, + * data/yacc.c: End the @output lines with an @. + +2008-11-04 Akim Demaille + + Improve the display of sizes. + * etc/bench.p.in: Higher precision. + Sort by decreasing size. + +2008-11-04 Akim Demaille + + Don't memcpy C++ structures. + * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional + arguments. + (variant::build): New overload for + copy-construction-that-destroys. + (variant::swap): New. + (parser::yypush_): Use it in variant mode. + +2008-11-04 Akim Demaille + + Better defaults for bench.pl. + * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the + default values. + Adjust &verbose uses. + (-q, --quiet): New. + +2008-11-04 Akim Demaille + + Make variant.yy more complex. + std::list cannot be copied via memcpy, they are more demanding than + std::string. Use one std::list to strengthen the test. + + * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc. + Adjust. + Create a list of strings, instead of a single large string. + +2008-11-04 Akim Demaille + + bench.pl --bench. + * etc/bench.pl.in (--bench, $bench): New. + +2008-11-04 Akim Demaille + + Sort methods. + * data/lalr1-fusion.cc (destroy): Use as() in its definition. + Define it after as(). + +2008-11-04 Akim Demaille + + Useless parens. + * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens. + +2008-11-04 Akim Demaille + + Issue missing synclines after user actions. + * data/c.m4 (b4_case): Issue synclines on the output file. + +2008-11-04 Akim Demaille + + Remove trailing empty line. + * data/lalr1-fusion.cc: Don't add an empty line after the user's + epilogue. + +2008-11-04 Akim Demaille + + Fix output of copyright years. + * data/bison.m4 (b4_copyright): Fix the indentation of the + copyright year paragraph. + Use b4_copyright_years when no years are given. + * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc + (b4_copyright_years): New. + Use it. + +2008-11-04 Akim Demaille + + Avoid the spurious initial empty line. + * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at + the end of @output request to suppress the empty line that + results. + +2008-11-04 Akim Demaille + + Remove parser::rhs_number_type. + * data/lalr1-fusion.cc (rhs_number_type): No longer define it. + (yyrhs_): Use b4_table_define. + +2008-11-04 Akim Demaille + + Fix iteration type. + * data/lalr1-fusion.cc: Use an int to iterate up to an int. + +2008-11-04 Akim Demaille + + Factor the declaration of the integer tables. + * data/lalr1-fusion.cc (b4_table_define): New. + Use it. + +2008-11-03 Akim Demaille + + Fix indentation of tables in lalr1.cc + * data/lalr1-fusion.cc: Fix the indentation. + +2008-11-03 Akim Demaille + + Destroy the lhs symbols after reduction. + * data/lalr1-fusion.cc (parse): After the user action, when in + variant mode, destroy the lhs symbols. + +2008-11-03 Akim Demaille + + Simplify yysyntax_error_ use. + * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token + type, but make it unnamed in the declaration when it is not used. + +2008-11-03 Akim Demaille + + Let yy::variant::build return an lvalue. + * data/lalr1-fusion.cc (variant::build): Return a reference to the + object. + +2008-11-03 Akim Demaille + + Define yy::variant only when needed. + * data/lalr1-fusion.cc (yy::variant): Define only if variants are + used. + +2008-11-03 Akim Demaille + + Bench the three-stack lalr1.cc. + * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the + one-stack one. + +2008-11-03 Akim Demaille + + Fail on parse error in calc++. + * doc/bison.texinfo (calc++.cc): Propagate failures to the exit + status. + * examples/calc++/test ($me, $number, $exit, run): New. + Use them to propagate errors to the exit status. + +2008-11-03 Akim Demaille + + Don't specify the skeleton twice in the example. + * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar + file does what is needed. + +2008-11-03 Akim Demaille + + bench: Improve output. + * etc/bench.pl.in (bench_grammar): Tune the printf format. + +2008-11-03 Akim Demaille + + bench: check impact of %debug on variants. + * etc/bench.pl.in (variant_grammar): Fix the computation of + $variant. + Generate a grammar file that can work with or without %debug. + Do use the @directive. + (bench_variant_parser): Check impact of %debug. + (@directives): Rename all the occurrences to... + (@directive): this, for consistency. + +2008-11-03 Akim Demaille + + bench: report the size too. + * etc/bench.pl.in ($iterations): Defaults to -3. + (&bench_grammar): Require hireswallclock. + Compute and display the size of the result. + More comments. + +2008-11-03 Akim Demaille + + bench: More use of the verbosity level. + * etc/bench.pl.in ($verbose, &verbose): New. + Use them. + More POD documentation. + +2008-11-03 Akim Demaille + + bench.pl: a command line interface + * etc/bench.pl.in: More doc. + Some fixes in the documentation. + ($cflags, $iterations, &help, &getopt): New. + Use them. + (&variant_grammar): Let the number of stages be 10 times what is + specified. + +2008-11-03 Akim Demaille + + Bench the use of Boost.Variants. + * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser): + New. + (&compile): Be ready to compile C++ parsers. + (&bench_push_parser): Move debug information to the outermost + level. + * THANKS: Add Michiel De Wilde. + +2008-11-03 Akim Demaille + + bench.pl: Pass directives as a list instead of as a string. + * etc/bench.pl.in (&directives): New. + (&triangular_grammar, &calc_grammar): Use it to format the Bison + directives. + (&triangular_grammar): Do use the directives (were ignored). + (&bench_grammar, &bench_push_parser): Adjust to pass lists of + directives. + +2008-11-03 Akim Demaille + + Improve genericity of bench.pl. + * etc/bench.pl.in (&bench_grammar): Take the set of benches as + argument. + (&bench_push_parser): New. + Call it. + +2008-11-03 Akim Demaille + + Add documentation to bench.pl. + * etc/bench.pl.in: Comment changes. + +2008-11-03 Akim Demaille + + Fuse the three stacks into a single one. + + In order to make it easy to perform benchmarks to ensure that + there are no performance loss, lalr1.cc is forked into + lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace + lalr1.cc. + + Meanwhile, to make sure that lalr1-fusion.cc is correctly + exercized by the test suite, the user must install a symbolic link + from lalr1.cc to it. + + Instead of having three stacks (state, value, location), use a + stack of triples. This considerably simplifies the code (and it + will be easier not to require locations as currently does the C++ + parser), and also gives a 10% speedup according to + etc/bench (probably mainly since memory allocation is done once + instead of three times). + + Another motivation is to make it easier to destruct properly + semantic values: now that they are bound to their state (hence + symbol type) it will be easier to call the appropriate destructor. + + These changes should probably benefit the C parser too. + + * data/lalr1.cc: Copy as... + * data/lalr1-fusion.cc: this new file. + (b4_rhs_value, b4_rhs_location): New definitions overriding those + from c++.m4. + (state_stack_type, semantic_stack_type, location_stack_type) + (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove. + (data_type, stack_type, yystack_): New. + (YYLLOC_DEFAULT, yypush_): Adjust. + (yyerror_range): Now based on data_type, not location_type. + +2008-11-03 Akim Demaille + + Push the state, value, and location at the same time. + This is needed to prepare a forthcoming patch that fuses the three + stacks into one. + + * data/lalr1.cc (parser::yypush_): New. + (parser::yynewstate): Change the semantics: instead of arriving to + this label when value and location have been pushed, but yystate + is to be pushed on the state stack, now the three of them must + have been pushed before. yystate still must be the new state. + This allows to use yypush_ everywhere instead of individual + handling of the stacks. + +2008-11-03 Akim Demaille + + Prefer references to pointers. + * data/lalr1.cc (b4_symbol_actions): New, overrides the default C + definition to use references instead of pointers. + (yy_symbol_value_print_, yy_symbol_print_, yydestruct_): + Take the value and location as references. + Adjust callers. + +2008-11-03 Akim Demaille + + stack::size instead of stack::height. + * data/lalr1.cc (stack::height): Rename as... + (stack::size): this. + Fix the output type. + Comment changes. + +2008-11-03 Akim Demaille + + Use variants to support objects as semantic values. + This patch was inspired by work by Michiel De Wilde. But he used + Boost variants which (i) requires Boost on the user side, (ii) is + slow, and (iii) has useless overhead (the parser knows the type of + the semantic value there is no reason to duplicate this + information as Boost.Variants do). + + This implementation reserves a buffer large enough to store the + largest objects. yy::variant implements this buffer. It was + implemented with Quentin Hocquet. + + * src/output.c (type_names_output): New. + (output_skeleton): Invoke it. + * data/c++.m4 (b4_variant_if): New. + (b4_symbol_value): If needed, provide a definition for variants. + * data/lalr1.cc (b4_symbol_value, b4_symbol_action_) + (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy) + (b4_char_sizeof, yy::variant): New. + (parser::parse): If variants are requested, define + parser::union_type, parser::variant, change the definition of + semantic_type, construct $$ before running the user action instead + of performing a default $$ = $1. + * examples/variant.yy: New. + Based on an example by Michiel De Wilde. + +2008-11-03 Akim Demaille + + Parameterize the extraction of semantic values. + To make future changes easier, no longer rely on ".TYPE" being the + way to get a semantic value. + + * data/c.m4 (b4_symbol_value): New. + Use it. + * data/c++.m4, data/yacc.c: Use it. + * data/glr.c: Use b4_symbol_value. + (b4_rhs_data): New. + Use it. + +2008-11-03 Akim Demaille + + Prepare easier M4 changes. + * data/lalr1.cc: Use escaped [] instead of literals to prepare + future changes. + +2008-11-02 Joel E. Denny + + Initiate further development. + * NEWS: Create an empty section for new entries. + * gnulib: Update submodule to HEAD. + +2008-11-02 Joel E. Denny + + * NEWS: Version 2.4. + +2008-11-02 Joel E. Denny + + Prepare for next release. + * NEWS: Briefly mention changes since 2.3b. + * README: Say GNU m4 1.4.6, which we've been requiring in release + announcements already, not 1.4.3, which breaks the build. + +2008-11-02 Joel E. Denny + + Say %language is experimental. + We're thinking of extending it's effect on output file naming. See the + thread at + . + * NEWS: Say it's experimental. + * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't + recommend it over %skeleton for now. + (Bison Options): Likewise. + (C++ Bison Interface): Use %skeleton not %language. + (Calc++ Parser): Use %skeleton not %language. + * src/getargs.c (usage): Say it's experimental. + +2008-11-01 Di-an Jan + Paolo Bonzini + + Support all Java parser class modifiers. + * data/java.m4 (b4_percent_define_get3): New. + (b4_final_if, b4_strictfp_if): New. + * data/lalr1.java (final, strictfp, extends, implements): Support. + * doc/bison.texinfo (final, strictfp, extends, implements): Add + documentation. + * tests/java.at (AT_CHECK_JAVA_MINIMAL): New. + (AT_CHECK_JAVA_MINIMAL_W_LEXER): New. + (AT_CHECK_JAVA_GREP): New. + (Java parser class modifiers): New test. + (Java parser class extends and implements): New test. + + Model exception propagation better with throws and lex_throws. + * data/java.m4 (b4_list2): New. + (throws): Change default. + * data/lalr1.java (yyaction): Add throws. + (parse): Add lex_throws in addition to throws. + * doc/bison.texinfo (throws, lex_throws): Add documentation. + * tests/java.at (Java throws specifications): New test. + + Improve documentation for Java parsers. + * doc/bison.texinfo (Java Parsers): Add subsections. + Don't quote first argument of %define. + (Java Bison Interface): Document output files. Move documentation + of parser class and merge into Java Parser Interface. Document + features that error out. Document directives with no effect. + Move note about Javadoc higher. + (Java Semantic Values): Explicitly mention stype. + Document that generic types cannot be used. + (Java Location Values): Use @deftypeivar. Document constructors. + Correct return value for toString. + (Java Parser Interface): List undocumented constants/fields. + Move documentation of fields added by %parse-param closer to list + of members. Document that token names are added as fields. + Document constructors accurately. Remove error method. + (Java Scanner Interface): Move note on %pure-parser to Java Bison + Interface. Describe %code lexer and yylex accutately. + Remove documentation that does not match the code. + (Java Action Features): New. + (Java Differences): Add reference. Add item on semantic values. + Add note about @{ ... @}. Clarify %% epilogue placement. + (Java Declarations Summary): New. + + Fix Java skeleton. + * data/java.m4 (b4_prefix): Correct quoting for m4_define_default. + (b4_remove_comma): Quote test argument. + (b4_identification): Remove "bison" field. + * tests/java.at (Java parser class and package names): New test. + (Java %parse-param and %lex-param): New test. + (Java stype, position_class and location_class): New test. + +2008-10-31 Di-an Jan + + * data/lalr1.jave: Update copyright years. + (YYParser): Correct name of "generated from" file in Javadoc: + use b4_file_name instead of @ofile@. + (Location constructor): Correct Javadoc parameter name. + (yylloc): Add missing opening m4 quote after b4_location_if. + This removes a stray [ in the Javadoc of Lexer.getStartPos. + (Lexer.yyerror): Fix incorrect m4 and Javadoc. + (YYParser constructor): Correct Javadoc parameter name. + +2008-10-30 Joel E. Denny + + Always put auxiliary code files in the same dir as other output files. + * src/files.c (compute_file_name_parts): When the user specifies + --output but not --file-prefix, extract the directory prefix from the + file prefix not from the grammar file name. This affects the location + of files like location.hh generated by the C++ skeleton. The includes + in the other output files require this fix. + * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories + for expected output files. + (Output files): Add a test for the above. + +2008-10-29 Joel E. Denny + + * gnulib: Update submodule to HEAD. + +2008-10-28 Joel E. Denny + + Update copyright year. + * src/files.c: Here. + +2008-10-28 Di-an Jan (tiny change) + + Don't overwrite the input file. + * src/files.c (output_file_name_check): Fatal error if using input file + for output. + * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status + argument. + (Conflicting output files): Add test. + +2008-10-28 Akim Demaille + + Space changes. + * data/lalr1.cc: Formatting changes. + +2008-10-28 Akim Demaille + + Don't define debugging functions when !YYDEBUG. + * data/lalr1.cc (debug_stream, set_debug_stream) + (debug_level_type, debug_level, set_debug_level): Don't + declare them when YYDEBUG is not defined. + The implementation are already YYDEBUG-aware. + +2008-10-28 Akim Demaille + + Prefer "continue" for empty loop bodies. + * etc/bench.pl.in: Use "continue" instead of {}. + +2008-10-28 Akim Demaille + + Space and comments changes. + * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes. + * data/c.m4, data/lalr1.cc: Space changes. + +2008-10-28 Akim Demaille + + Make gnulib a submodule. + * gnulib: New. + * .gitmodules (gnulib): New. + +2008-10-18 Joel E. Denny + + Fix yyerror_range for user-defined location type in C++. Reported by + Georg Sauthoff at + . + * data/lalr1.cc (parse): Change type of yyerror_range to location_type. + * THANKS (Georg Sauthoff): Add. + +2008-10-18 Joel E. Denny + + Update several administrative files mainly to facilitate releasing. + * HACKING (Administrivia): Make the git-merge-changelog notes more + helpful. + (Test suite): Don't say lalr1.cc is not exercised in the test suite. + (Release Procedure): Update for git and add numerous details that were + previously missing. + * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint. + * maint.mk (announcement): Don't list bison as a bootstrap tool so + that announcements don't claim we bootstrapped with whatever bison + happened to be in PATH. Add flex as a bootstrap tool. + * Makefile.maint: Remove, previously replaced by maint.mk. + * Makefile.cfg: Remove, and migrate settings to... + * cfg.mk: ... here for the sake of `make announcement'. + * bootstrap.conf (gnulib_modules): Add announce-gen. + * README: Say GNU Bison instead of just Bison. Suggested by Karl + Berry. + +2008-10-08 Di-an Jan (tiny change) + + Small but important bugfixes for the Java skeleton. + * data/lalr1.java (yyerror): Change Location to b4_location_type. + (yy_symbol_print): Call toString on yyvaluep. + +2008-08-29 Akim Demaille + + Clarify UPDATED use. + * doc/bison.texinfo: It refers to the last edition of this file, + not to the release date of Bison. + Reported by Joel E. Denny. + +2008-08-29 Akim Demaille + + * README: Update FAQ pointer. + Reported by Joel E. Denny. + +2008-08-27 Eric Blake + + Resync m4sugar from autoconf. + * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine) + (m4_init): Adjust to latest m4.git changes. + (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side + effects. + * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug. + (_m4_list_cmp): Reduce side effects. + +2008-08-27 Akim Demaille + + Check yyerrok in calc.at. + * tests/calc.at (calc.y): Use yyerrok on "( error )". + (AT_CHECK_CALC): Add a check that ensures that yyerrok works as + expected. + +2008-08-27 Akim Demaille + + Support yyerrok in lalr1.cc. + YYBACKUP is still to import back into lalr1.cc. + * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define. + +2008-08-26 Joel E. Denny + + For maintainer-check*, don't recompile for a $(VERSION) update. + * cfg.mk: New file. + (_is-dist-target): Override the one in GNUmakefile. + * Makefile.am (EXTRA_DIST): Add cfg.mk. + +2008-08-26 Joel E. Denny + + Update for recent change to gnulib. + * src/parse-gram.y: Don't include strverscmp.h. It comes from + string.h now. + +2008-08-15 Eric Blake + + Remaining m4sugar merge from autoconf. + * data/m4sugar/m4sugar.m4: Copy entire file from autoconf. + * data/m4sugar/foreach.m4: New file, copied from autoconf. + * data/Makefile.am (dist_m4sugar_DATA): Distribute it. + * src/output.c (output_skeleton): Tell m4 how to find it. + + Partial m4sugar merge from autoconf: m4_map. + * data/m4sugar/m4sugar.m4 (m4_fst): Delete. + (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently. + (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros. + * data/java.m4 (b4_token_enums): Use more efficient short-circuit + for empty list. + * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals): + Likewise. + (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer + declares it. + +2008-08-07 Joel E. Denny + + Keep .version and PACKAGE_VERSION in sync. + * Makefile.am ($(top_srcdir)/.version): Declare configure as a + dependency, and add comments justifying this in more detail. Discussed + starting at + . + +2008-08-06 Eric Blake + + Partial m4sugar merge from autoconf: m4_shiftn. + * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation. + (m4_shift2, m4_shift3): New macros. + (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients. + * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def) + (b4_c_ansi_function_decl, b4_c_function_call): Likewise. + * data/java.m4 (b4_remove_comma): Likewise. + + Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6. + * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros. + (m4_wrap): Guarantee FIFO order, in spite of m4 1.6. + (m4_init): Consolidate wrapped text into single m4_wrap. + * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order + in wrapped text. + +2008-08-05 Eric Blake + + Partial m4sugar merge from autoconf: builtins, version.m4. + * data/m4sugar/m4sugar.m4 (changeword): Nuke. + (m4_prepend): Remove, as it is unused and inherently quadratic, + whereas m4_append is linear in newer m4. + (m4_mkstemp): New builtin. + (m4_symbols): Make rename conditional. + (m4_version_prereq): Ensure fatal error if used in bison, which + intentionally lacks version.m4. + + Fix comments in m4sugar. + * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf. + +2008-08-02 Joel E. Denny + + Update for recent .gitignore fix in Gnulib. + * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates + anchored .gitignore entries. + +2008-08-02 Joel E. Denny + + Set gnu or gnits strictness. + * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during + development and gnits strictness for releases. Based on Eric Blake's + suggestion at + . + +2008-07-31 Paolo Bonzini + + * NEWS: Clarify documentation of %language. + +2008-07-31 Paolo Bonzini + + Support usage of git-merge-changelog. + * .gitattributes: New. + * HACKING: Document usage of git-merge-changelog. + * bootstrap: Install git-merge-changelog entries in .git/config + if appropriate. + +2008-07-27 Joel E. Denny + + Remove remaining dependence on CVS Id keyword. + * ChangeLog: For the sake of people still using CVS, don't use dollars + when mentioning Id. + * data/xslt/bison.xsl: Remove Id from header comments, where it was + unusual anyway. + * data/xslt/xml2dot.xsl: Likewise. + * data/xslt/xml2text.xsl: Likewise. + * data/xslt/xml2xhtml.xsl: Likewise. + * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID. + * doc/Makefile.am (neutralize): Remove, no longer needed. + (.x.1): Don't use neutralize. + (edit): Don't substitute for ID. + (Doxyfile): Don't define Id, and thus don't depend on ChangeLog. + +2008-07-27 Joel E. Denny + + Fix dependence on computed configure variables. + * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not + $(top_srcdir)/configure.ac so that changes to computed variables, such + as PACKAGE_VERSION, are seen. + * tests/Makefile.am ($(srcdir)/package.m4): Likewise. + +2008-07-20 Joel E. Denny + + Update copyright dates for recent changes. + * Makefile.am: Here. + * src/Makefile.am: Here. + * src/reduce.c: Here. + * tests/reduce.at: Here. + +2008-07-18 Joel E. Denny + + Use git-version-gen for version names between releases. + * .cvsignore (.tarball-version, GNUmakefile, *~): Add. + * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add. + * .prev-version: New. + * .version.in: Remove. + * ChangeLog: Remove the Id previously used for capturing the CVS + revision. + * GNUmakefile: Remove, now copied from Gnulib. + * Makefile.am: Add code suggested by comments in + build-aux/git-version-gen. + (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk, + .prev-version, and .version. + * NEWS (2.3b+): Rename to... + (?.?): ... this because we're dropping the "+" version naming scheme, + but, in general, we still can't be sure of our next release name. + * bootstrap: Add a quick hack to remove from .gitignore the + GNUmakefile entry that gnulib adds. We already have a /GNUmakefile + entry. This should really be fixed in gnulib instead. + * bootstrap.conf (gnulib_modules): Add gnumakefile. + * configure.ac (AC_INIT): Set version name by invoking + build-aux/git-version-gen. + (AC_CONFIG_FILES): Remove .version, now generated by + build-aux/git-version-gen. + * maint.mk: New, copied from coreutils. + * doc/.cvsignore (bison.1): Add. + * doc/.gitignore (/bison.1): Add. + * doc/bison.1: Remove, generated. + * src/.cvsignore (revision.c): Remove. + * src/.gitignore (/revision.c): Remove. + * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h. + (BUILT_SOURCES): Remove revision.c. + (revision.c): Remove. + * src/getargs.c (version): Don't print revision after the VERSION. + * src/revision.h: Remove. + +2008-07-16 Joel E. Denny + + Fix untranslatable composition of sentences. Reported by Goran + Uddeborg at + . + * THANKS (Goran Uddeborg): Add. + * src/reduce.c (reduce_print): Report the number of nonterminals and + rules useless in the grammar in separate sentences. + * tests/reduce.at (Useless Rules): Update output. + (Reduced Automaton): Likewise. + (Underivable Rules): Likewise. + (Empty Language): Likewise. + +2008-07-15 Joel E. Denny + + Fix some .gitignore and .cvsignore problems. + * bootstrap (insert_sorted_if_absent): Replace all uses with... + (insert_vc_ignore): ... this new function, which prepends `/' to all + .gitignore entries before passing them to insert_sorted_if_absent. + * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that + .cvsignore files are maintained even though Bison developers run + bootstrap while using Git. + * .cvsignore (*.patch *.log log patches applied): Remove, apparently + unneeded by Bison. + (gnulib): Add. + * .gitignore (/*.patch *.log log patches applied): Remove, broken and + unneeded. Reported by Eric Blake. + * lib/.gitignore (/*~): Add. + * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore. + * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric + Blake. + * src/.gitignore (/bison.exe): Add. Reported by Eric Blake. + +2008-07-15 Joel E. Denny + + Improve forward-compatibility with GNU M4. Reported by Eric Blake at + . + * bootstrap.conf (gnulib_modules): Add unsetenv. + * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add. + * m4/.gitignore, m4/.cvsignore (/environ.m4): Add. + (/setenv.m4): Add. + * src/output.c (output_skeleton): For the m4 invocation, pass -dV as + the first argument because it may become position-dependent, and unset + POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions. + Add comments explaining these issues in more detail. + +2008-07-14 Joel E. Denny + + Add .gitignore everywhere based on .cvsignore. + * .gitignore: New. + * build-aux/.gitignore: New. + * data/.gitignore: New. + * doc/.gitignore: New. + * etc/.gitignore: New. + * examples/.gitignore: New. + * examples/calc++/.gitignore: New. + * lib/.gitignore: New. + * m4/.gitignore: New. + * po/.gitignore: New. + * runtime-po/.gitignore: New. + * src/.gitignore: New. + * tests/.gitignore: New. + +2008-05-27 Joel E. Denny + + * NEWS (2.3b+): New section, empty for now. + * configure.ac (AC_INIT): 2.3b -> 2.3b+. + +2008-05-27 Joel E. Denny + + * NEWS (2.3b): Update release date since there has been a delay in + getting the announcements and tarballs out. + +2008-05-23 Joel E. Denny + + * NEWS: Version 2.3b. + * configure.ac (AC_INIT): Likewise. + (PACKAGE_COPYRIGHT_YEAR): Update to 2008. + +2008-05-23 Joel E. Denny + + * HACKING: Don't say don't mention HACKING in the ChangeLog. We've + been doing it for years. + (Test suite): Mention maintainer-push-check and maintainer-xml-check. + (Release Procedure): Add FIXME about make alpha being unmaintained. + +2008-05-13 Joel E. Denny + + * data/yacc.c: Reformat m4 a little for readability. + * src/lalr.c (build_relations): Correct comment. + +2008-05-12 Juan Manuel Guerrero + + DJGPP specific issue. + * djgpp/config.sed: Fixes required to run configure scripts generated + by autoconf 2.62. + +2008-05-07 Joel E. Denny + + * HACKING (Release Procedure): translation@iro.umontreal.ca is now + coordinator@translationproject.org. + +2008-05-06 Joel E. Denny + + * THANKS: Add Eric Blake. + +2008-04-23 Eric Blake + + Revert prior patch, by working around autoconf regression. + * tests/output.at (m4_expand): Add workaround for autoconf 2.62. + ("Output file name: ("): Uncomment test. + ("Output file name: )"): Likewise. + Based on an idea from Noah Misch. + +2008-04-21 Joel E. Denny + + Work-around an Autoconf 2.62 AT_SETUP bug that was not present in + 2.61. Reported by Juan Manuel Guerrero at + . + * tests/output.at ("Output file name: ("): Comment out test case for + now. + ("Output file name: )"): Likewise. + +2008-04-21 Joel E. Denny + + * GNUmakefile: Update git-version-gen invocation so make dist + succeeds. + +2008-04-21 Joel E. Denny + + Update to the current gnulib CVS repository, and fix trigraph handling + in Bison. + * bootstrap: Update gnulib CVS repository URL. + (symlink_to_dir): Encapsulate the code that guarantees the destination + directory exists into... + (check_dst_dir): ... this new function, and... + (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't + fail when copying files into lib/uniwidth/. + * src/output.c (prepare_symbols): When writing yytname muscles, where + symbol names will be encoded in C-string literals, tell quotearg to + escape trigraphs. This used to be the default in gnulib. + * tests/regression.at (Token definitions): Because of the change in + gnulib's quotearg behavior, string_as_id in parse-gram.y no longer + escapes trigraphs in symbol names. Thus, yytname no longer has + trigraphs unnecessarily doubly escaped. Update test case output. + Extend test case to be sure Bison's own error messages will no longer + have trigraphs in symbol names unnecessarily escaped once. + +2008-04-20 Joel E. Denny + + Fix make dist infinite loop reported by Juan Manuel Guerrero at + . + * .cvsignore: Add .version. + * .version.in: New. + * bootstrap.conf (gnulib_modules): Add git-version-gen. + * configure.ac (AC_CONFIG_FILES): Add .version. + * build-aux/.cvsignore: Add git-version-gen. + +2008-03-08 Joel E. Denny + + * NEWS (2.3a+): Mention that -g now takes an argument. + * doc/bison.texinfo (Bison Options): Reword -W entry a little for + consistency. Update the -g and -x entries now that they take + arguments. Use brackets to indicate optional arguments. + * src/getargs.c (usage): Explain the relationship between arguments of + long and short options more completely. Document --defines and -d + separately since the former takes an argument but, for POSIX Yacc, the + latter does not. + (short_options): Let -W take an optional argument like --warnings. + (getargs): Sort cases. + +2008-02-28 Akim Demaille + + * doc/bison.texinfo: Fix a few typos. + +2008-02-28 Akim Demaille + + * doc/bison.texinfo (Bison Options): Document -W. + Based on Joel E. Denny's NEWS entry, and Automake's documentation. + +2008-02-28 Akim Demaille + + * src/getargs.c (short_options): Split and sort for readability. + -g and -x take optional arguments, just like their long options. + * build-aux/cross-options.pl: Use /x to make the regexp easier to + understand. + Fix the handling of $opt which resulted in all the argument to be + considered as optional. + +2008-02-22 Joel E. Denny + + * NEWS (2.3a+): Don't say %language is experimental. Mention Java and + say its interface is experimental. + * doc/bison.texinfo (Decl Summary): In the %language entry, mention + Java. + (Bison Options): In the -L and --language entry, mention Java. + (Java Bison Interface): Say the interface is experimental. + * src/getargs.c (usage): Mention -L and --language. + + * NEWS (2.3a+): Say the push parsing interface is experimental. + * doc/bison.texinfo (Push Decl): Likewise. + (Decl Summary): Likewise in the "%define api.push_pull" entry. + (Push Parser Function): Likewise. + (Pull Parser Function): Likewise. + (Parser Create Function): Likewise. + (Parser Delete Function): Likewise. + (Table of Symbols): Likewise in the yypstate_delete, yypstate_new, + yypull_parse, and yypush_parse entries. + + * NEWS (2.3a+): Mention XML support, and say the schema is + experimental. + * doc/bison.texinfo (Bison Options): Mention -x and --xml. + * src/getargs.c (usage): Say the XML schema is experimental. + + * NEWS (2.3a+): Say option instead of flag. + +2008-02-21 Wojciech Polak + + * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer + text. + +2008-02-20 Joel E. Denny + + Fix impure push parser compile error reported by Bob Rossi at + . + * data/yacc.c: Clean up whitespace in the output a little. + (yypstate_allocated): Define for impure push parsers regardless of + whether the pull interface is also requested. + * tests/push.at (Push Parsing: Multiple impure instances): Extend to + check impure push parsers without the pull interface. + + * data/yacc.c (yypstate_new): Don't try to invoke yyerror since + yyerror takes arguments specified by %parse-param while yypstate_new + does not. + * doc/bison.texinfo (Parser Create Function): Document that + yypstate_new returns 0 for multiple impure parser instances. + * tests/push.at (Push Parsing: Multiple impure instances): Update + expected stderr output. + +2008-02-19 Joel E. Denny + + * runtime-po/POTFILES.in (push.c): Remove. + +2008-02-17 Joel E. Denny + + * data/Makefile.am (dist_pkgdata_DATA): Remove push.c. + * data/push.c: Rename to... + * data/yacc.c: ... this, overwriting it. + * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'. + `%push-pull-parser' -> `%define api.push_pull "both"'. + Remove old yacc.c tests, and update push.c tests to yacc.c. + +2008-02-17 Joel E. Denny + + * data/bison.m4 (b4_percent_code_get): Output %code block comments like + `"%code top" blocks' instead of `%code "top" blocks'. + * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03. + Clean up whitespace in the output a little. + +2008-02-16 Joel E. Denny + + Fix documentation problems reported by Tim Josling at + . + * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser. + * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative* + integers. Explain the effect of literal string aliases on error + messages. Copy token 0 documentation from the C++ skeleton + documentation. + +2008-02-16 Joel E. Denny + + Accept a token number in a %left, %right, or %nonassoc for POSIX + conformance. Reported by Tim Josling at + . + * NEWS (2.3a+): Mention. + * doc/bison.texinfo (Precedence Decl): Describe how literal strings + and code numbers are treated by precedence declarations. + * src/parse-gram.y (precedence_declaration): Use symbols.prec instead + of symbols.1. + (symbols.prec): New, just like symbols.1 but uses symbol.prec instead + of symbol. + (symbol.prec): New, just like symbol but allows INT. + * src/symtab.c (symbol_user_token_number_set): Remove an aver that no + longer holds. + * tests/regression.at (Token number in precedence declaration): New + test case. + +2008-02-06 Juan Manuel Guerrero + + DJGPP specific issues. + * djgpp/config.bat: Add filenames that are not 8.3 clean and that must + be changed. Copyright timestamp adjusted. + * djgpp/config.sed: Add filenames that are not 8.3 clean and that must + be changed. Copyright timestamp adjusted. + * djgpp/config.site: Copyright timestamp adjusted. + * djgpp/config_h.sed: Copyright timestamp adjusted. + * djgpp/djunpack.bat: Copyright timestamp adjusted. + * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the + filename translation list. + * djgpp/subpipe.c (init_subpipe): Check the environment variables + TMPDIR, TMP and TEMP, in that order, to determinate where the temp + files shall be created. Before trying to use the temp dir where the + environment variable points to check that the dir really exists. If + not default to the cwd as temp dir. Copyright timestamp adjusted. + * djgpp/subpipe.h: Copyright timestamp adjusted. + * djgpp/testsuite.sed: Copyright timestamp adjusted. + +2008-01-30 Paul Eggert + + * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording. + +2008-01-09 Paul Eggert + + * data/yacc.c (yyparse): Correct the comment when locations aren't used. + Problem reported by Claudio Saavedra in + . + +2008-01-05 Wojciech Polak + + * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML + document's title with the input grammar file name. + +2007-12-22 Joel E. Denny + + Automate regression testing of the XML/XSLT implementation. Discussed + starting at + . + * configure.ac (XSLTPROC): New substitution. + * Makefile.am (maintainer-xml-check): New phony target invoking... + * tests/Makefile.am (maintainer-xml-check): ... this new phony target + invoking make maintainer-check with BISON_TEST_XML=1. + * tests/atlocal.in (XSLTPROC): New. + * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind + not to report reachable memory when Bison is expected to have a + non-zero exit status and (2) to compare XML/XSLT output with --graph + and --report=all output for every working grammar when + BISON_TEST_XML=1. + (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks. + (AT_BISON_CHECK_XML): New. + (AT_QUELL_VALGRIND): New. + * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and... + (AT_CHECK): ... don't redefine this since this was the old way to + quell Valgrind. + * tests/actions.at: Rewrite all AT_CHECK invocations for bison as + AT_BISON_CHECK invocations. + * tests/c++.at: Likewise. + * tests/calc.at: Likewise. + * tests/conflicts.at: Likewise. + * tests/cxx-type.at: Likewise. + * tests/existing.at: Likewise. + * tests/glr-regression.at: Likewise. + * tests/headers.at: Likewise. + * tests/input.at: Likewise. + * tests/java.at: Likewise. + * tests/output.at: Likewise. + * tests/push.at: Likewise. + * tests/reduce.at: Likewise. + * tests/regression.at: Likewise. + * tests/sets.at: Likewise. + * tests/skeletons.at: Likewise. + * tests/synclines.at: Likewise. + * tests/torture.at: Likewise. + (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar + tends to hang xsltproc. + (Big horizontal): Likewise. + +2007-12-08 Joel E. Denny + + In XML output, remove redundant class attribute on symbol element. + * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New. + * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to + look up a symbol to determine whether it's a nonterminal or terminal. + * src/gram.c (rule_rhs_print_xml): Remove class attribute. + * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise. + + Add prec/assoc information to XML output. + * src/gram.c (grammar_rules_print_xml): For each rule that has a + %prec, add a percent_prec attribute. + * src/print-xml.c (print_grammar): For each terminal that has a + precedence or associativity, add a prec or assoc attribute. + (xml_indent): New. + (xml_puts): Use xml_indent. + (xml_printf): Use xml_indent. + * src/print-xml.h (xml_indent): Prototype. + + * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from + . + +2007-12-08 Joel E. Denny + + * data/xslt/bison.xsl (bison:ruleNumber): Rename to... + (bison:ruleByNumber): ... this for clarity. + * data/xslt/xml2dot.xsl (xsl:template match="item"): Update. + * data/xslt/xml2text.xsl (xsl:template match="item"): Update. + (xsl:template match="reduction"): Update. + (xsl:template match="item"): Update. + (xsl:template match="reduction"): Update. + + In the XML output, don't print the list of rules where symbols appear. + Compute it in XSLT instead. Discussed at + . + * data/xslt/bison.xsl (bison:ruleByLhs): New. + (bison:ruleByRhs): New. + * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use + bison:ruleByRhs. + (xsl:template match="terminal/rule"): Remove. + (xsl:template match="nonterminal"): Use bison:ruleByLhs and + bison:ruleByRhs. + (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"): + Remove. + * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use + bison:ruleByRhs and mode="number-link" for rule template. + (xsl:template match="terminal/rule"): Remove. + (xsl:template match="nonterminal"): Use bison:ruleByLhs and + bison:ruleByRhs and mode="number-link" for rule template. + (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"): + Rewrite as... + (xsl:template match="rule" mode="number-link"): ... this. + * src/print-xml.c (print_grammar): Don't print the list of rules. + +2007-12-01 Joel E. Denny + + Don't let --report affect XML output; always print all information. + Discussed at + . + * src/conflicts.c (log_resolution): Implement. + * src/print-xml.c (print_core): Implement. + (print_state): Implement. + (print_xml): Implement. + + * NEWS (2.3a+): Fix quotes. + * src/parse-gram.y (prologue_declaration): For consistency with -v, + don't let %verbose clear the list specified by --report. + +2007-11-26 Akim Demaille + + * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl. + +2007-11-24 Joel E. Denny + + In the XML output, list useless and unused symbols and rules with the + useful ones and add a "usefulness" attribute. Discussed starting at + . + * src/gram.c (grammar_rules_partial_print_xml): Remove. + (grammar_rules_print_xml): Print all rules instead of just those + useful in the grammar, and add a "usefulness" attribute. + * src/gram.h (grammar_rules_partial_print_xml): Remove prototype. + * src/print-xml.c (print_rules_useless_in_parser): Remove. + (print_grammar): Print all nonterminals instead of just useful ones, + and add a "usefulness" attribute to nonterminals and terminals. + (print_xml): Don't print a separate "reductions" or + "rules-useless-in-parser" element. + * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar. + (reduce_xml): Remove. + (reduce_token_unused_in_grammar): New. + (reduce_nonterminal_useless_in_grammar): New. + * src/reduce.h (reduce_xml): Remove prototype. + (reduce_token_unused_in_grammar): Add prototype. + (reduce_nonterminal_useless_in_grammar): Add prototype. + * data/xslt/xml2text.xsl: Update for XML changes. + * data/xslt/xml2xhtml.xsl: Update for XML changes. + * tests/reduce.at (Useless Terminals): Update output. + (Useless Rules): Update output. + (Reduced Automaton): Update output. + + Say "Terminals unused in grammar" instead of "Unused terminals". + * NEWS (2.3a+): Update. + * doc/bison.texinfo (Understanding): Update example output. + * src/reduce.c (reduce_output): Implement. + * data/xslt/xml2text.xsl: Implement. + * data/xslt/xml2xhtml.xsl: Implement. + +2007-11-18 Joel E. Denny + + Accept --report-file=FILE to override the default `.output' filename. + * NEWS (2.3a+): Mention. + * doc/bison.texinfo (Bison Options): Add an entry. + * src/files.c (compute_output_file_names): Don't override + spec_verbose_file if already set. + * src/getargs.c (usage): Document --report-file. + (REPORT_FILE_OPTION): New anonymous enum member. + (long_options): Add entry for it. + (getargs): Add case for it setting spec_verbose_file. + + * build-aux/cross-options.pl: Don't record a short option just because + there's an arg. + * doc/.cvsignore: Add yacc.1. + +2007-11-14 Akim Demaille + + * doc/yacc.1.in: New. + * configure.ac, doc/Makefile.am: Adjust. + * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new + config.h symbol. + Use AC_SUBST for assignments too. + * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR. + +2007-11-10 Joel E. Denny + + * src/gram.c: Remove comments that duplicate comments in gram.h. + + When reporting useless rules and nonterminals, say "useless in grammar" + instead of "useless", and say "useless in parser" instead of "never + reduced". Discussed starting at + . + * NEWS (2.3a+): Mention this change. + * data/xslt/xml2text.xsl: Update output text and expected input XML + element names to match changes below. + * data/xslt/xml2xhtml.xsl: Likewise. + (xsl:template match="bison-xml-report"): Add missing entry in Table of + Contents: "Rules useless in parser due to conflicts". + * doc/bison.texinfo (Decl Summary): Reword a little. + (Understanding): Update example output for changes below. + * src/gram.c: (rule_useful_p): Rename to... + (rule_useful_in_grammar_p): ... this. + (rule_useless_p): Rename to... + (rule_useless_in_grammar_p): ... this. + (rule_never_reduced_p): Rename to... + (rule_useless_in_parser_p): ... this. + (grammar_rules_print): Update for renames. + (grammar_rules_print_xml): Update for renames. + (grammar_rules_never_reduced_report): Rename to... + (grammar_rules_useless_report): ... this since it is used for either + kind of useless rule. + * src/gram.h: Reword comments and update function names in prototypes. + * src/main.c (main): Say "rule useless in parser due to conflicts". + * src/print-xml.c (print_rules_never_reduced): Rename to... + (print_rules_useless_in_parser): ... this, and rename output XML + element "rules-never-reduced" to "rules-useless-in-parser". + (print_xml): Update for rename. + * src/print.c (print_results): Say "Rules useless in parser due to + conflicts". + * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar". + (nonterminals_reduce): Say "nonterminal useless in grammar". + (reduce_output): Say "Nonterminals useless in grammar". + Say "Rules useless in grammar". + (reduce_xml): Rename output XML element "useless" to + "useless-in-grammar". + (reduce_print): Don't report the count of grammatically useless rules + as "rules never reduced" just because %yacc is specified. + In the correct report of this count, say nonterminal(s) and rule(s) + "useless in grammar". + * tests/conflicts.at (S/R in initial): Update expected output. + (Defaulted Conflicted Reduction): Likewise. + (Unreachable States After Conflict Resolution): Likewise. + * tests/existing.at (GNU pic Grammar): Likewise. + * tests/reduce.at (Useless Nonterminals): Likewise. + (Useless Rules): Likewise. + (Reduced Automaton): Likewise. + (Underivable Rules): Likewise. + (Empty Language): Likewise. + +2007-11-09 Joel E. Denny + + * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the + here document and before the EOF so that BSD's implementation of Bourne + shell doesn't parse the delimiter as part of the here document. + * doc/.cvsignore: Add cross-options.texi. + * src/getargs.c (usage): Add a blank line after the warning categories. + +2007-11-08 Paolo Bonzini + + * data/lalr1.java (Lexer): Remove usage of b4_pure_if. + +2007-11-05 Akim Demaille + + Remove Id: from bison.1. + * doc/Makefile.am (remove_time_stamp): Include the sed invocation. + (perl -0777 -pi -e 's/\.PP\nId): New. + (.x.1): Use it to ignore the version control revision. + +2007-11-05 Akim Demaille + + * build-aux/Makefile.am: Ship cross-options.pl. + * doc/Makefile.am: Always refer to cross-options.texi with + $(srcdir). + (MAINTAINERCLEANFILES): Add it. + +2007-11-04 Akim Demaille + + Generate the long/short option cross-table. + * build-aux/cross-options.pl: New. + * doc/Makefile.am (cross-options.texi): New. + * doc/bison.texinfo: Use it. + +2007-11-04 Akim Demaille + + Generate bison.1 using help2man. + * doc/common.x, doc/bison.x: New. + * doc/Makefile.am (bison.1, .x.1): New. + The code is taken from autoconf-2.61/man/Makefile.am. + * configure.ac: Look for help2man. + +2007-11-04 Akim Demaille + + Complete --help. + * src/getargs.c (usage): Document -W, make it clear that -d, + -g and -x have optional arguments. + +2007-11-04 Akim Demaille + + Find sha1sum when named gsha1sum. + * bootstrap (find_tool): New. + ($SHA1SUM): New. + +2007-10-28 Joel E. Denny + + Deprecate %pure-parser and add `%define api.pure'. Discussed starting + at + . + * NEWS (2.3a+): Mention. + * data/bison.m4 (b4_pure_if): Don't define it here. + * data/c.m4 (b4_identification): Depend on individual skeletons to + define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the + values of the %define variables api.pure or api.push_pull. Define + YYPURE, YYPUSH, and YYPULL accordingly. + * data/glr.c: Define b4_pure_if based on `%define api.pure' unless + glr.cc has already defined b4_pure_flag. + * data/push.c: Define b4_pure_if based on `%define api.pure'. + Remove YYPUSH and YYPULL since they're back in b4_identification again. + * data/yacc.c: Define b4_pure_if based on `%define api.pure'. + * doc/bison.texinfo (Pure Decl): Update. + (Push Decl): Update. + (Decl Summary): Add api.pure to %define entry. + In %pure-parser entry, say it's deprecated and reference %define. + (Pure Calling): Update. + (Error Reporting): Update. + (C++ Scanner Interface): Update. + (How Can I Reset the Parser): Update. + (Table of Symbols): In %pure-parser entry, say it's deprecated and + reference %define. + * src/getargs.c (pure_parser): Remove global variable. + * src/getargs.h (pure_parser): Remove extern. + * src/output.c (prepare): Don't define pure_flag muscle. + * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a + wrapper around `%define api.pure'. + * tests/calc.at (Simple LALR Calculator): Update. + (Simple GLR Calculator): Update. + * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations): + Update. + (GLR: Resolve ambiguity, pure, locations): Update. + (GLR: Merge conflicting parses, pure, no locations): Update. + (GLR: Merge conflicting parses, pure, locations): Update. + * tests/glr-regression.at (Uninitialized location when reporting + ambiguity): Update + * tests/input.at (Unused %define api.pure): New test case. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for + AT_PURE_IF and AT_PURE_AND_LOC_IF. + * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update. + +2007-10-28 Joel E. Denny + + %define push_pull -> %define api.push_pull. Discussed starting at + . + * data/push.c: Expect the new name. + * data/yacc.c: Likewise. + * doc/bison.texinfo (Push Decl): Update. + (Decl Summary): Update %define entry. + (Push Parser Function): Update. + (Pull Parser Function): Update. + (Parser Create Function): Update. + (Parser Delete Function): Update. + * tests/calc.at (Simple LALR Calculator): Update. + * tests/input.at (%define enum variables): Update. + * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update. + (Push Parsing: Multiple impure instances): Update. + (Push Parsing: Unsupported Skeletons): Update. + * tests/torture.at (Exploding the Stack Size with Alloca): Update. + (Exploding the Stack Size with Malloc): Update. + + * NEWS (2.3a+): Add an entry for the push parser, and clean up the + other entries some. + +2007-10-27 Joel E. Denny + + For the XML output's terminal element, rename @number to @token-number, + and add @symbol-number. In the nonterminal element, rename @number to + @symbol-number. Discussed starting at + . + * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for + renames. + (xsl:template match="nonterminal"): Likewise. + * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise. + (xsl:template match="nonterminal"): Likewise. + * src/print-xml.c (print_grammar): Implement. + +2007-10-21 Joel E. Denny + + * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After + 2007-10-11 change, the child elements here are items not rules. + (xsl:template match="item"): New. + (xsl:template match="rule"): Update for new reduced itemset. + (xsl:template match="point"): Remove. + (xsl:template match="empty"): For consistency with --graph, don't + output "/* empty */". + * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking + line-wrap, don't pass a negative value as first-line-length since this + won't work with the following changes. + (xsl:template name="line-wrap"): Simplify slightly. + (xsl:template name="ws-search"): Eliminate recursion. + * src/print_graph.c (print_core): Don't print a reduction's lookahead + set next to an item whose dot is not at the end of the RHS even if it + happens to be associated with the same rule. + +2007-10-19 Joel E. Denny + + Add %define lr.keep_unreachable_states. + * NEWS (2.3a+): Mention it in the entry for unreachable state removal. + * doc/bison.texinfo (Decl Summary): Mention it in the %define entry. + * src/main.c (main): Implement it. + * tests/conflicts.at (Unreachable States After Conflict Resolution): + Extend to test it, and fix a typo. + +2007-10-19 Joel E. Denny + + * NEWS (2.3a+): Add entry for recent .output file lookahead set fix. + * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in + the example .output text. + * tests/regression.at (Extra lookahead sets in report): Improve wording + of comments. + +2007-10-17 Wojciech Polak + + * src/print-xml.c (print_grammar): Renamed + and attributes: + "type" to "number" and "symbol" to "name". + * data/xslt/xml2text.xsl (xsl:template match="terminal"): + Use new attribute names. + (xsl:template match="nonterminal"): Likewise. + * data/xslt/xml2xhtml.xsl: Likewise. + +2007-10-17 Joel E. Denny + + * doc/bison.texinfo (Bison Options): Add entry for --print-datadir. + (Option Cross Key): Likewise. + + * src/print-xml.c (print_core): Don't print a reduction's lookahead set + next to an item whose dot is not at the end of the RHS even if it + happens to be associated with the same rule. + * src/print.c (print_core): Likewise. + * tests/conflicts.at (Unresolved SR Conflicts): Update output. + (Resolved SR Conflicts): Update output. + * tests/regression.at (Extra lookahead sets in report): New test case. + +2007-10-11 Wojciech Polak + + * src/print-xml.c (print_core): Remove item set + redundancy. + * data/xslt/bison.xsl (bison:ruleNumber): New key. + Improve processing time. Suggested by Joel E. Denny. + * data/xslt/xml2dot.xsl (xsl:template name="escape"): + Write xsl:param "required" attribute as comment. + * data/xslt/xml2text.xsl (xsl:template match="item"): New. + (xsl:template match="rule"): Support new reduced itemset. + (xsl:template match="point"): Remove. + * data/xslt/xml2xhtml.xsl: Likewise. + +2007-10-09 Joel E. Denny + + * src/getargs.c (version): Update copyright year. + +2007-10-09 Joel E. Denny + + Make xml2dot.xsl and --graph produce the same output. + * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` ' + instead of a `\n'. That is, don't add escapes yet or they'll be doubly + escaped later. + (xsl:template name="output-node"): Use the new escape template instead + of the string-replace template directly. + (xsl:template name="output-edge"): Likewise. + (xsl:template name="escape"): New, escapes backslashes and newlines in + addition to quotation marks. + * src/graphviz.c (start_graph, output_node, output_edge): Add + whitespace to output for legibility. + + Make xml2text.xsl and --report produce the same output, and remove the + XML "conflicts" element since a conflict summary is easily extracted + from the automaton. + * data/xslt/bison.xsl: New. + (xsl:template match="state" mode="bison:count-conflicts): New. + * data/xslt/xml2text.xsl: Import bison.xsl. + (xsl:template match="bison-xml-report"): Instead of styling the + "conflicts" element, style the "automaton" element with mode + "conflicts". Unlike the former, the latter lists S/R and R/R + conflicts for a state on the same line. + (xsl:template match="conflicts"): Remove. + (xsl:template match="conflict"): Remove. + (xsl:template match="terminal"): Line-wrap the list of rules in which + the terminal is used. + (xsl:template match="nonterminal"): Likewise for nonterminals. + (xsl:template match="automaton" mode="conflicts"): New. + (xsl:template match="state" mode="conflicts"): New. + (xsl:template name="line-wrap"): New. + (xsl:template name="ws-search"): New. + * data/xslt/xml2xhtml.xsl: Import bison.xsl. + (xsl:template match="bison-xml-report"): Instead of styling the + "conflicts" element, style the "automaton" element with mode + "conflicts." + (xsl:template match="conflicts"): Remove. + (xsl:template match="conflict"): Remove. + (xsl:template match="automaton" mode="conflicts"): New. + (xsl:template match="state" mode="conflicts): New. + * src/conflicts.c (conflicts_output_xml): Remove. + * src/conflicts.h (conflicts_output_xml): Remove prototype. + * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml. + * src/print.c (print_grammar): Consistently wrap at the 66th column so + the corresponding XSLT is easier. Also, never wrap between a word and + the comma that follows it. + +2007-10-08 Joel E. Denny + + Improve C++ namespace support. Discussed starting at + . + * data/c++.m4: (b4_namespace_ref, b4_namespace_open, + b4_namespace_close): New macros that interpret the %define variable + "namespace" so its value can contain "::" to indicate nested + namespaces. + * data/glr.cc (b4_namespace): Don't define, and replace all uses with + the above macros. + * data/lalr1.cc (b4_namespace): Likewise. + * data/location.cc (b4_namespace): Likewise. + * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry + inside a new table in the general %define entry. Document `%define + namespace' there as well. Point the %name-prefix entry to it since it + explains it more completely in the case of C++. + (C++ Bison Interface): Mention `%define namespace' instead of + %name-prefix. + (Table of Symbols): Remove the `%define push_pull' entry. The %define + entry suffices. + * tests/c++.at (Relative namespace references): New test case. + (Absolute namespace references): New test case. + (Syntactically invalid namespace references): New test case. + * tests/input.at (C++ namespace reference errors): New test case. + +2007-10-08 Joel E. Denny + + Add syncline support and location accessor to internal %define + interfaces. + * data/bison.m4 (b4_percent_define_get_loc): New. + (b4_percent_define_get_syncline): New. + (b4_percent_define_flag_if): Use b4_percent_define_get_loc. + (b4_percent_define_default): Record defining location as line 1 rather + than 0 for the sake of synchronizing #line's, and define + b4_percent_define_syncline(VARIABLE). + (b4_percent_define_check_values): Use b4_percent_define_get_loc. + * src/muscle_tab.c (muscle_syncline_grow): New. + (muscle_code_grow): Use muscle_syncline_grow. + (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and + define b4_percent_define_syncline(VARIABLE). + (muscle_percent_define_get_loc): New. + (muscle_percent_define_get_syncline): New. + (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and + remove some unused variables. + (muscle_percent_define_default): Record defining location as line 1 + rather than 0 for the sake of synchronizing #line's, and define + b4_percent_define_syncline(VARIABLE). + (muscle_percent_define_check_values): Use + muscle_percent_define_get_loc. + * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype. + (muscle_percent_define_get_syncline): Prototype. + * tests/skeletons.at (%define Boolean variables: invalid skeleton + defaults): Update output for location change. + (Complaining during macro argument expansion): Extend to test + b4_percent_define_get_loc and b4_percent_define_get_syncline errors. + +2007-10-07 Joel E. Denny + + Fix some error-reporting macro bugs. + * data/bison.m4 (b4_cat): New. + (b4_error, b4_error_at): Use b4_cat to send error directives directly + to stdout so they don't become arguments to other macros. Update + comments and add examples. + (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and + add examples. + (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately + after printing the error directive so that M4 doesn't report subsequent + problems that are induced by this problem. + * src/scan-skel.l: Recognize @` digraph outside of directive arguments + instead of just in them. Recognize @\n in both places. Both expand to + the empty string. Needed by b4_cat. + * tests/skeletons.at (Complaining during macro argument expansion): + New test case. + (Fatal errors make M4 exit immediately): New test case. + +2007-10-04 Joel E. Denny + + Implement --print-datadir. + * src/getargs.c (usage): Mention. + (PRINT_DATADIR_OPTION): New anonymous enum member. + (long_options): Add entry for it. + (getargs): Add case for it calling compute_pkgdatadir. + * src/output.c (output_skeleton): Encapsulate data directory + computation from here... + (prepare): ... and from here... + (compute_pkgdatadir): ... into this new function. + * src/output.h (compute_pkgdatadir): Prototype. + +2007-09-29 Joel E. Denny + + * src/print-xml.c (escape_bufs): New static global variable + replacing... + (xml_escape_n): ... the static local variable buf here. + (print_xml): Free memory for escape_bufs. + * src/reduce.c (reduce_xml): XML-escape terminal symbol tags. + +2007-09-25 Joel E. Denny + + Replace `%push-parser' and `%push-pull-parser' with + `%define push_pull "push"' and `%define push_pull "both"'. + `%define push_pull "pull"' is the default. + * doc/bison.texinfo (Push Decl, Push Parser Function, + Pull Parser Function, Parser Create Function, Parser Delete Function): + Update declarations. + (Decl Summary, Table of Symbols): Replace %push-parser and + %push-pull-parser entries with a %define push_pull entry. + * data/bison.m4 (b4_percent_define_check_values): New macro. + (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these + definitions... + * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp + definitions... + * data/push.c: ... to here and compute them from the value of the + %define variable push_pull. + * data/c-skel.m4: Instead of choosing the push.c skeleton for push + parsing requests here... + * data/yacc.c: ... hack this to switch to push.c any time + b4_use_push_pull_flag or the %define variable push_pull is set. This + will go away when we mv push.c yacc.c. + * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that + push parsing is not supported since unused %define variables are + reported anyway. + * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove. + * src/muscle_tab.h (muscle_percent_define_check_values): Update + comments for consistency with b4_percent_define_check_values. + * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag + muscles. + * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER): + Remove. + (prologue_declaration): Remove %push-parser and %push-pull-parser + rules. + * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules. + * tests/calc.at: Update declarations. + * tests/input.at (%define enum variables): New test case. + * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update + declaration. + (Push Parsing: Multiple impure instances): Update declaration. + (Push Parsing: Unsupported Skeletons): New test case. + * tests/torture.at (Exploding the Stack Size with Alloca): Update + declaration. + (Exploding the Stack Size with Malloc): Update declaration. + +2007-09-24 Wojciech Polak + + Add XSLT transformations. + + * data/xslt/xml2dot.xsl: Transform XML into DOT. + * data/xslt/xml2text.xsl: Transform XML into plain text. + * data/xslt/xml2xhtml.xsl: Transform XML into XHTML. + * data/Makefile.am (xsltdir): New variable. + (dist_xslt_DATA): Add xslt/*.xsl files. + +2007-09-23 Paul Eggert + + * src/conflicts.c (log_resolution): Fix indenting bugs I introduced. + Problem reported by Wojciech Polak. + * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2. + (xml_printf): Undo change I made on 21 September; that is, + indent 2 spaces, not 1. + +2007-09-23 Joel E. Denny + + Pacify ./configure --enable-gcc-warnings. + * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument + `char const *' instead of `char *'. + * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused + local variable `sep'. + +2007-09-21 Paul Eggert + + * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used + elsewhere. + * src/print-xml.c: Prefer "const" after types; that's more consistent. + (xml_printf): Indent just 1 space for level. + (e_char, xlate_char): Remove. + (xml_escape_string): Rewrite to avoid undefined behavior (used + storage that was freed from the stack). + (xml_escape_n): Don't bother checking for subscript error. + +2007-09-21 Wojciech Polak + + Add Bison XML Automaton Report. + + Add support for an -x option to generate an XML report. + It is not documented yet. + * src/print-xml.c: New file. + * src/print-xml.h: Likewise. + * lib/timevar.def (TV_XML): New var. + * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h. + * src/conflicts.c: Include print-xml.h. + (solved_conflicts_xml_obstack): New var. + (log_resolution, conflicts_solve, conflicts_free): + Add support for XML report. + (conflicts_output_val): New function. + * src/conflicts.h (conflicts_output_val): New decl. + * src/files.c (spec_xml_file): New var. + (compute_output_file_names, output_file_names_free): Add XML support. + * src/files.h (spec_xml_file): New decl. + * src/getargs.c (xml_flag): New var. + (usage, short_options, long_options, getargs): Add XML support. + * src/getargs.h (xml_flag): New decl. + * src/gram.c: Include print-xml.h. + (rule_lhs_print_xml, rule_rhs_print_xml): + (grammar_rules_partial_print_xml, grammar_rules_print_xml): + New functions. + * src/gram.h: Declare external ones. + * src/main.c: Include print-xml.h. + (main): Add XML support. + * src/reduce.c: Include print-xml.h. + (reduce_xml): New function. + * src/reduce.h: Declare it. + * src/state.c: Include print-xml.h. + (state_new): Add XML support. + (state_rule_lookahead_tokens_print_xml): New function. + * src/state.h: Declare it. + (struct state): New member solved_conflicts_xml. + * src/symtab.c (symbol_class_get_string): New function. + * src/symtab.h: Declare it. + +2007-09-21 Paul Eggert + + * GNUmakefile: Switch to coreutils's version. + * bootstrap: Likewise. + * Makefile.cfg: Adjust to new GNUmakefile. + * README-hacking: Likewise. + + Import from gnulib: + + 2006-08-18 Paul Eggert + Bruno Haible + + * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists + and is a script that invokes bison. Tighten the code. Add comments. + +2007-08-28 Joel E. Denny + + Spell "boolean" as "Boolean". Reported by Akim Demaille. + * data/bison.m4 (b4_percent_define_flag_if): Fix complaint. + * doc/bison.texinfo (Decl Summary): Fix. + * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint. + * tests/input.at (Boolean %define variables): Update output. + * tests/skeletons.at (%define boolean variables: invalid skeleton + defaults): Rename to... + (%define Boolean variables: invalid skeleton defaults): ... this and + update output. + +2007-08-17 Joel E. Denny + + In impure push mode, don't allow more than one yypstate to be allocated + since multiple impure parsers would corrupt yynerrs. + * data/push.c (yypstate_allocated): New static global variable + initialized to 0. + (yypull_parse): If yypstate_new returns 0, don't report it as memory + exhaustion if yypstate_allocated is 1, but still return 2. + (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is + already 1. Otherwise, set it to 1. + (yypstate_delete): Set it to 0. + * tests/push.at (Push Parsing: Multiple impure instances): New test + case. + +2007-08-17 Bob Rossi + + * doc/bison.texinfo (Push Decl): Document the push parser. + (Table of Symbols): Ditto. + (Pure Decl): Ditto. + (Decl Summary): Ditto. + (Multiple Parsers, Push Parser Function, Pull Parser Function, + Parser Create Function, Parser Delete Function): + Add new push parser symbols. + (Table of Symbols): Document push-parser, push-pull-parser, + yypush_parse, yypull_parse, yypstate_new and yypstate_delete. + +2007-08-15 Paul Eggert + + Update to GPLv3. + * doc/gpl-3.0.texi: New file. + * doc/gpl.texi: Remove. + * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg: + * Makefile.maint, NEWS, PACKAGING, README, README-alpha: + * README-hacking, TODO, bootstrap, bootstrap.conf: + * configure.ac, data/Makefile.am, data/README, data/bison.m4: + * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4: + * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4: + * data/lalr1.cc, data/lalr1.java, data/location.cc: + * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4: + * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat: + * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed: + * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h: + * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo: + * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README: + * etc/bench.pl.in, examples/Makefile.am, examples/extexi: + * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c: + * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h: + * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c: + * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h: + * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c: + * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h: + * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h: + * lib/timevar.c, lib/timevar.def, lib/timevar.h: + * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c: + * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4: + * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am: + * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h: + * src/complain.c, src/complain.h, src/conflicts.c: + * src/conflicts.h, src/derives.c, src/derives.h, src/files.c: + * src/files.h, src/flex-scanner.h, src/getargs.c: + * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c: + * src/lalr.c, src/lalr.h, src/location.c, src/location.h: + * src/main.c, src/muscle_tab.c, src/muscle_tab.h: + * src/nullable.c, src/nullable.h, src/output.c, src/output.h: + * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y: + * src/print.c, src/print.h, src/print_graph.c: + * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c: + * src/reduce.h, src/relation.c, src/relation.h: + * src/revision.h, src/scan-code.h, src/scan-code.l: + * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h: + * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c: + * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h: + * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h: + * tests/Makefile.am, tests/actions.at, tests/c++.at: + * tests/calc.at, tests/conflicts.at, tests/cxx-type.at: + * tests/existing.at, tests/glr-regression.at: + * tests/headers.at, tests/input.at, tests/java.at: + * tests/local.at, tests/output.at, tests/push.at: + * tests/reduce.at, tests/regression.at, tests/sets.at: + * tests/skeletons.at, tests/synclines.at, tests/testsuite.at: + * tests/torture.at: + Update to GPLv3. + +2007-08-11 Joel E. Denny + + Get rid of broken %no-parser, -n, and --no-parser implementation and + documentation. + * TODO: Don't mention them. + * doc/bison.1: Likewise. + * doc/bison.texinfo (Decl Summary): Likewise. + (Bison Options): Likewise. + (Option Cross Key): Likewise. + * src/getargs.c (no_parser_flag): Remove global variable. + (usage): Don't print description of -n and --no-parser. + (long_options): Remove --no-parser entry here. + (getargs): Remove -n case in the switch here. + * src/getargs.h (no_parser_flag): Remove extern. + * tests/regression.at (Web2c Actions): Remove comment that mentions + --no-parser. + +2007-08-11 Joel E. Denny + + * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not + name user variables starting with `yy'. Just pass NULL instead of a + dummy local &yylval to yypush_parse. + * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables + starting with `yy'. + +2007-08-03 Joel E. Denny + + * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is + true since it's then always used regardless of whether yyoverflow is + defined. Reported by Christian Burger at + . + * THANKS: Add Christian Burger. + + * ChangeLog: For changes in doc/bison.texinfo, consistently reference + node names: say "Decl Summary" not "Bison Declaration Summary". + +2007-07-28 Joel E. Denny + + * src/muscle_tab.c (muscle_percent_define_flag_if): In order to + determine whether this function has already complained about an invalid + value for a %define boolean variable, don't check whether Bison has + ever examined the value. As written, the check was a tautology. + Instead, record and check for this complaint using a separate muscle. + +2007-07-27 Joel E. Denny + + Fix push parsing memory leak reported by Brandon Lucia at + . + * THANKS: Add Brandon Lucia. + * data/push.c (yypstate_delete): Free the stack if it was reallocated + but the parse never completed and thus freed it. + * tests/Makefile.am (TESTSUITE_AT): Add push.at. + * tests/testsuite.at: Include push.at. + * test/push.at: New. + (Push Parsing: Memory Leak for Early Deletion): New test case. + +2007-07-17 Joel E. Denny + + Improve handling of multiple S/R conflicts in the same state and of S/R + conflicts involving multiple reductions. + * src/conflicts.c (resolve_sr_conflict): Don't assign the error action + set for a state here or Bison will abort if it is reassigned on a + later conflicted reduction in the same state. + Similarly, don't finalize and assign the solved conflicts report here + or it will be lost if it is reassigned on a later conflicted reduction + in the same state. + (set_conflicts): Instead, assign them both here after all S/R conflicts + in the state have been fully examined. + * src/print.c (shift_set): Rename to... + (no_reduce_set): ... this. + (print_reductions): Update for rename, and add %nonassoc error action + tokens to no_reduce_set so that, when printing the first remaining + reduction on an error action token, the reduction is enclosed in + brackets. + (print_results): Update for rename. + * tests/conflicts.at (Solved conflicts report for multiple reductions + in a state): New test case. + (%nonassoc error actions for multiple reductions in a state): New test + case. + + * src/main.c (main): Don't depend on C99 features. + +2007-07-16 Joel E. Denny + + * build-aux/.cvsignore: Add compile. + * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and + uniwidth. + +2007-07-10 Joel E. Denny + + * bootstrap (slurp): Create target directories that don't exist. + Specifically, we need lib/uniwidth/ because of recent Gnulib changes. + +2007-07-09 Joel E. Denny + + * LR0.c (new_itemsets): Fix wording in comments: say item index rather + than item number. + * closure.c (closure): Likewise. + * state.h (reductions): Comment sorting of rules. + (state): Comment sorting of items. + +2007-07-02 Joel E. Denny + + Fix C++ test cases after recent Gnulib changes. Discussed starting at + . + * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's + definition in order to avoid Gnulib headers since we don't use config.h + here. + * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR + rather than AT_DATA so that config.h is included. + +2007-07-01 Joel E. Denny + + * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF + instead of fprintf. Guard these functions with #if YYDEBUG instead of + #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison + and so that YYFPRINTF is guaranteed to be defined here. + +2007-05-29 Joel E. Denny + + * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace + with... + (muscle_percent_define_check_values): ... this more helpful function. + Again, it's not used yet, but it will be. + * src/muscle_tab.h: Likewise. + + Improve some comments in parser table construction. + * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base. + (generate_states): Don't mention ruleset, which is internal to closure. + * src/closure.c (closure): Explain sorting of core and itemset, which + is required for this function to behave correctly. + * src/closure.h (closure): Mention sorting. + +2007-05-28 Joel E. Denny + + * src/lalr.c (state_lookahead_tokens_count): For code readability, + move the check for disabled transitions to an aver since conflict + resolution hasn't happened yet. + + * src/lalr.c (state_lookahead_tokens_count): Remove the check that + labels a state as inconsistent just because it has error transitions. + The original form of this check appeared in revision 1.1 of lalr.c, + which was committed on 1991-12-21. Now (at least), changing the + consistency label on such a state appears to have no useful effect in + any of the places it is examined, which I enumerate below. The key + point to understanding each item in this enumeration is that a state + with an error transition is labelled consistent in the first place only + if it has no rules, so the check cannot matter for states that have + rules. (1) Labelling a state as inconsistent will cause set_conflicts + to try to identify its conflicts, and a state must have *rules* to have + conflicts. (2) Labelling a state as inconsistent will affect how + action_row sets the default *rule* for the state. (3) Labelling a + state as inconsistent will cause build_relations to add lookback edges + to *rules* in that state. + * src/state.h (struct state): Word the comment for member consistent + more carefully. + +2007-05-27 Joel E. Denny + + Don't depend on C99 features. + * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop. + * src/lalr.c (lalr_update_state_numbers): Fix for-loop. + * src/reader.c (check_and_convert_grammar): Fix for-loop. + * src/state.c (state_mark_reachable_states): Fix for-loop. + (state_remove_unreachable_states): Fix for-loop. + + Don't widen struct state with member reachable just to temporarily + record reachability. Instead, use a local bitset. + * src/state.h (struct state): Remove member. + * src/state.c (state_new): Don't initialize it. + (state_mark_reachable_states): Rename to... + (state_record_reachable_states): ... this, and use bitset. + (state_remove_unreachable_states): Use bitset. + +2007-05-26 Joel E. Denny + + * src/Makefile.am (yacc): Quote target action commands properly so + that the yacc script isn't corrupt. Reported by Hans Aberg at + . + + * data/glr.c (yylval): As in yacc.c, don't extern in the header for + the case of pure parsers. Reported by Frans Englich at + . + * THANKS: Add Frans Englich. + + * NEWS (2.3a+): In the %code entry, reference section `Bison + Declaration Summary' from the manual now since the %code summary has + moved there. + * doc/bison.texinfo (Prologue Alternatives): Mention that directives + in the rules section must be terminated by semicolons. + +2007-05-20 Joel E. Denny + + Extend the front-end API for %define variables to more completely + mirror the back-end. This will be useful in the future. + * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef): + Update comments to mention the new front-end counterparts of these + macros. + * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code + for muscle_string_decode and muscle_location_decode. + (muscle_string_decode): New static function. + (muscle_location_decode): Use MUSCLE_COMMON_DECODE. + (muscle_percent_define_get, muscle_percent_define_ifdef): New + functions. + (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and + muscle_percent_define_get to mimic the b4_percent_define_flag_if + implementation more closely. + (muscle_percent_define_invalid_value): New function. + * src/muscle_tab.h (muscle_percent_define_get, + muscle_percent_define_ifdef, muscle_percent_define_invalid_value): + Prototype. + +2007-05-07 Joel E. Denny + + * NEWS (2.3a+): Mention yesterday's state-removal change. + (2.3a): Remove the %language entry, which was added after 2.3a. + * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c, + src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c, + src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at, + tests/existing.at: Update copyright date. + +2007-05-06 Joel E. Denny + + If conflict resolution makes states unreachable, remove those states, + report rules that are then unused, and don't report conflicts in those + states. + * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers): + New global function. + * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global + function. + * src/main.c (main): After conflict resolution, remove the unreachable + states and update all data structures that reference states by number. + * src/state.c (state_new): Initialize each state's reachable member to + false. + (state_mark_reachable_states): New static function. + (state_remove_unreachable_states): New global function. + * src/state.h (struct state): Add member bool reachable. + (state_remove_unreachable_states): Prototype. + * tests/conflicts.at (Unreachable States After Conflict Resolution): + New test case. + * tests/existing.at (GNU pic Grammar): Update test case output now that + an unused rule is discovered. + +2007-05-06 Joel E. Denny + + Minor code cleanup in parser table construction. + * src/LR0.c (new_itemsets): Use item_number_is_symbol_number. + (new_itemsets, save_reductions): Update for rename to nitemset. + * src/closure.c (nritemset): Rename to... + (nitemset): ... this since the "r" appears to meaningless and isn't + used in the comments. + (closure): Update for rename. + * src/closure.h (nritemset): Update extern to... + (nitemset): ... this. + * src/lalr.c (LA): Fix a typo in comments. + * src/print.c (print_core): Update for rename to nitemset. + * src/print_graph.c (print_graph): Likewise. + * src/state.h: Fix some typos in header comments. + +2007-04-04 Paul Eggert + + * THANKS: Use ASCII for Sebastien Fricker's name. Bison source + still sticks to ASCII. Sorry! + + * README-hacking: New file, taken mostly from coreutils, with changes + for Bison. Contains much of the contents of: + * README-cvs: Remove. + * bootstrap: Sync from gnulib. + * build-aux/.cvsignore: Remove *.t, mkinstalldirs. + * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h. + +2007-03-10 Joel E. Denny + + * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian + Setzer. + (Java Differences): Fix some typos. + * THANKS: Add Sebastian Setzer. + +2007-03-07 Paolo Bonzini + + * data/java.m4 (b4_single_class_if): Remove. + (b4_abstract_if): Look at "%define abstract". + (b4_lexer_if): New. + (b4_union_name): Rename... + (b4_yystype): ... to this. Map to "%define stype". + (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl, + b4_maybe_throws): Fix quoting. + (b4_lex_param_call): Move below to keep b4_*_param_decl close. + * data/lalr1.java (Lexer interface): Always define. + (Lexer interface within parser class): Remove. + (YYLexer class): New, used when "%code lexer" is present. + (constructor): When "%code lexer" is used, pass %lex-param + to the lexer constructor. + (yylex, yyparse): Remove %lex-param from method invocations + (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype. + + * doc/bison.texinfo (Java Bison Interface): Mention "%define + abstract". Rename "%define union_name" to "%define stype". + Rename method names according to previous patch. + (Java Scanner Interface): Describe "%code lexer" instead of + "%pure-parser" and "%define single_class". + (Java Differences): Mention "%code lexer". + + * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument. + Include scanner here, using macros from tests/local.at. + (AT_DATA_CALC_Y): Remove final argument. + (_AT_CHECK_JAVA_CALC): Likewise. + (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations + of %locations and %error-verbose. + (main): Test with and without %lex-param. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF. + (AT_BISON_OPTION_POPDEFS): Pop it. + +2007-03-07 Juan Manuel Guerrero + + DJGPP spefic issue. Inhibit the use of disallowed characters for + file name genertion on Win98, WinXP, etc. These are |<>":?*\ + and concern testsuite case 46. + * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST + * djgpp/testsuite.sed: Inhibit the use of disallowed characters. + * djgpp/config.bat: Inhibit the use of disallowed characters. + +2007-03-02 Joel E. Denny + + Miscellaneous %define and %code cleanup. + * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how + values are interpreted. + * doc/bison.texinfo (Decl Summary): Clean up and extend %define + documentation a little more. + * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT, + muscle_percent_define_insert, muscle_percent_code_grow): New + functions/macros. + * src/muscle_tab.h (muscle_percent_define_insert, + muscle_percent_code_grow): Prototype. + * src/parse-gram.y (prologue_declaration): Use + muscle_percent_define_insert and muscle_percent_code_grow when parsing + %define and %code directives. + + Make it easy to share %define boolean variables between the front-end + and back-end. Though not used yet, this will be useful in the future. + * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about + Bison uses of names rather than just skeleton uses of names. + (b4_percent_define_get, b4_percent_define_ifdef): Rename + b4_percent_define_skeleton_variables(VARIABLE) to + b4_percent_define_bison_variables(VARIABLE). + (b4_percent_code_get, b4_percent_code_ifdef): Rename + b4_percent_code_skeleton_qualifiers(QUALIFIER) to + b4_percent_code_bison_qualifiers(QUALIFIER). + (b4_check_user_names_wrap): Update for renames. + * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if, + muscle_percent_define_default): New functions mimicking + b4_percent_define_flag_if and b4_percent_define_default. + + For %define variables, report locations for invalid values and + redefinitions. + * data/bison.m4 (b4_percent_define_flag_if): Read + b4_percent_define_loc(VARIABLE) to report the location of an invalid + value for VARIABLE. + (b4_percent_define_default): Save a special location in + b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE + must later be reported as invalid. + * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New + functions. + (muscle_percent_define_insert): Record the location of VARIABLE in + muscle percent_define_loc(VARIABLE), and use it to report the previous + location for a redefinition. + (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if. + (muscle_percent_define_default): Update like b4_percent_define_default. + (muscle_grow_user_name_list): Rename to... + (muscle_user_name_list_grow): ... this for consistency and use + muscle_location_grow. + * src/muscle_tab.h (muscle_location_grow): Prototype. + * tests/input.at (%define errors): Update expected output. + * tests/skeletons.at (%define boolean variables: invalid skeleton + defaults): New test case. + +2007-02-28 Joel E. Denny + + * src/print.c (lookahead_set, state_default_rule): Remove. + (print_reductions): Replace state_default_rule invocation with + equivalent use of yydefact, which was computed in token_actions in + tables.c. + (print_results): Don't allocate lookahead_set. + +2007-02-27 Paolo Bonzini + + * data/lalr1.java: Prefix all private members with yy. + +2007-02-24 Joel E. Denny + + Use YYFPRINTF instead of fprintf where appropriate. Reported by + Sebastien Fricker at + . + * THANKS: Add Sebastien Fricker. + * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement. + * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must + accept a variable number of arguments. + +2007-02-19 Joel E. Denny + + * bootstrap: Remove occurrences of .#bootmp from lib/Makefile. + +2007-02-13 Juan Manuel Guerrero + + * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61. + * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61. + * djgpp/config.site: Adjustments concerning the use of autoconf 2.61. + +2007-02-11 Paul Eggert + + Undo my 2007-02-07 change, switching back to the c-strcase module + introduced in the 2007-02-03 change. Bruno Haible reported that + the 2007-02-07 change would be dangerous in Turkish if we add a + language whose name contains "i", since "i" is not lowercase "I" + in Turkish. + * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase. + * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h, + c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c. + * m4/.cvsignore: Remove strcase.m4. + * src/getargs.c: Revert 2007-02-07 change, as follows. + Include c-strcase.h. + (language_argmatch): Use c_strcasecmp rather than strcasecmp. + +2007-02-11 Bruno Haible + + Enable the Java related testsuite tests when the only Java compiler + found is a gcj < 4.3. Discussed at + . + * configure.ac (gt_JAVACOMP): Don't specify a target_version. + +2007-02-11 Joel E. Denny + + * data/Makefile.am: Update copyright date. + * data/push.c (yypull_parse): Report memory exhaustion and return 2 if + yypstate_new returns NULL. + (yypstate_new): Return NULL if malloc does. + * src/reader.c (packgram): Move translation of rule actions from the + beginning of packgram to... + (check_and_convert_grammar): ... here right before packgram is invoked + so it's easier to write more complete comments, and remove redundant + code. + +2007-02-10 Joel E. Denny + + As in semantic actions, make @$ in %initial-action, %destructor, and + %printer imply %locations. + * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when + scanning @$. + * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting... + (@$ in %initial-action implies %locations, + @$ in %destructor implies %locations, + @$ in %printer implies %locations): ... these new test cases. + +2007-02-07 Paul Eggert + + Undo most of the 2007-02-03 change, switching to the strcase module + now that gnulib strcase has been fixed. + * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase. + * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h, + c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c + * m4/.cvsignore: Add strcase.m4. + * src/getargs.c: Revert 2007-02-03 change, as follows. + Don't include c-strcase.h. + (language_argmatch): Use strcasecmp rather than c_strcasecmp. + strcasecmp has "unspecified behavior" outside the POSIX locale, + but it works fine in practice if at least one argument is ASCII, + as is the case in Bison. + +2007-02-07 Paolo Bonzini + + * tests/java.at: Skip tests if only one of javac/java is present. + Reported by Joel E. Denny. + * tests/atlocal.in: Adjust copyright years. + +2007-02-05 Paolo Bonzini + + * data/lalr1.java (Stack): Work around old verifiers that disallow + access to the private fields of an inner class, from the outer class. + We can make Stack's fields public because user code doesn't have access + to the instance of Stack used by parse(). Reported by Paul Eggert. + +2007-02-03 Paul Eggert + + * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really + the right spot for these files? + * bootstrap.conf (gnulib_modules): Add c-strcase. + * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c, + c-strncasecmp.c. + * src/getargs.c: Include c-strcase.h. + (language_argmatch): Use c_strcasecmp rather than strcasecmp, + to avoid unspecified behavior. + +2007-02-01 Joel E. Denny + + * doc/bison.texinfo (Decl Summary): Correct typo. + +2007-01-30 Paolo Bonzini + + * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false. + Complain if the value does not match empty, "true" or "false". + * data/c++.m4: Adjust default definitions of %define variables. + * data/java.m4: Adjust default definitions of %define variables. + * doc/bison.texinfo (Decl Summary): Adjust the %define entry according + to above behavior. + * tests/input.at (Boolean %define variables): Test new behavior. + +2007-01-29 Paolo Bonzini + + * NEWS: Mention java. + * TODO: Remove things that are done. + * bootstrap.conf: Add javacomp-script and javaexec-script. + * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC. + + * data/Makefile.am: Add new files. + * data/java-skel.m4: New. + * data/java.m4: New. + * data/lalr1.java: New. + + * doc/bison.texinfo: Put "A Complete C++ Example" under + C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers + under Other Languages. + + * src/getargs.c (valid_languages): Add Java. + * src/getargs.h (struct bison_language): Update size of string fields. + + * tests/Makefile.am: Add java.at. + * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC. + * tests/java.at: New. + * tests/testsuite.at: Include it. + +2007-01-28 Joel E. Denny + + Clean up. + * src/scan-skel.l (at_directive_perform): Add at_directive_argc and + at_directive_argv arguments so these no longer have to be global + variables. Also, update the implementation for the following changes. + (fail_for_at_directive_too_many_args, + fail_for_at_directive_too_few_args): Add at_directive_name argument. + (at_directive_name): Remove as at_directive_argv[0] will be used for + this now. + (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv + for the directive name. + (at_directive_argc, at_directive_argv): Make these local within + skel_lex instead of global. + (INITIAL): Update directive start action for above changes. + (SC_AT_DIRECTIVE_ARG): Rename to... + (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes. + (SC_AT_DIRECTIVE_SKIP_WS): Update. + (scan_skel): Move yylex_destroy to... + (skel_scanner_free): ... here. + * tests/skeletons.at (installed skeleton file name): Rename to... + (installed skeleton file names): ... this. + +2007-01-27 Joel E. Denny + + * ChangeLog: For changes in doc/bison.texinfo, consistently reference + node names: say "Table of Symbols" not "Bison Symbols", and say "Decl + Summary" not "Directives". + * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the + %code entry in "Decl Summary" rather than the one in "Table of Symbols" + since the former is now the more complete one. + (Prologue Alternatives): Likewise and do the same for %defines. + (Table of Symbols): Add summary of %code, add summary of %define, and + move full %code documentation to... + (Decl Summary): ... here for consistency with other entries in these + sections. + Move %define entry in order to keep this list alphabetized. + Reword %define entry a little to put less emphasis on the skeleton + concept, which most users shouldn't have to think about. + +2007-01-26 Paul Eggert + + Adjust to recent gnulib changes. + * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h. + Add string.h, string_.h, unistd_.h, wchar_.h. + * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4. + * src/system.h: Don't include ; this is now done by + . + +2007-01-23 Paolo Bonzini + + Simplify implementation of unqualified %code, implement macros for + uniform treatment of boolean %define flags. Document %define. + * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if, + b4_percent_code_ifdef): New. + (b4_percent_code_get): Map unqualified %code to b4_percent_code(). + * data/c++.m4: Define default value for global_tokens_and_yystype. + * data/glr.cc: Likewise. + * data/location.cc: Use b4_percent_define_flag_if. + + * doc/bison.texinfo (Decl Summary): Document %define. + + * src/parse-gram.y (Unqualified %code): Change muscle name to + b4_percent_code(). + (content.opt): Default to empty. + +2007-01-17 Joel E. Denny + + Implement support for relative and absolute skeleton file names. + Discussed starting at + . + * doc/bison.texinfo (Decl Summary): Document in %skeleton entry. + (Bison Options): Document in --skeleton entry. + * src/output.c (output_skeleton): Use strncpy rather than strcpy since + full_skeleton can't necessarily hold all of pkgdatadir. + If the specified skeleton file name contains a `/', don't prepend + pkgdatadir. + * src/parse-gram.y (prologue_declaration): If the specified skeleton + file name contains a `/', prepend the grammar file directory. + * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at. + * skeletons.at: New file. + (relative skeleton file names): New test case. + (installed skeleton file names): New test case. + * tests/testsuite.at: Include skeletons.at. + + * bootstrap: Update copyright to 2007. + +2007-01-17 Paolo Bonzini + + * bootstrap: Remove occurrences of .#bootmp from the files. + +2007-01-17 Akim Demaille + + * doc/bison.texinfo (Calc++ Parser): Don't try to alias + nonterminals. + Use per-type %printer. + +2007-01-17 Joel E. Denny + + * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4, + data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc, + djgpp/config.site, src/files.c, src/files.h, src/main.c, + src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h, + src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at, + tests/glr-regression.at, tests/input.at, tests/local.at, + tests/output.at, tests/torture.at: Update copyright to 2007. + +2007-01-16 Akim Demaille + + * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an + error code. + (Calc++ Scanner): Exit with failure if we can't open the input + file. + Accept "-" standing for stdin. + (Calc++ Top Level): Print the result only if the parsing was + successful. + +2007-01-16 Akim Demaille + + * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line. + +2007-01-15 Paolo Bonzini + and Joel E. Denny + + Clean up %define and %code implementation in M4 some. Most + importantly, rename all related macros to be in the b4_percent_define + and b4_percent_code namespaces. Also, complete support for `.' in + %define variable names and %code qualifiers. + * data/bison.m4 (b4_check_user_names): Check for special + "SKELETON-NAMESPACE(name)" macros instead of using two nested + m4_foreach loops. + (b4_get_percent_define, b4_get_percent_code): Rename to... + (b4_percent_define_get, b4_percent_code_get): ... these. + Extend documentation with examples. + For SKELETON-NAMESPACE (as documented for b4_check_user_names), use + b4_percent_define_skeleton_variables and + b4_percent_code_skeleton_qualifiers. + Expect any value for the %define variable `foo' to be stored in the + macro named `b4_percent_define(foo)'; expect any %code blocks for the + qualifier `foo' to be stored in a macro named `b4_percent_code(foo)'; + expect any unqualified %code blocks to be stored in a macro named + `b4_percent_code_unqualified'. + Use m4_indir so that %define variable names and %code qualifiers can + contain `.', which is allowed by the grammar parser. + (b4_percent_define_default): New macro to set a default value for a + %define variable. + (m4_wrap): Update wrapped code, and fix some underquoting. + (b4_check_user_names_wrap): Update and define outside the m4_wrap. + Expect grammar uses of %define variables and %code qualifiers to be + defined in b4_percent_define_user_variables and + b4_percent_code_user_qualifiers. + * data/c++.m4: Use b4_percent_define_default rather than + m4_define_default. Fix some underquoting. Skeleton usage of %define + variable define_location_comparison now implies skeleton usage of + %define variable filename_type. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc, + data/push.c, data/yacc.c: Update macro names. + * src/parse-gram.y (prologue_declaration, grammar_declaration): Update + muscle names. + +2007-01-14 Juan Manuel Guerrero + + DJGPP specific issues. + + * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific + default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default. + +2007-01-09 Joel E. Denny + + * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to + run parsers in all tests so that Valgrind is invoked during + maintainer-check-valgrind. + (Duplicate representation of merged trees): Free all semantic values. + (Duplicated user destructor for lookahead): Likewise. + +2007-01-09 Joel E. Denny + + * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a + command-line prefix. + * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is + ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't + miss Valgrind messages. + (Exploding the Stack Size with Malloc): Likewise. + +2007-01-09 Joel E. Denny + + Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be + locals. Reported by Juan Manuel Guerrero at + . + * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if. + Fix some indentation also. + * tests/torture.at (Exploding the Stack Size with Alloca): Add comment + explaining this issue. + +2007-01-09 Paolo Bonzini + and Joel E. Denny + + Simplify union and prologue handling, and escape union and lex/parse + params with digraphs. + * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default + values to the empty string since these are no longer guaranteed + initialized by the front-end. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add + braces around b4_user_stype since this is no longer done by the + front-end. + * src/files.c, src/files.h (pre_prologue_obstack, + post_prologue_obstack): Remove. + * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header + comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped + with digraphs. This fixes lex params and parse params. + * src/muscle_tab.h (muscle_pair_list_grow): Update comments. + * src/output.c (prepare): Remove muscle insertion of the prologues. + (output): Remove freeing of pre_prologue_obstack and + post_prologue_obstack. + * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather + than prologue_augment for prologue parsing so you don't need prologue + obstacks. + (grammar_declaration): For %union RHS, use `braceless' instead of + "{...}" so that braces are already stripped and code is escaped with + digraphs. + * src/reader.c (prologue_augment): Remove. + (reader): Remove initialization of pre_prologue_obstack and + post_prologue_obstack. + * src/reader.h (prologue_augment): Remove. + + * data/c.m4: Remove stray parenthesis. + +2007-01-08 Joel E. Denny + + Remove quotes from variables names in %define directives and from + qualifiers in %code directives, and restrict the characters that are + allowed in them to M4-friendly ones. For %define, continue to support + the quoted form as a deprecated feature. Discussed starting at + . + * NEWS (2.3a+): Add entry for the change to %define. Update entry for + %code. + * doc/bison.texinfo (Prologue Alternatives): Update. + (Decl Summary): In %defines entry, update mention of `%code requires' + and `%code provides'. + (C++ Location Values): Update %define uses. + (Calc++ Parser Interface): Likewise. + (Calc++ Parser): Likewise, and update `%code requires' uses. + (Table of Symbols): Update %code documentation. + * src/parse-gram.y (prologue_declaration): For %define variables, use + `variable' instead of `STRING'. + (grammar_declaration): For %code qualifiers, use `ID' instead of + `STRING'. + (variable): New nonterminal that takes an `ID' or a `STRING'. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code + and %define uses. + * tests/calc.at (_AT_DATA_CALC_Y): Update %define use. + * tests/input.at (Reject unused %code qualifiers): Update %code uses. + (%define errors): Update %define uses. + +2007-01-08 Joel E. Denny + + * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING + instead of muscle_insert for %define values so that M4-special + characters are replaced with digraphs. + * tests/input.at (%define errors): Extend to check weird values. + +2007-01-08 Joel E. Denny + + Instead of having skeletons declare all valid %define variables and + %code qualifiers, provide macros that retrieve the associated values + and build these lists automatically. Thus Bison will now warn when a + variable or qualifier is not used by the skeleton in the current + invocation regardless of whether it might sometimes be used by that + skeleton in other invocations. Also, move all %define value macros to + the b4_percent_define_ namespace, and remove the %define "NAME" {CODE} + form, which is replaced by %code. + * data/bison.m4 (b4_check_for_unrecognized_names): Rename to... + (b4_check_user_names): ... this, and change the series of valid name + arguments to a single list argument for names used in the skeleton + similar to the existing list argument for names used in the grammar. + Warn instead of complaining. + (b4_get_percent_define, b4_get_percent_code): New to retrieve %define + values and %code code, to format %code code properly, and to build + lists of all %define variables and %code qualifiers used in the + skeleton: b4_skeleton_percent_define_variables and + b4_skeleton_percent_code_qualifiers. + (b4_check_percent_define_variables, b4_check_percent_code_qualifiers): + Remove, and... + (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that + the skeleton names lists can finish building first. In place of + b4_used_percent_define_variables and b4_used_percent_code_qualifiers, + expect the lists b4_user_percent_define_variables and + b4_user_percent_code_qualifiers. + * data/c++.m4: Where setting default values for b4_parser_class_name, + b4_location_type, b4_filename_type, b4_namespace, and + b4_define_location_comparison, update their names to the + b4_percent_define_ namespace. + * data/glr.c: Don't use b4_check_percent_define_variables and + b4_check_percent_code_qualifiers. Use b4_get_percent_code. + * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define. + (b4_parser_class_name, b4_namespace): Define these using + b4_get_percent_define for parser_class_name and namespace. + * data/location.cc: Use b4_get_percent_define. + * data/push.c: Don't use b4_check_percent_define_variables and + b4_check_percent_code_qualifiers. Use b4_get_percent_code. + * data/yacc.c: Likewise, and don't call m4_exit in + b4_use_push_for_pull_if or m4_wrap code will never execute. + * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list): + Rename to... + (muscle_grow_user_name_list): ... this for consistency with the + terminology used in bison.m4. + * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to + %define variable names, and rename muscle used_percent_define_variables + to user_percent_define_variables. + (grammar_declaration): Rename muscle used_percent_code_qualifiers to + user_percent_code_qualifiers. + (content): Remove. + (content.opt): Replace content RHS with STRING RHS so %define "NAME" + {CODE} form is no longer accepted. + * tests/input.at (Reject bad %code qualifiers): Rename to... + (Reject unused %code qualifiers): ... this, and update test output. + (%define error): Update test output. + +2007-01-07 Joel E. Denny + + Check for unrecognized %define variables similar to checking for + unrecognized %code qualifiers. Check for redefined %define variables. + * data/bison.m4 (b4_check_for_unrecognized_names): New macro that + generalizes... + (b4_check_percent_code_qualifiers): ... this, which now wraps it. + (b4_check_percent_define_variables): New, also wraps it. + * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define + variables using b4_check_percent_define_variables. + * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as + all those exercised in the test suite and all those listed in the + `Default values' section of c++.m4. Are there others? + * data/push.c, data/yacc.c: Declare no valid %define variables. + * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function, + similar to muscle_find, but it works even when the muscle stores a + const value. + (muscle_grow_used_name_list): New function for constructing the used + name list muscles that b4_check_for_unrecognized_names requires. + * src/parse-gram.y (prologue_declaration): Warn if a variable is + %define'd more than once. Define the b4_used_percent_define_variables + muscle with muscle_grow_used_name_list. + (grammar_declaration): Abbreviate %code code with + muscle_grow_used_name_list. + * tests/input.at (%define errors): New. + +2007-01-06 Joel E. Denny + + Provide warn_at, complain_at, and fatal_at function callbacks to the + skeletons, and use this for %code qualifier complaints. + * data/bison.m4 (b4_error_at): New, invoked by... + (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap + the skeleton scanner's new @warn_at(...@), @complain_at(...@), and + @fatal_at(...@) directives. + (b4_check_percent_code_qualifiers): Rewrite to expect locations for + qualifiers in b4_used_percent_code_qualifiers and to use + b4_complain_at. + * src/location.c, src/location.h (boundary_set_from_string): New global + function. + * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global + function. + * src/parse-gram.y (grammar_declaration): Add locations for qualifiers + to b4_used_percent_code_qualifiers. + * src/scan-skel.l (fail_for_at_directive_too_few_args): New static + function. + (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments. + (lineno): Rename to... + (out_lineno): ... this so I don't misunderstand it again. + (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines + here; these newlines are in the input but not the output file. + (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to... + (at_directive_perform): ... this new static function, and add handling + of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@) + directives. + * tests/input.at (Reject bad %code qualifiers): Update test output with + locations and extend. + + * tests/output.at (Output file name: [, Output file name: ]): Remove + bogus comment about these tests failing. + +2007-01-06 Joel E. Denny + + Clean up b4_check_percent_code_qualifiers a little. + * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers + in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite + documentation and add examples. + * src/parse-gram.y (grammar_declaration): Double-M4-quote those + qualifiers here. + +2007-01-05 Joel E. Denny + + Don't use m4_divert since it makes m4_divert_push and m4_divert_pop + unreliable -- especially when they're hidden inside another macro. + * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, + data/c.m4: Remove m4_divert(-1). + * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc, + data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with + m4_divert_push(0) and m4_divert_pop(0). + * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and + an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is + pushed and popped by m4sugar, should be first on the stack. + + Provide warn, complain, and fatal function callbacks to the skeletons. + This provides more flexibility than m4_fatal, improves the error + message format, and captures messages for translation. Discussed + starting at + . + * data/bison.m4 (b4_error): New, invoked by... + (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the + skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@) + directives. Because these M4 macros might be called when the current + diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus + the previous removal of uses of m4_divert, which caused trouble. + (b4_check_percent_code_qualifiers): Use b4_complain instead of + m4_fatal to report unrecognized %code qualifiers. + * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++ + push parser requests. + * data/glr.c: Use b4_complain instead of m4_fatal to report + non-deterministic push parser requests. + Update @output usage to @output(...@) form. + * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to + report missing %defines. Update @output usage to @output(...@) form. + * data/location.cc, data/push.c, data/yacc.c: Update @output usage to + @output(...@) form. + * src/main.c (main): Invoke skel_scanner_free. + * src/scan-skel.h (skel_scanner_free): Prototype new function. + * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the + obstack_for_string from flex-scanner.h. + (YY_DECL): Use to declare skel_lex static. + (decode_at_digraphs): Remove; now handled in the new + SC_AT_DIRECTIVE_ARG start condition. + (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static + functions. + (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc, + at_directive_argv): New static globals. + (INITIAL): Use fail_for_invalid_at. + Don't parse `@output file_name\n' or `@basename(...@)'. Instead, + recognize the start of a generalized `@directive(...@)' form and + start... + (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the + directive args (using the new obstack_for_string), to decode the + contained @ diagraphs, and to perform the directive. It recognizes + @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and + @output(...@). + (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by + SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter, + `@,'. + (scan_skel): Initialize obstack_for_string on the first call. + (skel_scanner_free): New function to free obstack_for_string. + * tests/input.at (Reject bad %code qualifiers): Update test output. + +2007-01-04 Joel E. Denny + + Consolidate the 4 prologue alternative directives (%code, %requires, + %provides, and %code-top) into a single %code directive with an + optional qualifier field. Discussed at + . + * NEWS (2.3a+): Rewrite the existing entry for the prologue + alternatives. + * doc/bison.texinfo (Prologue Alternatives): Update. + (Decl Summary): Update to %code "requires" and %code "provides". + (Calc++ Parser): Update to %code "requires". + (Table of Symbols): Remove entries for %requires, %provides, and + %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry. + * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these + are replaced by b4_percent_code_provides and b4_percent_code_requires, + which are skeleton-specific. + (b4_check_percent_code_qualifiers): New. A skeleton can use this to + declare what %code qualifiers it supports and to complain if any other + qualifiers were used in the grammar. + * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires]) + and b4_user_code([b4_percent_code_provides]) in place of + b4_user_requires and b4_user_provides. + * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise. + Add b4_user_code([b4_percent_code_top]) and + b4_user_code([b4_percent_code]). + Invoke b4_check_percent_code_qualifiers. + * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES, + PERCENT_REQUIRES): Remove. + (grammar_declaration): Remove RHS's for %code-top, %provides, and + %requires. Rewrite the %code RHS as the unqualified form defining the + muscle b4_percent_code. Add another RHS for the qualified %code form, + which defines muscles of the form b4_percent_code_QUALIFIER and the + b4_used_percent_code_qualifiers muscle. + * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES, + PERCENT_REQUIRES): Remove. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use + %code "requires" and %code "provides". + * tests/input.at (Reject bad %code qualifiers): New. + +2007-01-03 Joel E. Denny + + Use the new code_props interface for destructors and printers. + * src/symtab.h (symbol, semantic_type): Remove destructor_location and + printer_location members, and change the type of the destructor and + printer members to code_props. + (symbol_destructor_set, symbol_destructor_get, symbol_printer_set, + symbol_printer_get, semantic_type_destructor_set, + semantic_type_printer_set, default_tagged_destructor_set, + default_tagless_destructor_set, default_tagged_printer_set, + default_tagless_printer_set): Use code_props in arguments and return + types in place of char const * and location. + (symbol_destructor_location_get, symbol_printer_location_get): Remove + since the locations are now contained in the return of + symbol_destructor_get and symbol_printer_get. + * src/output.c (symbol_destructors_output, symbol_printers_output): + Replace with... + (symbol_code_props_output): ... this to eliminate duplicate code. + (output_skeleton): Update to use symbol_code_props_output. + * src/reader.c (symbol_should_be_used): Update use of + symbol_destructor_get. + * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set): + Update uses of the various _destructor_set and _printer_set functions. + * src/symtab.c: (default_tagged_destructor_location, + default_tagless_destructor_location, default_tagged_printer_location, + default_tagless_printer_location): Remove since we... + (default_tagged_destructor, default_tagless_destructor, + default_tagged_printer, default_tagless_printer): ... change the type + of these to code_props. + (symbol_new, semantic_type_new, symbol_destructor_set, + semantic_type_destructor_set, symbol_destructor_get, + symbol_printer_set, semantic_type_printer_set, symbol_printer_get, + symbol_check_alias_consistency, default_tagged_destructor_set, + default_tagless_destructor_set, default_tagged_printer_set, + default_tagless_printer_set): Update. + (symbol_destructor_location_get, symbol_printer_location_get): Remove. + (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for + code_props members. + (symbol_print): Use SYMBOL_CODE_PRINT. + +2007-01-03 Joel E. Denny + + Use the new code_props interface for rule actions. + * src/symlist.h (symbol_list): Replace action, action_location, and + used members with a code_props action_props member. + * src/reader.c (symbol_should_be_used, grammar_rule_check, + grammar_midrule_action, grammar_current_rule_merge_set, + grammar_current_rule_symbol_append, packgram): Update. + * src/scan-code.h (translate_rule_action): Remove, no longer used. + * src/scan-code.l (handle_action_dollar): Update. + (translate_rule_action): Remove, no longer used. + * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update. + +2007-01-02 Joel E. Denny + + Use the new code_props interface in parse-gram.y. + * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt): + Update all uses of translate_* functions to use the new code_props + interface and to use gram_scanner_last_string_free and + code_scanner_last_string_free where possible. + (grammar_declaration): symbol_list_destructor_set and + symbol_list_printer_set now perform the translation, so don't do it + here. Use gram_scanner_last_string_free where possible. + * src/scan-code.h, src/scan-code.l (translate_symbol_action, + translate_code): Remove, no longer used. + * src/symlist.h, src/symlist.c (symbol_list_destructor_set, + symbol_list_printer_set): Perform code translation here rather than + depending on the caller to do so. + + * src/symlist.h (struct symbol_list): Correct some documentation typos. + * src/scan-gram.h (gram_last_string): Remove declaration. + * src/scan-gram.l (last_string): Declare it static. + +2007-01-02 Joel E. Denny + + Encapsulate code properties and related functionality for the various + destructors, printers, and actions into a code_props structure and + interface. This patch merely implements code_props in scan-code.h and + scan-code.l. Future patches will rewrite other modules to use it. + Discussed starting at + . + * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to + consistently initialize const structs that have an empty location + field. + * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT + to ensure consistency. + * src/scan-code.h (code_props): New structure. + (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New + function, macro, and const global variable for initializing a + code_props with no code. + (code_props_plain_init, code_props_symbol_action_init, + code_props_rule_action_init, code_props_translate_code): The rest of + the new code_props functional interface. Among other things, the init + functions set the code_props kind field so that + code_props_translate_code will know whether to behave like + translate_symbol_action, translate_rule_action, or translate_code. + These old translate functions must remain until all other modules are + updated to use the new code_props interface. + (code_scanner_last_string_free): New function similar to + gram_scanner_last_string_free. + (code_scanner_free): Add documentation. + * src/scan-code.l: Implement the new interface. + (code_lex): Make it static, add a code_props* argument, and remove the + rule argument. + (last_string): New static global similar to the one in scan-gram.l. + (SC_RULE_ACTION): Update to use the code_props* argument to code_lex + instead of rule. + (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the + code_props since Bison may one day use this information for destructors + and printers. + (<*><>): Use STRING_FINISH so that last_string is set. + (handle_action_dollar): Use symbol_list_n_get and set used flag + directly since symbol_list_n_used_set is removed. + (translate_action): Add a code_props* argument and remove the rule, + action, and location arguments. Pass the code_props* on to code_lex. + (translate_rule_action, translate_symbol_action, translate_code): + Rewrite as wrappers around the new code_props interface. + * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since + it would eventually need to break the encapsulation of code_props. + +2007-01-01 Joel E. Denny + + * etc/.cvsignore: New. + +2007-01-01 Joel E. Denny + + Add maintainer-push-check to run maintainer-check using push parsing in + place of pull parsing where available. + * Makefile.am (maintainer-push-check): New. + * data/bison.m4 (b4_use_push_for_pull_if): New. + * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if + appropriately based on their existing values. + (yypush_parse): Don't print push-parser-specific diagnostics if push + parsing is being used in place of pull parsing. + * data/yacc.c: If push parsing should replace pull parsing, redirect to + push.c. + * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment + variable, and insert b4_use_push_for_pull_flag into muscles. + * tests/Makefile.am (maintainer-push-check): New. + +2006-12-31 Joel E. Denny + + * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse + (whether successful or failed) so that yypush_parse can be invoked + again to start a new parse using the same yypstate. + * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to + check multiple yypull_parse invocations on the same yypstate. For pull + mode, extend to check multiple yyparse invocations. + (Exploding the Stack Size with Alloca): Extend to try with + %push-pull-parser. + (Exploding the Stack Size with Malloc): Likewise. + + * tests/calc.at (Simple LALR Calculator): Don't specify + %skeleton "push.c" since %push-pull-parser implies that now. + * tests/headers.at (export YYLTYPE): Don't check for the push + declarations. Otherwise, this test case can't be used to see if push + mode can truly emulate pull mode. + * tests/input.at (Torturing the Scanner): Likewise. + * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove. + (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use + AT_YACC_IF, which now includes the case of push mode since %skeleton + need not be used for push mode. This will be more intuitive once + push.c is renamed to yacc.c. + +2006-12-31 Joel E. Denny + + For push mode, convert yyparse from a macro to a function, invoke yylex + instead of passing a yylexp argument to yypull_parse, and don't + generate yypull_parse or yyparse unless %push-pull-parser is declared. + Discussed starting at + . + * data/bison.m4 (b4_pull_if): New. + * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH. + * data/push.c: Improve M4 quoting a little. + (b4_generate_macro_args, b4_parenthesize): Remove. + (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse] + any time a pull parser is requested. + Don't #define this as a wrapper around yypull_parse. Instead, when + both push and pull are requested, make it a function that does that + same thing. + (yypull_parse): If there's a b4_prefix, #define this to + b4_prefix[pull_parse] when both push and pull are requested. + Don't define this as a function unless both push and pull are + requested. + Remove the yylexp argument and hard-code yylex invocation instead. + * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of + %push-parser. + * src/getargs.c (pull_parser): New global initialized to true. + * getargs.h (pull_parser): extern it. + * src/output.c (prepare): Insert pull_flag muscle. + * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token. + (prologue_declaration): Set both push_parser and pull_parser = true for + %push-pull-parser. Set push_parser = true and pull_parser = false for + %push-parser. + * src/scan-gram.l: Don't accept %push_parser as an alternative to + %push-parser since there's no backward-compatibility concern here. + Scan %push-pull-parser. + * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser + instead of %push-parser. + * tests/headers.at (export YYLTYPE): Make yylex static, and don't + prototype it in the module that calls yyparse. + * tests/input.at (Torturing the Scanner): Likewise. + * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well. + +2006-12-26 Joel E. Denny + + Update etc/bench.pl. Optimize push mode a little (the yyn change + deserves most of the credit). + * Makefile.am (SUBDIRS): Add etc subdirectory. + * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile. + * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult, + yytoken, yyval, and yyloc declarations to... + (yyparse or yypush_parse): ... here to improve performance. For + yypush_parse invocations after the first, be sure to assign yyn its old + value again. + (yypstate_new): Don't bother initializing the yyresult field since the + initial value isn't used. + (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list, + remove the #define that, in push mode, set it to yyps->NAME. + * etc/Makefile.am: New. + * etc/bench.pl: Remove and build it instead from... + * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke + "tests/bison" from the build directory by default rather than just + invoking "bison" from $PATH. + (calc_grammar): Update push parser code: don't declare yylval globally, + don't define yyparse_wrapper, and don't #define yyparse. + (bench_grammar): Update to check all working combinations of yacc.c, + push.c, impure, pure, pull, and push. + +2006-12-25 Joel E. Denny + + For push mode, add pull wrappers around yypush_parse. + * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros. + (yypull_parse): New function wrapping yypush_parse. + (yyparse): New #define wrapping yypull_parse. + * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser + is declared. + * tests/headers.at (export YYLTYPE): Make yylex global. For push mode, + prototype yylex in the module that calls yyparse, and don't prototype + yyparse there. Otherwise, the yyparse expansion won't compile. + * tests/input.at (Torturing the Scanner): Likewise. + +2006-12-25 Joel E. Denny + + Enable push parsers to operate in impure mode. Thus, %push-parser no + longer implies %pure-parser. The point of this change is to move + towards being able to test the push parser code by running the entire + test suite as if %push-parser had been declared. + * data/push.c (yypush_parse): For impure mode, remove the + yypushed_char, yypushed_val, and yypushed_loc arguments. + Instead, declare these as local variables initialized to the global + yychar, yylval, and yylloc. + For the first yypush_parse invocation only, restore the initial values + of these global variables when it's time to read a token since they + have been overwritten. + * src/parse-gram.y (prologue_declaration): Don't set pure_parser for + %push-parser. + * tests/calc.at (Simple LALR(1) Calculator): Always declare + %pure-parser along with %push-parser since this test case was designed + for pure push parsers. + * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused. + (AT_YACC_OR_PUSH_IF): New. + (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but + add a note that it's still wrong for some cases (as it has been for a + while). + (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since + %push-parser no longer implies %pure-parser. + +2006-12-20 Joel E. Denny + + Remove some unnecessary differences between the pull parser code and + the push parser code. This patch enables yynerrs in push mode. + * data/push.c: Reformat M4 a little. + (b4_yyerror_range): Remove and convert all uses to just yyerror_range. + (b4_declare_scanner_communication_variables): Don't omit yynerrs just + because push mode is on. Instead, if pure mode is on, move yynerrs + to... + (b4_declare_parser_state_variables): ... here. + (yynerrs, yyerror_range): For push mode, #define each NAME in this list + to yyps->NAME so it can be used in yypush_parse. + (yypush_parse): Don't omit uses of yynerrs in push mode. + +2006-12-20 Joel E. Denny + + Fix bug such that the first pushed token's value and location are + sometimes overwritten (sometimes by %initial-action) before being used. + * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and + yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity. + For the first yypush_parse invocation, initialize yychar to YYEMPTY to + more closely mimic the pull parser logic. + Don't copy the pushed token to yychar, yylval, and yylloc until it's + time to read a token, which is after any initialization of yylval and + yylloc. + (gottoken): Rename label to... + (yyread_pushed_token): ... for clarity and to avoid infringing on the + user namespace. + +2006-12-20 Joel E. Denny + + Rearrange initialization of the parser state variables so that the + skeleton doesn't have to have a copy for pull mode and another for push + mode. This patch also fixes at least a bug such that yylloc was not + initialized (with b4_location_initial_line and + b4_location_initial_column) upon calling yypush_parse. However, that + initialization now overwrites the first token's location; + %initial-action assigning @$ already did the same thing, and both bugs + will be fixed in a later patch. + * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa. + (b4_declare_parser_state_variables): Remove initialization of yytoken, + yyss, yyvs, yyls, and yystacksize. + (yypstate_new): Remove initialization of some yypstate fields: yystate, + yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and + yylsp. + (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to + yyps->NAME so it can be used in yypush_parse. + (yyparse or yypush_parse): For yypush_parse, don't print the + "Starting parse" diagnostic for invocations after the first. + Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for + yypush_parse, only do it for the first invocation. + Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc + initialization to occur in yypush_parse but only on the first + invocation. + +2006-12-19 Joel E. Denny + + * data/push.c: Add CPP guards around push parser declarations in both + the header and the code file. + In the code file, move the push parser declarations to the same place + they appear in the header file. + Clean up the M4 some, especially the inconsistent underquoting in + some b4_c_function_def and b4_c_function_decl uses. + +2006-12-19 Joel E. Denny + + Encapsulate the push parser state variables into an M4 macro so the + push skeleton doesn't have to list them again for pull mode's yyparse. + For push mode, remove yypush_parse's local equivalents of these + variables to eliminate unnecessary copying between the two sets at + run-time. This patch also fixes at least a bug related to multiple + %initial-action invocations in push mode. + * data/push.c (b4_declare_parser_variables): Rename to... + (b4_declare_scanner_communication_variables): ... this for clarity and + update both uses. + (b4_declare_yyparse_variables): Remove and move its contents to the one + spot where it was invoked. + (b4_declare_parser_state_variables): New macro containing the parser + state variables required by push mode. + (struct yypstate): Replace all fields but yynew with + b4_declare_parser_state_variables. + (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs, + yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define + each NAME in this list to yyps->NAME so it can be used in yypush_parse. + (yyparse or yypush_parse): For yyparse in pull mode, replace local + parser state variable declarations with + b4_declare_parser_state_variables. + Don't initialize parser state variables when calling yypush_parse since + yypstate_new already does that. + Invoke the user's initial action only upon the first yypush_parse + invocation. + Remove all code that copies between the local parser state variables + and the yypstate. + +2006-12-19 Joel E. Denny + + * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to + prevent a name collision in a future patch where these names will + sometimes be #define'd. + (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field + since it no longer has the same name as the existing argument. + (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE. + +2006-12-19 Paolo Bonzini + and Joel E. Denny + + * doc/bison.texinfo (Decl Summary): In the %language entry, mention + that the argument is case-insensitive, and there's no `=' here. + For the %skeleton entry, mention that %language is better. + (Bison Options): Likewise for --language and --skeleton. Move the + --skeleton entry so that the `Tuning the parser' section is sorted + alphabetically on long options. + (C++ Bison Interface): Don't use the word skeleton. Don't explain the + %language directive in detail here; cross-reference the %language + documentation instead. + (Calc++ Parser): Use `%require "@value{VERSION}"' rather than + `%require "2.3b"' so that the example is always up-to-date. + (Table of Symbols): Add entries for %language and %skeleton. + * examples/extexi (normalize): Instead of replacing every %require + argument with the current Bison version, just substitute for + `@value{VERSION}'. This guarantees that we're testing what actually + appears in the documentation. + * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)' + rather than `@VERSION@'. + +2006-12-18 Paul Eggert + + * NEWS: Reword the %language news a bit, and put it earlier. + + * src/getargs.c (skeleton_arg): Last arg is now location const *. + Rewrite to simplify the logic. + (language_argmatch): Likewise. + (program_name): We now own this var. + * src/getargs.h (struct bison_language): Use char[] rather than + const char *. + + * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim + Java is supported. + * src/complain.c (program_name): Remove decl; no longer needed. + * src/main.c (program_name): Remove; now belongs to getargs. + +2006-12-18 Paolo Bonzini + + * NEWS: Document %language. + + * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4. + + * data/c-skel.m4, data/c++-skel.m4: New files. + * data/glr.c: Complain on push parsers. + + * doc/bison.texinfo (C++ Parser Interface): Prefer %language + over %skeleton. + (Decl Summary): Document %language and %skeleton. + (Command line): Document -L. + + * examples/extexi: Rewrite %require directive. + * examples/calc++/Makefile.am: Pass VERSION to extexi. + + * src/files.c (compute_exts_from_gc): Look in language structure + for .y extension. + (compute_file_name_parts): Check whether .tab should be added. + * src/getargs.c (valid_languages, skeleton_prio, language_prio): + (language, skeleton_arg, language_argmatch): New. + (long_options): Add --language. + (getargs): Use skeleton_arg, add -L/--language. + * src/getargs.h: Include location.h. + (struct bison_language, language, skeleton_arg, language_argmatch): New. + * src/output.c (prepare): Pick default skeleton from struct language. + Don't dispatch C skeletons here. + * src/parse-gram.y (PERCENT_LANGUAGE): New. + (prologue_declaration): Add "%language" rule, use skeleton_arg. + * src/scan-gram.l ("%language"): New rule. + + * tests/calc.at: Test %skeleton and %language. + * tests/local.at (AT_SKEL_CC_IF): Look for %language. + (AT_GLR_IF): Look for %skeleton "glr.cc". + (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite. + (AT_YACC_IF): Reject %language. + +2006-12-18 Paul Eggert + + * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type', + since it wasn't used; only the typedef name 'semantic_type' is needed. + Also, omit trailing white space. + + * bootstrap: Sync from coreutils. + (gnulib_extra_files): Add build-aux/announce.gen. + (slurp): Adjust .gitignore files like .cvsignore files. + * build-aux/announce-gen: Remove from CVS, since bootstrap + now creates this. + +2006-12-16 Joel E. Denny + + Make %push-parser imply %pure-parser. This fixes several bugs; see + . + * src/parse-gram.y (prologue_declaration): For %push-parser, also set + pure_parser = true. + * data/push.c: Don't bother testing b4_push_if when deciding whether + to expand b4_declare_parser_variables globally. + (yypush_parse): Likewise in here. + + * data/push.c (yypush_parse): Add b4_parse_param to arguments. + (yy_reduce_print): Reformat M4 for readability. + +2006-12-15 Bob Rossi + and Joel Denny + + * data/push.c (yypstate): Add typedef, and update all uses of + struct yypstate to just yypstate. + * tests/calc.at (_AT_DATA_CALC_Y): Update here as well. + +2006-12-14 Bob Rossi + + * data/push.c (yypush_parse): Declare prototype regardless of + %locations option. + +2006-12-14 Bob Rossi + + * data/push.c (yyparse): Remove the prototype and the #define when in + push-parser mode. + +2006-12-13 Bob Rossi + + * data/push.c (yypstate_init): Rename to... + (yypstate_new): ... this and use b4_c_function_def. + (yypstate_delete): New. + (yypush_parse): Change parameters yynval and yynlloc to be const. + * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and + yypstate_delete functions. + +2006-12-13 Joel E. Denny + + * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our + strange test case titles. Reported by Bob Rossi. + +2006-12-13 Paul Eggert + + * TODO: Add pointer to Sylvain Schmitz's work on static detection + of potential ambiguities in GLR grammers. + +2006-12-12 Joel E. Denny + + * tests/testsuite.at (AT_CHECK): When checking if $1 starts with + `bison ', use m4_index instead of m4_substr since chopping up a string + containing M4-special characters causes problems here. + + Fix a couple of bugs related to special characters in user-specified + file names, and make it easier for skeletons to compute output file + names with the same file name prefix as Bison-computed output file + names. + * data/glr.cc, data/push.c, data/yacc.c: In @output, use + b4_parser_file_name and b4_spec_defines_file instead of + @output_parser_name@ and @output_header_name@, which are now redundant. + * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use + b4_parser_file_name, b4_spec_defines_file, and the new + @basename(FILENAME@) instead of @output_parser_name@ and + @output_header_name@, which inappropriately escaped the file names as + C string literals. + * src/files.c (all_but_ext): Remove static qualifier. + (compute_output_file_names): Move `free (all_but_ext)' to... + (output_file_names_free): ... here since all_but_ext is needed later. + * src/files.h (all_but_ext): Extern. + * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does + exactly what MUSCLE_INSERT_STRING used to do. + (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special + characters are escaped properly. + * src/output.c (prepare): Define muscle file_name_all_but_ext as + all_but_ext. + For pkgdatadir muscle, maintain previous functionality by using + MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem + is that b4_pkgdatadir is used inside m4_include in the skeletons, so + digraphs would never be expanded. Hopefully no one has M4-special + characters in his Bison installation path. + * src/scan-skel.l: Don't parse @output_header_name@ and + @output_parser_name@ anymore since they're now redundant. + In @output, use decode_at_digraphs. + Parse a new @basename command that invokes last_component. + (decode_at_digraphs): New. + (BASE_QPUTS): Remove unused. + * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro. + (Output file name): New tests. + +2006-12-09 Joel E. Denny + + Warn about output files that are generated by the skeletons and that + conflict with other output files. + * data/glr.c: Don't generate the header file here when glr.cc does. + * src/files.c (file_names, file_names_count): New static globals. + (compute_output_file_names): Invoke output_file_name_check for files + not generated by the skeletons and remove existing checks. + (output_file_name_check): New function that warns about conflicting + output file names. + (output_file_names_free): Free file_names. + * src/files.h (output_file_name_check): Declare. + * src/scan-skel.l: Invoke output_file_name_check for files generated by + the skeletons. + * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New. + (Conflicting output files): New tests. + +2006-12-09 Ralf Wildenhues + + * doc/bison.texinfo: Fix a couple of typos. + +2006-12-08 Bob Rossi + + * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse): + Rename to... + (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and + update all uses. + (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps. + (yypush_parse): Rename yypvars argument to yyps and remove redundant + local pv. + (yypstate_init, yypush_parse): Declare in Bison-generated header file. + * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions. + +2006-12-07 Bob Rossi + and Joel Denny + + * data/push.c (yypvarsinit): Change return type from void* to struct + yypvars*. No longer cast to void* on return. + (struct yypvars): Remove yylen since it need not be remembered between + yypushparse invocations. + (yypushparse): Don't copy between yylen and pv->yylen. + +2006-12-05 Bob Rossi + + * data/push.c (yychar_set, yylval_set, yylloc_set): Delete. + (yypushparse): Add yynchar, yynlval, yynlloc parameters. + (b4_declare_parser_variables): Do not declare yynerrs for push mode. + (struct yypvars): Remove b4_declare_parser_variables. + (yypvarsinit): Remove init code for removed variables. + (global scope): Do not declare b4_declare_parser_variables if + push or pure mode. + (yypushparse): Add b4_declare_parser_variables. + Init new local variables, and remove init code for removed + yypvars variables. + (yyparse): Delete. + * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode + and yyparse for other modes. + (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests. + * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added. + (AT_YYERROR_SEES_LOC_IF): push-parser makes this false. + (AT_PURE_LEX_IF): True if pure or push parser. + +2006-12-05 Joel E. Denny + + Document Yacc prologue alternatives and default %destructor's and + %printer's as experimental. Don't mention Java yet. Discussed at + . + * NEWS (2.3a+): Say they're experimental. Remove any mention of Java. + (2.3a): Annotate this entry to say the old forms of these features were + also experimental. + * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols, + Table of Symbols): Say they're experimental. Comment out any mention + of Java (we'll want this back eventually). + +2006-12-01 Joel E. Denny + + Support a file name argument to %defines. Deprecate `=' in + %file-prefix, %name-prefix, and %output. Discussed at + . + * NEWS (2.3a+): Mention. + * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new + form of %defines, and remove `=' from entries for %file-prefix, + %name-prefix, and %output. + * src/parse-gram.y (prologue_declaration): Implement. + * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple + LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from + all but one occurrence of %name-prefix. + * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise. + * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one + occurrence of each of %file-prefix and %output. Add check for %defines + with argument. + * tests/reduce.at (Useless Terminals, Useless Nonterminals, + Useless Rules, Reduced Automaton, Underivable Rules, Empty Language): + Remove the `=' from %output. + +2006-11-21 Joel E. Denny + + Don't escape $ in test case titles since Autoconf 2.61 now does that + correctly. + * tests/actions.at (Default %printer and %destructor are not for error + or $undefined): Here. + (Default %printer and %destructor are not for $accept): Here. + * tests/input.at (Invalid $n and @n): Here. + +2006-11-20 Joel E. Denny + + Rename to <>. Discussed starting at + . + * NEWS (2.3a+): Update. + * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols): + Update. + * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement. + * src/scan-gram.l (INITIAL): Implement. + * src/symlist.c (symbol_list_default_tagless_new): Update comment. + * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update + comment. + * tests/actions.at (Default tagless %printer and %destructor, + Default tagged and per-type %printer and %destructor, + Default %printer and %destructor are not for error or $undefined, + Default %printer and %destructor are not for $accept, + Default %printer and %destructor for mid-rule values): Update. + * tests/input.at (Default %printer and %destructor redeclared, + Unused values with default %destructor): Update. + +2006-11-17 Joel E. Denny + + Don't let %prec take a nonterminal. + * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a + token. + * tests/input.at (%prec takes a token): New test checking that %prec + won't take a nonterminal. + +2006-11-10 Joel E. Denny + + * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because + it was double-quoted. + * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own + grammar is maintained with Bison's highest standards. + * src/getargs.c: Fix some typos in Doxygen comments. + +2006-11-10 Joel E. Denny + + Fix memory leaks in scanners generated by at least Flex 2.5.9 and + later. Reported by Paul Eggert in + . + * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9. + * src/scan-code.l (translate_action): Don't bother invoking + yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer. + (code_scanner_free): Instead of invoking + yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy, + which frees more. + * src/scan-gram.l (gram_scanner_free): Likewise. + * src/scan-skel.l (scan_skel): Likewise. + +2006-11-09 Joel E. Denny + + * src/files.c (tr): Change return type to void. + * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow + has been called previously for the same key. + (muscle_find): Return storage instead of value so that + --enable-gcc-warnings doesn't produce warnings that the return discards + const. aver that the value and storage are the same since storage + could potentially be NULL when value is not. + * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the + same as 0. + +2006-11-08 Paul Eggert + + * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing + the earlier change today), m4/intl.m4, m4/intldir.m4. This gives + us a slightly cleaner distribution, and also works. + * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent + gnulib changes. + +2006-11-08 Joel E. Denny + and Paul Eggert + + Don't let Bison leak memory except when it complains. + * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file): + (spec_defines_file, dir_prefix): Now char *, not const char *, + since they are freed. + * src/files.c: Likewise. + (all_but_ext, all_but_tab_ext, src_extension, header_extension): + Likewise. + (tr): Now operates in-place. All uses changed. + (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary + values. + (compute_file_name_parts, compute_output_file_names): Don't store + read-only data in variables that will be freed. + (compute_output_file_names): Free all_but_ext, all_but_tab_ext, + src_extension, and header_extension. + (output_file_names_free): New public function to free + spec_verbose_file, spec_graph_file, spec_defines_file, + parser_file_name, and dir_prefix. + * src/getargs.c (getargs): Don't store read-only data in variables that + will be freed. + * src/main.c (main): Invoke output_file_names_free, code_scanner_free + (which previously existed but was unused), and quotearg_free. + * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'. + * src/muscle_tab.c: Likewise. + (muscle_entry): Make the value char const *, + and add a new storage member that is char * and can be freed. + (muscle_entry_free): New private function. + (muscle_init): Use it instead of free. + (muscle_insert, muscle_grow): Update and use new storage member. + (muscle_code_grow): Free the string passed to muscle_grow + since it's not needed anymore. + * src/parse-gram.y (%union): Make `chars' member a `char const *', and + add a new `char *code' member. + ("{...}"): Declare semantic type as code. + * src/scan-code.h (translate_rule_action): + (translate_symbol_action, translate_code, translate_action): Return + `char const *' rather than `char *' since external code should not free + these strings. + * src/scan-code.l: Likewise. + * src/scan-gram.l (): Use val->code for BRACED_CODE, + which is "{...}" in the parser. + * tests/Makefile.am (maintainer-check-valgrind): Set + VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking + Valgrind. + * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't + complain. + * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and + expecting a non-zero exit status sets --leak-check=summary and + --show-reachable=no for Valgrind. Bison unabashedly leaks memory in + this case, and we don't want to hear about it. + +2006-11-08 Paul Eggert + + * bootstrap (runtime-po/Makevars): Derive from po/Makevars + instead of from the template, to simplify configuration a bit. + * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4 + and m4/wint_t.m4, as they are needed with the latest gnulib. + +2006-10-31 Joel E. Denny + + Disable unset/unused mid-rule value warnings by default, and recognize + --warnings=midrule-values to enable them. Discussed starting at + . + * NEWS (2.3a+): Mention. + * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum + warnings): Add entry for midrule-values subargument. + * src/reader.c (symbol_should_be_used): Don't return true just because + the value is a set/used mid-rule value unless + --warnings=midrule-values was specified. + * tests/input.at (Unused values, Unused values before symbol + declarations): Run tests with and without --warnings=midrule-values. + + * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather + than LIST_FREE directly. + +2006-10-31 Joel E. Denny + + Finish implementing --warnings=error, which should not be implied by + --warnings=all (or by its synonyms -W and --warnings without + subarguments). + * src/complain.c (set_warning_issued): New function to report that + warnings are being treated as errors and to record an error if so. + Invoke... + (warn_at, warn): ... here. + * src/getargs.c (warnings_args, warnings_types): Reorder so that + "error - warnings are errors" does not appear above "all - all of the + above". + (getargs): For -W and --warnings without subarguments, don't let + FLAGS_ARGMATCH set warnings_error in warnings_flag. + * src/getargs.h (enum warnings): Unset warnings_error in warnings_all. + +2006-10-31 Joel E. Denny + + * src/getargs.c (flags_argmatch): Don't cause segmentation fault for + empty subargument list. For example: `bison --warnings= parser.y'. + +2006-10-21 Joel E. Denny + + * data/push.c, data/yacc.c: Make sure there's a newline at the end of + the parser header file so that gcc doesn't warn. + +2006-10-21 Joel E. Denny + + Split the default %destructor/%printer into two kinds: <*> and . + Discussed starting at + . + * NEWS (2.3a+): Mention. + * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the + previous change today related to mid-rules. + (Table of Symbols): Remove %symbol-default and add <*> and . + * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove. + (TYPE_TAG_ANY): Add as <*>. + (TYPE_TAG_NONE): Add as . + (generic_symlist_item): Remove RHS for %symbol-default and add RHS's + for <*> and . + * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove. + (TYPE_TAG_ANY, TYPE_TAG_NONE): Add. + * src/symlist.c (symbol_list_default_new): Split into tagged and + tagless versions. + (symbol_list_destructor_set, symbol_list_printer_set): Split + SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and + SYMLIST_DEFAULT_TAGLESS. + * src/symlist.h: Update symbol_list_default*_new prototypes. + (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into + SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS. + * src/symtab.c (default_destructor, default_destructor_location, + default_printer, default_printer_location): Split each into tagged and + tagless versions. + (symbol_destructor_get, symbol_destructor_location_get, + symbol_printer_get, symbol_printer_location_get): Implement tagged + default and tagless default cases. + (default_destructor_set, default_printer_set): Split each into tagged + and tagless versions. + * src/symtab.h: Update prototypes. + * tests/actions.at (Default %printer and %destructor): Rename to... + (Default tagless %printer and %destructor): ... this, and extend. + (Per-type %printer and %destructor): Rename to... + (Default tagged and per-type %printer and %destructor): ... this, and + extend. + (Default %printer and %destructor for user-defined end token): Extend. + (Default %printer and %destructor are not for error or $undefined): + Update. + (Default %printer and %destructor are not for $accept): Update. + (Default %printer and %destructor for mid-rule values): Extend. + * tests/input.at (Default %printer and %destructor redeclared): Extend. + (Unused values with default %destructor): Extend. + +2006-10-21 Joel E. Denny + + Don't apply the default %destructor/%printer to an unreferenced midrule + value. Mentioned at + . + * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially + like $@n instead of just @n so that the default %destructor/%printer + logic doesn't see them as user-defined symbols. + (symbol_is_dummy): Check for both forms of the name. + * src/reader.c (packgram): Remove the `$' from each midrule symbol + name for which the midrule value is referenced in any action. + * tests/actions.at (Default %printer and %destructor for mid-rule + values): New test. + * tests/regression.at (Rule Line Numbers, Web2c Report): Update output + for change to dummy symbol names. + +2006-10-20 Joel E. Denny + + Warn about unset midrule $$ if the corresponding $n is used. + * src/reader.c (symbol_should_be_used): Check midrule parent rule for + $n usage. + (packgram): Before invoking grammar_rule_check on any rule, make sure + all actions have already been scanned in order to set `used' flags. + Otherwise, checking that a midrule's $$ is set will not always work + properly because the midrule check must forward-reference the midrule's + parent rule. + * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new + warning. + +2006-10-20 Joel E. Denny + + More improvements to the documentation of the prologue alternatives: + * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the + Bison manual. + * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add + some text to clarify the relative importance of the new directives and + to show how these directives may be viewed as code labels. + +2006-10-16 Joel E. Denny + + Similar to the recently removed %before-header, add %code-top as the + alternative to the pre-prologue. Mentioned at + . + Also, let the prologue alternatives appear in the grammar section. + * src/parse-gram.y (PERCENT_CODE_TOP): New token. + (prologue_declaration): Move the existing prologue alternatives to... + (grammar_declaration): ... here and add %code-top. + * src/scan-gram.l (PERCENT_CODE_TOP): New token. + + Clean up and extend documentation for the prologue alternatives. + * NEWS (2.3a+): Describe prologue alternatives. + * doc/bison.texinfo (Prologue): Move discussion of prologue + alternatives to... + (Prologue Alternatives): ... this new section, and extend it to discuss + all 4 directives in detail. + (Table of Symbols): Clean up discussion of prologue alternatives and + add %code-top. + +2006-10-16 Juan Manuel Guerrero + + DJGPP specific issues. + + * djgpp/config.bat: config.hin has been moved to lib. Adjust + config.bat accordingly. + * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60. + * djgpp/config.site: Likewise. + +2006-10-16 Paolo Bonzini + + Replace %*-header with %provides, %requires, %code. See discussion at + http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html + + * data/bison.m4 (b4_user_requires, b4_user_provides): New. + (b4_user_start_header): Remove. + * data/glr.c: Use new macros instead of b4_*start_header + and b4_*end_header. + * data/glr.cc: Likewise. + * data/lalr1.cc: Likewise. + * data/push.c: Likewise. + * data/yacc.c: Likewise. + + * doc/bison.texinfo: Remove %before-header, rename + %{start,end,after}-header to %requires, %provides, %code. + + * src/parse-gram.y: Likewise (also rename token names accordingly). + * src/scan-gram.l: Likewise. + * tests/actions.at: Likewise. + +2006-10-14 Paul Eggert + + * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS). + Problem reported by Joel E. Denny. + +2006-10-14 Jim Meyering + + (Sync from coreutils.) + Work also when the working directory (with e.g. coreutils sources) + is version controlled with git, rather than CVS. + * bootstrap (CVS_only_file): Test for the existence of README-cvs, + rather than CVS. + In messages and comments, say e.g., "checked-out sources", + rather than "CVS sources". + (version_controlled_file): New function. Work for git as well as + for CVS. Don't use grep's -q option. + (slurp): Call it here, in place of CVS-specific code. + +2006-10-14 Joel E. Denny + + Fix testsuite for ./configure --enable-gcc-warnings: + * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare. + Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in + __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at. + * test/input.at (Torturing the Scanner): #include for abort. + * test/regression.at (Diagnostic that expects two alternatives): + Likewise. + +2006-10-12 Paul Eggert + + * bootstrap.conf (gnulib_modules): Add config-h. + * djgpp/subpipe.c: Include unconditionally; don't + worry about HAVE_CONFIG_H. + * lib/abitset.c: Likewise. + * lib/bitset.c: Likewise. + * lib/bitset_stats.c: Likewise. + * lib/bitsetv-print.c: Likewise. + * lib/bitsetv.c: Likewise. + * lib/ebitset.c: Likewise. + * lib/get-errno.c: Likewise. + * lib/lbitset.c: Likewise. + * lib/subpipe.c: Likewise. + * lib/timevar.c: Likewise. + * lib/vbitset.c: Likewise. + * lib/bitset.c: Include "bitset.h" first, to test interface. + * lib/bitset_stats.c: Include "bitset_stats.h" first. + * lib/bitsetv-print.c: Include "bitsetv-print.h" first. + * lib/bitsetv.c: Include "bitsetv.h" first. + * lib/get-errno.c: Include "get-errno.h" first. + * m4/.cvsignore: Add config-h.m4. + * tests/actions.at (Default %printer and %destructor for ...): + Adjust expected line numbers in output to reflect removal of #if + HAVE_CONFIG_H lines. + * tests/glr-regression.at (Missed %merge type warnings when ...): + Likewise. + * tests/regression.at (Braced code in declaration in rules section): + Likewise. + * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H. + * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE): + Include unconditionally. + + * bootstrap: Sync from coreutils, as follows: + + 2006-10-11 Paul Eggert + + * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell + variable was sometimes used without being initialized. This + messed up the installation of the INSTALL file in some cases. + + 2006-10-09 Paul Eggert + + * bootstrap (usage, main program, symlink_to_gnulib): Add option + --copy. Inspired by a suggestion from Bruno Haible. + + 2006-10-03 Jim Meyering + + * bootstrap: Undo last change to this file, since now gnulib-tool + sticks with the automake default in generating dependencies. + +2006-10-12 Paul Eggert + + * configure.ac: Use AC_PROG_CC_STDC; this is more modern than + the old AC_PROG_CC / AM_PROG_CC_STDC combination. + + * doc/bison.1: Add copyright notice. + + * data/glr.c: Don't include ; not used. + + * NEWS: The -g and --graph options now output graphs in Graphviz + DOT format, not VCG format. + * doc/bison.1: Likewise. + * doc/bison.texinfo (Understanding, Bison Options): Likewise. + * THANKS: Add Satya Kiran Popuri, who proposed the initial version + of this change in + . + * TODO: Remove Graphviz entry. + * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h; + remove vcg.c, vcg.h, vcg_defaults.h. + * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove. + * src/graphviz.c, src/graphviz.h: New files. + * src/files.c (compute_output_file_names): Output .dot, not .vcg. + * src/files.h: Make comment more generic. + * src/main.c (main): Likewise. + * src/print_graph.h: Likewise. + * src/getargs.c (usage): Make usage description more generic. + * src/print_graph.c: Include graphviz.h rather than vcg.h. + (static_graph, fgraph): Remove. All uses changed to pass + arguments instead of sharing a static var. + (print_core, print_actions, print_state, print_graph): + Output graphviz format rather than VCG format. + * tests/.cvsignore: Remove *.vcg; add *.dot. + * tests/output.at: Expect *.dot files, not *.vcg files. + + * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this + accommodates the 2006-10-08 change. + +2006-10-11 Bob Rossi + + * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if. + (b4_yyssa, b4_yyerror_range): New macros. + (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields. + (yypvarsinit): Remove init of removed fields. + (yypushparse): Remove use of removed fields; use new macros instead. + +2006-10-11 Paul Eggert + + * data/push.c (yypushparse): Fix memory leak if yymsg is malloced + in a push parser. Reindent slightly to match yacc.c better. + +2006-10-11 Bob Rossi + + * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg, + yymsg_alloc fields. + (yypvarsinit, yypushparse): Remove init of removed fields. + (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr. + +2006-10-09 Paul Eggert + + * THANKS: Add Paolo Bonzini and Bob Rossi. + +2006-10-08 Paolo Bonzini + + * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column, + b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if, + b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code, + b4_define_user_cde and uses): Remove. + (b4_comment, b4_prefix, b4_sync_start): New. + * data/bison.m4: New file, with most of the content removed from c.m4. + * src/muscle_tab.h: Use "do {...} while(0)" throughout. + * src/output.c (output_skeleton): Pass bison.m4. + (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix + only if specified. + +2006-10-05 Paul Eggert + + Fix test failure reported by Tom Lane in + + and try to make such failures easier to catch in the future. + * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg; + that's now the caller's responsibility. + (yyprocessOneStack, yyrecoverSyntaxError, yyparse): + Set yychar = YYEOF if it's negative. + * tests/actions.at (yylex): Abort if asked to read past EOF. + * tests/conflicts.at (yylex): Likewise. + * tests/cxx-type.at (yylex): Likewise. + * tests/glr-regression.at (yylex): Likewise. + * tests/input.at (yylex): Likewise. + * tests/regression.at (yylex): Likewise. + * tests/torture.at (yylex): Likewise. + +2006-10-01 Paul Eggert + + Fix problems with translating English-language diagnostics. + * bootstrap: Fix bug introduced in recent bootstrap changes, with + respect to bison-runtime pot generation. The YY_ stuff + wasn't being captured. + * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var. + * po/POTFILES.in: Add src/location.c, src/scan-code.l. + * runtime-po/POTFILES.in: Add data/push.c. + +2006-09-29 Paul Eggert + + Merge bootstrap changes from coreutils. + + 2006-09-28 Jim Meyering + + Automatically generated dependencies are important even + when all of the sources in a directory come from gnulib. + * bootstrap (gnulib_tool): Remove the "no-dependencies" automake + option that gnulib-tool adds to what becomes our lib/gnulib.mk. + + 2006-09-23 Jim Meyering + + * bootstrap (gnulib_tool_options): Add "--local-dir gl". + + 2006-09-20 Paul Eggert + + * bootstrap: Add support for --force. + (usage): New function. Describe usage less tersely. + (CVS_only_file): New var. + +2006-09-21 Paul Eggert + + * data/push.c (YYPUSH_MORE): Make it an enum instead. + (yypushparse): Use YYPUSH_MORE instead of the mystery constant. + Adjust white space and comments to match GNU style better. + +2006-09-20 Bob Rossi + + * data/push.c (yyresult_get): Remove function. + (YYPUSH_MORE): Add #define. + (yypushparse): Modify return value. + +2006-09-20 Paul Eggert + + * stamp-h.in: Remove; no longer needed. + * .cvsignore: Replace autom4te.cache and config.cache with *.cache. + Remove config.h, config.hin, intl (no longer created). + * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h, + stamp-h1. + + Sync bootstrap from coreutils, as follows: + + 2006-09-18 Paul Eggert + + * bootstrap (symlink_to_gnulib): New function. + (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib + to copies-of-gnulib. + (cp_mark_as_generated, slurp, gnulib_files): + Avoid making a copy if it's the same as the old version. + (gnulib_files): Add support for this variable (used by Bison). + +2006-09-20 Paul Eggert + + * src/getargs.c (usage): Rework to use conventions similar to + coreutils, to make translation a bit easier and the code a bit + smaller. Problem reported by Tim Van Holder. + +2006-09-15 Paul Eggert + + Use some of gnulib's new modules, taken from coreutils. + + * bootstrap: Sync from coreutils, except add support for gnulib_files. + * bootstrap.conf: New file. + (gnulib_modules): Add configmake, inttypes, unistd. + (XGETTEXT_OPTIONS): Add complain, complain_at, + fatal, fatal_at, warn, warn_at, unexpected_end. + * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here. + (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this. + (gl_EARLY): Add. + (AM_STDBOOL_H): Remove; gl_INIT now dows this. + (gl_INIT): Add + (GNULIB_AUTOCONF_SNIPPET): Remove. + (AM_GNU_GETTEXT): Add; require formatstring macros since that's + the pickiest. + * lib/.cvsignore: Add inttypes_.h. + * lib/Makefile.am: Include gnulib.mk first so we can append to it. + (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils. + (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove + no-longer-necessary initializations. + (lib_SOURCES): Remove, replacing by libbison_a_SOURCES. + * lib/subpipe.c: Include unconditionally, now that we + use the unistd module. + * src/system.h: Likewise. + * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4, + ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4, + gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4. + * src/Makefile.am (DEFS): Remove, since configmake does this for us. + (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us. + * src/system.h: Include inttypes.h unconditionally, now that we + use the inttypes module. Don't bother to include stdint.h, since + inttypes.h now does that for us. + (LOCALEDIR): Remove, now that we use the configmake module. + * src/getargs.c: Include configmake.h. + * src/main.c: Likewise. + * src/output.c: Likewise. + * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib, + not from $abs_top_builddir, since config.h moved. + + + Port to GCC 2.95. First two problems reported by Michael Deutschmann in + . + + * src/parse-gram.y (symbol_declaration): Don't put statements + before declarations; it's not portable to C89. + * src/scan-code.l (handle_action_at): Likewise. + + * src/scan-code.l: Always initialize braces_level; the old code + left it uninitialized and therefore had undefined behavior. + + Don't attempt to redefine 'assert', since it runs afoul of + systems where standard headers (mistakenly) include . + Instead, define and use our own alternative, called 'aver'. + * src/reader.c: Don't include assert.h, since we no longer + use assert. + * src/scan-code.l: Likewise. + * src/system.h (assert): Remove, replacing with.... + (aver): New function, taking a bool arg. All uses changed. + * src/tables.c (pack_vector): Ensure that aver arg is bool, + not merely an integer. + +2006-09-15 Bob Rossi + + Add support for push parsing. Based on the original work of + Odd Arild Olsen . + * data/Makefile.am (dist_pkgdata_DATA): Add push.c. + * data/c.m4 (YYPUSH): New. + (b4_push_if): New macro. Use it instead of #ifdef YYPUSH. + * data/push.c: New file. + * src/getargs.c (push_parser): New var. + * src/getargs.h (push_parser): New declaration. + * src/output.c (prepare): Add macro insertion of `push_flag'. + * src/parse-gram.y (PERCENT_PUSH_PARSER): New token. + (prologue_declaration): Parse %push-parser. + * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token. + * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to + list of removed lines from the traces observed. + (AT_CHECK_CALC_LALR): Added push parser tests. + +2006-09-13 Paul Eggert + + * NEWS: Version 2.3a. + * configure.ac (AC_INIT): Likewise. + + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove + "#define YYSTYPE int" that caused "make maintainer-check" to fail + due to header ordering dependencies. I don't know why the #define + was there. + + Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero + runtime cost when YYDEBUG is not defined, and so that some tests + that used to fail now work. Problem and initial suggestion by + Paolo Bonzini. + * data/c++.m4 (b4_parse_param_cons): Omit leading ','. + * data/glr.cc (b4_parser_class_name): + Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_. + (debug_level, set_debug_level): Affect yydebug_, not ::yydebug. + (yydebug_) [YYDEBUG]: New member. + (yycdebug_): Now defined only if YYDEBUG. + * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG. + (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_. + (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only + if YYYDEBUG. + (debug_stream, set_debug_stream, debug_level, set_debug_level): + Define only if YYDEBUG. + * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to + set_debug_level. + * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise. + * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to + AT_CHECK_CALC_GLR_CC that are working now. + +2006-09-12 Paul Eggert + + * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove. + We don't need them in glr.cc, and glr.c defines them. + Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c + assumes that defining it to anything is the same as defining + it to 1. Problem reported by Paolo Bonzini. + +2006-09-12 Paolo Bonzini (tiny change) + + * data/c.m4 (b4_null, b4_case): Define. + * src/output.c (prepare_symbols): Use b4_null. + (user_actions_output): Use b4_case. + +2006-09-11 Paul Eggert + + * data/glr.c (b4_shared_declarations): Put start-header first, + before any #includes that we generate, so that feature-test + macros work. Problem reported by Michael Deutschmann in + . + * data/lalr1.cc: Likewise. + * doc/bison.texinfo (Prologue): Document that feature-test macros + should be defined before any Bison declarations. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns + that depend on location.hh after, not before, Bison decls, since + we now include location.hh after the first user prologue. + + * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by + Sander Brandenburg in + . + Also, fix minor white space and comment issues. + (Prologue): Mention that it's better to define feature-test macros + before Bison declarations. Problem reported by Michael Deutschmann. + + * README-cvs: Fix typo: "&" should be "&&". Problem reported + by Jim Meyering. + * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4. + This adjusts to recent gnulib changes. + +2006-09-04 Joel E. Denny + + Finish implementation of per-type %destructor/%printer. Discussed + starting at + + and + . + * NEWS (2.3+): Add a description of this feature to the default + %destructor/%printer description. + * doc/bison.texinfo (Freeing Discarded Symbols): Likewise. + * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set): + Invoke semantic_type_destructor_set or semantic_type_printer_set when a + list node contains a semantic type. + * src/symtab.c, src/symtab.h: Extend with a table that associates + semantic types with their %destructor's and %printer's. + (semantic_type_from_uniqstr, semantic_type_get, + semantic_type_destructor_set, semantic_type_printer_set): New functions + composing the public interface of that table. + (symbol_destructor_get, symbol_destructor_location_get, + symbol_printer_get, symbol_printer_location_get): If there's no + per-symbol %destructor/%printer, look up the per-type before trying + the default. + * tests/actions.at (Per-type %printer and %destructor): New test case. + * tests/input.at (Default %printer and %destructor redeclared): + Extend to check that multiple occurrences of %symbol-default in a + single %destructor/%printer declaration is an error. + (Per-type %printer and %destructor redeclared, Unused values with + per-type %destructor): New test cases. + +2006-09-04 Joel E. Denny + + Require default %destructor/%printer to be declared using + %symbol-default instead of an empty symbol list, and start working on + new per-type %destructor/%printer. Discussed at + . + * NEWS (2.3+): Add %symbol-default to example. + * bison.texinfo (Freeing Discarded Symbols): Likewise. + (Table of Symbols): Add entry for %symbol-default. + * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token. + (generic_symlist, generic_symlist_item): New nonterminals for creating + a list in which each item is a symbol, semantic type, or + %symbol-default. + (grammar_declaration): Use generic_symlist in %destructor and %printer + declarations instead of symbols.1 or an empty list. + (symbol_declaration, precedence_declaration, symbols.1): Update actions + for changes to symbol_list. + * src/reader.c: Update for changes to symbol_list. + * src/scan-code.l: Likewise. + * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token. + * src/symlist.c, src/symlist.h: Extend such that a list node may + represent a semantic type or a %symbol-default in addition to just an + ordinary symbol. Add switched functions for setting %destructor's and + %printer's. + * tests/actions.at, tests/input.at: Add %symbol-default to all default + %destructor/%printer declarations. + +2006-08-23 Joel E. Denny + + Whether the default %destructor/%printer applies to a particular symbol + isn't a question of whether the user *declares* that symbol (in %token, + for example). It's a question of whether the user by any means + *defines* the symbol at all (by simply using a char token, for + example). $end is defined by Bison whereas any other token with token + number 0 is defined by the user. The error token is always defined by + Bison regardless of whether the user declares it with %token, but we + may one day let the user define error as a nonterminal instead. + * NEWS (2.3+): Say "user-defined" instead of "user-declared". + * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document + the meaning of "user-defined". + * tests/actions.at (Default %printer and %destructor for user-declared + end token): Rename to... + (Default %printer and %destructor for user-defined end token): ... + this. + + * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the + computation of whether to apply the default, don't maintain a list of + every Bison-defined symbol. Instead, just check for a first character + of '$', which a user symbol cannot have, and check for the error token. + +2006-08-21 Joel E. Denny + + Don't apply the default %destructor or %printer to the error token, + $undefined, or $accept. This change fits the general rule that the + default %destructor and %printer are only for user-declared symbols, + and it solves several difficulties that are described in the new test + cases listed below. + * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement. + * tests/actions.at (Default %printer and %destructor are not for error + or $undefined, Default %printer and %destructor are not for $accept): + New test cases. + +2006-08-19 Joel E. Denny + + Allow %start after the first rule. + * src/reader.c (grammar_current_rule_begin): Don't set the start symbol + when parsing the first rule. + (check_and_convert_grammar): Search for it here after all grammar + declarations have been parsed. Skip midrules, which have dummy LHS + nonterminals. + * src/symtab.c (symbol_is_dummy): New function. + * src/symtab.h (symbol_is_dummy): Declare it. + * tests/input.at (%start after first rule): New test. + +2006-08-18 Joel E. Denny + + Redo some of the previous commit: add back the ability to use + non-aliased/undeclared string literals since it might be useful to + those declaring %token-table. + * src/reader.c (check_and_convert_grammar): Undo changes in previous + commit: don't worry about complaints from symbols_pack. + * src/symtab.c (symbol_new, symbol_class_set, + symbol_check_alias_consistency): Undo changes in previous commit: count + each string literal as a new symbol and token, assign it a symbol + number, and don't complain about non-aliased string literals. + (symbols_pack): Since symbol_make_alias still does not decrement symbol + and token counts but does still set aliased tokens to the same number, + symbol_pack_processor now leaves empty slots in the symbols array. + Remove those slots. + * tests/regression.at (Undeclared string literal): Remove test case + added in previous commit since non-aliased string literals are allowed + again. + (Characters Escapes, Web2c Actions): Undo changes in previous commit: + remove unnecessary string literal declarations. + * tests/sets.at (Firsts): Likewise. + +2006-08-18 Joel E. Denny + + Don't allow an undeclared string literal, but allow a string literal to + be used before its declaration. + * src/reader.c (check_and_convert_grammar): Don't invoke packgram if + symbols_pack complained. + * src/symtab.c (symbol_new): Don't count a string literal as a new + symbol. + (symbol_class_set): Don't count a string literal as a new token, and + don't assign it a symbol number since symbol_make_alias does that. + (symbol_make_alias): It's not necessary to decrement the symbol and + token counts anymore. Don't assume that an alias declaration occurs + before any uses of the identifier or string, and thus don't assert that + one of them has the highest symbol number so far. + (symbol_check_alias_consistency): Complain if there's a string literal + that wasn't declared as an alias. + (symbols_pack): Bail if symbol_check_alias_consistency failed since + symbol_pack asserts that every token has been assigned a symbol number + although undeclared string literals have not. + * tests/regression.at (String alias declared after use, Undeclared + string literal): New test cases. + (Characters Escapes, Web2c Actions): Declare string literals as + aliases. + * tests/sets.at (Firsts): Likewise. + +2006-08-14 Joel E. Denny + + In the grammar scanner, STRING_FINISH unclosed constructs and return + them to the parser in order to improve error messages. + * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER, + SC_BRACED_CODE, SC_PROLOGUE): Implement. + * tests/input.at (Unclosed constructs): New test case. + * tests/regression.at (Invalid inputs): Update now that unclosed %{ is + seen. + + * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove + unused global. + +2006-08-13 Joel E. Denny + + Handle string aliases for character tokens correctly. + * src/symtab.c (symbol_user_token_number_set): If the token has an + alias, check and set its alias's user token number instead of its own, + which is set to indicate the alias. Previously, every occurrence of + the character token in the grammar overwrote that alias indicator with + the character code. + * tests/input.at (String aliases for character tokens): New test. + +2006-08-12 Joel E. Denny + + * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts. + +2006-08-11 Paul Eggert + + * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT, + to prevent failures when building on older platforms. + Check for autopoint failure. + Set XGETTEXT_OPTIONS to values that check for C format strings, + so that translators are warned about them (this also helps + prevent core dumps). + + * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer + function, since it simplifies our code a bit. + + * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare + rather than -W, so we don't get bogus warnings about sign comparisons. + Add -Wpointer-arith, since that warning is useful (it reports code + that does not conform to C89 and that some compilers reject). + * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change, + since it's no longer needed. + +2006-08-10 Joel E. Denny + + Clean up scanners a bit. + * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack + definitions so gcc won't warn when obstack_for_string is unused. + * src/scan-code.l: config.h and system.h are already #include'd by + scan-code-c.c, so get rid of them here. + * src/scan-gram.l: Likewise. + * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack + definitions rather than duplicating the rest of it. + * src/scan-gram-c.c, scan-skel-c.c: #include "system.h". + +2006-08-09 Joel E. Denny + + Suppress signed/unsigned comparison warnings for yycheck. + * data/c.m4 (b4_safest_int_type): New macro. + * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against + a signed int type, cast it to b4_safest_int_type first. + * data/yacc.c: Likewise. + (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is + also overwritten. + +2006-08-09 Ralf Wildenhues (tiny change) + + * doc/bison.texinfo: Fix some typos. + +2006-08-02 Paul Eggert + + * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4, + po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4. + + * bootstrap (gnulib_tool): Stop using --assume-autoconf; + the latest gnulib does this a different way. + (get_translations): Sharuzzaman Ahmat Raslan reported that the ms + translation was patched, so stop omitting it. + +2006-07-29 Joel E. Denny + + Enable declaration of default %printer/%destructor. Make the parser + use these for all user-declared grammar symbols for which the user does + not declare a specific %printer/%destructor. Thus, the parser uses it + for token 0 if the user declares it but not if Bison generates it as + $end. Discussed starting at + , + , + and + . + * NEWS (2.3+): Mention. + * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to + declare a %destructor for a mid-rule's semantic value. It's just + impossible to declare one specific to it. + (Freeing Discarded Symbols): Mention that @$ can be used in %destructor + code. Describe default %destructor form. + * src/parse-gram.y (grammar_declaration): Parse default + %printer/%destructor declarations. + * src/output.c (symbol_destructors_output): Use symbol_destructor_get + and symbol_destructor_location_get rather than accessing the destructor + and destructor_location members of struct symbol. + (symbol_printers_output): Likewise but for %printer's. + * src/reader.c (symbol_should_be_used): Likewise but for %destructor's + again. + * src/symtab.c (default_destructor, default_destructor_location, + default_printer, default_printer_location): New static global + variables to record the default %destructor and %printer. + (symbol_destructor_get, symbol_destructor_location_get, + symbol_printer_get, symbol_printer_location_get): New functions to + compute the appropriate %destructor and %printer for a symbol. + (default_destructor_set, default_printer_set): New functions to set the + default %destructor and %printer. + * src/symtab.h: Prototype all those new functions. + * tests/actions.at (Default %printer and %destructor): New test to + check that the right %printer and %destructor are called, that they're + not called for $end, and that $$ and @$ work correctly. + (Default %printer and %destructor for user-declared end token): New + test to check that the default %printer and %destructor are called for + a user-declared end token. + * tests/input.at (Default %printer and %destructor redeclared, Unused + values with default %destructor): New tests to check related grammar + warnings and errors. + +2006-07-29 Joel E. Denny + + Clean up handling of %destructor for the end token (token 0). + Discussed starting at + + and + . + + Make the skeletons consistent in how they pop the end token and invoke + its %destructor. + * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start + state, which has token number 0, since this would invoke the + %destructor for the end token. + * data/lalr1.cc (yy::parser::parse): Don't check for the final state + until after shifting the end token, or else it won't be popped. + * data/yacc.c (yyparse): Likewise. + + * data/glr.c (yyparse): Clear the lookahead after shifting it even when + it's the end token. Upon termination, destroy an unshifted lookahead + even when it's the end token. + * data/lalr1.cc (yy::parser::parse): Likewise. + * data/yacc.c (yyparse): Likewise. + + * src/reader.c (packgram): Don't check rule 0. This suppresses unused + value warnings for the end token when the user gives the end token a + %destructor. + + * tests/actions.at (Printers and Destructors): Test all the above. + +2006-07-24 Paul Eggert + + Update to latest gnulib and gettext versions. + * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer. + Add fopen-safer. + (gnulib_files): Add m4/warning.m4. Don't worry about files + overwritten by autopoint. + Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4. + Suppress "id", "ms", "tr" translations for now, since gettext 0.15 + rejects them. + Don't use autoreconf; instead, invoke autopoint etc. by hand, + so that we can remove the intl files at a better time. + (intl_files_to_remove): Remove aclocal.m4, since it gets + rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4, + m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4, + m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4. + Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4. + Remove datarootdir hack; no longer needed. + * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING. + (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15. + * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c, + strdup.h. + * m4/.cvsignore: Remove hard-locale.m4, strdup.m4. + * m4/warning.m4: Remove from CVS, since we now use gnulib's version. + +2006-07-20 Paul Eggert + + * bootstrap: Adjust to today's change to gnulib-tool by invoking + it with --assume-autoconf='latest-stable'. + +2006-07-13 Joel E. Denny + + * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at + least 1.4.7 and 1.4.4) by putting a #line between `typedef union + YYSTYPE' and `{'. + * src/muscle_tab.h (muscle_grow): Replace the header comments with + those from muscle_tab.c since the old ones are misleading. + +2006-07-13 Akim Demaille + + Support %define "KEY" {VALUE}. + * src/scan-code.h, src/scan-code.l (translate_action) + (translate_rule_action, translate_symbol_action, translate_code): + Return char *, not const char *. + * src/parse-gram.y (declaration): Rename as... + (prologue_declaration): this. + (string_content): Remove this nonterminal, use STRING. + (braceless, content, content.opt): New nonterminal. + Use them. + (%define): Now accept content.opt, i.e., accept also BRACED_CODE + as value. + * src/scan-gram.l (getargs.h): Don't include it. + +2006-07-12 Paul Eggert + + * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)' + rather than a for-loop that declares a local bool variable. This + should work around a compatibility problem with a Cray x1e C++ + compiler reported by Hung Nguyen in + . + The for-loop was introduced in the 2004-11-17 change but I don't + know why it was needed. + +2006-07-12 Akim Demaille + + * data/c.m4: Comment changes. + +2006-07-10 Akim Demaille + + * src/complain.c (error_message, ERROR_MESSAGE): New. + To factor... + (fatal_at, fatal, warn_at, warn, complain_at, complain): these. + * src/complain.h, src/complain.c (warning_issued): Remove, unused. + +2006-07-09 Paul Eggert + + * NEWS: Instead of %union, you can define and use your own union type + YYSTYPE if your grammar contains at least one tag. + Your YYSTYPE need not be a macro; it can be a typedef. + * doc/bison.texinfo (Value Type, Multiple Types, Location Type): + (Union Decl, Decl Summary): Document this. + * data/glr.c (YYSTYPE): Implement this. + * data/glr.cc (YYSTYPE): Likewise. + * data/lalr1.cc (YYSTYPE): Likewise. + * data/yacc.c (YYSTYPE): Likewise. + * src/output.c (prepare): Output tag_seen_flag. + * src/parse-gram.y (declaration, grammar_declaration): + Use 'union_seen' rather than 'typed' to determine whether + %union has been seen, since grammars can now be typed without + %union. + (symbol_declaration, type.opt, symbol_def): + Keep track of whether a tag has been seen. + * src/reader.c (union_seen, tag_seen): New vars. + (typed): remove. + * src/reader.h (union_seen, tag_seen, typed): Likewise. + * src/scan-code.l (untyped_var_seen): New variable. + (handle_action_dollar): Adjust to above changes. + (handle_action_dollar, handle_action_at): + Improve overflow checking for outlandish numbers. + * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to + avoid new diagnostics generated by above changes. + * tests/regression.at (YYSTYPE typedef): Add test to check + for type tags without %union. + + * src/symlist.c (symbol_list_length): Return int, not unsigned + int, since callers expect int. This may need to get revisited + once we have proper integer overflow checking. + + * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this + object is now static. + + * src/getargs.c (flags_argmatch): Return void, not int, + to pacify ./configure --enable-gcc-warnings. + + * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string) + since last_string is already defined to FLEX_PREFIX (last_string). + +2006-07-09 Akim Demaille + + Implement --warnings/-W. + * src/getargs.c (report_argmatch, trace_argmatch): Remove, + replaced by... + (flags_argmatch, FLAGS_ARGMATCH): this new function and macro. + Adjust callers. + * src/getargs.h, src/getargs.c (warnings, warnings_flags) + (warnings_args, warnings_types): New. + (getargs, short_options, long_options): Accept -W/--warnings. + Sort the options by alphabetical order, upper case letter right + before its lower case. + +2006-07-09 Joel E. Denny + + Change %merge result type clash warnings to errors. Discussed at + . + * src/reader.c (record_merge_function_type): Use complain_at. + * tests/glr-regression.at (Missed %merge type warnings when LHS type is + declared later): Update test case results. + +2006-07-09 Akim Demaille + + * src/getargs.h, src/getargs.c: Swap --report and --trace handling + to be in alphabetical order. + (trace_args): Spelling fixes. + +2006-07-09 Paul Eggert + + * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy" + so they don't collide with user-defined macros. + (yy_stack_print): Don't assume that yytype_int16 promotes to int; + this was never guaranteed, and now that we're using gnulib stdint, + which defines int_fast16_t to long int, the problem is exposed. + +2006-07-08 Paul Eggert + + * data/c.m4 (b4_basename): Simplify a bit, since we don't + need the full POSIX semantics (and weren't implementing them + anyway). + + Adjust to Autoconf 2.60 and today's gnulib. + * bootstrap (gnulib_modules): Add stdint. + Remove special case for m4/onceonly_2_57.m4, since gnulib-tool + no longer copies it. + (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4, + since stdint needs the former and wcwidth (which is now required + by mbswidth) needs the latter. + Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to + work around a compatibility glitch between gettext 0.14.6 and + Autoconf 2.60. + * configure.ac (AC_PREREQ): Require Autoconf 2.60. + Do not check for uintptr_t, since new stdint module does the right + thing. + * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h. + Add stdint.h, stdint_.h, wcwidth.h. + * m4/.cvsignore: Remove alloca.m4, onceonly.m4. + Add absolute-header.m4, double-slash-root.m4, longlong.m4, + stdint.m4, wchar_t.m4, wcwidth.m4. + * src/files.c: Include and in the + usual order for ../lib/*.h files. + (file_name_split): Use last_component, not base_name, to adjust + to gnulib changes. + * src/parse-gram.h: Include in the usual order + for ../lib/*.h files. + (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8): + Define unconditionally, since we now assume the stdint module. + * src/scan-skel.l: Include . + (BASE_QPUTS): Use last_component, not base_name. + * src/system.h: Include in the usual order + for ../lib/*.h files. Include unconditionally, + since we now use the stdint module. + (uintptr_t): Declare if UINTPTR_MAX is not defined, not + HAVE_UINTPTR_T, since we now use the stdint module. + (base_name): Remove decl, since files now include + to get the decl. + +2006-07-08 Akim Demaille + + * data/c.m4 (b4_location_initial_column, b4_location_initial_line): + New, default to 1. + * data/yacc.c, data/glr.c, data/location.cc: Use them. + * NEWS, doc/bison.texinfo: The initial column and line are 1 by + default. + * tests/calc.at: Adjust. + +2006-07-08 Akim Demaille + + * data/c.m4 (b4_basename): New. + (b4_syncline): Also output the location of its invocation (from + the skeleton). + (b4_user_action, b4_define_user_action, b4_user_actions) + (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header) + (b4_user_stype): New. + * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them. + +2006-07-07 Joel E. Denny + + In the grammar file, the first column is 1 not 0 on the first line as + on every other line. + * src/parse-gram.y (%initial-action): Initialize @$ correctly. + * tests/input.at (Torturing the Scanner): Update output. + + * src/scan-gram.l (scanner_cursor): Declare it static. + +2006-07-07 Joel E. Denny + + In warnings, say "previous declaration" rather than "first + declaration". + * src/symtab.c (redeclaration): Do that here. + * src/reader.c (record_merge_function_type): In the case of a result + type clash, report the previous declaration rather than the very first + one in the grammar file. + * tests/glr-regression.at (Missed %merge type warnings when LHS type is + declared later): Add a third declaration to check this behavior. + * tests/input.at (Incompatible Aliases): Update output. + +2006-06-27 Akim Demaille + + * doc/Doxyfile.in: New. + * doc/Makefile.am: Use it. + * src/lalr.h, src/symtab.h: Initial doxygenation. + +2006-06-26 Joel E. Denny + + Don't miss %merge result type warnings just because the LHS types are + declared after the %merge. This continues the effort of the previous + patch. + * src/reader.c (get_merge_function): Don't set the merger type yet. + (record_merge_function_type): New function for setting the merger type + and checking for clashes. + (grammar_current_rule_merge_set): Set the location of the %merge for + the current rule. + (packgram): Invoke record_merge_function_type for each rule now that + all symbol type declarations have been parsed. + * src/reader.h (merger_list.type_declaration_location): New member + storing the location of the first %merge from which the type for this + merging function was derived. + * src/symlist.h (symbol_list.merger_declaration_location): New member + storing the location of a rule's %merge, if any. + * tests/glr-regression.at (Missed %merge type warnings when LHS type is + declared later): New test to catch the error fixed by the above patch. + +2006-06-26 Joel E. Denny + + Get action warnings (grammar_rule_check) right even when symbol + declarations appear after the rules. Discussed at + + and + . + Don't mistake the type of $$ in a midrule to be that of its parent + rule's $$. + * src/reader.c (grammar_current_rule_end): Don't invoke + grammar_rule_check yet since not all symbol declarations may have been + parsed yet. + (grammar_midrule_action): Likewise. + Don't record whether the midrule's $$ has been used yet since actions + haven't been translated yet. + Record the midrule's parent rule and its RHS index within the parent + rule. + (grammar_current_rule_action_append): Don't translate the action yet + since not all symbol declarations may have been parsed yet and, thus, + warnings about types for $$, $n, @$, and @n can't be reported yet. + (packgram): Translate the action and invoke grammar_rule_check now that + all symbol declarations have been parsed. + * src/scan-code.l (handle_action_dollar): Now that this is invoked + after parsing the entire grammar file, the symbol list here in the case + of a midrule is actually the midrule's empty RHS, so reference its + parent rule's RHS where necessary. + On the other hand, now that you can already know it's a midrule, you + aren't forced to think $$ has the same type as its parent rule's $$. + (handle_action_at): In the case of a midrule, reference the parent rule + where necessary. + * src/symlist.c (symbol_list_new): Initialize new midrule-related + members. + (symbol_list_length): Now that this is invoked after all rules have + been parsed, a NULL symbol (rather than a NULL symbol list node) + terminates a rule. symbol_list_print already does this correctly. + * src/symlist.h (symbol_list.midrule_parent_rule, + symbol_list.midrule_parent_rhs_index): New members so that midrules can + remember their relationships with their parents. + * tests/input.at (Type Clashes): Extend to catch the midrule $$ error + fixed by the above patch. + (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros + implementing... + (Unused values): ... this old test case and... + (Unused values before symbol declarations): ... this new test case. + This one is the same as `Unused values' except that all symbol + declarations appear after the rules in order to catch the rest of the + errors fixed by the above patch. + +2006-06-26 Joel E. Denny + + More cleanup. + * src/reader.c (current_rule): Declare it static since it's no longer + used outside this file. + (grammar_current_rule_action_append): Remove redundant arguments from + translate_rule_action invocation. + * src/reader.h (current_rule): Remove this unused extern. + * src/scan-code.h (translate_rule_action): Remove redundant arguments. + * src/scan-code.l (translate_rule_action): Likewise. + +2006-06-25 Joel E. Denny + + Clean up yesterday's patch. + * parse-gram.y (rhs): Move grammar_midrule_action invocation from here + to... + * src/reader.c (grammar_current_rule_action_append): ... here for + consistency with grammar_current_rule_symbol_append. + * tests/regression.at (Braced code in declaration in rules section): + Make yyerror and yylex static as usual. + +2006-06-24 Joel E. Denny + + Fix bug that mistakes braced code in a declaration in the rules section + to be a rule action. Mentioned at + . + * src/scan-gram.l: Move midrule action detection from the start of the + scanning of any braced code to... + * src/parse-gram.y (rhs): ... the parsing of braced code as a rule + action. For readability, use $2 and @2 rather than the equivalent + global variables. + * tests/regression.at (Braced code in declaration in rules section): + New test to catch the error fixed by the above patch. + + Work on code readability some. + * src/scan-code.l (current_rule): Get rid of this misleading and + redundant declaration: it's actually extern'ed in reader.h. + (YY_DECL, code_lex, handle_action_dollar, handle_action_at, + translate_action): Add a rule argument and use it instead of the global + current_rule. + (translate_rule_action): This already receives current_rule through an + argument, so pass it on to translate_action instead of assigning + current_rule to current_rule. + (translate_symbol_action, translate_code): Pass rule = NULL to + translate_action. + +2006-06-23 Joel E. Denny + + Rename %before-definitions to %start-header and %after-definitions to + %end-header. Don't use these declarations to separate pre-prologue + blocks from post-prologue blocks. Add new order-independent + declarations %before-header and %after-header as alternatives to the + traditional Yacc pre-prologue and post-prologue blocks. Discussed at + . + * NEWS (2.3+): Update for these changes. + * data/glr.c (b4_before_definitions): Update to... + (b4_start_header): ... this. + (b4_after_definitions): Update to... + (b4_end_header): ... this. + * data/glr.cc: Likewise. + * data/lalr1.cc: Likewise. + * data/yacc.c: Likewise. + * doc/bison.texinfo (The prologue): Update names, and replace remaining + prologue blocks with %*-header declarations. + (Calc++ Parser): Likewise. + (Decl Summary): Update names. + (Table of Symbols): Update description. + * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to... + (PERCENT_END_HEADER): ... this. + (PERCENT_BEFORE_DEFINITIONS): Update to... + (PERCENT_START_HEADER): ... this. + (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens. + (declaration): Update token names and m4 macro names. + When parsing %end-header and %start-header, invoke translate_code + before muscle_code_grow, and no longer set global booleans to remember + whether these declarations have been seen. + Parse new %after-header and %before-header. + * src/reader.c (before_definitions, after_definitions): Remove. + (prologue_augment): Accept a new bool argument to specify whether to + augment the pre-prologue or post-prologue. + * src/reader.h (before_definitions, after_definitions): Remove these + extern's. + (prologue_augment): Add new bool argument. + * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to... + (PERCENT_END_HEADER): ... this. + (PERCENT_BEFORE_DEFINITIONS): Update to... + (PERCENT_START_HEADER): ... this. + (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens. + * tests/actions.at (Printers and Destructors): Update names. + +2006-06-22 Joel E. Denny + + Add comparison operators for C++ location classes. Discussed at + . + * data/c++.m4 (b4_define_location_comparison): New boolean %define + declaration indicating whether filename_type has an operator==. If + filename_type is `std::string', it defaults to `1', `0' otherwise. + * data/location.cc: Iff b4_define_location_comparison is `1', add + operator== and operator!= for class position and for class location. + + Some minor fixes. + * src/scan-action.l: Remove unused file. + * src/symtab.c (symbol_printer_set): Use printer_location not + destructor_location. + * src/symtab.h (struct symbol): Replace incorrect source comment for + printer members. + * tests/input.at (Incompatible Aliases): Update output with correct + printer location. + +2006-06-20 Joel E. Denny + + Don't put the pre-prologue in the header file. For the yacc.c code + file and the glr.c header and code files, move the pre-prologue before + the token definitions. Add new %before-definitions and + %after-definitions to declare code that will go in both the header file + and code file. Discussed at + , + , + and + . + * NEWS (2.3+): Describe these changes. + * data/glr.c (b4_pre_prologue): Move from within to before... + (b4_shared_declarations): ... this. + Add new b4_before_definitions before b4_token_enums. + Add new b4_after_definitions at the end. + * data/glr.cc (b4_pre_prologue): Replace with... + (b4_before_definitions): ... this in the header file. + (b4_after_definitions): New near the end of the header file. + * data/lalr1.cc (b4_pre_prologue): Move from the header file to the + code file right before including the header file. + (b4_before_definitions): New in the previous position of + b4_pre_prologue in the header file. + (b4_after_definitions): New near the end of the header file. + * data/yacc.c: Clean up some m4 quoting especially in the header file. + (b4_token_enums_defines): In the code file, move to right before + YYSTYPE for consistency with the header file. + (b4_before_definitions): New right before b4_token_enums_defines in + both the header and code file. + (b4_after_definitions): New right after YYLTYPE and yylloc in both the + header and code file. + * doc/bison.texinfo (Prologue): Show use of %before-definitions instead + of prologues for %union dependencies. + (Decl Summary): In %defines description, mention the effect of + %before-definitions and %after-definitions on the header file. + (Calc++ Parser): Forward declare driver in a %before-definitions rather + than in the pre-prologue so that make check succeeds. + (Table of Symbols): Add entries for %before-definitions and + %after-definitions. + * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for + %before-definitions. + (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions. + (declaration): Parse those declarations and append to + b4_before_definitions and b4_after_definitions, respectively. + * src/reader.c (before_definitions, after_definitions): New bools to + track whether those declarations have been seen. + (prologue_augment): Add to the post-prologue if %union, + %before-definitions, or %after-definitions has been seen. + * src/reader.h (before_definitions, after_definitions): New extern's. + * src/scan-gram.l: Scan the new declarations. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second + prologue block in a %before-definitions or a %after-definitions based + on whether the %union is declared. + * tests/regression.at (Early token definitions with --yacc, Early token + definitions without --yacc): Move tests for token definitions into the + post-prologue since token names are no longer defined in the + pre-prologue. + +2006-06-20 Akim Demaille + + * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New. + (symbol_get): Use it. + * src/parse-gram.y: Use it. + +2006-06-19 Joel E. Denny + + * src/scan-gram.l: Remove unused declaration of last_string_1 so the + build succeeds when configured with --enable-gcc-warnings. + +2006-06-19 Paul Eggert + + * src/parse-gram.y (char_name): New function. + (CHAR, STRING, string_content): For %printer, properly escape. + (ID): Prefer fputs to fprintf. + (id): Reindent to be consistent with other rules. + Properly quote char. + + The Translation Project changed its way of publishing translations + to maintainers. I haven't received any responses to my request + for supporting the old way, or for documenting the new way. I + have modified 'bootstrap' to use screen scraping + (in this case, HTML scraping). This is unreliable and inelegant, + but I don't see any better way. Yuck. + * bootstrap (TP_URL, WGET_COMMAND): New vars. + (get_translations): New function, which uses HTML scraping to + deduce locations of latest translations. + Use this function to grab both bison and bison-runtime .po files. + Don't bother priming the pump for the runtime-po domain any more, + as it's now translated better than bison is. + +2006-06-19 Akim Demaille + + * src/scan-gram.l: No longer "parse" things after `%union' until + `{'. Rather, return a single "%union" token. + No longer make symbols: return strings, and leave the conversion + to symbols to the parser. + (SC_PRE_CODE, token_type): Remove. + * src/parse-gram.y (%union): New field `character'. + Sort tokens. + (CHAR): New token. + (ID, ID_COLON): Now that the scanner no longer makes them + identifiers, adjust all uses to invoke symbol_get. + (id_colon): New, wraps the conversion from string to symbol. + (%union): Accept a possible union_name. + (symbol): Now can be a char. + * data/c.m4 (b4_union_name): Leave a default value. + * data/glr.c, data/yacc.c: Use it. + +2006-06-11 Joel E. Denny + + For associating token numbers with token names for "yacc.c", don't use + #define statements unless `--yacc' is specified; always use enum + yytokentype. Most important discussions start at: + , + , + and + . + * NEWS (2.3+): Mention. + * data/c.m4 (b4_yacc_if): New. + (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the + token #define's. + * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc' + on token name definitions. + * src/getargs.c (usage): Capitalize `Yacc' in English. + * src/output.c (prepare): Define b4_yacc_flag. + * tests/regression.at (Early token definitions): Test that tokens names + are defined before the pre-prologue not just before the post-prologue. + Remove this test case and copy to... + (Early token definitions with --yacc): ... this to test #define's. + (Early token definitions without --yacc): ... and this to test enums. + +2006-06-11 Paul Eggert + + * NEWS: Reword the post-2.3 change to not be so optimistic about + removing the old "look-ahead" spelling. + Update previous look-ahead/lookahead change reports. + * REFERENCES: look-ahead -> lookahead (since that's + what he actually wrote). + * doc/refcard.tex: look ahead -> lookahead, + look-ahead -> lookahead + +2006-06-09 Joel E. Denny + + For consistency, use `lookahead' instead of `look-ahead' or + `look_ahead'. Discussed starting at + + and then at + . + * NEWS: For the next release, note the change to `--report'. + * TODO, doc/bison.1: Update English. + * doc/bison.texinfo: Update English. + (Understanding Your Parser, Bison Options): Document as + `--report=lookahead' rather than `--report=look-ahead'. + * src/conflicts.c: Update English in comments. + (lookahead_set): Rename from look_ahead_set. + (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens. + (resolve_sr_conflict): Rename local look_ahead_tokens to + lookahead_tokens, and update other uses. + (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts, + count_rr_conflicts, conflicts_free): Update uses. + * src/getargs.c (report_args): Move "lookahead" before alternate + spellings. + (report_types): Update uses. + (usage): For `--report' usage description, state `lookahead' spelling + rather than `look-ahead'. + * src/getargs.h (report.report_lookahead_tokens): Rename from + report_look_ahead_tokens. + * src/lalr.c: Update English in comments. + (compute_lookahead_tokens): Rename from compute_look_ahead_tokens. + (state_lookahead_tokens_count): Rename from + state_look_ahead_tokens_count. + Rename local n_look_ahead_tokens to n_lookahead_tokens. + (lookahead_tokens_print): Rename from look_ahead_tokens_print. + Rename local n_look_ahead_tokens to n_lookahead_tokens. + Update other uses. + Update English in output. + (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses. + * src/print.c: Update English in comments. + (lookahead_set): Rename from look_ahead_set. + (print_reduction): Rename argument lookahead_token from + look_ahead_token. + (print_core, state_default_rule, print_reductions, print_results): + Update uses. + * src/print_graph.c: Update English in comments. + (print_core): Update uses. + * src/state.c: Update English in comments. + (reductions_new): Update uses. + (state_rule_lookahead_tokens_print): Rename from + state_rule_look_ahead_tokens_print, and update other uses. + * src/state.h: Update English in comments. + (reductions.lookahead_tokens): Rename from look_ahead_tokens. + (state_rule_lookahead_tokens_print): Rename from + state_rule_look_ahead_tokens_print. + * src/tables.c: Update English in comments. + (conflict_row, action_row): Update uses. + * tests/glr-regression.at + (Incorrect lookahead during deterministic GLR, + Incorrect lookahead during nondeterministic GLR): Rename + print_look_ahead to print_lookahead. + * tests/torture.at: Update English in comments. + (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from + AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR. + (Many lookahead tokens): Update uses. + * data/glr.c: Update English in comments. + * lalr1.cc: Likewise. + * yacc.c: Likewise. + * src/conflicts.h: Likewise. + * src/lalr.h: Likewise. + * src/main.c: Likewise. + * src/output.c: Likewise. + * src/parse-gram.c: Likewise. + * src/tables.h: Likewise. + * tests/calc.at: Likewise. + +2006-06-08 Joel E. Denny + + * src/flex-scanner.h (yytext): Remove stray `*/' in #define. + +2006-06-07 Paul Eggert + + * TODO: Add request from Nelson H. F. Beebe to be able to install + Bison without installing the yacc script. + +2006-06-07 Joel E. Denny + + * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng + and yytext if they're already #define'd. + * src/flex-scanner.h, src/location.h: Move #include "system.h" to... + * src/scan-code-c.c: ... here. + * src/scan-code.l, src/scan-gram.l: ... and here. Also #include + . + +2006-06-07 Joel E. Denny + + Get Bison to build again when configured with --enable-gcc-warnings. + * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some + missing #include's. + * src/scan-code.l (handle_action_dollar, handle_action_at): Rename + loc argument as it shadows a global. + * src/scan-gram.l: Remove stray comma that prevents boundary_set + invocation. + + * src/.cvsignore: Add scan-code.c. + +2006-06-07 Akim Demaille + + * src/scan-gram.l: Move the "add a trailing ; to actions" code + to... + * src/scan-code.l: here. + * tests/input.at (Torturing the Scanner): Fix another location + error. + +2006-06-07 Akim Demaille + + * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash. + +2006-06-06 Akim Demaille + + Extract the parsing of user actions from the grammar scanner. + As a consequence, the relation between the grammar scanner and + parser is much simpler. We can also split "composite tokens" back + into simple tokens. + * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New. + * src/scan-gram.l (add_column_width, adjust_location): Move to and + rename as... + * src/location.h, src/location.c (add_column_width) + (location_compute): these. + Fix the column count: the initial column is 0. + (location_print): Be robust to ending column being 0. + * src/location.h (boundary_set): New. + * src/main.c: Adjust to scanner_free being renamed as + gram_scanner_free. + * src/output.c: Include scan-code.h. + * src/parse-gram.y: Include scan-gram.h and scan-code.h. + Use boundary_set. + (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION) + (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part, + which is now, again, a separate token. + Adjust all dependencies. + Wherever actions with $ and @ are used, use translate_code. + (action): Remove this nonterminal which is now useless. + * src/reader.c: Include assert.h, scan-gram.h and scan-code.h. + (grammar_current_rule_action_append): Use translate_code. + (packgram): Bound check ruleno, itemno, and rule_length. + * src/reader.h (gram_in, gram__flex_debug, scanner_cursor) + (last_string, last_braced_code_loc, max_left_semantic_context) + (scanner_initialize, scanner_free, scanner_last_string_free) + (gram_out, gram_lineno, YY_DECL_): Move to... + * src/scan-gram.h: this new file. + (YY_DECL): Rename as... + (GRAM_DECL): this. + * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New. + * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out): + (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in): + (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy): + Move these declarations, and... + (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE): + these to... + * src/flex-scanner.h: this new file. + * src/scan-gram.l (rule_length, rule_length_overflow) + (increment_rule_length): Remove. + (last_braced_code_loc): Rename as... + (gram_last_braced_code_loc): this. + Adjust to the changes of the parser. + Move all the handling of $ and @ into... + * src/scan-code.l: here. + * src/scan-gram.l (handle_dollar, handle_at): Remove. + (handle_action_dollar, handle_action_at): Move to... + * src/scan-code.l: here. + * src/Makefile.am (bison_SOURCES): Add flex-scanner.h, + scan-code.h, scan-code-c.c, scan-gram.h. + (EXTRA_bison_SOURCES): Add scan-code.l. + (BUILT_SOURCES): Add scan-code.c. + (yacc): Be robust to white spaces. + + * tests/conflicts.at, tests/input.at, tests/reduce.at, + * tests/regression.at: Adjust the column numbers. + * tests/regression.at: Adjust the error message. + +2006-06-06 Joel E. Denny + + * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output. + Use Akim's wording from + . + +2006-06-06 Joel E. Denny + + Between Bison releases, manually append `+' to the previous Bison + release number, and use that as a signal to automatically print the + ChangeLog's CVS Id keyword from --version. Discussed starting at + . + * ChangeLog: Add Id header. + * configure.ac (AC_INIT): Append `+' to `2.3'. + * src/.cvsignore: Add revision.c. + * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h. + (BUILT_SOURCES): Add revision.c. + (revision.c): New target rule. This file defines a new global variable + named revision. It initializes it with either the Id from ChangeLog + or, if VERSION doesn't contain `+', with the empty string. + * src/getargs.c (version): Print the value of revision. + * src/revision.h: Extern revision. + +2006-06-05 Paul Eggert + + * NEWS: Version 2.3. + * configure.ac (AC_INIT): Likewise. + +2006-05-30 Paul Eggert + + * data/glr.c (YYRECOVERING): Define to be a function-like macro + with no arguments, not as an object-like macro. This is for + compatibility with data/yacc.c. Problem reported by John P. Hartmann in + . + * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols): + Document this. + +2006-05-30 Joel E. Denny + + * src/getargs.c (usage): Back out yesterday's modification of the + --help output so that we don't have to wait for translation before + releasing 2.3. + +2006-05-29 Paul Eggert + + * doc/bison.texinfo (Introduction): Don't say "GLR grammar". + Problem reported by Akim Demaille. + +2006-05-29 Joel E. Denny + + * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output. + +2006-05-26 Paul Eggert + + * data/yacc.c (yy_reduce_print): Omit trailing white space in + generated source code. Problem reported by Frans Englich in + . + +2006-05-22 Paul Eggert + + * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the + shell, not within 'make', so that 'make' by an ordinary builder + (using GNU make) does not worry about configuring gzip. This also + works around a bug reported independently by Keith Thompson and by + Georg Schwarz, whereby gzip 1.2.4 --help would output usage on + stderr rather than stdout, messing up the build logs. + +2006-05-21 Joel E. Denny + + * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID + to make sure that YYID will never be unused. This fixes a 'make + maintainer-check' failure caused by the recent changes to the 'Trivial + grammars' test case, which caused g++ 4.1.0 to complain that YYID was + not used. + * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case. + +2006-05-21 Joel E. Denny + + * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the + state before an empty RHS is always resolved here. Only the location + of that state is guaranteed to be resolved, and that's enough. This + fixes the remaining bug reported by Derek M. Jones in + . + * tests/glr-regression.at (Uninitialized location when reporting + ambiguity): Test the above case. + Also, the embedded comments in this test case claim it checks the case + of an empty RHS that has inherited the initial location. However, the + corresponding LHS was already resolved, so yyresolveLocations didn't + actually have reason to modify it. Fix this by forcing + nondeterministic operation at the beginning of the parse. + +2006-05-20 Paul Eggert + + * data/c.m4 (b4_yy_symbol_print_generate): + (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than + 'const YYSTYPE', and similarly for YYLTYPE. This fixes one + of the bugs reported today by Derek M Jones in + . + * doc/bison.texinfo (Value Type): Document that YYSTYPE must be + defined to be a type name without parens or brackets. + (Location Type): Similarly for YYLTYPE. + * tests/regression.at (Trivial grammars): Put in a test for this + bug that will be caught by 'make maintainer-check' (though not, + alas, by 'make check' unless your compiler is picky). + +2006-05-19 Paul Eggert + + * NEWS: Version 2.2. + * configure.ac (AC_INIT): Likewise. + +2006-05-17 Joel E. Denny + + * data/glr.c (yyreportTree): Make room in yystates for the state + preceding the RHS. This fixes the segmentation fault reported by Derek + M. Jones in + . + (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing + to the user. Reported for yyreportTree by Derek M. Jones later in the + same thread. + * THANKS: Add Derek M. Jones. + Update my email address. + Fix typo in Steve Murphy's name. + +2006-05-14 Paul Eggert + + * data/glr.c (yyreportSyntaxError): Fix off-by-one error in + checking against YYLAST that caused the parser to miss a potential + alternative in its diagnostic. + Problem reported by Maria Jose Moron Fernandez in + . + * data/lalr1.cc (yysyntax_error_): Likewise. + * data/yacc.c (yysyntax_error): Likewise. + * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for + tokens, in case we run into an older C compiler. + (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros. + Use them to check for the off-by-one error fixed above. + + * data/yacc.c (yytnamerr): Fix typo: local var should be of type + YYSIZE_T, not size_t. + * tests/regression.at (Trivial grammars): New test, to catch + the error fixed by the above patch. + +2006-05-14 Akim Demaille + + * doc/bison.texinfo (C++ Bison Interface): Clarify the naming + scheme. + Reported by Steve Murphy. + +2006-05-14 Akim Demaille + + * data/glr.cc, data/lalr1.cc: Using %defines is mandatory. + * data/glr.cc: b4_location_flag is now b4_locations_flag. + +2006-05-14 Akim Demaille + + Implement --trace=m4. + * src/getargs.c (trace_types, trace_args): Accept trace_m4. + * src/output.c (output_skeleton): When set, pass -dV to m4. + + Factor the handling of flags in m4. + * src/output.c (prepare): Rename the muscle names debug, defines, + error_verbose to debug_flag, defines_flag, error_verbose_flag. + * data/c.m4: Adjust. + (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New. + Use b4_define_flag_if to define other b4_FLAG_if macros. + (b4_location_if): As a consequence, rename as... + (b4_locations_if): this, for consistency. + Adjust all the skeletons. + +2006-05-14 Akim Demaille + + * etc/bench.pm: Shorten bench names. + +2006-05-14 Akim Demaille + + * src/output.h, src/output.c (error_verbose): Move to... + * src/getargs.h, src/getargs.c: here. + Sort the flags. + Adjust dependencies. + +2006-05-13 Paul Eggert + + * data/c.m4 (b4_copyright): Put the special exception for Bison + skeletons here, so we don't have to put it in each skeleton. All + uses changed. Suggested by Akim Demaille. Also, wrap the + copyright notice, in case it is longer than 80 columns. Replace + comma by newline after title. + +2006-05-11 Paul Eggert + + * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an + incompatibility, not a bug. Mention that it wasn't fixed as of + flex 2.5.33. + +2006-05-11 Akim Demaille + + * examples/extexi: Enforce the precedence of concatenation over + >>. + Reported by Tommy Nordgren. + +2006-05-11 Akim Demaille + + * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes + with the member "token". + Reported by Martin Nylin. + +2006-05-08 Paul Eggert + + * data/glr.c: Switch to Bison 2.2 special-exception language in + the copyright notice. Use more-regular format for titles and + copyright notices. + * data/glr.cc: Likewise. + * data/location.cc: Likewise. + * data/yacc.cc: Likewise. + * doc/bison.texinfo (Conditions): Document this. + * NEWS: likewise. Upgrade version to 2.2. + +2006-04-27 Akim Demaille + + * data/glr.cc: Remove dead code. + +2006-04-25 Paul Eggert + + * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use + that variable and the line breaks the bootstrap. Problem reported + by Juan M. Guerrero. + +2006-04-24 Akim Demaille + + * doc/bison.texinfo (Multiple start-symbols): New. + +2006-04-24 Akim Demaille + + * etc/README, etc/bench.pl: New. + +2006-04-03 Akim Demaille + + * src/scan-gram.l: Be robust to BRACED_CODE appearing before any + rule. + Reported by Mickael Labau. + * tests/input.at (Torturing the Scanner): Test it. + +2006-03-16 Paul Eggert + + * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice. + Problem reported by Bob Rossi. + +2006-03-13 Paul Eggert + + * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used + and didn't really work. + For the index, use @ifnotinfo, not @iftex. + Minor cleanups of spacing and terminology. + +2006-03-12 Akim Demaille + + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition + of AT_NAME_PREFIX when %name-prefix is not used. + +2006-03-12 Akim Demaille + + Apply --prefix to C++ skeletons too: they change the namespace. + The test suite already exercize these cases. + * data/c++.m4 (b4_namespace): New. + * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'. + * data/lalr1.cc (yytnameerr_): Move its definition into the namespace. + * data/yacc.c, data/glr.c: Remove a useless `[]'. + * doc/bison.texinfo: Document it. + (Option Cross Key): Use @multitable in all formats. It looks + nicer, even in TeX outputs. + (Rules): Use the same code whatever the output type is. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS) + (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX. + * tests/calc.at: Use it, instead of hard coding `yy'. + +2006-03-10 Akim Demaille + + * TODO: Remove dead items. + +2006-03-10 Akim Demaille + + * doc/FAQ: Remove, merged into... + * doc/bison.texinfo (FAQ): this. + * doc/Makefile.am (EXTRA_DIST): Adjust. + +2006-03-10 Akim Demaille + + * data/c.m4 (b4_token_enum): Always define the enum of tokens, + even if empty. + * data/lalrl1.cc, data/glr.cc (parser::token_type): New. + * doc/bison.texinfo (Calc++ Scanner): Use it. + +2006-03-09 Paul Eggert + + Fix two nits reported by twlevo, plus one more that I discovered. + + * src/assoc.h (assoc_to_string): Give a name to the arg, as + this is the usual Bison style. + * src/location.h (location_print): Likewise. + + * src/reader.h (token_name): Likewise. + +2006-03-08 Paul Eggert + + Fix some nits reported by twlevo. + * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure" + and "POSIX". Use more-modern syntax for URLs. Mention C++ + and ask for Java. Don't hardwire OS version numbers. Add + copyright notice. + * m4/.cvsignore: Add unistd_h.m4, for latest gnulib. + * src/conflicts.c (solved_conflicts_obstack): Now static. + +2006-03-08 Joel E. Denny + + * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web + page. Say "you can use it" not "you may use it" as on the web page; + we're describing capabilities not granting permission. + +2006-03-06 Paul Eggert + + * data/glr.c (yyresolveLocations): Rename local variables to avoid + shadowing warnings. Use usual patter for iterating through RHS. + * tests/glr-regression.at + (Uninitialized location when reporting ambiguity): + Modify yylex so that it uses its argument, rather than trying + to rely on ARGSUSED (which doesn't work for gcc with warnings). + const char -> char const. + + * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind): + Don't use tabs inside commands; it messes up 'ps'. + Problem reported by twlevo. + +2006-03-06 Joel E. Denny + + * tests/glr-regression.at (Uninitialized location when reporting + ambiguity): New test case. + * data/glr.c (yyresolveLocations): New function, which uses + YYLLOC_DEFAULT. + (yyresolveValue): Invoke yyresolveLocations before reporting an + ambiguity. + * doc/bison.texinfo (Default Action for Locations): Note + YYLLOC_DEFAULT's usage for ambiguity locations. + (GLR Semantic Actions): Cross-reference those notes. + +2006-03-04 Joel E. Denny + + * tests/glr-regression.at (Leaked semantic values when reporting + ambiguity): Remove unnecessary union and type declarations. + (Leaked lookahead after nondeterministic parse syntax error): New test + case. + * data/glr.c (yyparse): Check for zero stacks remaining before + attempting to shift the lookahead so that you don't lose it. + +2006-03-02 Joel E. Denny + + Avoid memory leaks by not invoking longjmp in yyreportAmbiguity. + * tests/glr-regression.at (Leaked semantic values when reporting + ambiguity): New test case. + * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return + yyabort rather than invoking yyFail, which invokes longjmp. Remove the + now unnecessary yystackp parameter. + (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary + destructors can be called. + + * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily + in existing testcases. + +2006-03-02 Joel E. Denny + + Don't leak semantic values for parent RHS when a user action cuts the + parser, and clean up related code a bit. + * tests/glr-regression.at (Leaked merged semantic value if user action + cuts parse): Rename to... + (Leaked semantic values if user action cuts parse): ... this. Add check + for leaked parent RHS values. + * data/glr.c (yydestroyGLRState): In debugging output, distinguish + between an unresolved state (non-empty chain of semantic options) and + an incomplete one (signaled by an empty chain). + (yyresolveStates): Document the interface. Move all manipulation of a + successfully or unsuccessfully resolved yyGLRState to... + (yyresolveValue): ... here so that yyresolveValue always leaves a + yyGLRState with consistent data and thus is easier to understand. + Remove the yyvalp and yylocp parameters since they are always just + taken from the yys parameter. When reporting a discarded merged value + in debugging output, note that it is incompletely merged. Document the + interface. + (yyresolveAction): If resolving any of the RHS states fails, destroy + them all rather than leaking them. Thus, as long as user actions are + written to clean up the RHS correctly, yyresolveAction always cleans up + the RHS of a semantic option. Document the interface. + +2006-02-27 Paul Eggert + + * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that + led to a segmentation fault in GNU Pascal. Problem reported + by Waldek Hebisch. + +2006-02-21 Joel E. Denny + + * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a + mid-rule action inside a nonterminal symbol in order to declare a + destructor for its semantic value. + +2006-02-16 Paul Eggert + + * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && ! + YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined + __cplusplus && ! defined _STDLIB_H && ! + ((defined YYMALLOC || defined malloc) && (defined YYFREE || + defined free))]: Include rather than rolling our own + declarations of malloc and free, to avoid problems with + incompatible declarations (using 'throw') C++'s stdlib.h. This + should fix Debian bug 340012 + , + reported by Guillaume Melquiond. + +2006-02-13 Paul Eggert + + * NEWS: Clarify symbols versus types in unused-value warnings. + + * configure.ac (AC_INIT): Bump version number. + +2006-02-13 Paul Eggert + + * NEWS: Version 2.1a. + * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex, + since C99 requires this. + +2006-02-11 Paul Eggert + + * m4/c-working.m4: New file. + * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it. + +2006-02-10 Paul Eggert + + * Makefile.maint: Merge from coreutils. + +2006-02-09 Paul Eggert + + More portability fixes for problems summarized by Nelson H. F. Beebe. + + * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a + configuration screwup "./configure CC=/opt/SUNWspro/bin/c89 + CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC + LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this + messes up because C++ code is compiled in 32-bit mode but linked + in 64-bit mode. + +2006-02-08 Paul Eggert + + More portability fixes for problems summarized by Nelson H. F. Beebe. + + * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex + 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l. + + * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from + nodist_PROGRAMS, since we don't need to actually compile the + example if we're just doing a plain 'make'. This avoids bothering + the installer unnecessarily about problems due to weird C++ + compilers. + +2006-02-06 Paul Eggert + + More portability fixes for problems summarized by Nelson H. F. Beebe. + + * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather + than #include "...", and compile with -I'.'. The old method was + not portable, according to Posix and the C standard, and it does + not work with Sun C 5.7, where previous #line directives affect + the working directory used in later #include "..." directives. + +2006-02-06 Juan Manuel Guerrero + + Various DJGGP specific issues in /djgpp + +2006-02-02 Paul Eggert + + More portability fixes for problems summarized by Nelson H. F. Beebe. + + * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that + '#include ' works and that you can apply ++ to iterators. + +2006-02-01 Paul Eggert + + Work around portability problems summarized by Nelson H. F. Beebe in + . + + * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check + that '#include ' works. + + * data/lalr1.cc (yytranslate_): No longer inline, to work around a + porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained + "warning: sorry: semantics of inline function static data `const + unsigned char translate_table[262]' are wrong (you'll wind up with + multiple copies)". + + * lib/bbitset.h (struct bitset_vtable): Rename members not, and, + or, xor to not_, and_, or_, and xor_, respectively. This works + around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a + random system header somewhere that includes the equivalent of + . + + * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC + -E" works; it apparently doesn't work with PathScale EKO Compiler + Suite Version 2.0. + +2006-01-30 Joel E. Denny + + During deterministic GLR operation, user actions should be able to + influence the parse by changing yychar. To make this easier to fix and + to make glr.c easier to evolve in general, don't maintain yytoken in + parallel with yychar; just compute yytoken when needed. + * tests/glr-regression.at (Incorrect lookahead during deterministic + GLR): Check that setting yychar in a user action has the intended + effect. + * data/glr.c (yyGLRStack): Remove yytokenp member. + (yyclearin): Don't set *yytokenp. + (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine + yychar rather than *yytokenp to determine the current lookahead. + Compute yytoken locally when needed. + (yyparse): Likewise. Remove the local yytoken that yytokenp used to + point to. + + * doc/bison.texinfo (Bison Options): Remove stray sentence fragment + after `--report' documentation. + +2006-01-30 Paul Eggert + + * src/parse-gram.y (grammar_declaration): Location of printer + symbol is @1, not list->location. Bug reported by twlevo. + * tests/input.at (Incompatible Aliases): Adjust to above change. + +2006-01-29 Paul Eggert + + * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do + all the test at once. This makes the output easier to read in the + normal case. + + Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I + got from . The bug is that + when two actions appeared in succession, the second one was + scanned before the first one was added to the grammar rule + as a midrule action. Bison then output the incorrect warning + "parse.y:905.17-906.36: warning: unused value: $3". + * src/parse-gram.y (BRACED_CODE, action): These are no longer + associated with a value. + (rhs): Don't invoke grammar_current_rule_action_append. + (action): Invoke it here instead. + * src/reader.c (grammar_midrule_action): Now extern. + (grammar_current_rule_action_append): Don't invoke + grammar_midrule_action; that is now the scanner's job. + * src/reader.h (last_string, last_braced_code_loc): + (grammar_midrule_action): New decls. + * src/scan-gram.l (last_string): Now extern, sigh. + (last_braced_code_loc): New extern variable. + ("{"): Invoke grammar_midrule_action if the current + rule already has an action. + ("}"): Set last_braced_code_loc before returning. + * tests/input.at (AT_CHECK_UNUSED_VALUES): + Add some tests to check that the above changes fixed the bug. + +2006-01-27 Paul Eggert + + * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p. + All used changed. Check whether the symbol has a destructor, + not whether it is typed. + * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so + that the values are still reported as unused. All line numbers + adjusted. + +2006-01-23 Paul Eggert + + Work around a bug in bro 0.8, which underparenthesizes its + definition of YYLLOC_DEFAULT. + * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize + their arguments. + * data/lalr1.cc: Likewise. + * data/yacc.cc: Likewise. + +2006-01-22 Paul Eggert + + Work around a bug in Pike 7.0, and give the Pike folks a + better way to override the usual int widths. + * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the + user can override the types. + (short): #undef, to work around a bug in Pike 7.0. + (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types. + (union yyalloc.yyss): Use yytype_int16 rather than short. + All uses changed. + (yysigned_char): Remove. + * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16): + (YYTYPE_INT16): New macros, to test the new facility in yacc.c. + * tests/regression.at (Web2c Actions): Adjust to above changes. + + * src/reader.c (check_and_convert_grammar): New function. + (reader): Close the input file even if something went wrong during + parsing. Minor file descriptor leak reported by twlevo. + + * src/assoc.c (assoc_to_string): Use a default: abort (); case + to pacify gcc -Wswitch-default. + * src/scan-gram.l (adjust_location): Use a default: break; case + to pacify gcc -Wswitch-default. + * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out): + (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in): + (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy): + Move these decls to scan-skel.l, since they don't need to be + visible elsewhere. + * src/scan-skel.l: Accept the above decls. + (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31 + is used. + +2006-01-21 Paul Eggert + + * Makefile.cfg (local-checks-to-skip): Add changelog-check, + since we don't want to insist on a version number at the start + of the changelog every time. + * Makefile.maint: Sync from coreutils a bit better. + (sc_trailing_blank): Renamed from sc_trailing_space. + All uses changed. + (sc_no_if_have_config_h, sc_require_config_h): + (sc_prohibit_assert_without_use): New rules. + (sc_obsolete_symbols): Don't catch Makefile.maint itself. + (sc_dd_max_sym_length): Fix leading spaces in rule. + (sc_system_h_headers): Prefix with @. + (sc_useless_cpp_parens, m4-check): Output line numbers. + (changelog-check): Allow version only in head. + * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to + satisfy new Makefile.maint rule. + * data/glr.c: Likewise. + * data/glr.cc: Likewise. + * data/lalr1.cc: Likewise. + * data/yacc.c: Likewise. + * lib/ebitsetv.c: Likewise. + * lib/lbitset.c: Likewise. + * lib/subpipe.c: Likewise. + * lib/timevar.c: Likewise. + * src/system.h: Likewise. + * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output. + * djgpp/Makefile.maint: Add copyright notice. + * djgpp/README.in: Likewise. + * djgpp/config.bat: Likewise. + * djgpp/config.site: Likewise. + * djgpp/config_h.sed: Likewise. + * djgpp/djunpack.bat: Likewise. + * djgpp/config.sed: Fix copyright notice to match standard format. + * djgpp/subpipe.h: Likewise. + * lib/bitsetv-print.c: Likewise. + * lib/bitsetv.c: Likewise. + * lib/subpipe.h: Likewise. + * lib/timevar.c: Likewise. + * lib/timevar.h: Likewise. + * djgpp/subpipe.c: Use standard recipe for config.h. + * lib/abitset.c: Likewise. + * lib/bitset.c: Likewise. + * lib/bitset_stats.c: Likewise. + * lib/bitsetv-print.c: Likewise. + * lib/bitsetv.c: Likewise. + * lib/ebitsetv.c: Likewise. + * lib/get-errno.c: Likewise. + * lib/lbitset.c: Likewise. + * lib/subpipe.c: Likewise. + * lib/timevar.c: Likewise. + * lib/vbitset.c: Likewise. + * tests/local.at: Likewise. + * src/scan-gram.l: Don't include verify.h, since system.h does + that for us. + * .x-sc_require_config_h: New file. + * .x-sc_unmarked_diagnostics: New file. + +2006-01-20 Paul Eggert + + Be a bit more systematic about using 'abort'. + * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed. + * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp): + Put 'default: abort ();' before some other case, to satisfy older + pedantic compilers. + * lib/bitset_stats.c (bitset_stats_init): Likewise. + * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise. + * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise. + * src/conflicts.c (resolve_sr_conflict): Likewise. + * src/vcg.c (get_color_str, get_textmode_str, get_shape_str): + (get_decision_str, get_orientation_str, get_node_alignment_str): + (get_arrow_mode_str, get_crossing_type_str, get_view_str): + (get_linestyle_str, get_arrowstyle_str): Likewise. + * src/conflicts.c (resolve_sr_conflict): + Use a default case rather than one for the one remaining enum + value, to catch invalid enum values as well. + * src/lalr.c (set_goto_map, map_goto): + Prefer "assert (FOO);" to "if (!FOO) abort ();". + * src/nullable.c (nullable_compute, token_definitions_output): + Likewise. + * src/reader.c (packgram, reader): Likewise. + * src/state.c (transitions_to, state_new, state_reduction_find): + Likewise. + * src/symtab.c (symbol_user_token_number_set, symbol_make_alias): + (symbol_pack): Likewise. + * src/tables.c (conflict_row, pack_vector): Likewise. + * src/scan-skel.l (QPUTS): Remove unnecessary parens. + (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts. + * src/system.h: Don't include . + (assert): New macro. + + * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl): + (Destructor Decl, Parser Function, Pure Calling): + Describe rules for braces inside C code more carefully. + +2006-01-19 Paul Eggert + + Fix some porting glitches found by Nelson H. F. Beebe. + * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from + compilers that don't understand that abort () does not return. + * src/state.c (transitions_to): Likewise. + * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check + that '#include ' works. + * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX): + (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX): + #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901, + for the benefit of some pre-C99 compilers. + + * bootstrap: Undo changes to gnulib files that autoreconf made. + + Minor fixups to get 'make maintainer-check' to work. + * configure.ac: Don't use -Wnested-externs, as it's incompatible + with the new verify.h implementation. + * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput). + * data/glr.c (YYUSE): Depend on __GNUC__ as well. + * data/yacc.c (YYUSE): Likewise. + * data/lalr1.cc (yysyntax_error_): YYUSE (yystate). + * lib/subpipe.c (end_of_output_subpipe): The args are unused. + * src/parse-gram.y (declaration): Don't pass a string constant + to a function that expects char *, since GCC might complain + about the constant value. + * src/reader.c (symbol_typed_p): Add parens to pacify GCC. + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval + before #defining them. + * tests/glr-regression.at + (Incorrectly initialized location for empty right-hand side in GLR): + In yyerror, use the msg arg. + (Corrupted semantic options if user action cuts parse): + (Incorrect lookahead during deterministic GLR): + (Incorrect lookahead during nondeterministic GLR): + Don't name a local var 'index'; it shadows string.h's 'index'. + +2006-01-19 Akim Demaille + + * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial + location, not just parts of it. + +2006-01-18 Paul Eggert + + * NEWS: Document the fact that multiple %unions are now allowed. + * doc/bison.texinfo (Union Decl): Likewise. + * TODO: This feature is now implemented, so remove it from + the wishlist. + + * Makefile.maint: Merge with coreutils Makefile.maint. + (CVS_LIST): Use build-aux version if available. + (VERSION_REGEXP): New macro. + (syntax-check-rules): Add sc_no_if_have_config_h, + sc_prohibit_assert_without_use, sc_require_config_h, + sc_useless_cpp_parens. + (sc_obsolete_symbols): Check for O_NDELAY. + (sc_dd_max_sym_length): Track coreutils. + (sc_unmarked_diagnostics): Look in all files, not just *.c. + (sc_useless_cpp_parens): New rule. + (news-date-check): Look for version or today's date. + (changelog-check): Don't require version number near head. + (copyright-check): Use current year instead of hardwiring 2005. + (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz). + (announcement): Add --gpg-key-ID. + + * djgpp/config.sed: Add copyright notice, and replace "filesystem" + with "file system". + + Avoid undefined behavior that addressed just before the start of an + array. Problem reported by twlevo. + * src/reader.c (packgram): Prepend a new sentinel before ritem. + * src/lalr.c (build_relations): Rely on new sentinel. + * src/gram.c (gram_free): Adjust to new sentinel. + +2006-01-12 Joel E. Denny + + * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to + yylookaheadNeeds. All uses updated. + (yysplitStack): Rename local yynewLookaheadStatuses to + yynewLookaheadNeeds. + * data/glr-regression.at (Incorrect lookahead during nondeterministic + GLR): In comments, change `lookahead status' to `lookahead need'. + +2006-01-11 Paul Hilfinger + + * data/glr.c (yysplitStack): A little stylistic rewrite. + +2006-01-11 Paul Hilfinger + + * data/glr.c (yyaddDeferredAction): Flesh out the comment. + +2006-01-11 Joel E. Denny + + * doc/bison.texinfo: Fix some typos. + (GLR Semantic Actions): New subsection discussing special + considerations because GLR semantic actions might be deferred. + (Actions): Mention look-ahead usage of yylval. + (Actions and Locations): Mention look-ahead usage of yylloc. + (Special Features for Use in Actions): Add YYEOF entry and mention it + in the yychar entry. + In the yychar entry, remove mention of the local yychar case (pure + parser) since this is irrelevant information when writing semantic + actions and since it's already discussed in `Table of Symbols' where + yychar is otherwise described as an external variable. + In the yychar entry, don't call it the `current' look-ahead since it + isn't when semantic actions are deferred. + In the yychar and yyclearin entries, add note about deferred semantic + actions. + Add yylloc and yylval entries discussing look-ahead usage. + (Look-Ahead Tokens): When discussing yychar, don't call it the + `current' look-ahead, and do mention yylval and yylloc. + (Error Recovery): Cross-reference `Action Features' when mentioning + yyclearin. + (Table of Symbols): In the yychar entry, don't call it the `current' + look-ahead. + In the yylloc and yylval entries, mention look-ahead usage. + +2006-01-08 Joel E. Denny + + * tests/glr-regression.at: Update copyright year to 2006. + +2006-01-06 Joel E. Denny + + * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to + use during nondeterministic operation to track which stacks have + actually needed the current lookahead. + (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack): + Allocate, deallocate, resize, and otherwise shuffle space for + yylookaheadStatuses in parallel with yystates member of yyGLRStateSet. + (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status + appropriately during nondeterministic operation. + (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc + members to store the current lookahead to be used by the deferred + user action. + (yyaddDeferredAction): Add size_t yyk parameter specifying the stack + from which the RHS is taken. Set the lookahead members of the new + yySemanticOption according to the lookahead status for stack yyk. + (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to + yyaddDeferredAction. + (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead + members of yySemanticOption before invoking yyuserAction, and then set + them back to their current values afterward. + (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY. + (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint. + * tests/glr-regression.at: Remove `.' from the ends of recent test case + titles for consistency. + (Leaked merged semantic value if user action cuts parse): In order to + suppress lint warnings, use arguments in merge function, and assign + char value < 128 in main. + (Incorrect lookahead during deterministic GLR): New test case. + (Incorrect lookahead during nondeterministic GLR): New test case. + +2006-01-06 Joel E. Denny + + * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept + !yyvaluep as signal that no semantic value is available to print. + * data/glr.c (yydestroyGLRState): If state is not resolved, don't try + to print a semantic value. + +2006-01-06 Joel E. Denny + + * tests/glr-regression.at: For consistency with my newer test cases, + don't thank myself. + +2006-01-05 Joel E. Denny + + * data/glr.c (yyresolveValue): When merging semantic options, if at + least one user action succeeds but a later one cuts the parse, then + destroy the semantic value before returning rather than leaking it. + (yyresolveStates): If a user action cuts the parse and thus + yyresolveValue fails, ignore the (unset) semantic value rather than + corrupting the yyGLRState, and empty the semantic options list since + the user actions should have called all necessary destructors. + Simplify code with YYCHK. + * tests/glr-regression.at (Corrupted semantic options if user action + cuts parse): New test case. + (Undesirable destructors if user action cuts parse): New test case. + Before applying any of this patch, this test case never actually failed + for me... but only because the corrupted semantic options usually + masked this bug. + (Leaked merged semantic value if user action cuts parse): New test + case. + +2006-01-05 Akim Demaille + + * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/. + +2006-01-04 Paul Eggert + + * data/c.m4 (b4_c_modern): New macro, with a new provision for + _MSC_VER. Problem reported by Cenzato Marco. + (b4_c_function_def): Use it. + * data/yacc.c (YYMODERN_C): Remove. All uses replaced by + b4_c_modern. + (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather + than rolling our own. + +2006-01-04 Akim Demaille + + Also warn about non-used mid-rule values. + * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule + member. + (symbol_list_new): Adjust. + * src/reader.c (symbol_typed_p): New. + (grammar_rule_check): Use it. + (grammar_midrule_action): Bind a mid-rule LHS to its rule. + Check its rule. + * tests/input.at (AT_CHECK_UNUSED_VALUES): New. + Use it. + * tests/actions.at (Exotic Dollars): Adjust. + +2006-01-04 Akim Demaille + + * src/reader.c (grammar_midrule_action): If $$ is set in a + mid-rule, move the `used' bit to its lhs. + * tests/input.at (Unused values): New. + * tests/actions.at (Exotic Dollars): Adjust: exp is not typed. + +2006-01-03 Paul Eggert + + * doc/bison.texinfo (Bison Options): Say more accurately what + --yacc does. + * src/parse-gram.y (rules_or_grammar_declaration): Don't complain + about declarations in the grammar when in Yacc mode, as POSIX does + not require a diagnostic when the grammar uses extensions. + + * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool. + + Warn about dubious constructions like "%token T T". + Reported by twlevo. + * src/symtab.h (struct symbol.declared): New member. + * src/symtab.c (symbol_new): Initialize it to false. + (symbol_class_set): New arg DECLARING, specifying whether + this is a declaration that we want to warn about, if there + is more than one of them. All uses changed. + + * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: + Allow multiple %union directives, whose contents concatenate. + * src/parse-gram.y (grammar_declaration): Likewise. + Use muscle_code_grow, so that we don't need stype_line any more. + All uses changed. + + * src/muscle_tab.c (muscle_grow): Fix comment. + + * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc: + * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at: + Update copyright year to 2006. + +2006-01-03 Akim Demaille + + Have glr.cc pass (some of) the calc.at tests. + * data/glr.cc (b4_parse_param_orig): New. + (b4_parse_param): Improve its definition, and bound it more + clearly in the skeleton. + (b4_epilogue): Append, instead of prepending, in order to keep + #line consistency. + Simplify the generation of auxiliary functions: locations and + purity are mandated. + (b4_global_tokens_and_yystype): Honor it. + * data/location.cc (c++.m4): Don't include it. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF + and AT_SKEL_CC_IF. + * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of + AT_LALR1_CC_IF. + Be sure to initialize the first position's filename. + (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are + mandated anyway. + (AT_CHECK_CALC_GLR_CC): New. + Use it to exercise glr.cc as a lalr1.cc drop-in replacement. + +2006-01-02 Akim Demaille + + * src/output.c (output_skeleton): Don't hard wire the inclusion of + c.m4. + * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4. + * data/glr.cc: Do not include stack.hh. + +2006-01-02 Joel E. Denny + + * data/glr.c: Reformat whitespace with tabs. + (b4_lpure_formals): Remove this unused m4 macro. + * tests/cxx-type.at: Reformat whitespace with tabs. + (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo + since it's a member. Rename type to isNterm for clarity. + +2005-12-29 Akim + + Let glr.cc catch up with symbol_value_print. + * data/glr.cc (b4_yysymprint_generate): Replace by... + (b4_yy_symbol_print_generate): this. + (yy_symbol_print, yy_symbol_value_print): Declare them. + +2005-12-28 Paul Eggert + + * src/location.h (boundary): Note that a line or column equal + to INT_MAX indicates an overflow. + * src/scan-gram.l: Include verify.h. Don't include get-errno.h. + (rule_length_overflow, increment_rule_length, add_column_width): + New functions. + ({id}, "\"", "'"): + ("}"): + Use increment_rule_length rather than incrementing it by hand. + (adjust_location, handle_syncline): Diagnose overflow. + (handle_action_dollar, handle_action_at): + Fix bug with monstrosities like $-2147483648. + Remove now-unnecessary checks. + (scan_integer): Verify assumptions and remove now-unnecessary checks. + (convert_ucn_to_byte): Verify assumptions. + (handle_syncline): New arg LOC. All callers changed. + Don't store through a value derived from char const * pointer. + + * src/reader.c (grammar_rule_check): Rewrite slightly to avoid + GCC warnings. + +2005-12-27 Paul Eggert + + * src/reader.c (grammar_midrule_action, grammar_symbol_append): + Remove unnecessary forward static decls. + +2005-12-27 Akim Demaille + + * src/reader.c (grammar_current_rule_check): Also check that $$ + is used. + Take the rule to check as argument, hence rename as... + (grammar_rule_check): this. + * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end): + Rename as... + (grammar_rule_begin, grammar_rule_end): these, for consistency. + (grammar_midrule_action, grammar_symbol_append): Now static. + * tests/torture.at (input): Don't rely on the default action + being always performed. + * tests/calc.at: "Set" $$ even when the action is "cut" with + YYERROR or other. + * tests/actions.at (Exotic Dollars): Instead of using unused + values, check that the warning is issued. + +2005-12-22 Paul Eggert + + * NEWS: Improve wording for unused-value warnings. + +2005-12-22 Akim Demaille + + * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4 + (b4_yysymprint_generate): Rename as... + (b4_yy_symbol_print_generate): this. + Generate yy_symbol_print instead of yysymprint. + Generate also yy_symbol_value_print, and use it. + +2005-12-22 Akim Demaille + + * NEWS: Warn about unused values. + * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add + a `used' member. + (symbol_list_n_get, symbol_list_n_used_set): New. + (symbol_list_n_type_name_get): Use symbol_list_n_get. + * src/scan-gram.l (handle_action_dollar): Flag used symbols. + * src/reader.c (grammar_current_rule_check): Check that values are + used. + * src/symtab.c (symbol_print): Accept 0. + * tests/existing.at: Remove the type information. + Empty the actions. + Remove useless actions (beware of mid-rule actions: perl -000 + -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g'). + * tests/actions.at (Exotic Dollars): Use unused values. + * tests/calc.at: Likewise. + * tests/glr-regression.at (No users destructors if stack 0 deleted): + Likewise. + + * src/gram.c (rule_useful_p, rule_never_reduced_p): Use + rule_useful_p. + +2005-12-21 Paul Eggert + + Undo 2005-12-01 tentative license wording change. The wording is + still being reviewed by the lawyers, and we don't want to wait for + them before publishing a test release. For now, revert to the + previous wording. + * NEWS: Undo 2005-12-01 change. + * data/glr.c: Revert to previous license wording. + * data/glr.cc: Likewise. + * data/lalr1.cc: Likewise. + * data/location.cc: Likewise. + * data/yacc.c: Likewise. + + * NEWS: Reword %destructor vs YYABORT etc. + * data/glr.c: Use American spacing, for consistency. + * data/glr.cc: Likewise. + * data/lalr1.cc: Likewise. + * data/yacc.c: Likewise. + * data/yacc.c: Reformat comments slightly. + * doc/bison.texinfo: Replace "non-" with "non" when that makes sense, + for consistency. Fix some spelling errors and reword recently-included + text slightly. + * tests/cxx-type.at: Cast results of malloc, for C++. + +2005-12-21 Joel E. Denny + + * tests/cxx-type.at: Construct a tree, count the parents of shared + nodes, and free each node once and only once. Previously, the memory + for semantic values was leaked instead. + +2005-12-21 Joel E. Denny + + * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members. + (yylval, yylloc): If pure, #define to yystackp->yyval and + yystackp->yyloc similar to yychar and yynerrs. + (yyparse): If pure, remove local yylval and yylloc. Add local + yystackp to accommodate pure definitions of yylval and yylloc. + (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change + yylvalp and yyllocp to &yylval and &yylloc. + (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[] + namespace. Previously, nerrs and char were missing, but lval and lloc + weren't necessary. + (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove + yylvalp and yyllocp parameters since, if pure, these are now always + accessible through yystackp. If not pure, they are still accessible + globally. + * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to + `if (YYID (N))' to pacify lint. + +2005-12-21 Akim Demaille + + YYACCEPT, YYERROR, and YYABORT, as user actions, should not + destroy the RHS symbols of a rule. + * data/yacc.c (yylen): Initialize to 0. + Keep its value to the number of items to possibly shift. + In particular, a regular successful parse that ends on YYFINAL by + a (internal) YYACCEPT must not have yylen != 0. + (yyerrorlab, yyreturn): Pop the RHS. + Reorder a bit to emphasize the `shifting' bits of code. + (YYPOPSTACK): Now accept a number of items to pop. + * data/lalr1.cc: Likewise. + * data/glr.c: Formatting changes. + Use goto instead of fall through. + * doc/bison.texinfo (Destructor Decl): Complete. + +2005-12-20 Juan Manuel Guerrero + + * Makefile.am: DJGPP specific files added to EXTRA_DIST. + * djgpp/Makefile.maint: Fix PACKAGE variable computation. + * djgpp/config.bat: Replace every occurrence of the file name + scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with + c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS. + * djgpp/config.sed: Replace every occurrence of the file name + scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with + c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS. + * djgpp/djunpack.bat: DJGPP specific file. + * djgpp/fnchange.lst: DJGPP specific file. + * djgpp/README.in: Add new information about how to unpack the bison + source on MSDOS and other systems which have 8.3 file name restrictions + using djunpack.bat and fnchange.lst. + +2005-12-12 Paul Eggert + + * bootstrap (build_cvs_prefix): Remove; unused. + (CVS_PREFIX): Adjust to yesterday's Savannah reorganization + when getting gnulib. + +2005-12-12 "Joel E. Denny" + + * data/glr.c: Reorder typedef declarations for structs to match order + of struct declarations. + Rename yystack everywhere to yystackp except in yyparse where it's not + a pointer. + (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for + consistency. + (yyis_table_ninf): Change 0 to YYID (0) to pacify lint. + (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint. + (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify + lint. + +2005-12-09 Paul Eggert + + * tests/sets.at (Accept): Fix typos in regular expression used to + sed out the final state number. + + Work around portability problem on Solaris 10: flex-generated + files include before , which messes up + because the latter defines __EXTENSIONS__. Address the problem + by creating two new little files that include first, + then include the flex-generated files. Rewrite everyone else + to include first, as well. + * lib/timevar.c: Always include "config.h". + * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with + scan-gram-c.c, and scan-skel.l with scan-skel-c.c. + (EXTRA_bison_SOURCES): New macro. + * src/scan-gram-c.c, src/scan-skel-c.c: New files. + * src/system.h: Don't include config.h. + * src/LR0.c: Include first. + * src/assoc.c: Likewise. + * src/closure.c: Likewise. + * src/complain.c: Likewise. + * src/conflicts.c: Likewise. + * src/derives.c: Likewise. + * src/files.c: Likewise. + * src/getargs.c: Likewise. + * src/gram.c: Likewise. + * src/lalr.c: Likewise. + * src/location.c: Likewise. + * src/main.c: Likewise. + * src/muscle_tab.c: Likewise. + * src/nullable.c: Likewise. + * src/output.c: Likewise. + * src/parse-gram.y: Likewise. + * src/print.c: Likewise. + * src/print_graph.c: Likewise. + * src/reader.c: Likewise. + * src/reduce.c: Likewise. + * src/relation.c: Likewise. + * src/state.c: Likewise. + * src/symlist.c: Likewise. + * src/symtab.c: Likewise. + * src/tables.c: Likewise. + * src/uniqstr.c: Likewise. + * src/vcg.c: Likewise. + + * src/parse-gram.y: Fix minor problems uncovered by lint. + (current_lhs, current_lhs_location): Now static. + (current_assoc): Remove unused variable. + + Cleanups so that Bison-generated parsers have less lint. + * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): + Prepend /*ARGSUSED*/, for lint's sake. + * data/glr.c (YYUSE): Properly parenthesize, and use an alternate + definition if 'lint' is defined. + (YYID): New macro (or function, if lint). + All uses of /*CONSTCOND*/0 replaced by YYID(0). + * data/yacc.c: Likewise. + * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print): + (yyrecoverSyntaxError): Prepend /*ARGSUSED*/. + * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code + is C++ only. + * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only. + * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]: + Use YYID(0) rather than 0, for lint. + (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow. + (yysyntax_error): Rewrite to avoid lint warnings about parenthesization. + +2005-12-07 Paul Eggert + + * tests/glr-regression.at + (Improper handling of embedded actions and dollar(-N) in GLR parsers): + Close memory leak reported by twlevo. + +2005-12-06 "Joel E. Denny" + + * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for + all stacks. + (yyparse): Iterate another stack in order to call user destructors. + * tests/glr-regression.at (No users destructors if stack 0 deleted): + New test case. + (Duplicated user destructor for lookahead): This test now is expected + to succeed. + +2005-12-01 Paul Eggert + + * NEWS: Document the following change. + * data/yacc.c: Say "parser skeleton" rather than "file", since + it's no longer just a file. + * data/glr.c: Grant a special exception for C GLR parsers, that + reads like the already-existing exception for C LALR(1) parsers. + * data/glr.cc: Likewise. + * data/lalr1.cc: Likewise. + * data/location.cc: Likewise. + * data/yacc.c: Reword the "written by" statement to clarify that + it was the parser skeleton, not the entire output file. + * data/glr.c: Written by Paul Hilfinger. + * data/glr.cc: Written by Akim Demaille. + * data/lalr1.cc: Likewise. + +2005-11-18 Paul Eggert + + * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT): + Fix typos in previous change that broke 'make check'. + YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't + supported in C. + * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR): + Don't check NUM-STDERR-LINES, since the output format is fluctuating. + We can revert this once things settle down. + + * src/conflicts.c (conflicts_print): Don't print file name twice + when %expect fails because there were no conflicts. + * doc/bison.texinfo (Expect Decl): Tighten up wording in previous + change. + * tests/conflicts.at (%expect not enough, %expect too much): + (%expect with reduce conflicts): Adjust to new behavior. + +2005-11-18 Akim Demaille + + * src/conflicts.c (conflicts_print): Unsatisfied %expectation are + errors. + * NEWS: Document this. + * doc/bison.texinfo (Expect Decl): Likewise. + +2005-11-16 Akim Demaille + + Generalize the display of semantic values and locations in traces. + * data/glr.c (yy_reduce_print): Fix indices (again). + * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect + literal integers. + * data/lalr1.cc (yyreduce_print): Rename as... + (yy_reduce_print): this. + Display values and locations. + * data/yacc.c (yy_reduce_print): Likewise. + (YY_REDUCE_PRINT): Adjust to pass the required arguments. + (yysymprint): Move higher to be visible from yy_reduce_print). + (yyparse): Adjust. + * tests/calc.at: Adjust the expected length of the traces. + +2005-11-14 Akim Demaille + + * data/glr.c (yy_reduce_print): The loop was quite wrong: type are + from 1 to N, while values and location start at 0. + (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2. + +2005-11-14 Akim Demaille + + * data/glr.c (yy_reduce_print): Fix the $ number. + +2005-11-14 Akim Demaille + + "Use" parse parameters. + * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New. + * data/glr.c, data/glr.cc: Use them. + * data/glr.c (YYUSE): Have a C++ definition that supports + non-pointer types. + +2005-11-14 Akim Demaille + + * data/glr.c (yyexpandGLRStack): Declare only if defined. + +2005-11-14 Akim Demaille + + * data/glr.cc: New. + * data/m4sugar/m4sugar.m4 (m4_prepend): New. + +2005-11-12 Akim Demaille + + Let position and location be PODs. + * data/location.cc (position::initialize, location::initialize): New. + (position::position, location::location): Define only if + b4_location_constructors is defined. + * data/lalr1.cc (b4_location_constructors): Define it for backward + compatibility. + * doc/bison.texinfo (Initial Action Decl): Use initialize. + +2005-11-12 Akim Demaille + + * data/lalr1.cc: Move the body of the ctor and dtor into the + parser file (instead of the header). + Wrap the implementations in a "namespace yy". + +2005-11-12 Akim Demaille + + Have glr.c include its header file when created. + * data/glr.c (b4_shared_declarations): New. + Output them verbatim in the parser if !%defines, otherwise + output then in the header file, and include it instead. + +2005-11-11 Akim Demaille + + * data/glr.c: Comment changes. + +2005-11-11 Akim Demaille + + When yydebug, report semantic and location values for reductions. + * data/glr.c (yy_reduce_print): Report the semantic values and the + locations. + (YY_REDUCE_PRINT): Adjust. + (yyglrReduce): Use them. + (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations. + * data/c.m4 (b4_yysymprint_generate): Specify the const arguments. + * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction + traces. + +2005-11-10 Akim Demaille + + * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New. + (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them. + (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE. + +2005-11-09 Albert Chin-A-Young + + * m4/cxx.m4, examples/Makefile.am: Don't build + examples/calc++ if no C++ compiler is available. (trivial change) + +2005-11-09 Akim Demaille + + * src/scan-skel.l: Use a couple of asserts. + +2005-11-03 Akim Demaille + + In some (weird) cases, the final state number is incorrect. + Reported by Alexandre Duret-Lutz. + * src/LR0.c (state_list_append): Remove the computation of + final_state. + (save_reductions): Do it here. + (get_state): Alpha conversion. + (generate_states): Use a for loop. + * src/gram.h (item_number_is_rule_number) + (item_number_is_symbol_number): New. + * src/state.c: Use assert. + * src/system.h: Include assert.h. + * tests/sets.at (Accept): New. + +2005-10-30 Paul Hilfinger + + * data/glr.c (yyfill): Adjust comment. + (yyresolveAction): Initialize default location properly + for empty right-hand sides. + (yydoAction): Ditto. + Add comment explaining apparently dead code. + * tests/glr-regression.at + (Incorrectly initialized location for empty right-hand side in GLR): + New test. + +2005-10-30 Paul Eggert + + * bootstrap (cleanup_gnulib): New function. Use it to clean up + gnulib when interrupted. This fixes some race conditions and + works around some portability problems (one noted by Paul + Hilfinger). + +2005-10-22 Akim + + * Makefile.cfg: Adjust to config -> build-aux. + Reported by twledo. + +2005-10-21 Akim Demaille + + * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass + the %parse-params. + * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust. + * data/yacc.c (b4_Pure_if): Rename as... + (b4_yacc_pure_if): this. + (YY_SYMBOL_PRINT, yyparse): Adjust. + * doc/bison.texinfo: Formatting changes. + +2005-10-21 Akim Demaille + + Finish the transition config -> build-aux. + * configure.ac, Makefile.am: Use build-aux. + * config/prev-version, config/announce-gen, config/Makefile.am: + Move to... + * build-aux/prev-version, build-aux/announce-gen, + * build-aux/Makefile.am: here. + +2005-10-14 Akim Demaille + + * examples/calc++/test: Use set -x only when VERBOSE. + +2005-10-13 Paul Eggert + + * NEWS: Bison now warns if it finds a stray `$' or `@' in an action. + * src/scan-gram.l ([$@]): Implement this. + +2005-10-13 Akim Demaille + + * src/scan-skel.l: Output the base name parts of the parser and + header file names. + * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and + additional checks. + Use this to exercise C++ outputs in subdirs. + Reported by Oleg Smolsky. + +2005-10-12 Paul Eggert + + * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at + __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either. + Problem reported by John P. Hartmann. + * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has + already defined it. + +2005-10-12 Akim Demaille + + * src/parse-gram.y (version_check): Exit 63 to please missing + (stands for "version mismatch). + * tests/input.at, doc/bison.texinfo: Adjust. + +2005-10-10 Paul Eggert + + Work around portability problems with Visual Age C compiler + (xlc and xlC_r) reported by John P. Hartmann. + * data/location.cc (initial_column, initial_line): Remove. + All uses replaced by 0 and 1. + * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31 + that xlc complains about. + * src/scan-skel.l (skel_wrap): Likewise. + * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well + as __STDC__. + * data/yacc.c (YYMODERN_C): New macro, which also looks at + __STDC_VERSION__. Use it everywhere instead of looking at + __STDC__ and __cplusplus. + +2005-10-10 Akim Demaille + + * examples/calc++/test: Be quiet unless VERBOSE. + +2005-10-05 Paul Eggert + + * data/c.m4 (yydestruct, yysymprint): + Use YYUSE instead of casting to void. + * data/glr.c (YYUSE): New macro. + (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError): + Use it instead of rolling our own. + (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT): + (YYCHK1): + Use /*CONSTCOND*/ to suppress lint warnings. + * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT): + (YY_STACK_PRINT): Use 'false' not '0'. + (YYUSE): New macro. + (yysymprint_, yydestruct_): Use it instead of rolling our own. + * data/yacc.c (YYUSE): New macro. + (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT): + (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT): + (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings. + + + * data/m4sugar/m4sugar.m4 (_m4_map): New macro. + (m4_map, m4_map_sep): Use it. Handle the empty list correctly. + +2005-10-04 Paul Eggert + + Undo the parts of the unlocked-I/O change that substituted + putc or puts for printf. This might hurt performance a bit, + but some people prefer the printf style. + * data/c.m4 (yysymprint): Prefer printf to puts and putc. + * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove. + All uses replaced by YYFPRINTF and YYDPRINTF. + * data/yacc.c: Likewise. + * lib/bitset.c (bitset_print): Likewise. + * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to + putc and puts. + * lib/lbitset.c (debug_lbitset): Likewise. + * src/closure.c (print_firsts, print_fderives): Likewise. + * src/gram.c (grammar_dump): Likewise. + * src/lalr.c (look_ahead_tokens_print): Likewise. + * src/output.c (escaped_output): Likewise. + (user_actions_output): Break apart two printfs. + * src/parse-gram.y (%printer): Prefer printf to putc and puts. + * src/reduce.c (reduce_print): Likewise. + * src/state.c (state_rule_look_ahead_tokens_print): Likewise. + * src/system.h: Include unlocked-io.h rathe than stdio.h. + + * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError): + Use assignments rather than casts-to-void to suppress + unused-variable warnings. This pacifies 'lint'. + * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress + unused-variable warnings. + +2005-10-03 Juan Manuel Guerrero + + * Makefile.am: DJGPP specific files added to EXTRA_DIST. + +2005-10-02 Paul Eggert + + Use unlocked I/O for a minor performance improvement on hosts like + GNU/Linux and Solaris that support unlocked I/O. The basic idea + is to use the gnlib unlocked-io module, and to prefer putc and + puts to printf when either will work (since the latter doesn't + come in an unlocked flavor). + * bootstrap (gnulib_modules): Add unlocked-io. + * data/c.m4 (yysymprint): Prefer puts and putc to printf. + * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros. + Prefer them to YYFPRINTF and YYDPRINTF if either will do, + and similarly for puts and putc and printf. + * data/yacc.c: Likewise. + * lib/bitset.c (bitset_print): Likewise. + * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h. + * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts + to printf. + * lib/lbitset.c (debug_lbitset): Likewise. + * src/closure.c (print_firsts, print_fderives): Likewise. + * src/gram.c (grammar_dump): Likewise. + * src/lalr.c (look_ahead_tokens_print): Likewise. + * src/output.c (escaped_output): Likewise. + (user_actions_output): Coalesce two printfs. + * src/parse-gram.y (%printer): Prefer putc and puts to printf. + * src/reduce.c (reduce_print): Likewise. + * src/state.c (state_rule_look_ahead_tokens_print): Likewise. + * src/system.h: Include unlocked-io.h rather than stdio.h. + + * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as + this confuses xgettext. + +2005-10-02 Akim Demaille + + * bootstrap (gnulib_modules): Add strverscmp. + * lib/.cvsignore: Add strverscmp.c, strverscmp.h. + * m4/.cvsignore: Add strverscmp.m4. + * src/parse-gram.y (%require): New token, new rule. + (version_check): New. + * src/scan-gram.l (%require): Adjust. + * tests/input.at (AT_REQUIRE): New. + Use it. + * doc/bison.texinfo (Require Decl): New. + (Calc++ Parser): Use %require. + +2005-10-02 Akim Demaille + + * data/location.cc: New. + +2005-10-02 Paul Eggert , + Akim Demaille + + Make sure -odir/foo.cc creates dir/location.hh etc. + * src/files.h (spec_outfile, parser_file_name, spec_name_prefix) + (spec_file_prefix, spec_verbose_file, spec_graph_file) + (spec_defines_file): Now const. + (dir_prefix): New. + (short_base_name): Remove. + * src/files.c: Adjust. + (dirname.h): Include. + (base_name): Don't prototype it. + (finput): Remove, duplicates gram_in. + (full_base_name, short_base_name): Replace by... + (all_but_ext, all_but_tab_ext): these. + (compute_base_names): Rename as... + (compute_file_name_parts): this. + Update to compute the new variables, including dir_prefix. + Adjust dependencies. + * src/output.c (prepare): Output them. + * src/reader.c: Adjust to use gram_in, not finput. + * src/scan-skel.l (@dir_prefix@): New. + +2005-10-02 Juan Manuel Guerrero + + * lib/subpipe.c: New function end_of_output_subpipe() added + to allow support for non-posix systems. This is a no-op function + for posix systems. + + * lib/subpipe.h: New function end_of_output_subpipe() added + to allow support for non-posix systems. This is a no-op function + for posix systems. + + * src/output.c (output_skeleton): Use end_of_output_subpipe() to + handle the lack of pipe/fork functionality on non-posix systems. + + * djgpp/Makefile.maint: DJGPP specific file. + + * djgpp/README.in: DJGPP specific file. + + * djgpp/config.bat: DJGPP specific configuration file. + + * djgpp/config.sed: DJGPP specific configuration file. + + * djgpp/config.site: DJGPP specific configuration file. + + * djgpp/config_h.sed: DJGPP specific configuration file. + + * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c. + + * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h. + +2005-10-02 Akim Demaille + + * data/location.cc: New, extract from... + * data/lalr1.cc: here. + (location.hh): Include it after the user prologue, in case the + filename type is defined by the user. + Forward declation location and position before the pre-prologue. + (yyresult_): Rename as... + (yyresult): this, it's a local variable, not an attribute. + * data/Makefile.am (dist_pkgdata_DATA): Adjust. + +2005-10-01 Akim Demaille + + * examples/extexi: Restore the #line generation. + +2005-09-30 Akim Demaille , + Alexandre Duret-Lutz + + Move the token type and YYSTYPE in the parser class. + * data/lalr1.cc (stack.hh, location.hh): Include earlier. + (parser::token): New, from the moved free definition of tokens. + (parser::semantic_value): Now a full definition instead of an + indirection to YYSTYPE. + (b4_post_prologue): No longer included in the header file, but + in the implementation file. + * doc/bison.texi (C+ Language Interface): Update. + * src/parse-gram.y: Support unary %define. + * tests/actions.at: Define global_tokens_and_yystype for backward + compatibility until we update the tests. + * tests/calc.at: Idem. + (first_line, first_column, last_line, last_column): Define for lalr1.cc + to simplify the code. + +2005-09-29 Paul Eggert + + Port to SunOS 4.1.4, which lacks strtoul and strerror. + Ah, the good old days! Problem reported by Peter Klein. + * bootstrap (gnulib_modules): Add strerror, strtoul. + * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c + * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4. + +2005-09-29 Akim Demaille + + * data/c.m4 (b4_error_verbose_if): New. + * data/lalr1.cc: Use it. + (YYERROR_VERBOSE_IF): Remove. + (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as + parser members, replaced by... + (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse + local variables. + (yysyntax_error_): Takes the state number as argument. + (yyreduce_print_): Use the argument yyrule, not the former + attribute yyn_. + +2005-09-26 Paul Eggert + + * bootstrap (gnulib_modules): Add verify. + * lib/.cvsignore: Add verify.h. + * src/getargs.c: Use ARGMATCH_VERIFY rather than verify. + * src/system.h (verify): Remove. + Include verify.h instead. + * src/tables.c (tables_generate): Use new API for 'verify'. + +2005-09-21 Paul Eggert + + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use + local variables whose names begin with 'yy'. + * tests/calc.at (_AT_DATA_CALC_Y): Likewise. + Trivial changes from Joel E. Denny. + + * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need + it itself. + * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we + don't use alloca any more. + + * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined + __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER && + defined _ALLOCA_H]: Don't include ; not needed in this case. + * tests/torture.at (Exploding the Stack Size with Alloca): Adjust + to match yacc.c, to test more hosts. + +2005-09-20 Paul Eggert + + * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This + doesn't affect behavior. + (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for + Solaris, AIX, MSC. + (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed. + This works a bit better with glibc, if user code has already included + stdlib.h. + * doc/bison.texinfo (Bison Parser): Document that users can't + arbitrarily use malloc and free for other purposes. Document + that and might be included. + (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the + user must declare alloca. + + * HACKING (release): Forwarn the Translation Project about + stable releses. + +2005-09-20 Akim Demaille + + * data/glr.c: Use b4_token_enums, not b4_token_enums_defines. + +2005-09-19 Paul Eggert + + * data/yacc.c (YYSIZE_MAXIMUM): New macro. + (YYSTACK_ALLOC_MAXIMUM): Use it. + (yysyntax_error): New function. + (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if + multiple syntax errors are reported, and alloca is being used. + Instead, reallocate buffers twice as big each time, so that + we waste at most half the allocated memory. Start with a small + (128-byte) buffer that will suffice in most cases anyway. + Use yysyntax_error to do most of the work. + + * doc/bison.texinfo (Error Reporting, Table of Symbols): + yynerrs is the number of errors reported, not the number of + errors encountered. + + * tests/glr-regression.at (Duplicated user destructor for lookahead): + Mark it as expected to fail. + Cast result of malloc; problem reported by twlevo@xs4all.nl. + * tests/actions.at, tests/calc.at, tests/glr-regression.at: + Don't start user-code symbols with "yy", to avoid name space problems. + +2005-09-19 Akim Demaille + + Remove the traits, failed experiment. + It never proved useful, and anyway because of the current + definition, it was not possible to have several specialization of + this traits, making it useless. + * data/lalr1.cc (yy:traits): Remove. + Inline its definitions in the parser class. + +2005-09-19 Akim Demaille + + * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at + least Mac OSX with a /usr/local install of gettext. + +2005-09-19 Akim Demaille + + * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar + and yytoken for similarity with the other skeletons. + +2005-09-19 Akim Demaille + + * NEWS, configure.ac: update version number to 2.1a. + +2005-09-16 Paul Eggert + + * NEWS: Version 2.1. + + * NEWS: Remove notice of yytname change, since it was never in an + official release. + * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing + diagnostic. + * src/output.c (prepare): Likewise. + * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro. + (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE + is not defined. This is an awful hack, but it's enough for now. + All callers changed. + * tests/glr-regression-at (make_value): Args are const pointers now, + to avoid GCC warning. + (Duplicated user destructor for lookahead): New test. Currently + skipped. It fails on my host but I'm not sure it'll always fail. + +2005-09-16 Akim Demaille + + * src/symtab.h (struct symbol): Declare the printer and destructor + as const, to avoid accidental calls to free. + (symbol_destructor_set, symbol_printer_set): Adjust. + * src/symtab.c: Adjust. + +2005-09-16 Akim Demaille + + * data/c.m4 (b4_token_enums): New. + (b4_token_defines): Rename as... + (b4_token_enums_defines): this. + (b4_token_defines): New, output only the #defines. + * data/yacc.c, data/glr.c: Adjust. + * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines. + * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define + as default values. + +2005-09-16 Akim Demaille + + * data/lalr1.cc (yylex_): Remove, inline its code. + (yyreport_syntax_error_): Remove, replaced by... + (yysyntax_error_): this which returns a string and leaves to the + caller the call to the users' error function. + (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc): + Move from members of the parser object... + (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc): + to local variables of the parse function. + +2005-09-16 Akim Demaille + + * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF + since it's in Bison's name space. + +2005-09-15 Paul Eggert + + * data/glr.c (yyresolveValue): Add default case to pacify + gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl. + + * NEWS: Document when yyparse started to return 2. + * doc/bison.texinfo (Parser Function): Document when yyparse + returns 2. + + * data/lalr1.cc: Revert part of previous change, as it's incompatible. + (b4_filename_type): Renamed back from b4_file_name_type. All uses + changed. + (class position): file_name -> filename (reverting). All uses changed. + +2005-09-14 Paul Eggert + + * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't + do anything if $@ exists. This reverts part of the 2005-07-07 + patch. + +2005-09-11 Paul Eggert + + * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it + contains obsolete information and isn't worth distributing as a + separate file anyway. + * data/glr.c [defined YYSETJMP]: Don't include . + (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros. + All uses of jmp_buf, setjmp, longjmp changed to use these instead. + (yyparse): Abort if user code uses longjmp to throw an unexpected + value. + +2005-09-09 Paul Eggert + + * data/c.m4 (b4_identification): Define YYBISON_VERSION. + Suggested by twlevo@xs4all.nl. + + * data/glr.c (YYCHK1): Do not assume YYE is in range. + This avoids a diagnostic from gcc -Wswitch-enum. + Problem reported by twlevo@xs4all.nl. + + * doc/bison.texinfo: Don't use "filename", as per GNU coding + standards. Use "file name" or "file" or "name", depending on + the context. + (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c, + not to hack/foo.tab.c. + (Calc++ Top Level): 2nd arg of main is not const. + * data/glr.c: b4_filename -> b4_file_name. + * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type. + All uses changed. + (class position): filename -> file_name. All uses changed. + * data/yacc.c: b4_filename -> b4_file_name. + * lib/bitset.h: filename -> file_name in local vars. + * lib/bitset_stats.c: Likewise. + * src/files.c: Likewise. + * src/scan-skel.l ("@output ".*\n): Likewise. + * src/files.c (file_name_split): Renamed from filename_split. + * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename. + +2005-09-08 Paul Eggert + + * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h, + to accommodate latest gnulib. + + * tests/glr-regression.at (Duplicate representation of merged trees): + Add casts to pacify g++. Problem reported by twlevo@xs4all.nl. + + * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is + needed. + +2005-08-26 Paul Eggert + + * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem. + All uses changed. Invoke user destructor after an error during a + split parse (trivial change from Joel E. Denny). + + * tests/glr-regression.at + (User destructor after an error during a split parse): New test case. + Problem reported by Joel E. Denny in: + http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html + +2005-08-25 Paul Eggert + + * README-cvs: Give URLs for recommended tools. + Mention Gzip version problem, and bootstrapping issues. + Remove troubleshooting section, as it's somewhat obsolete. + + * bootstrap (no_cache): New var, to accommodate different wget + variants. Use it instead of '-C off'. Problem reported by + twlevo@xs4all.nl. + + * data/glr.c (yydestroyStackItem): New function. + (yyrecoverSyntaxError, yyreturn): Use it to improve quality of + debugging information. Problem reported by Joel E. Denny. + +2005-08-25 Akim Demaille + + * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too. + +2005-08-24 Paul Eggert + + * data/glr.c (yyrecoverSyntaxError, yyreturn): + Don't invoke destructor on unresolved entries. + * tests/glr-regression.at + (User destructor for unresolved GLR semantic value): New test case. + Problem reported by Joel E. Denny in: + http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html + +2005-08-21 Paul Eggert + + * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c. + Add strnlen.c. + * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4, + lib-prefix.m4, po.m4. + + * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:" + in yydestruct diagnostic, since it might not be an error. + Problem reported by Joel Denny near end of + . + * data/lalr1.cc (yyerturn): Likewise. + * data/yacc.c (yyreturn): Likewise. + * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change. + + * src/files.c: Remove obsolete FIXME comment. + + * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency + with the other templates, and to fix bogus run-on messages such + as the one reported at the end of + . + All callers changed to avoid the newline. + (yyprocessOneStack): Output two lines rather than one, to accommodate + the above change. This changes the debug output format slightly. + + * data/glr.c (yyresolveValue): Fix redundant parse tree problem + reported by Joel E. Denny in + + (trivial change). + * tests/glr-regression.at (Duplicate representation of merged trees): + New test, from Joel E. Denny in: + . + * THANKS: Add Joel E. Denny. + + * configure.ac (AC_INIT): Bump to 2.0c. + +2005-07-24 Paul Eggert + + * NEWS: Version 2.0b. + + * Makefile.am (SUBDIRS): Put examples before tests, so that + "make check" doesn't finish with "All 1 tests passed". + + * tests/regression.at (Token definitions): Don't rely on + AT_PARSER_CHECK for data that contains backslashes. It currently + uses 'echo', and 'echo' isn't portable if its argument contains + backslashes. Problem found on OpenBSD 3.4. Also, do not assume + that the byte '\0xff' is not printable in the C locale; it is, + under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are + not printable, so use '\0x81' to test. + + * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent + version of GCC, since the macro is used with non-GCC compilers. + + Fix core dump reported by Pablo De Napoli in + . + * tests/regression.at (Invalid inputs with {}): New test. + * src/parse-gram.y (token_name): Translate type before using + it as an index. + + * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on + the user's name space. All uses changed to __attribute__ + ((__unused__)). + (yyFail, yyMemoryExhausted, yyreportAmbiguity): + Add __attribute__ ((__noreturn__)). + + * etc/clcommit: Remove. We weren't using it, and it failed + "make maintainer-distcheck". + * Makefile.maint: Merge from coreutils. + (CVS_LIST, CVS_LIST_EXCEPT): New macros. + (syntax-check-rules): Change list of rules as described below. + (sc_cast_of_alloca_return_value, sc_dd_max_sym_length): + (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof): + (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope): + (sc_trailing_space): New rules. + (sc_xalloc_h_in_src): Remove. + (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value): + (sc_space_tab, sc_error_exit_success, sc_changelog): + (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics): + (makefile-check, po-check, author_mark_check): + (makefile_path_separator_check, copyright-check): + Use grep -n, to make it easier to find violations. + Use CVS_LIST and CVS_LIST_EXCEPT. + (header_regexp, h_re): Remove. + (dd_c): New macro. + (sc_dd_max_sym_length, .re-list, news-date-check): New rules. + (my-distcheck): Use more-modern GCC flags. + (signatures, %.asc): Remove. + (rel-files, announcement): Remove signatures. + Restore old updating code, even though we don't use it, so + that we're the same as coreutils. + (alpha, beta, major): Depend on news-date-check. + Make the upload commands. + + * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space. + * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise. + * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise. + * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise. + * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise. + * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise. + * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise. + * tests/sets.at: Likewise. + + * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that + we comment out the Autoconf version number. + * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as + it's error-prone and "make maintainer-distcheck" rejects it. + + * lib/subpipe.c: Include without checking for HAVE_FCNTL_H. + Indent calls to "error" to pacify "make maintainer-distcheck", + when the calls are not intended to be translated. + * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h. + + * src/Makefile.am (DEFS): Use +=, to pacify + "make maintainer-distcheck". + (bison_SOURCES): Add scan-skel.h. + (sc_tight_scope): New rule, from coreutils. + + * src/files.c (src_extension, header_extension): + Now static, not extern. + * src/getargs.c (short_options): Likewise. + * src/muscle_tab.c (muscle_table): Likewise. + * src/parse-gram.y (current_class, current_type, current_prec): + Likewise. + * src/reader.c (grammar_end, previous_rule_end): Likewise. + * src/getargs.h: Redo comments to pacify "make maintainer-distcheck". + * src/main.c (main): Cast bindtextdomain and textdomain calls to + void, to avoid warning when NLS is disabled. + * src/output.c: Include scan-skel.h. + (scan_skel): Remove decl, since scan-skel.h does this. + (output_skeleton): + Indent calls to "error" to pacify "make maintainer-distcheck". + * src/print_graph.c: Don't include , as system.h does this. + * src/reader.h (gram_end, gram_lineno): New decls to pacify + "make maintainer-distcheck". + * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in): + (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno): + (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug): + (skel_lex_destroy, scan_skel): Move these decls to... + * src/scan-skel.h: New file. + * src/uniqstr.c (uniqstr_assert): + Indent calls to "error" to pacify "make maintainer-distcheck". + + * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR), + not @VAR@. + + * tests/torture.at: Revamp to avoid misuse of atoi that + "make maintainer-distcheck" complained about. + + * examples/extexi (message): Don't print a message more than once, + and omit line-number decoration that makes Emacs compile think + that informative messages are worth worrying about. + +2005-07-22 Paul Eggert + + * configure.ac: Update version number. + + * Makefile.am (SUBDIRS): Add examples; somehow this got removed + accidentally. + * examples/calc++/calc++-parser.yy: Remove from CVS, as it's + autogenerated by the maintainer. + * examples/calc++/.cvsignore: Add *.yy. + + * lib/bitset.c (bitset_alloc): Don't cast xcalloc result. + * lib/bitset_stats.c (bitset_stats_init): Likewise. + * lib/bitsetv.c (bitsetv_alloc): Likewise. + + * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c. + + * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint + from maintainer-distcheck about casting the argument of 'free'. + + * NEWS: Mention recent yytname changes. + * THANKS: Add Anthony Heading, twlevo@xs4all.nl. + + * bootstrap: For translations that have not yet been upgraded to + the new runtime-po domain, prime the pump by extracting the + relevant strings from the obsolete translations. This code can be + removed once the bison-runtime domain has been translated by each + team. + + * src/scan-gram.l (.): Don't double-quote token names, + now that token names are already quoted. + + Fix problem reported by Anthony Heading. + * data/glr.c (YYTOKEN_TABLE): New macro. + (yytname): Define if YYTOKEN_TABLE. + * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise. + * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise. + (YYERROR_VERBOSE): Define the same way the other skeletons do. + * src/output.c (prepare_symbols): Output token_table_flag. + +2005-07-21 Paul Eggert + + * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc + again if the first call fails. + + * data/glr.c (yytnamerr): New function. + (yyreportSyntaxError): Use it to dequote most string literals. + * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility + with other skeletons. All uses changed. + (yytnameerr_): New function. + (yyreport_syntax_error): Use it to dequote most string literals. + * data/yacc.c (yytnamerr): New function. + (yyerrlab): Use it to decode most string literals. + * doc/bison.texinfo (Decl Summary, Calling Convention): + Clarify quoting convention of yytname. + * src/output.c (prepare_symbols): Quote all names. This undoes + the 2005-04-17 change, which is now accomplished (mostly) via + changes in the parsers as described above. + * tests/regression.at (Token definitions, Web2c Actions): + Undo most 2005-04-17 change here, too. + +2005-07-20 Paul Eggert + + Fix more problems reported by twlevo@xs4all.nl. + * tests/cxx-type.at: Don't pipe output of ./types through sed to + remove trailing spaces. This loses the exit status of ./types, + and isn't needed since ./types shouldn't be emitting trailing + spaces. + * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed, + as the stack isn't valid in that case. + + * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out): + (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in): + (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy): + Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31 + is used. + * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out): + (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in): + (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy): + Likewise. + + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with + overly-picky compilers that reject 'char *foo = "bar";'. + + * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output + to FILE * parameter, not to stderr. This fixes a typo introduced + in the 2005-07-12 change. + + * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid + warnings from GCC 4. + + * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack): + (yyglrShiftDefer, yysplitStack): + Remove unused parameters b4_pure_formals. All uses changed. + (yyglrShift): Remove unused parameters b4_user_formals. + All uses changed. + (yyglrReduce): Removed unused parameter yylocp. All uses changed. + +2005-07-18 Paul Eggert + + Destructor cleanups and regularization among the three skeletons. + * NEWS: Document the behavior changes. + * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the + stack before failing, as the cleanup code will do it for us now. + * data/lalr1.cc (yyerrlab): Likewise. + * data/glr.c (yyparse): Pop everything off the stack before + freeing it, so that destructors get called properly. + * data/lalr1.cc (yyreturn): Likewise. + * data/yacc.c (yyreturn): Pop and destroy the start symbol, too. + This is more consistent. + * doc/bison.texinfo (Destructor Decl): Mention more reasons + why destructors might be called. 1.875 -> 2.1. + (Destructor Decl, Decl Summary, Table of Symbols): + Some English-language cleanups for %destructor. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): + Add output line for destructor of start symbol. + * tests/calc.at (AT_CHECK_CALC): Add one to line counts, + because of that same extra output line. + + * NEWS: Document minor wording changes in diagnostics of + Bison-generated parsers. + * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow. + Remove unused formals. All uses changed. + (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous". + (yyparse): Rename yyoverflowlab to yyexhaustedlab. + * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted". + Rename yyoverflowab to yyexhaustedlab. + When memory exhaustion occurs during syntax-error reporting, + report it separately rather than in a single diagnostic; this + eases translation. + * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow. + (Memory Exhausted): Renamed from Parser Stack Overflow. + Revamp wording slightly to prefer "memory exhaustion". + * tests/actions.at: "parser stack overflow" -> "memory exhausted". + + * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf. + + Add i18n support to the GLR skeleton. Partially fix the C++ + skeleton; a C++ expert needs to finish this. Remove debugging + msgids; there's little point to having them translated, since they + can be understood only by someone who can read the + (English-language) source code. + + Generate runtime-po/bison-runtime.pot automatically, so that we + don't have to worry about garbage getting in that file. We'll + make sure after the next official release that old msgids don't + get lost. See + . + + * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove. + Now auto-generated. + * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet. + Fix typos in explanations of the runtime file. + * bootstrap: Change gettext keyword from YYI18N to YY_. + Use standard Makefile.in.in in runtime-po, since we'll arrange + for backward-compatible bison-runtime.po files in a different way. + * data/glr.c (YY_): New macro, from yacc.c. + (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse): + Translate messages intended for users. + (yyreportSyntaxError): Change "virtual memory" to "memory" to match + the wording in the other skeletons. We don't know that the memory + is virtual. + * data/lalr1.cc (YY_): Renamed from _. All uses changed. + Use same method that yacc.c uses. + Don't translate debugging messages. + (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff; + it doesn't work (yet), and requires C++ expertise to fix. + * data/yacc.c (YY_): Renamed from YY18N. All uses changed. + Move defn to a more logical place, to be consistent with other + skeletons. + Don't translate debugging messages. + Don't assume line numbers fit in unsigned int; use unsigned long fmts. + * doc/bison.texinfo: Mention . Change glibc cross reference + to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS. + * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc. + + Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl. + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return + void, not int. + * tests/glr-regression.at (Badly Collapsed GLR States): + Likewise. + (Improper handling of embedded actions and dollar(-N) in GLR parsers): + yylex should return 0 at EOF rather than aborting. + + Improve tests for stack overflow in GLR parser. + Problem reported by twlevo@xs4all.nl. + * data/glr.c (struct yyGLRStack): Remove yyerrflag member. + All uses removed. + (yyStackOverflow): Just longjmp, but with value 2 so that caller + can handle the problem. + (YYCHK1): Use goto (a la yacc.c) rather than setting a flag. + (yyparse): New local variable yyresult to record the result. + Use result of setjmp to set it, rather than storing itinto + struct. + (yyDone): Remove label. + (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels, + to mimic yacc.c. Do not discard lookahead if it's EOF (possible + if YYABORT is used). + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with + yyparse status; put status > 1 into diagnostic. + Check that status==2 works. + * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at: + Use exit status 3 for failure to open (which shouldn't happen). + +2005-07-17 Paul Eggert + + * tests/conflicts.at (%nonassoc and eof): Don't exit with status + 1 on syntax error; just let yyparse do its thing. + * tests/glr-regression.at (Badly Collapsed GLR States): Likewise. + * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise. + (Exploding the Stack Size with Alloca): + (Exploding the Stack Size with Malloc): + Expect exit status 2, not 1, since the parser is supposed to blow + its stack. Problem reported by twlevo@xs4all.nl. + + * data/glr.c (yyparse): Don't assume that the initial calls + to YYMALLOC succeed; in that case, yyparse incorrectly returned 0. + Print a stack-overflow message and fail instead. + Initialize the line-number information before creating the stack, + so that the stack-overflow message can report line zero safely. + +2005-07-14 Paul Eggert + + Fix problems reported by twlevo@xs4all.nl. + * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined. + (yyuserMerge): Provide a default case if b4_mergers is empty. + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE. + * tests/glr-regression.at + (Improper handling of embedded actions and dollar(-N) in GLR parsers): + Add casts to pacify C++ compilers. + * tests/glr-regression.at (Improper merging of GLR delayed action + sets): Declare yylex before using it. + * tests/Makefile.am (maintainer-check-g++): Fix a stray + $(GXX) that escaped the renaming of GXX to CXX. Remove bogus + test for valgrind; valgrind is independent of g++. + (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check + for compatibility with POSIX 1003.1-2001 (if running coreutils). + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++. + Use a destructor, so that we can expand the stack. Change + YYSTYPE to char * so that we can free it. Cast result of malloc. + +2005-07-13 Paul Hilfinger + + * data/glr.c (yyuserAction): Fix uninitialized variable that caused + a valgrind failure. Problem reported by twlevo@xs4all.nl. + +2005-07-13 Paul Eggert + + * PACKAGING: New file, suggested by Bruno Haible and taken from + similar wording in gettext's PACKAGING file. + * NEWS: Mention PACKAGING. + * Makefile.am (EXTRA_DIST): Add PACKAGING. + +2005-07-12 Paul Eggert + + * NEWS: Document recent i18n improvements. + * bootstrap: Get runtime translations into runtime-po. + Create runtime-po files automatically, if possible. + * configure.ac: Invoke BISON_I18N, so that we eat our own dog food. + * data/yacc.c: Rewrite inclusion of so that ENABLE_NLS + does not infringe on the user's name space. + (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS. + * doc/bison.texinfo (Internationalization): Revamp the English + and Texinfo syntax a bit, to try to make it clearer. + (Bison Options, Option Cross Key): Mention --print-localedir. + * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to + YYENABLE_NLS. Quote a bit more. + * runtime-po/.cvsignore: New file. + * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot. + * runtime-po/Rules-quot: Remove; now created by bootstrap. + * runtime-po/quot.sed: Likewise. + * runtime-po/boldquot.sed: Likewise. + * runtime-po/en@quot.header: Likewise. + * runtime-po/en@boldquot.header: Likewise. + * runtime-po/insert-header.sin: Likewise. + * runtime-po/remove-potcdate.sin: Likewise. + * runtime-po/Makevars: Likewise. + * runtime-po/LINGUAS: Likewise. + * runtime-po/de.po: Likewise; we will rely on the translation project + to maintain this, so "bootstrap" should get it. + * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine + its value. + * src/main.c (main): Bind the bison-runtime domain, too. + +2005-07-12 Bruno Haible + + * data/yacc.c: Include when NLS is enabled. + (YYI18N): Renamed from _. Use dgettext when NLS is enabled. + * po/POTFILES.in: Remove autogenerated file src/parse-gram.c. + * runtime-po: New directory. + * runtime-po/Makefile.in.in: New file, copied from po/, with modified + $(DOMAIN).pot-update rule, so that old messages are never dropped. + * runtime-po/Rules-quot: New file, copied from po/. + * runtime-po/quot.sed: Likewise. + * runtime-po/boldquot.sed: Likewise. + * runtime-po/en@quot.header: Likewise. + * runtime-po/en@boldquot.header: Likewise. + * runtime-po/insert-header.sin: Likewise. + * runtime-po/remove-potcdate.sin: Likewise. + * runtime-po/Makevars: New file. + * runtime-po/POTFILES.in: New file. + * runtime-po/LINGUAS: New file. + * runtime-po/bison-runtime.pot: New file. + * runtime-po/de.po: New file. + * m4/bison.m4: New file. + * Makefile.am (SUBDIRS): Add runtime-po. + (aclocaldir, aclocal_DATA): New variables. + * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in. + Define aclocaldir. + * src/getargs.c (usage): Document --print-localedir option. + (PRINT_LOCALEDIR_OPTION): New enum item. + (long_options): Add --print-localedir option. + (getargs): Handle --print-localedir option. + * doc/bison.texinfo (Bison Parser): Remove paragraph about _(). + (Internationalization): New section. + +2005-07-12 Akim Demaille + + * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments, + for consistency with the rest of the code. + * src/symlist.h, src/symlist.c (symbol_list_print): Ditto. + Add separators. + +2005-07-12 Akim Demaille + + * src/parse-gram.y: Use %printer instead of YYPRINT. + +2005-07-12 Akim Demaille + + * src/symtab.h, src/symtab.c (symbol_print): New. + * src/symlist.h, src/symlist.c (symbol_list_print): New. + * src/symlist.c (symbol_list_n_type_name_get): Report the culprit. + +2005-07-12 Akim Demaille + + * data/glr.c (b4_syncline): Fix (swap) the definitions of + b4_at_dollar and b4_dollar_dollar. + +2005-07-11 Paul Eggert + + * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer + and Pennello's paper. + +2005-07-09 Paul Eggert + + * data/yacc.c (yyparse): Undo previous patch. Instead, + set yylsp[0] and yyvsp[0] only if the initial action + sets yylloc and yylval, respectively. + + * data/yacc.c (yyparse): In the initial action, set + yylsp[0] and yyvsp[0] rather than yylloc and yylval. + This avoids the use of undefined variables if the initial + action does not set yylloc and/or yylval. + +2005-07-07 Paul Eggert + + * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh: + * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc: + Remove from CVS. These files are automatically generated. + * examples/extexi: Clarify that this file is now part of Bison, + not GNU M4, and that it works with any POSIX-compatible Awk. + * examples/calc++/Makefile.am (run_extexi): Remove; not used. + ($(calc_extracted)): Renamed from $(calc_sources_extracted), + so that we also get calc++-parser.yy. Geneate it. + Use $(AWK), not gawk, since any conforming Awk will do. + Put comment before action, since older 'make' can't handle comment + in action. + $(BUILT_SOURCES): List all built sources, not just some of them. + $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources. + $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT. + $($(calc_sources_generated)): Remove unnecessary test for existence + of target. (This had a shell syntax error anyway; a stray "x".) + (calc_extracted): List $(srcdir)/calc++-parser.yy, not + calc++-parser.yy. + * examples/.cvsignore, examples/calc++/.cvsignore: New files. + + * bootstrap (gnulib_modules): Add gettext, now that it's no longer + implied by the other modules. + +2005-07-06 Akim Demaille + + Bind examples/calc++ to the package. + * examples/calc++/Makefile: Remove, replaced by... + * examples/calc++/Makefile.am: ... this new file. + * examples/calc++/test: Remove input. + * examples/calc++/compile: Remove. + * examples/Makefile.am: New. + * configure.ac, Makefile.am: Adjust. + * doc/Makefile.am (clean-local): New, for more recent texi2dvis. + +2005-07-05 Paul Eggert + + * data/glr.c (yyFail): Drastically simplify; since the format argument + never had any % directives, we can simply pass it to yyerror. + (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will + be modified later, as that is the usual style in glr.c. + Problems reported by Paul Hilfinger. + + Rewrite GLR parser to catch more buffer overrun, storage exhaustion, + and size overflow errors. + * data/glr.c: Include etc. after user prolog, not before, + in case the user prolog sets feature-test macros like _GNU_SOURCE. + (YYSIZEMAX): New macro. + (yystpcpy): New function, taken from yacc.c. + (struct yyGLRStack.yyspaceLeft): Now size_t, not int. + (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls, + so that we don't have to maintain their signatures. + (yyFail): Check for buffer overflow, by using vsnprintf rather + than vsprintf. Allocate a bigger buffer if possible. + Report an error if buffer allocation fails. + (yyStackOverflow): New function. + (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether + the initialization was successful. It might fail if storage was + exhausted. + (yyexpandGLRStack): Add more checks for storage allocation failure. + Use yyStackOverflow to report failures. + (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction): + (yysplitStack, yyprocessOneStack, yyparse, yypstack): + Don't assume stack number fits in int. + (yysplitStack): Check for storage allocation failure. + (yysplitStack, yyprocessOneStack): Add pure_formals, so that we + can print diagnostics on storage allocation failure. All callers + changed. + (yyresolveValue): Use yybool for boolean. + (yyreportSyntaxError): Check for size-calculation overflow. + This code is taken from yacc.c. + (yyparse): Check for storage allocation errors when allocating + the initial stack. + +2005-07-05 Akim Demaille + + Extract calc++ from the documentation. + * doc/bison.texinfo (Calc++): Add the extraction marks. + * examples/extexi: New, from the aborted GNU Programming 2E. + Separate the different paragraph of a file with empty lines. + * examples/Makefile: Use it to extract the whole calc++ example. + +2005-06-24 Akim Demaille + + * doc/bison.texinfo (C++ Parser Interface): Use defcv to define + class typedefs. + +2005-06-22 Akim Demaille + + * doc/bison.texinfo (C++ Language Interface): First stab. + (C++ Parsers): Remove. + +2005-06-22 Akim Demaille + + * data/lalr1.cc (yylex_): Honor %lex-param. + +2005-06-22 Akim Demaille + + Start a set of simple examples. + * examples/calc++/Makefile, examples/calc++/calc++-driver.cc, + * examples/calc++/calc++-driver.hh, + * examples/calc++/calc++-parser.yy, + * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc, + * examples/calc++/compile, examples/calc++/test: New. + +2005-06-09 Paul Eggert + + * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside + extern "C" {}. This fixes a problem reported by Paul Hilfinger, + which stems from the 2005-05-27 patch. + +2005-06-06 Paul Hilfinger + + * data/glr.c: Modify treatment of unused parameters to permit use + of g++ (which doesn't allow __attribute__ ((unused)) for parameters). + +2005-05-30 Paul Eggert + + Fix infringement on user name space reported by Janos Zoltan Szabo. + * data/yacc.c (yyparse): strlen -> yystrlen. + +2005-05-30 Akim Demaille + + * data/lalr1.cc (_): New. + Translate the various messages. + +2005-05-27 Paul Eggert + + Fix infringement on user name space reported by Bruno Haible. + * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it. + Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on + the user's name space. + (alloca): Include to get it, if it's not built in. + (YYMALLOC, YYFREE): Define only if needed. + (malloc, free): Declare, but only if needed, as this infringes on + the user name space. + +2005-05-25 Paul Eggert + + Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible. + * lib/bitset.c (bitset_print): Don't assume size_t can be printed + with %d format. + * lib/ebitset.c (min, max): Undef before defining. + * lib/vbitset.c (min, max): Likewise. + * lib/subpipe.c (create_subpipe): Save local variables in case + vfork clobbers them. + +2005-05-24 Bruno Haible + + * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the + error message syntax used by gcc-4.0. + +2005-05-23 Paul Eggert + + * README: Mention m4 1.4.3. Remove obsolete advice about + Sun Forte Developer 6 update 2, VMS, and MS-DOS. + + * bootstrap: Remove workaround for problem I encountered with + gettext 0.14.1; it seems to be fixed now. + +2005-05-22 Paul Eggert + + * NEWS: Version 2.0a. + + * src/files.c: Include "stdio-safer.h"; this fixes a typo in + the previous change. + + Various maintainer cleanups. + * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*, + conftest*, for benefit of CVS commands run at the same time as + "configure". Add build-aux, since "bootstrap" now creates it and + its subfiles. + * Makefile.cfg (move_if_change): Remove. + * Makefile.maint: Remove the update stuff; we now use "bootstrap". + (ftp-gnu, www-gnu, move_if_change, local_updates, update): + (po_repo, do-po-update, po-update, wget_files, get-targets): + (config.guess-url_prefix, config.sub-url_prefix): + (ansi2knr.c-url_prefix, texinfo.tex-url_prefix): + (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url): + ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update): + Remove. + * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux; + this is now the recommended name. + * config/.cvsignore: Remove config.guess, config.rpath, config.sub, + depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex, + ylwrap. These files now go into build-aux. + * config/move-if-change: Remove. + * config/prev-version.txt: Bump from 1.75 to 2.0. + + * bootstrap: Add stdio-safer, unistd-safer modules. + Remove m4/glibc2.m4 (introduced by latest gnulib, but + we don't need it). + * lib/.cvsignore: Add dup-safer.c, fd-safer.c, + fopen-safer.c, stdio-safer.h, unistd-safer.h. + * lib/subpipe.c: Include "unistd-safer.h". + (create_subpipe): Make sure all the newly-created + file descriptors are > 2, so that diagnostics don't + get sent down them (which might cause Bison to hang, in theory). + * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4. + * src/files.c (xfopen): Use fopen_safer, not fopen. + + * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port + yesterday's yacc.c fix. + +2005-05-21 Paul Eggert + + * data/glr.c, data/lalr1.cc: Update copyright date. + + Fix a destructor bug reported by Wolfgang Spraul in + . + * data/yacc.c (yyabortlab): Don't call destructor, and + don't set yychar to EMPTY. + (yyoverflowlab): Don't call destructor. + (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY. + * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines, + since we no longer output the message "discarding lookahead token + end of input ()". + +2005-05-20 Paul Hilfinger + + * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to + fix a small glitch in debugging output. + (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline + after YY_SYMBOL_PRINT where needed. + + (struct yyGLRState): Add some comments. + (struct yySemanticOption): Add some comments. + (union yyGLRStackItem): Add comment. + + (yymergeOptionSets): Correct this to properly perform the union, + avoiding infinite reported by Michael Rosien. + Update comment. + + * tests/glr-regression.at: Add test for GLR merging error reported + by M. Rosien. + +2005-05-13 Paul Eggert + + * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am, + Makefile.cfg, Makefile.maint, NEWS, README, README-alpha, + README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am, + data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c, + data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo, + doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am, + lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c, + lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h, + lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c, + lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c, + lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h, + lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c, + lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h, + lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4, + m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c, + src/assoc.h, src/closure.c, src/closure.h, src/complain.c, + src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c, + src/derives.h, src/files.c, src/files.h, src/getargs.c, + src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h, + src/location.c, src/location.h, src/main.c, src/muscle_tab.c, + src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c, + src/output.h, src/parse-gram.c, src/parse-gram.h, + src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c, + src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c, + src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l, + src/scan-skel.l, src/state.c, src/state.h, src/symlist.c, + src/symlist.h, src/symtab.c, src/symtab.h, src/system.h, + src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h, + src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am, + tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at, + tests/cxx-type.at, tests/existing.at, tests/glr-regression.at, + tests/headers.at, tests/input.at, tests/local.at, tests/output.at, + tests/reduce.at, tests/regression.at, tests/sets.at, + tests/synclines.at, tests/testsuite.at, tests/torture.at: + Update FSF postal mail address. + +2005-05-11 Paul Eggert + + * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does. + Problem reported by Ralf Menzel. + +2005-05-01 Paul Eggert + + * tests/actions.at: Test that stack overflow invokes destructors. + From Marcus Holland-Moritz. + * data/yacc.c (yyerrlab): Move the code that destroys the stack + from here.... + (yyreturn): to here. That way, destructors are called properly + even if the stack overflows, or the user calls YYACCEPT or + YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz. + (yyoverflowlab): Destroy the lookahead. + +2005-04-24 Paul Eggert + + * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment. + +2005-04-17 Paul Eggert + + * NEWS: Bison-generated C parsers no longer quote literal strings + associated with tokens. + * src/output.c (prepare_symbols): Don't escape strings, + since users don't want to see C escapes. + * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes + in diagnostics. + * tests/input.at (Torturing the Scanner): Likewise. + * tests/regression.at (Token definitions, Web2c Actions): Likewise. + +2005-04-16 Paul Eggert + + * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if + the data size is known to be too small and we can't increase it. + This works around an HP-UX 11.00 glitch reported by Andrew Benham. + +2005-04-15 Paul Eggert + + * src/parse-gram.y: Include quotearg.h. + (string_as_id): Quote $1 before using it as a key, since the + lexer no longer quotes it for us. + (string_content): Don't strip quotes, since lexer no longer + quotes it for us. + * src/scan-gram.l: Include quotearg.h. + ("\""): Omit quote. + ("'"): Quote symbol before using it as + a key, since the rest of the lexer doesn't quote it. + * src/symtab.c (symbol_get): Don't quote symbol; caller does it now. + * tests/regression.at (Token definitions): Check for backslashes + in token strings. + + * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro. + (YYSIZE_T): Define to unsigned long int when using an older compiler. + (yyparse): Revamp code to generate long syntax error message, to + make it easier to translate, and to avoid problems with arithmetic + overflow. Change "virtual memory" to "memory" in diagnostic, since + we don't know whether the memory is virtual. + +2005-04-13 Paul Eggert + + * NEWS: Bison-generated C parsers now use the _ macro to + translate strings. + * data/yacc.c (_) [!defined _]: New macro. + All English strings wrapped inside this macro. + * doc/bison.texinfo (Bison Parser): Document _. + * po/POTFILES.in: Include src/parse-gram.c, since it now + includes translateable strings that parse-gram.y doesn't. + +2005-04-12 Paul Eggert + + * src/symtab.c (symbol_make_alias): Call symbol_type_set, + reverting the 2004-10-11 change to this function. + (symbol_check_alias_consistency): Don't call symbol_type_set + if the type name is already correct. + * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder. + +2005-03-25 Paul Eggert + + * tests/regression.at (Token definitions): Don't use a token named + c, as that generates a "#define c ..." that runs afoul of buggy + stdlib.h that uses the identifier c as a member of struct + drand48_data. Problem reported by Horst Wente. + +2005-03-21 Paul Eggert + + * bootstrap: Change translation URL from + http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to + http://www.iro.umontreal.ca/translation/maint/bison/ to avoid + redirection glitches. Problem reported by twlevo@xs4all.nl. + +2005-03-20 Paul Eggert + + * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options + after operands; POSIX says this isn't portable for the c99 command. + +2005-03-18 Paul Eggert + + * tests/glr-regression.at (glr-regr2a.y): Try to dump core + immediately if a data overrun has occurred; this may help us track + down what may be a spurious failure on MacOS. + +2005-03-17 Paul Eggert + + Respond to problems reported by twlevo@xs4all.nl. + + * bootstrap: Use "trap - 0" rather than the unportable "trap 0". + + * src/vcg.h: Comment fix. + * src/vcg_defaults.h: Parenthesize macro bodies to make them safe. + (G_CMAX): Change to -1 instead of INT_MAX. + + * data/yacc.c (yyparse): Omit spaces before #line. + +2005-03-15 Paul Eggert + + * src/tables.c (state_number_to_vector_number): Put it inside an + "#if 0", since it's not currently used. Problem reported by + Roland McGrath. + +2005-03-06 Paul Eggert + + * src/output.c (escaped_output): Renamed from + escaped_file_name_output, since we now use it for symbol tags as + well. All uses changed. + (symbol_destructors_output, symbol_printers_output): + Escape symbol tags too. + Problem reported by Matyas Forstner in + . + + * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's + not needed. + * src/output.c (user_actions_output, token_definitions_output, + symbol_destructors_output, symbol_printers_output): Likewise. + * src/reader.c (prologue_augment): Likewise. + * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise. + + * src/vcg.c (output_edge): Don't quote linestyle arg. + Problem reported by twlevo@xs4all.nl. + +2005-02-28 Paul Eggert + + * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in + example, reported by Derek M Jones. Also, make the example even + more outrageous, to better illustrate how bad the problem is. + +2005-02-24 Paul Eggert + + * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for + putsym. Typo reported by Sebastian Piping. + +2005-02-23 Paul Eggert + + * doc/bison.texinfo (Language and Grammar): some -> same + (Epilogue): int he -> in the + Typos reported by Sebastian Piping via Justin Pence. + +2005-02-07 Paul Eggert + + * tests/glr-regression.at (Improper handling of embedded actions + and dollar(-N) in GLR parsers): Renamed from "Improper handling of + embedded actions and $-N in GLR parsers", work around an Autoconf bug + with dollar signs in test names. + * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n", + for a similar reason. + +2005-01-28 Paul Eggert + + * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone + wants to redefine G_VIEW. + +2005-01-27 Paul Eggert + + * src/vcg.c (get_view_str): Remove case for normal_view. + Problem reported by twlevo@xs4all.nl. + +2005-01-24 Paul Eggert + + * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug. + Problem reported by twlevo@xs4all.nl. + + * doc/bison.texinfo: Change @dircategory from "GNU programming + tools" to "Software development". Requested by Richard Stallman + via Karl Berry. + +2005-01-23 Paul Eggert + + * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands. + Problem reported by twlevo@xs4all.nl. + +2005-01-21 Paul Eggert + + * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register" + keyword; it's not needed with modern compilers, and it doesn't + affect correctness with older compilers. Suggested by + twlevo@xs4all.nl. + +2005-01-17 Paul Eggert + + * data/glr.c (yyuserAction): Add "default: break;" case to pacify + gcc -Wswitch-default. + * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise. + * data/yacc.c (yyparse): Likewise. + +2005-01-12 Paul Eggert + + * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined + already. Let config.h define any nonstandard values. + +2005-01-10 Paul Eggert + + * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10), + for the benefit of slower hosts. Problem reported by + Nelson H. F. Beebe. + +2005-01-07 Paul Eggert + + * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab + being defined and not used. + * data/lalr1.cc (yyparse): Likewise. + Use "if (false)" rather than "if (0)". + +2005-01-05 Paul Eggert + + * TODO: Mention that we should allow NUL bytes in tokens. + +2005-01-02 Paul Eggert + + * src/scan-skel.l (<>): Don't close standard output. + Problem reported by Hans Aberg. + +2005-01-01 Paul Eggert + + * src/getargs.c (version): Happy new year; update overall + program copyright date from 2004 to 2005. + + * src/scan-skel.l ("@output ".*\n): Don't close standard output. + Problem reported by Hans Aberg. + * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO. + (Output file names.): Add a test for the case when standard output + is closed. + +2004-12-26 Paul Eggert + + * doc/bison.texinfo (@copying): Update FDL version number to 1.2, + to fix an oversight in the Bison 2.0 manual. + +2004-12-25 Paul Eggert + + * NEWS: Version 2.0. Reformat the existing news items since + 1.875, so that related items are grouped together. + * configure.ac (AC_INIT): Bump version to 2.0. + * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0. + + * tests/torture.at (Exploding the Stack Size with Alloca): Set + YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined; + otherwise, we're not testing alloca. Unfortunately there's no + simple way to consult HAVE_ALLOCA here. + + * data/lalr1.cc (yydestruct_): Pacify unused variable warning + for yymsg, too. + + * src/LR0.c (new_itemsets): Use memset rather than zeroing by + hand. This avoids a warning about comparing int to size_t when + GCC warnings are enabled. + +2004-12-22 Paul Eggert + + * NEWS: Bison-generated parsers no longer default to using the + alloca function (when available) to extend the parser stack, due + to widespread problems in unchecked stack-overflow detection. + * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's + responsibility to set it to a positive value. This lets the user + specify a value that is not a preprocessor constant. + * data/yacc.c (YYMAXDEPTH): Likewise. + (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero. + * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs + to be a compile-time constant. However, explain the constraints on it. + Also, explain the constraints on YYINITDEPTH. + (Table of Symbols): Explain that alloca is no longer the default. + Explain the user's responsibility if they define YYSTACK_USE_ALLOCA + to 1. + + * doc/bison.texinfo (Location Default Action): Mention that n must + be zero when k is zero. Suggested by Frank Heckenbach. + +2004-12-22 Akim Demaille + + * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type) + (parser::state_type, parser::semantic_type, parser::location_type): + Private, not public. + (parser::parse): Return ints, not bool. + Returning a bool introduces a problem: 0 corresponds to false, and + it seems weird to return false on success. Returning true changes + the conventions for yyparse. + Alternatively we could return void and send an exception. + There is no clear consensus (yet?). + (state_stack, semantic_stack, location_stack): Rename as... + (state_stack_type, semantic_stack_type, location_stack_type): these. + Private, not public. + * tests/c++.at: New. + * tests/testsuite.at, tests/Makefile.am: Adjust. + +2004-12-21 Akim Demaille + + * data/lalr1.cc (parser::parse): Return a bool instead of an int. + +2004-12-21 Akim Demaille + + Don't impose std::string for filenames. + + * data/lalr1.cc (b4_filename_type): New. + (position::filename): Use it. + (parser.hh): Move the inclusion of stack.hh and location.hh below + the user code, so that needed headers for the filename type can be + included first. + Forward declare them before the user code. + * tests/Makefile.am (check-local, installcheck-local): Pass + TESTSUITEFLAGS to the TESTSUITE. + +2004-12-20 Akim Demaille + + Use more STL like names: my_class instead of MyClass. + + * data/lalr1.cc (LocationStack, LocationType, RhsNumberType) + (SemanticStack, SemanticType, StateStack, StateType) + (TokenNumberType, Stack, Slice, Traits, Parser::location) + (Parser::value): Rename as... + (location_stack, location_type, rhs_number_type, semantic_stack) + (semantic_type, state_stack, state_type, token_number_type, stack) + (slice, traits, parser::yylloc, parser::yylval): these. + + * tests/calc.at, tests/regression.at, tests/actions.at: Adjust. + +2004-12-19 Paul Eggert + + * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions. + * data/yacc.c (YYLLOC_DEFAULT): Likewise. + +2004-12-17 Paul Eggert + + Remove uses of 'short int' and 'unsigned short int'. This raises + some arbitrary limits. It uses more memory but nowadays that's + not much of an issue. + + This change does not affect the generated parsers; that's a different + task, as some users will want to conserve memory there. + + Ideally we should use size_t to represent all object counts, and + something like ptrdiff_t to represent signed differences of object + counts; but that will require more code-cleanup than I have the + time to do right now. + + * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions): + Use size_t, not int or short int, to count objects. + * src/closure.c (nritemset, closure): Likewise. + * src/closure.h (nritemset, closure): Likewise. + * src/nullable.c (nullable_compute): Likewise. + * src/print.c (print_core): Likewise. + * src/print_graph.c (print_core): Likewise. + * src/state.c (state_compare, state_hash): Likewise. + * src/state.h (struct state): Likewise. + * src/tables.c (default_goto, goto_actions): Likewise. + + * src/gram.h (rule_number, rule): Use int, not short int. + * src/output.c (prepare_rules): Likewise. + * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions, + errs, reductions): Likewise. + * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol): + Likewise. + * src/tables.c (vector_number, tally, action_number, + ACTION_NUMBER_MINIMUM): Likewise. + * src/output.c (muscle_insert_short_int_table): Remove. + +2004-12-17 Akim Demaille + + * data/lalr1.cc: Extensive Doxygenation. + (error_): Rename as... + (error): this, since it is visible to the user. + Adjust callers. + (Parser::message): Now an automatic variable from... + (Parser::yyreport_syntax_error_): here. + * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to + Parser::error. + * tests/input.at: Escape $. + +2004-12-16 Paul Eggert + + * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location): + Parenthesize rhs to avoid obscure problems with mistakes like + "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all. + * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location, + b4_rhs_location): Likewise. + * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location, + b4_rhs_location): Likewise. + +2004-12-16 Akim Demaille + + * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and + yacc.c: be sure to stay within yycheck_. + * tests/actions.at: Re-enable C++ tests. + +2004-12-16 Akim Demaille + + * src/print_graph.c (print_graph): Remove layoutalgorithm uses for + real. + +2004-12-16 Akim Demaille + + Use #define to handle the %name-prefix. + + * data/glr.c, data/yacc.c: Comment changes. + * data/lalr1.cc (yylex): Use #define to select the name of yylex, + so that one can refer to yylex in the parser file, and have it + renamed, as is the case with other skeletons. + +2004-12-16 Akim Demaille + + Move lalr1.cc internals into yy*. + + * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_) + (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_) + (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_) + (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_) + (empty_, final_, terror_, errcode_, ntokens_) + (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_) + (looka_, ilooka_, error_range_, nerrs_): + Rename as... + (yysemantic_stack_, yylocation_stack_, yystate_stack_) + (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_) + (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_) + (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_) + (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_) + (yyfinal_, yyterror_, yyerrcode_, yyntokens_) + (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_) + (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_): + these. + +2004-12-15 Paul Eggert + + Fix some problems reported by twlevo at xs4all. + * src/symtab.c (symbol_new): Report an error if the input grammar + contains too many symbols. This is better than calling abort() later. + * src/vcg.h (enum layoutalgorithm): Remove. All uses removed. + (struct node, struct graph): + Rename member expand to stretch. All uses changed. + (struct graph): Remove member layoutalgorithm. All uses removed. + * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed. + * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND. + All uses changed. + (N_STRETCH): Rename from N_EXPAND. All uses changed. + +2004-12-15 Akim Demaille + + * data/lalr1.cc: Normalize /** \brief ... */ to ///. + Add more Doxygen comments. + (symprint_, stack_print_, reduce_print_, destruct_, pop) + (report_syntax_error_, translate_): Rename as... + (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_) + (yypop_, yyreport_syntax_error_, yytranslate_): this. + +2004-12-15 Akim Demaille + + * data/lalr1.cc (lex_): Rename as... + (yylex_): this. + Move the trace here. + Take the %name-prefix into account. + Reported by Alexandre Duret-Lutz. + +2004-12-15 Akim Demaille + + Simplify the C++ parser constructor. + + * data/lalr1.cc (debug_): Rename as... + (yydebug_): so that the parser's internals are always in the yy* + pseudo namespace. + Adjust uses. + (b4_parse_param_decl): Remove the leading comma as it is now only + called as unique argument list. + (Parser::Parser): Remove the constructor accepting a location and + an initial debugging level. + Remove from the other ctor the argument for the debugging level. + (debug_level_type, debug_level, set_debug_level): New. + + * tests/actions.at, tests/calc.at, tests/regression.at: Adjust + constructor calls. + +2004-12-15 Akim Demaille + + Remove b4_root related material: failure experiment + (which goal was to allow to derive from a class). + + * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove + definitions and uses. + +2004-12-14 Paul Eggert + + * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items, + not 2, since it's not portable to subtract 1 from the start of an + array. The new item 0 is never set or used. All uses changed. + + (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming + the default definition of YYLLOC_DEFAULT. Problem reported + by Frank Heckenbach. + +2004-12-12 Paul Eggert + + * data/glr.c (YYRHSLOC): Don't have two definitions, one for + the normal case and one for the error case. Just use the + first one uniformly. Problem reported by Frank Heckenbach. + (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can + use exactly the same macro in both places. + (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE, + so that the normal-case YYRHSLOC works for the error case too. + All uses changed. + * data/yacc.c (YYRHSLOC): New macro, taken from glr.c. + (YYLLOC_DEFAULT): Use the same macro as glr.c. + * doc/bison.texinfo (Location Default Action): Don't claim that + we have an array of locations. Use the same macro for both glr + and lalr parsers. Mention YYRHSLOC. Mention what happens when + the index is 0. + +2004-12-10 Paul Eggert + + * HACKING: Update email addresses to send announcements to. + + * configure.ac (AC_INIT): Bump version to 1.875f. + +2004-12-10 Paul Eggert + + * NEWS: Version 1.875e. + * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e. + + * src/scan-skel.l: Include "complain.h", for "fatal". + + * src/relation.h (relation_print, relation_digraph): + Relation sizes are of type relation_node, not size_t (this is + merely a doc fix, since the two types are equivalent). + (relation_transpose): Relation sizes are of type relation_node, + not int. + * src/relation.c: Likewise. + (top, infinity): Now of type relation_node, not int. + (traverse, relation_transpose): Use relation_node, not int. + + * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args + with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning. + (yyparse): Remove unused local introduced in 2004-10-25 patch. + + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg + specifying whether the test should be skipped. Use it tp + specify that the [%defines %skeleton "lalr1.cc"] tests currently + fail on some hosts, and should be skipped. + +2004-12-08 Paul Eggert + + * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers + changed to use xcalloc, xnmalloc, xnrealloc, respectively, + unless otherwise specified below. + + * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc, + to allocate kernel_base, kernel_items, kernel_size, since + they needn't be initialized to 0. + (allocate_storgae): Likewise, for shiftset, redset, shift_symbol. + * src/closure.c (new_closure): Likewise, for itemset. + * src/derives.c (derives_compute): Likewise, for delts, derives, q. + * src/lalr.c (set_goto_map): Likewise, for temp_map. + (initialize_F): Likewise, for reads, edge, reads[i], includes[i]. + (build_relations): Likewise for edge, states1, includes. + * src/nullable.c (nullable_compute): Likewise, for squeue, relts. + * src/reader.c (packgram): Likewise, for ritem, rules. + * src/reduce.c (nonterminals_reduce): Likewise for nontermmap. + * src/relation.c (relation_digraph): Likewise for VERTICES. + (relation_transpose): Likewise for new_R, end_R. + * src/symtab.c (symbols_token_translations_init): Likewise for + token_translations. + * src/tables.c (save_row): Likewise for froms, tos, conflict_tos. + (token_actions): Likewise for yydefact, actrow, conflrow, + conflict_list. + (save_column): Likewise for froms[symno], tos[symno]. + (goto_actions): Likewise for state_count. + (pack_table): Likewise for base, pos, check. + (tables_generate): Likewise for width. + + * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base + for initial core. Just have a separate core, so we needn't worry + about whether kernel_size and kernel_base are initialized. + + * src/LR0.c (shift_symbol, redset, shiftset, kernel_base, + kernel_size, kernel_items): Remove unnecessary initialization. + * src/conflicts.c (conflicts): Likewise. + * src/derives.c (derives): Likewise. + * src/muscle_tablc (muscle_insert): Likewise. + * src/relation.c (relation_digraph): Likewise. + * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order, + conflrow, conflict_table, conflict_list, table, check): + Likewise. + + * src/closure.c (new_closure): Arg is of type unsigned int, not int. + This is because all callers pass unsigned int. + * src/closure.h (new_closure): Likewise. + + * src/lalr.c (initialize_F): Initialize reads[i] in all cases. + (build_relations): Initialize includes[i] in all cases. + * src/reader.c (packgram): Always initialize rules[ruleno].prec + and rules[ruleno].precsym. Initialize members in order. + * src/relation.c (relation_transpose): Always initialize new_R[i] + and end_R[i]. + * src/table.c (conflict_row): Initialize 0 at end of conflict_list. + + * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0]; + conflict_list[0] was always 0, but now it isn't initialized. + + * src/table.c (table_grow): When conflict_table grew, the grown + area wasn't cleared. Fix this. + + * lib/.cvsignore: Add strdup.c, strdup.h. + * m4/.cvsignore: Add strdup.m4. + +2004-12-07 Paul Eggert + + * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro. + * src/lalr.c (set_goto_map): Don't allow ngotos to equal + GOTO_NUMBER_MAXIMUM, since we occasionally compute + ngotos + 1 without checking for overflow. + (build_relations): Use END_NODE, not -1, to denote end of edges. + * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge, + build_relations): Use goto_number, not int, for goto numbers. + * src/tables.c (save_column, default_goto): Likewise. + +2004-11-23 Akim Demaille + + * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead + of #defining from yystype. + Don't typedef yystype, C++ does not need it. + This lets it possible to forward declare it as union. + +2004-11-23 Paul Eggert + + * bootstrap (gnulib_modules): Add extensions. + Problem reported by Jim Meyering. + +2004-11-22 Paul Eggert + + * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, + src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l, + src/system.h, src/tables.c: XFREE -> free, to accommodate + recent change to gnulib xalloc.h. + Problem reported by Jim Meyering. + +2004-11-17 Akim Demaille + + * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings. + +2004-11-17 Akim Demaille , + Alexandre Duret-Lutz + + * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow + changes. + (YYCDEBUG): Adjust. + Use it instead of cdebug_. + (Parser::debug_stream, Parser::set_debug_stream): New. + (Parser::symprint_): Define cdebug_ for temporary backward + compatibility. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use + debug_stream (). + +2004-11-17 Akim Demaille + + * data/lalr1.cc (Parser:print_): Remove, use %printer instead. + * tests/regression.at (_AT_DATA_DANCER_Y): Adjust. + * tests/calc.at (_AT_DATA_CALC_Y): Ditto. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise. + +2004-10-27 Paul Eggert + + * data/glr.c (yyloc_default): Remove; not used. + Problem reported by Frank Heckenbach. + +2004-10-25 Akim Demaille + + * data/glr.c (YYRHSLOC): Move its definition next to its uses. + Introduce another definition to address simple location arrays. + (yyGLRStack): New member: yyerror_range. + (yyrecoverSyntaxError, yyparse): Update it. + (yyrecoverSyntaxError): Use it when shifting the error token to + have an accurate range, equivalent to the one computed by both + yacc.c and lalr1.cc. + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so + that column numbers start at column 0, as per GNU Coding + Standards, the others tests, and the doc. + (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC): + Adjust to the above change (first column is 0). + And adjust the location of the "", now covering the whole + line. + +2004-10-22 Akim Demaille + and Paul Eggert + + Remove some arbitrary limits on goto numbers and relations. + * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit + initial values, since they're never used. + (set_goto_map): ngotos is now unsigned, so test for overflow + by seeing whether it wraps around to zero. + * src/lalr.h (goto_number): Now size_t, not short int. + (GOTO_NUMBER_MAXIMUM): Remove. + * src/relation.c (relation_print, traverse, relation_transpose): + Check for END_NODE rather than looking at sign. + * src/relation.h (END_NODE): New macro. + (relation_node): Now size_t, not short int. + +2004-10-22 Paul Eggert + + * doc/bison.texinfo (Language and Grammar): In example, "int" is a + keyword, not an identifier. Problem reported by Baron Schwartz in + . + +2004-10-11 Akim Demaille + + * src/symtab.c (symbol_check_alias_consistency): Also check + type names, destructors, and printers. + Reported by Alexandre Duret-Lutz. + Recode the handling of associativity and precedence in terms + of symbol_precedence_set. + Accept no redeclaration at all, not even equal to the previous + value. + (redeclaration): New. + Use it to factor redeclaration complaints. + (symbol_make_alias): Don't set the type of the alias, let + symbol_check_alias_consistency do it as for other features. + * src/symtab.h (symbol): Add new member prec_location, and + type_location. + * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them. + * tests/input.at (Incompatible Aliases): New. + +2004-10-09 Paul Eggert + + .cvsignore fixes to accommodate gnulib changes, + and the practice of naming build directories "_build". + * .cvsignore: Add "_*". Sort. + * lib/.cvsignore: Add getopt_.h, xalloc-die.c. + * m4/.cvsignore: Add "*_gl.m4". + +2004-10-06 Akim Demaille + + * src/parse-gram.y (add_param): Fix the truncation of trailing + spaces. + +2004-10-05 Akim Demaille + + In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless + whether the reducion was empty or not. This leaves room to + improve the use of YYLLOC_DEFAULT in such a case. + lalr1.cc is still experimental, so changing this is acceptable. + And finally, there are probably not many users who changed the + handling of locations in GLR, so changing is admissible too. + + * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an + empty reduction, set @$ to an empty location ending the previously + stacked symbol. + Adjust uses to make sure the code is triggered on empty + reductions. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the + expected output: empty reductions have empty locations. + +2004-09-29 Akim Demaille + + * data/lalr1.cc: Move towards a more standard C++ coding style + for templates: Class < T > -> Class. + +2004-09-29 Akim Demaille + + * data/lalr1.cc: Reinstall the former ctor, for sake of + compatibility, but warn it will be removed. + Move towards a more standard C++ coding style (i.e., type *var -> + type* var). + +2004-09-27 Paul Eggert + + * src/parse-gram.y (add_param): Rewrite to avoid strchr, + since it's less likely to work if NULs are involved in the future. + +2004-09-27 Akim Demaille + + * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration. + +2004-09-27 Akim Demaille + + * data/lalr1.cc (b4_parse_param_decl_1): New. + (b4_parse_param_decl): Use it to have different names between attribute + and argument names. + (b4_cc_constructor_call): Likewise. + +2004-09-24 Akim Demaille + + * src/parse-gram.y (add_param): Strip the leading and trailing + blanks from a formal argument declaration. + (YY_LOCATION_PRINT): New. + +2004-09-24 Akim Demaille + + * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation + after the location. + +2004-09-24 Akim Demaille + + * doc/bison.texinfo (Table of Symbols): Sort. + +2004-09-21 Akim Demaille + + * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove + the useless parentheses. + Suggested by Paul Eggert. + +2004-09-20 Akim Demaille + + Let the initial-action act on the look-ahead, and use it for the + "initial push" (corresponding to an hypothetical beginning-of-file). + And let lalr1.cc honor %initial-action. + + * doc/bison.texinfo (Initial Action Decl): Clarify, and add an + example. + * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment. + (Parser::Parser): Remove the ctor that used to initialize it. + (Parser::parse): Like in the other skeletons, issue the "starting + parse" message before any action. + Honor %initial-action. + Initialize the stacks with the lookahead. + * data/yacc.c: Let $$ and @$ in %initial-action designate the + look-ahead. + Push them in the stacks. + * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations. + +2004-09-20 Akim Demaille + + * doc/bison.texinfo (Initial Action Decl): New. + +2004-09-20 Akim Demaille + + * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a + clearer criterion to define it. + (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL. + When reducing on an empty RHS, use the latest stacked location as + location. + yylloc is not always available. + * data/glr.c: Likewise. + Also, honor initial-actions. + +2004-09-20 Akim Demaille + + * data/yacc.c (YY_LOCATION_PRINT): New. + Define when we know YYLTYPE's structure, i.e., when the default + YYLLOC_DEFAULT is used. + * data/c.m4 (b4_yysymprint_generate): Use it. + * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial + value of the result. + (error_start_): Replace with... + (error_range_): this location array. + This allows to replace code relying on the implementation of + locations by portable code. + * data/yacc.c (yylerrsp): Replace with... + (yyerror_range): this. + Every time a token is popped, update yyerror_range[0], to have an + accurate location for the error token. + * data/glr.c (YY_LOCATION_PRINT): New. + (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT: + deference a pointer. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer + report the location in %printers. + + * src/scan-skel.l: Instead of abort, report error messages to ease + understanding skeleton scanning failures. + +2004-09-16 Akim Demaille + + * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as... + (iterator, const_iterator): these, to be more in the C++ spirit. + Also, return reverse iterators so that when displaying the stack + we display its bottom first. + (Parser::stack_print_, Parser::reduce_print_): Match the messages + from yacc.c. + We should probably use vector here though. + +2004-09-16 Akim Demaille + + Have more complete shift traces. + + * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT + to report Shifts instead of ad hoc YYDPRINTF invocations, + including for the error token. + * data/lalr1.cc (symprint_): Output the location. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't + output the location within the %printer. + Activate GLR tests, at least to make sure they compile properly. + They still don't pass though. + * tests/calc.at: Adjust expect verbose output, since now "Entering + state..." is on a different line than the "Shifting" message. + +2004-09-08 Akim Demaille + + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the + Bison directive from the Bison file to the invocation of this + macro, so that these directives are passed to + AT_BISON_OPTION_PUSHDEFS to get correct help macros. + Use these helping macros (e.g., AT_LOC, AT_VAL and so forth). + Move the AT_SETUP/AT_CLEANUP outside, to report as test title + the extra Bison directives instead of the whole series. + Change the grammar so that there are recoverable errors, and + unrecoverable errors. Now we can have the parser give up before + consuming the whole input. As a result we now can observe that + the lookahead is freed when needed. + Change the parser source to parse argv[1] instead of a hard coded + string. + Simplify yylex, and give a value and location to EOF. + Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that + passed directives already coded in the file. + Add some tests to check the location of "error". + For some tests, the C++ parser is correct, and not yacc.c. + For other tests, they provide different, but unsatisfying, values, + so keep the C++ value so that at least one parser is "correct" + according to the test suite. + (Actions after errors): Remove, this is subsumed by the + AT_CHECK_PRINTER_AND_DESTRUCTOR series. + +2004-09-06 Akim Demaille + + * data/lalr1.cc: Adjust the indentation of the labels. + (Parser::pop): New. + Use it. + +2004-09-06 Akim Demaille + + * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional + argument, an informative message. + Call YY_SYMBOL_PRINT. + Adjust all callers: integrate the associated YY_SYMBOL_PRINT. + * data/lalr1.cc (destruct_): Likewise. + In addition, no longer depend on b4_yysymprint_generate and + b4_yydestruct_generate to generate these functions, do it "by + hand". + +2004-09-03 Akim Demaille + + * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was + invoked, yydestruct the lookahead. + * tests/calc.at (Calculator $1): Update the expected lengths of + traces: there is an added line for the discarded lookahead. + * doc/bison.texinfo (Destructor Decl): Some rewording. + Define "discarded" symbols. + +2004-09-02 Akim Demaille + + * data/lalr1.cc (translate_, destruct_): No reason to be static. + +2004-09-02 Akim Demaille + + * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used. + (YYDSYMPRINTF): Rename as... + (YY_SYMBOL_PRINT): this. + * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous + two. + Use it instead of direct symprint_ calls. + (yybackup): Tweak the "Now at end of input" case to match yacc.c's + one. + +2004-09-02 Akim Demaille + + * data/lalr1.cc (b4_yysymprint_generate): New. + (symprint_): New member function, defined when YYDEBUG. + Use it consistently instead of token/nterm debugging output by + hand. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust + %printer calls to use cdebug_ when using lalr1.cc. + +2004-08-30 Florian Krohm + + * data/glr.c: Guard the declarations of yypstack and yypdumpstack + with #ifdef YYDEBUG. + +2004-08-26 Akim Demaille + + * doc/bison.texinfo (Implementing Loops): Rename as... + (Implementing Gotos/Loops): this. + +2004-08-13 Paul Eggert + + Adjust to latest gnulib. + * bootstrap (gnulib_modules): Add xalloc-die. + Set LC_ALL=C so that file names sort consistently. + Prefer the gnulib copies of gettext.m4, glibc21.m4, + inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4, + uintmax_t.m4, ulonglong.m4. + (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4, + po.m4 since we are now using _gl.m4 instead. + +2004-08-10 Florian Krohm + + * src/scan-action.l: Remove. Scanning of semantic actions is + handled in scan-gram.l. + +2004-08-07 Florian Krohm + + * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup. + + * src/location.h (struct): The file member is a uniqstr. + (equal_boundaries): Use UNIQSTR_EQ for comparison. + +2004-07-22 Paul Eggert + + Fix bug with non-%union parsers that have printers or destructors, + which led to a Bison core dump. Reported by Peter Fales in + . + + * data/c.m4 (b4_symbol_actions): Don't assume %union was used. + * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE, + not to our own type. + * src/output.c (symbol_destructors_output, symbol_printers_output): + Don't assume %union. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR, + AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument + UNION-FLAG. All callers changed. + (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union. + Use type char, not unsigned int, when declaring an array of char; + this lets us remove a cast. + (Printers and Destructors): Add non-%union test cases. + +2004-06-21 Paul Eggert + + * doc/bison.texinfo: Minor editorial changes, mostly to the new + GLR writeups. E.g., avoid frenchspacing and the future tense, + change "lookahead" to "look-ahead", and change "wrt" to "with + respect to". + +2004-06-21 Paul Hilfinger + + * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements): + New sections, split off from the GLR Parsers section. Put the new + Simple GLR Parser near the start of the GLR section, for clarity. + Rewrite connective text. + +2004-06-21 Frank Heckenbach + + * doc/bison.texinfo (Simple GLR Parsers): New section. + +2004-06-21 Paul Eggert + + * NEWS, TODO, doc/bison.texinfo: + Use "look-ahead" instead of "lookahead", to be consistent. + * REFERENCES: Fix incorrect reference to DeRemer and Pennello, + while we're fixing "look-ahead". + * src/conflicts.c (shift_set): Renamed from shiftset. + (look_ahead_set): Renamed from lookaheadset. + * src/print.c: Likewise. + * src/getargs.c (report_args): Add "look-ahead" as the new canonical + name for "lookahead". + (report_types, usage): Likewise. + * src/getargs.h (report_look_ahead_tokens): Renamed from + report_lookaheads. + * src/lalr.c (compute_look_ahead_tokens): Renamed from + compute_lookaheads. + (state_look_ahead_tokens_count): Renamed from state_lookaheads_count. + (look_ahead_tokens_print): Renamed from lookaheads_print. + * src/state.c (state_rule_look_ahead_tokens_print): Renamed from + state_rule_lookaheads_print. + * src/state.h: Likewise. + (reductions.look_ahead_tokens): Renamed from lookaheads. + * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from + AT_DATA_LOOKAHEADS_GRAMMAR. + +2004-06-03 Paul Eggert + + * README: Update location of patched M4 distribution. + +2004-05-30 Albert Chin-A-Young + + Don't assume the C++ compiler takes the same arguments as the C compiler + (trivial change). + * configure.ac (O0CXXFLAGS): New var. + * tests/atlocal.in (CXXFLAGS): Use it. + +2004-05-29 Paul Eggert + + Fix some "make check" problems with C++ reported by + Albert Chin-A-Young for Tru64 C++ in this thread: + http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html + + * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): + Output to a .cc file for C++, not to a .c file. + * tests/calc.at (AT_CHECK_CALC): Likewise. + * tests/regression.at (AT_CHECK_DANCER): Likewise. + * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c. + +2004-05-28 Albert Chin-A-Young + + * tests/calc.at, tests/actions.at: Workaround for SGI + C++ compiler. (trivial change) + +2004-05-27 Paul Eggert + + Spent a few hours checking out which prerequisite versions the + current sources actually require. I went all the way back to + Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated + a seemingly endless set of combinations of versions more recent + than that. The bottom line is that the current sources require + fairly recent versions of the build tools, and it'll be some work + to change this. + * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59. + (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8. + (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12. + Add comments explaining why those particular versions are + currently needed. + + * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug + in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in + . + + * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work + (it fails with a Autoconf-without-aclocal-m4 diagnostic). + +2004-05-26 Paul Eggert + + * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to + 0.11.5. Suggested by Bruno Haible. + * bootstrap: Remove gettext version checking. + + * doc/bison.texinfo (Decl Summary): Also mention that %union + can depend on prerequisite types. Problem reported by Tim + Van Holder. + +2004-05-25 Paul Eggert + + * README: Mention GNU m4 1.4 bugs and Akim's patched version. + * README-alpha: Don't tell people not to package this. + + * bootstrap: Don't assume $(...) works; use `...` instead. + Problem reported by Paul Hilfinger. Also, diagnose non-GNU + gettext better. + + * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's + put into the -d output file, and mention what to do if YYSTYPE is + defined as a macro. + +2004-05-24 Paul Eggert + + Undo change made earlier today: it caused autopoint to not bring + in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for + autopoint's. + + * bootstrap: Check that gettext version matches what's in + configure.ac. Warn users to ignore robots.txt ERROR 404. + * bootstrap: Undo today's earlier change (logged below). + * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise. + + The gettext version checking is causing more trouble than it's + curing; remove it. Problem reported by Paul Hilfinger. + + * bootstrap: Issue a warning that one can expect a message + 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'. + * configure.ac (AM_GNU_GETTEXT_VERSION): Remove. + +2004-05-23 Paul Eggert + + Ensure that the C++ compiler used for testing actually works on a + simple test program; if not, skip the C++-related tests. Problem + reported by Vin Shelton in: + http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html + + * m4/cxx.m4: New file. + * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add. + * tests/atlocal.in (BISON_CXX_WORKS): Add. + * tests/local.at (AT_COMPILE_CXX): Use it. + +2004-05-21 Paul Eggert + + * data/glr.c (yylloc): Output this macro even if locations are not + being generated, as the GLR parser needs it even in that case. + Problem reported by Troy A. Johnson + . + + * configure.ac (AC_INIT): Update to 1.875e. + +2004-05-21 Paul Eggert + + * NEWS: Version 1.875d. + * configure.ac (AC_INIT): Likewise. + * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d. + + * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow, + -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current + lalr1.cc runs afoul of the first, and the last two are no longer + supported by GCC 3.4.0. + * README: Mention GNU m4 1.4 or later; mention m4 patches. + * HACKING: Use ./bootstrap, not "make update" to import foreign files. + +2004-05-06 Paul Eggert + + * src/muscle_tab.c (hash_muscle): Accept and return size_t, not + unsigned int, for compatibility with latest gnulib hash module. + * src/state.c (state_hash, state_hasher): Likewise. + * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise. + * src/uniqstr.c (hash_uniqstr): Likewise. + +2004-05-03 Paul Eggert + + * NEWS: Unescaped newlines are no longer allowed in char & strings. + + * src/scan-gram.l (): Reject unescaped newlines in + character and string literals. + (unexpected_end): New function. + (unexpected_eof): Use it. + (unexpected_newline): New function. + (): Coalesce duplicate + actions. + + * NEWS: Document %expect-rr. + + * bootstrap (--gnulib-srcdir=*, --cvs-user=*): + Fix typo by replacing $1 with $option. + Remove more 'intl'-related files. + Don't DEFUN AM_INTL_SUBDIR twice. + + * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c, + memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c, + strtoul.c. + * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4, + hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4, + xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4, + inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4, + stdint_h.m4, uintmax_t.m4, ulonglong.m4. + * src/.cvsignore: Add *.output. + + * src/parse-gram.y: Put copyright notice inside %{ %} so it + gets copied to the output file. + +2004-04-28 Paul Eggert + + Get files from the gnulib and po repositories, instead of relying + on them being in our CVS. Upgrade to latest versions of gnulib + and Automake. + + * Makefile.am (SUBDIRS): Remove m4; Automake now does m4. + * bootstrap: Bootstrap from gnulib and po repositories. + Much of this code was stolen from GNU diff and GNU tar's bootstrap. + * README-cvs: Document these changes. Remove version numbers from + mentions of build tools, since they change so often. Mention Flex. + + * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg. + (gl_USE_SYSTEM_EXTENSIONS): Add. + (AC_GNU_SOURCE, AC_AIX, AC_MINIX): + Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS + does this for us. + (AC_ISC_POSIX): Remove; we no longer support this + ancient OS, as it gets in the way of latest Autoconf & gnulib. + (AC_HEADER_STDC): Remove: we now assume C89 or better. + (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS. + Do not check for C89 headers, except for locale.h which is used + by the Yacc library and must port to K&R hosts. + (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS. + Do not check for C89 functions, except for setlocale which is + used by the Yacc library. + (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed. + (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR, + gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL, + gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE, + gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC, + AM_GNU_GETTEXT): Remove; now done by: + (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us. + (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this + for us. + + * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap". + (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): + Define to empty, as gnulib.mk will do the rest for us. + ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this + for us. + (libbison_a_SOURCES): Define to $(lib_SOURCES) now. + (lib_SOURCES): New symbol, containing only the non-gnulib libs. + + * src/files.c: Include gnulib's xstrndup.h. + + * src/system.h (MALLOC): Use xnmalloc, for better overflow checking. + (REALLOC): Use xnrealloc, for likewise. + (xstrndup, stpcpy): Remove decls, as gnulib does this for us now. + (strnlen, memrchr): Remove decls; functions no longer used. + Include . + + * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c, + lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h, + lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h, + lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h, + lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c, + lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h, + lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h, + lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c, + lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c, + lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h, + lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c, + m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4, + m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4, + m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4, + m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4, + m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4, + m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4, + m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in, + po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po, + po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po, + po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po: + Remove, as these files are now generated automatically + by bootstrap or automake. + + * po/ChangeLog: Remove: all but one entry was a duplicate + of this file, and I moved that 2000-11-02 entry here. + + * config/.cvsignore: Add Makefile, depcomp, install-sh. + * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c, + argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h, + exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c, + getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h, + hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c, + memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h, + quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h, + strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c, + strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c, + unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c, + xstrndup.h. + * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4, + dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4, + mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4, + stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4. + * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars. + * src/.cvsignore: Remove *_.c. + + + * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't + support it. (The latest stable gzip doesn't.) + +2004-04-27 Paul Eggert + + * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this + case, as stos_ is now used by destructors due to the 2004-02-09 + change. + + Remove more K&R C support. + * lib/libiberty.y (PARAMS): Remove. All uses removed. + * lib/subpipe.c (errno): Remove decl. + Include unconditionally. + (EXIT_FAILURE): Remove macro. + * src/complain.c (vfprintf, strerror): Remove. + * src/system.h: Include limits.h, stdlib.h, string.h, locale.h + unconditionally. + (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns. + Use latest Autoconf recommendations for including inttypes.h, stdint.h. + (strchr, strspn, memchr): Remove decls. + * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h + unconditionally. Do not declare perror. + * tests/conflicts.at (%nonassoc and eof): Include stdlib.h + unconditionally. + + * src/complain.c (_): Remove useless defn, as system.h defines this. + + * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed + with latest obstack.h. + * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args + to procedure types, as obstack.h now does that for us. + * lib/lbitset.c (lbitset_elt_alloc): Likewise. + + * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include , + so that this include file can stand alone. + * lib/subpipe.c: Do not include , as subpipe.h + does this now. Include subpipe.h first after config.h, to + test whether it can stand alone. + + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't + declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the + unused declaration. + + * tests/synclines.at (%union synch line): Put a dummy member in + the union, because empty unions aren't allowed in C. Caught + by GCC 3.4.0. + +2004-04-13 Jim Meyering + + * src/conflicts.c (conflicts_print): Correct format string typo: + use `%%' to produce literal `%'. (trivial change) + +2004-03-30 Paul Eggert + + * src/getargs.c (version): Update copyright year to 2004. + + * data/c.m4 (b4_int_type): Use 'short int' rather than + 'short', and similarly for 'long', 'unsigned', etc. + * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum, + yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError, + yy_yypstack, yydumpstack): Likewise. + * data/lalr1.cc (user_token_number_max_, user_token_number_max_, + translate_, seq_, [], pop, Slice, range_, operator+, operator+=): + Likewise. + * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char, + yy_stack_print, yyparse): Likewise. + * doc/bison.texinfo (Prologue, Multiple Types): Likewise. + * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise. + * lib/bitset.c (bitset_print): Likewise. + * lib/bitset_stats.c (bitste_log_histogram_print): Likewise. + * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise. + * lib/bitsetv.c (bitsetv_dump): Likewise. + * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise. + * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset): + Likewise. + * src/LR0.c (allocate_itemsets): Likewise. + * src/gram.h (rule_number, rule): Likewise. + * src/lalr.h (goto_number): Likewise. + * src/nullable.c (nullable_compute): Likewise. + * src/output.c (prepare_rules): Likewise. + * src/relation.c (relation_print, relation_digraph): Likewise. + * src/relation.h (relation_node): Likewise. + * src/state.h (state_number, transitions, errs, reductions, + struct state): Likewise. + * src/symtab.h (symbol_number, struct symbol): Likewise. + * src/tables.c (vector_number, tally, action_number, + default_goto, goto_actions): Likewise. + * tests/existing.at (GNU Cim Grammar): Likewise. + * tests/regression.at (Web2c Actions): Likewise. + + * src/output.c (muscle_insert_short_int_table): Renamed from + muscle_insert_short_table. All uses changed. + +2004-03-25 Paul Hilfinger + + * src/parse-gram.y: Define PERCENT_EXPECT_RR. + (declaration): Replace expected_conflicts with expected_sr_conflicts. + Add %expect-rr rule. + + * src/scan-gram.l: Recognize %expect-rr. + + * src/conflicts.h (expected_sr_conflicts): Rename from + expected_conflicts. + (expected_rr_conflicts): Declare. + + * src/conflicts.c (expected_sr_conflicts): Rename from + expected_conflicts. + (expected_rr_conflicts): Define. + (conflicts_print): Check r/r conflicts against expected_rr_conflicts + for GLR parsers. + Use expected_sr_conflicts in place of expected_conflicts. + Warn if expected_rr_conflicts used in non-GLR parser. + + * doc/bison.texinfo: Add documentation for %expect-rr. + +2004-03-08 Paul Eggert + + Add support for hex token numbers. Suggested by Odd Arild Olsen in + . + + * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor + in lalr1.cc. + * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers. + * src/scan-gram.l (scan_integer): New function. + ({int}): Use it. + (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers. + (, \\x[0-9abcdefABCDEF]+, + handle_action_dollar, handle_action_at, convert_ucn_to_byte): + Say "long int", not "long", for uniformity with GNU style. + +2004-02-25 Paul Eggert + + * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from + compilers. This fixes a problem with Intel's C++ compiler being + chatty, reported by Guido Trentalancia in + . + +2004-02-09 Alexandre Duret-Lutz + + Support %destructor and merge error locations in lalr1.cc. + + * data/lalr1.cc (b4_cxx_destruct_def): New macro. + (Parser::stos_): Define unconditionally. + (Parser::destruct_): New method. Generate its body with + b4_yydestruct_generate. + (Parser::error_start_): New attribute. + (Parser::parse) : Call destruct_ on erroneous + token which are discarded. + (Parser::parse) : Update + error_start_ when erroneous token are discarded. + (Parser::parse) : Compute the location of the error + token so that it covers all the discarded tokens. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so + it can be called with `%skeleton "lalr1.cc"', and do that. + +2004-02-02 Paul Eggert + + * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions + $(top_srcdir)/lib and ../lib. This fixes a bug reported + by Paul Hilfinger; the old INCLUDES value didn't mention ../lib. + There's no need to mention top_builddir since Automake does that + for us. + (INCLUDES): Remove, as Automake says it's obsolescent. + Contents migrated into AM_CPPFLAGS as described above. + * lib/Makefile.am (INCLUDES): Remove; obsolescent. + +2004-01-14 Paul Hilfinger + + * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token. + (yyreportSyntaxError): Handle case where lookahead token is + YYEMPTY. + +2004-01-13 Paul Hilfinger + + * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that + resulting parsers are compilable with C++. + +2003-12-23 Paul Eggert + + * config/depcomp, config/install-sh: Sync with Automake 1.8. + * src/output.c (output_skeleton): Rename local var. + * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in + Bison tokens, as this runs afoul of the 2003-10-07 change that + disallowed NUL bytes in character constants or string literals. + + * tests/local.at: Require Autoconf 2.59's Autotest. + * tests/testsuite.at: Don't include local.at, since we now assume + Autoconf 2.59 or later. Autoconf 2.59 had some problems with + including it. + * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring + multiple inclusion warnings. + +2003-12-02 Akim Demaille + + * doc/bison.texinfo (How Can I Reset the Parser): More about start + conditions. + From Bruno Haible. + +2003-11-18 Alexandre Duret-Lutz + + * doc/bison.texinfo (Bison Options): Escape `@' in `$@'. + +2003-10-07 Paul Eggert + + * tests/Makefile.am (clean-local): Don't run 'testsuite --clean' + if testsuite doesn't exist. + + * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string + literals, unfortunately. + * src/scan-gram.l (): + Complain about NUL bytes in character constants or string literals. + +2003-10-05 Paul Eggert + + * NEWS: Don't document %no-default-prec, as it's still + too experimental. + * doc/bison.texinfo: Document %no-default-prec only if + the defaultprec flag is set. Normally it's not. + +2003-10-04 Paul Eggert + + * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a + non-modifiable lvalue, instead of a modifiable one. + * doc/bison.texinfo (Actions): Document that $$ can + be assigned to. Do not claim that $$ and $N are + array element references: user code should not rely on this. + +2003-10-01 Paul Eggert + + * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token. + (grammar_declaration): Use it. + * src/scan-gram.l: New token %no-default-prec. + * tests/conflicts.at: Revamp tests to use %no-default-prec. + * NEWS, doc/bison.texinfo: Document the above. + +2003-10-01 Akim Demaille + + VCG no longer supports long_straight_phase. + + * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase. + * src/print_graph.c (print_graph): Adjust. + +2003-09-30 Frank Heckenbach + and Paul Eggert + + * doc/bison.texinfo (Decl Summary, Contextual Precedence, + Table of Symbols): Document %default-prec. + * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token. + (grammar_declaration): Set default_prec on %default-prec. + * src/scan-gram.l (%default-prec): New token. + * src/reader.h (default_prec): New flag. + * src/reader.c: Likewise. + (packgram): Handle it. + * tests/conflicts.at (%default-prec without %prec, + %default-prec with %prec, %default-prec 1): New tests. + +2003-09-30 Paul Eggert + + * tests/testsuite.at: Include local.at, not input.at, fixing + a typo in the 2003-08-25 patch. + +2003-08-27 Akim Demaille + + * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify + GCC warnings. + +2003-08-26 Akim Demaille + + * config/announce-gen (print_changelog_deltas): Neutralize "<#" as + "<\#" to avoid magic from Gnus when posting parts of this script. + +2003-08-26 Akim Demaille + + * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from + (Parser::parse): here. + Adjust: nerrs and errstatus is now replaced by... + (Parser::nerrs_, Parser::errstatus_): New. + +2003-08-25 Akim Demaille + + * config/announce-gen, Makefile.cfg: New. + * Makefile.am: Adjust. + * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but + keeping local WGET and WGETFLAGS modifications from Paul Eggert. + +2003-08-25 Akim Demaille + + When reducing initial empty rules, Bison parser read an initial + location that is not defined. This results in garbage, and that + affects Bison's own parser. Therefore we need (i) to extend Bison + to support a means to initialize this location, and (ii) to use + this CVS Bison to fix CVS Bison's parser. + + * src/reader.h, reader.c (epilogue_augment): Remove, replace + with... + * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this. + * src/parse-gram.y: Adjust. + (%initial-action): New. + (%error-verbose): Since we require CVS Bison, there is no reason + not to use it. + * src/scan-gram.l: Adjust. + * src/Makefile.am (YACC): New, to make sure we use our own parser. + * data/yacc.c (yyparse): Use b4_initial_action. + +2003-08-25 Akim Demaille + + * doc/bison.texinfo: Don't promote stdout for error messages. + +2003-08-25 Akim Demaille + + * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi. + From Alexandre Duret-Lutz. + +2003-08-25 Akim Demaille + + Version 1.875c. + +2003-08-25 Akim Demaille + + * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New. + Use them. + +2003-08-25 Akim Demaille + + * data/lalr1.cc (Parser::reduce_print_): New. + Use it. + +2003-08-25 Akim Demaille + + Have lalr1.cc catch with Paul Eggert's patch to fix the infinite + error recovery loops. This patch is based on + . + Also, augment the similarity between lalr1.cc and yacc.c. + Note: the locations of error recovery rules are not correct yet. + + * data/lalr1.cc: Comment changes to augment the similarity between + lalr1.cc and yacc.c. + (YYERROR): Goto to yyerrorlab, not yyerrlab1. + (yyerrlab1): Remove, but where it used to be (now the bottom part of + yyerrlab), when hitting EOF, pop the whole stack here instead of + merely falling through the default error handling mechanism. + (yyerrorlab): New label, with the old contents of YYERROR, + plus the following change: pop the stack of rhs corresponding + to the production that invoked YYERROR. That is how Yacc + behaves (required by POSIX). + * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to + fail. + +2003-08-25 Akim Demaille + + Tune local.at so that people can "autom4te -l autotest calc.at -o + calc" for instance, to extract a sub test suite. + + * tests/testsuite.at: Move the initialization, Autotest version + requirement, and AT_TESTED invocation into... + * tests/local.at: here. + * tests/testsuite.at: Include it for compatibility with Autoconf + 2.57. + * tests/Makefile.am ($(TESTSUITE)): Report that the warning should + be ignore. + +2003-08-04 Paul Eggert + + Rework code slightly to avoid gcc -Wtraditional warnings. + * data/glr.c (yyuserMerge): Return void, not YYSTYPE. + The returned value is now stored in *YY0. All callers changed. + * src/output.c (merge_output): Adjust to the above change. + +2003-07-26 Paul Eggert + + * data/glr.c (YYASSERT): New macro. + (yyfillin, yydoAction, yyglrReduce, yysplitStack, + yyresolveStates, yyprocessOneStack): + Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'. + Derived from a suggestion by Frank Heckenbach. + +2003-07-25 Paul Eggert + + * data/glr.c (yyglrReduce): Don't use C89 string concatenation, + for portability to K&R C (after ansi2knr, presumably). See + + by Frank Heckenbach, though I have omitted the structure-initialization + part of his glr-knr.diff patch since I recall that the Portable + C Compiler didn't require that change. + + Let the user specify how to allocate and free memory. + Derived from a suggestion by Frank Heckenbach in + . + * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros. + All uses of free, malloc, realloc changed to use these macros, + and unnecessary casts removed. + * data/yacc.c (YYFREE, YYMALLOC): Likewise. + +2003-07-06 Matthias Mann + + * data/lalr1.cc (operator<<(std::ostream&, const Position&)): + use s.empty() rather than s == "" to test for empty string; see + + (trivial change) + +2003-06-25 Akim Demaille + + * config/depcomp, config/install-sh: Update from masters. + +2003-06-20 Paul Eggert + + * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed, + and return properly parenthesized result. + * data/lalar1.cc (YYLLOC_DEFAULT): Likewise. + * data/yacc.c (YYLLOC_DEFAULT): Likewise. + Remove unnecessary parentheses from uses. + * doc/bison.texinfo (Location Default Action): Describe the + conventions for parentheses. + +2003-06-19 Paul Eggert + + * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce, + yyreportTree): Do not assume that size_t is the same width as int, + when printing sizes. Print sizes using an unsigned format. + Problem reported by Frank Heckenbach in + . + + Port to Forte Developer 7 C compiler. + * data/glr.c (struct YYLTYPE): If locations are not being used, + declare a single dummy member, as empty structs do not conform + to the C standard. + (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)"; + the Forte Developer 7 C compiler complains that end-of-loop + code is not reached. + +2003-06-17 Paul Eggert + + * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to + avoid warnings from picky compilers about redefinition of PARAMS. + +2003-06-17 Paul Eggert + + Version 1.875b. + + * NEWS: Document 1.875b. + + * lib/bbitset.h: Do not include config.h; that's the includer's job. + Do not include ; shouldn't be needed on a C89 host. + * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard. + Don't use 'index' in comments, as it's a builtin fn on some hosts. + * lib/bitset_stats.c: Include gettext.h unconditionally, as + per recent gettext manual's suggestion. + * lib/ebitset.c (ebitset_resize, ebitset_unused_clear): + Use prototypes, not old-style definitions. + * lib/lbitset.c (lbitset_unused_clear): Likewise. + * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero, + vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p, + vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp, + vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp, + vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp, + vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and, + vbitset_or_and_cmp, vbitset_copy): Likewise. + + * lib/libiberty.h: Do not include config.h; that's the includer's job. + Do not include . + (PARAMS): Define unconditionally for C89. + (ATTRIBUTE_NORETURN): Remove. + (ATTRIBUTE_UNUSED): Define unconditionally. + + Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in: + + * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h. + * lib/vbitset.c, lib/vbitset.h: New files. + * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h, + lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import + from libbitset. + + * doc/bison.texinfo (How Can I Reset the Parser): Renamed from + `How Can I Reset @code{yyparse}', since texinfo does not allow + arbitrary @ in node names. + + * m4/Makefile.am (EXTRA_DIST): Add the following files, which + shouldn't be needed according to the gettext 0.12.1 documentation + but which seem to be needed anyway: codeset.m4 glibc21.m4 + intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4 + lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4. + * po/Makefile.in.in: Upgrade to gettext 0.12.1 version. + + * lib/.cvsignore: Add stdbool.h. + * m4/.cvsignore: Add nls.m4, po.m4. + + Upgrade to CVS gnulib. + * stdbool_.h: File renamed from stdbool.h.in. + * configure.ac (AM_STDBOOL_H): Invoke this instead of + AC_HEADER_STDBOOL. + (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests. + (AM_GNU_GETTEXT_VERSION): Update to 0.12.1. + * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h. + (MOSTLYCLEANFILES): New var. + ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H). + (stdbool.h): New rule. + * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h, + lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c, + lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4, + m4/quote.m4: Upgrade to today's gnulib. + + * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL. + (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails + the tests right now. + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and + yyerror are declared before use; C99 requires this. + +2003-06-09 Paul Hilfinger + + * data/glr.c (YYERROR): Update definition to reset yyerrState to 0 + first. + (yyrecoverSyntaxError): Correct the logic for setting and testing + yyerrState. + Correct comment on handling EOF. + Allow states with only a default reduction, rather than failing + (I can't quite reconstruct why these were not allowed before). + + Fixes to avoid problem that $-N rules in GLR parsers can cause + buffer overruns, corrupting state. + + * src/output.c (prepare_rules): Output max_left_semantic_context + definition. + * src/reader.h (max_left_semantic_context): New variable declaration. + * src/scan-gram.l (max_left_semantic_context): Define. + (handle_action_dollar): Update max_left_semantic_context. + * data/glr.c (YYMAXLEFT): New definition. + (yydoAction): Increase size of yyrhsVals by YYMAXLEFT. + (yyresolveAction): Ditto. + + Fixes to problems with location handling in GLR parsers reported by + Frank Heckenbach (2003/06/05). + + * data/glr.c (YYLTYPE): Make trivial if locations not used. + (YYRHSLOC): Add parentheses, and define only if locations used. + (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if + locations not used. + (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp. + (yydoAction): Remove redundant initialization of *yyvalp and *yylocp. + + * tests/cxx-type.at: Exercise location information; update tests + to differentiate output with and without locations. + Remove forward declarations of yylex and yyerror---caused errors + because default YYLTYPE not yet defined. + Change semantic actions to compute strings, rather than printing + them directly (to test proper passing of semantics values). Change + output to prefix notation and update test data and expected results. + (yylex): Track locations. + (stmtMerge): Return value rather than printing, and include arguments + in value. + +2003-06-03 Paul Eggert + + Avoid warnings generated by GCC 2.95.4 when Bison is + configured with --enable-gcc-warnings. + * data/lalr1.cc (yy::]b4_parser_class_name[::parse, + yy::]b4_parser_class_name[::translate_, + yy::Stack::operator[] (unsigned), + yy::Stack::operator[] (unsigned) const, + yy::Slice::operator[] (unsigned), + yy::Slice::operator[] (unsigned) const): + Rename local vars to avoid warnings. + * tests/glr-regression.at (Improper handling of embedded actions + and $-N in GLR parsers): Remove unused local variable from yylex. + * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take + (void) as arg when not pure, since we now assume C89 when building + Bison. Pacify GCC by using parameter. + +2003-06-02 Paul Eggert + + * data/lalr1.cc (yy::Position::lines, yy::Position::columns, + yy::Location::lines, yy::Location::columns): Rename arguments + to avoid shadowing; this removes a warning generated by GCC 3.3. + +2003-06-01 Paul Eggert + + Don't pass C-only warning optins (e.g., -Wmissing-declarations) + to g++, as GCC 3.3 complains if you do it. + * configure.ac (WARNING_CXXFLAGS): New subst. Set it to + everything that WARNING_CFLAGS has, except omit warnings + not suitable for C++. + (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]). + * tests/atlocal.in (CXXFLAGS): New var. + * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS. + + Fix a GLR parser bug I reported in February; see + . + The problem was that GLR parsers did not conform to the C standard, + because actions like { $1 = $2 + $3; } expanded to expressions + that invoked YYFILL in separate subexpressions, and YYFILL assigned + to a local variable. The C standard says that expressions + like (var = f ()) + (var = f ()) have undefined behavior. + Another problem was that GCC sometimes issues warnings that + yyfill and its parameters are unused. + + * data/glr.c (yyfillin): Renamed from the old yyfill. Mark + as possibly unused. + (yyfill): New function. + (YYFILL): Use it. + (yyuserAction): Change type of yynormal to bool, so that it matches + the new yyfill signature. Mark it as possibly unused. + + + Follow up on a bug I reported in February, where a Bison-generated + parser can loop. Provide a test case and a fix for yacc.c. I + don't have a fix for lalr1.cc or for glr.c, unfortunately. + The original bug report is in: + + + * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the + macro's size was becoming unwieldy. + (yyerrlab): Do not discard an empty lookahead symbol, as this + might destroy garbage. + (yyerrorlab): New label, with the old contents of YYERROR, + plus the following change: pop the stack of rhs corresponding + to the production that invoked YYERROR. That is how Yacc + behaves, and POSIX requires this behavior. + (yyerrlab1): Use YYPOPSTACK instead of its definiens. + * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available. + Define 'alarm' to do nothing if unistd.h is not available. + Add a new rule "exp: '-' error;" to test the above change to + data/yacc.c. Use 'alarm' to abort any test taking longer than + 10 seconds, as it's probably looping. + (AT_CHECK_CALC): Test recovery from error in new grammar rule. + Also, the new yacc.c generates two fewer diagnostics for an + existing test. + +2003-05-24 Paul Eggert + + * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate + YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined. + This fixes a problem reported by John Bowman when the Compaq/HP + Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM + -ansi -Wall -gall). + * data/yacc.c (union yyalloc): Likewise. + (YYCOPY): Do not evaluate __GNUC__ unless it is defined. + + Switch from 'int' to 'bool' where that makes sense. + + * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p, + abitset_subset_p, abitset_disjoint_p, abitset_and_cmp, + abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or, + abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp): + Return or accept bool, not int. All callers changed. + * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_, + bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise. + * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_, + bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_, + bitset_or_and_cmp_): Likewise. + * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise. + * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle, + bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p, + bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp, + bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp, + bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp, + bitset_stats_or_and_cmp): Likewise. + * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp, + ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p, + ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp, + ebitset_xor_cmp): Likewise. + * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp, + lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p, + lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp, + lbitset_xor_cmp): Likewise. + * lib/bbitset.h: Include . + (struct bitset_vtable): The following members now return bool, not + int: toggle, test, empty_p, disjoint_p, equal_p, subset_p, + and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp, + or_and_cmp). + * src/conflicts.c (count_rr_conflicts): Likewise. + * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int. + All uses changed. + * lib/ebitset.c (ebitset_obstack_init): Likewise. + * lib/lbitset.c (lbitset_obstack_init): Likewise. + * src/getargs.c (debug_flag, defines_flag, locations_flag, + no_lines_flag, no_parser_flag, token_table_flag, yacc_flag, + graph_flag): Likewise. + * src/getargs.h (debug_flag, defines_flag, locations_flag, + no_lines_flag, no_parser_flag, token_table_flag, yacc_flag, + graph_flag): Likewise. + * src/output.c (error_verbose): Likewise. + * src/output.h (error_verbose): Likewise. + * src/reader.c (start_flag, typed): Likewise. + * src/reader.h (typed): Likewise. + * src/getargs.c (LOCATIONS_OPTION): New constant. + (long_options, getargs): Use it. + * src/lalr.c (build_relations): Use bool, not int. + * src/nullable.c (nullable_compute): Likewise. + * src/print.c (print_reductions): Likewise. + * src/tables.c (action_row, pack_vector): Likewise. + * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro. + * src/output.c (prepare): Use it. + * src/output.c (token_definitions_output, + symbol_destructors_output, symbol_destructors_output): Use string, + not boolean integer, to keep track of whether to output separator. + * src/print_graph.c (print_core): Likewise. + * src/state.c (state_rule_lookaheads_print): Likewise. + + * config/install-sh: Sync from automake 1.7.5. + +2003-05-14 Paul Eggert + + * src/parse-gram.y (rules_or_grammar_declaration): Require a + semicolon after a grammar declaration, in the interest of possible + future changes to the Bison input language. + Do not allow a stray semicolon at the start of the grammar. + (rhses.1): Allow one or more semicolons after any rule, including + just before "|" as required by POSIX. + * tests/input.at (Torturing the Scanner): Add tests for ";|" in a + grammar. + +2003-05-14 Alexandre Duret-Lutz + + %parse-param support for lalr1.cc. + + * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons, + b4_cc_constructor_calls, b4_cc_constructor_call, + b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4 + definitions. + (yy::b4_parser_class_name::b4_parser_class_name): Take extra + parse-param arguments. + (yy::b4_parser_class_name): Declare instance variables to + hold parse-param arguments. + * tests/calc.at: s/value/semantic_value/ because value clashes + with a member of yy::b4_parser_class_name. Adjust C++ code + to handle %parse-param. Enable %parse-param test in C++. + +2003-05-12 Paul Eggert + + * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the + English a bit. Fix fclose typo. Change "const char" to "char + const", and use ANSI C rather than K&R for "main". Suggest + YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends) + and suggest yy_switch_to_buffer. + +2003-05-05 Paul Eggert + + * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes + C89. This avoids a diagnostic on compilers that define __STDC__ + to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in + . + +2003-05-03 Paul Eggert + + * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE): + Do not overrun array bounds. + This should fix a bug reported today by Olatunji Oluwabukunmi in + . + +2003-04-29 Akim Demaille + + * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to... + * src/getargs.c, src/getargs.h: here, as bool, not int. + (nondeterministic_parser): New. + * src/parse-gram.y, src/scan-gram.l: Support + %nondeterministic-parser. + * src/output.c (prepare): Use nondeterministic_parser instead + of glr_parser where appropriate. + * src/tables.c (conflict_row, action_row, save_row) + (token_actions, token_actions, pack_vector): Ditto. + +2003-04-29 Akim Demaille + + * doc/bison.texinfo (C++ Parsers, Implementing Loops): New. + +2003-04-29 Akim Demaille + + * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet) + with %pure-parser and %locations to exercise the patch from Yakov + Markovitch below. + +2003-04-28 Tim Van Holder + + * data/yacc.c: (b4_lex_param): Corrected for the case where + %lex-param is provided and %pure-parser isn't. + +2003-04-27 Paul Eggert + + Avoid gcc -Wundef warnings reported by Gerald Pfeifer in + . + * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA + if it is not defined. + (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined. + +2003-04-26 Paul Eggert + + * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_): + Declare to be of type suitable for the ninf value itself, not of + type suitable for the corresponding table, since the latter might + be unsigned but the ninf value might be negative. This fixes a + bug reported by Alexandre Duret-Lutz in + . + + * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR + invokes it. We shouldn't invoke it twice because it will attempt + to put error.o in the archive twice. This fixes a glitch reported + by Martin Mokrejs in + . + +2003-04-21 Paul Eggert + + * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch + to gnulib. + +2003-04-21 Yakov Markovitch + + * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]: + Fix obvious typo that results in uncompilable GLR parsers + when both %pure-parser and %locations are used. (trivial change) + +2003-04-17 Paul Eggert + + * src/scan-gram.l: Add %option nounput, since we no longer use unput. + (unexpected_eof): Renamed from unexpected_end_of_file, for brevity. + Do not insert the expected token via unput, as this runs afoul + of a POSIX-compatibility bug in flex 2.5.31. + All uses changed to BEGIN the parent state, + since we no longer insert the expected token via unput. + * tests/regression.at (Invalid inputs): Remove cascaded diagnostic + that is no longer emitted after the above change. + + * src/conflicts.c (set_conflicts): Resolve all conflicts, not just + the first one. This change is from Paul Hilfinger, and it fixes + regression reported by Werner Lemberg in + . + + (resolve_sr_conflict): Don't invoke state_errs_set + unless one or more tokens have been explicitly made errors. + Otherwise, the above change causes Bison to abort. + + * tests/existing.at (GNU pic Grammar): New test case, taken from + Lemberg's email. + +2003-03-31 Akim Demaille + + * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file. + +2003-03-31 Akim Demaille + + * src/output.c (prepare_symbols): Avoid trailing spaces in the + output. + +2003-03-31 Akim Demaille + + * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/. + From Paul Hilfinger. + +2003-03-29 Akim Demaille + + * m4/error.m4: Do not put under dynamic conditions some code which + expansion is under static control. + +2003-03-29 Akim Demaille + + * doc/bison.texinfo (How Can I Reset @code{yyparse}): New. + +2003-03-29 Akim Demaille + + * doc/bison.texinfo (Strings are Destroyed): New. + +2003-03-13 Paul Eggert + + * .cvsignore: Add configure.lineno. + * src/.cvsignore: Add yacc. + * tests/.cvsignore: Add testsuite.log. + * doc/fdl.texi: Sync with latest FSF version. + +2003-03-12 Paul Eggert + + * scan-gram.l (YY_USER_INIT): Initialize code_start, too. + (<>, <>): Set *loc to the scanner + cursor, instead of leaving it undefined. This fixes a bug + reported by Tim Van Holder in + . + * tests/input.at (Torturing the Scanner): Test the scanner on + an empty input file, which was Tim Van Holder's test case. + + * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether + can be included, include sys/time.h and + sys/times.h first, if available. This works around the SunOS + 4.1.4 porting bug reported by Bruce Becker in + . + + * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't + AC_CHECK_HEADERS([sys/wait.h]), as this interferes with + AC_HEADER_SYS_WAIT. + + Merge changes from gnulib. This was prompted because the CVS + snapshot didn't build on Solaris 7 due to strnlen problems. + + These changes need to be merged back into gnulib: + * lib/hash.c: Include unconditionally. + * m4/onceonly.m4 (m4_quote): New macro. + (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE): + Quote AC_FOREACH variable-expansions properly. + The 2003-01-03 obstack.h change also needs merging. + {end of changes requiring merging} + + * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4, + m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4, + m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4, + m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4, + m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4: + New files, imported from gnulib. + * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned + above. + + * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4, + m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current + gnulib sources. + + * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC): + Add. + (gl_ERROR): New, replacing jm_PREREQ_ERROR. + (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA. + (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy). + (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN. + (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH. + (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK. + (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG. + (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New. + (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC. + (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC. + (jm_PREREQ_ARGMATCH): Remove. + (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul. + * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h. + + * src/system.h: Include unconditionally. + + * lib/bbitset.h: Include unconditionally. We have been + assuming at least C89 in the bitset code for some time now. + +2003-03-03 Akim Demaille + + * ro.po: New. + +2003-03-02 Akim Demaille + + * doc/bison.texinfo (Table of Symbols): Reactivate the + documentation for %lex-param, and %parse-param. + +2003-03-02 Akim Demaille + + * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to + generate verbose error messages. + Use the number of tokens as an upper bound in yytname, as it + cannot be a non terminal. + +2003-03-02 Akim Demaille + + * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error + message. + +2003-03-02 Akim Demaille + + * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New. + Use them to exercise yycheck overrun. + Based on Andrew Suffield's grammar. + +2003-03-02 Akim Demaille + + Create tests/local.at for Bison generic testing macros. + + * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to... + * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): + This new file. + * tests/calc.at (AT_CHECK_CALC): Adjust. + * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR) + (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to... + * tests/local.at: here. + (AT_COMPILE_CXX): Tags the tests using it as c++. + Ignore the test if CXX is not functional. + +2003-03-01 Paul Eggert + + * src/scan-gram.l (code_start): Initialize it to scanner_cursor, + not loc->end, since loc->end might contain garbage and this leads + to undefined behavior on some platforms. + (id_loc, token_start): Use (IF_LINTed) initial values that do not + depend on *loc, so that the reader doesn't give the the false + impression that *loc is initialized. + ("%%"): Do not bother setting code_start, since its value + does not survive the return. + +2003-03-01 Akim Demaille + + * src/scan-gram.l (code_start): Always initialize it when entering + into yylex, as SC_EPILOGUE is activated *before* the corresponding + yylex invocation. An alternative would be making it static, but + then it starts with the second %%'s beginning, instead of its end. + +2003-02-28 Paul Eggert + + * lib/mbswidth.c: Include before "mbswidth.h", to work + around a UnixWare 7.1.1 porting bug reported by John Hughes in + . + +2003-02-26 Paul Eggert + + * README: Mention compiler bug in Sun Forte Developer 6 update 2. + Remove Sequent/Pyramid discussion (nobody uses them any more). + Merge VMS and MS-DOS discussion; these ports may well be dead + but let's keep mentioning them for now. Put <> around email + addresses. Add copyright notice. + +2003-02-24 Paul Eggert + + * data/glr.c (yy_reduce_print): yylineno -> yylno, + to avoid collision with flex use of yylineno. + Problem reported by Bruce Lilly in + . + * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise. + * data/yacc.c (yy_reduce_print): Likewise. + + * config/depcomp: Sync with Automake 1.7.3. + +2003-02-21 Akim Demaille + + * data/lalr1.cc: Use temporary variables instead of casts to + change integer types. + Suggested by Paul Eggert. + +2003-02-21 Akim Demaille + + * doc/bison.texinfo: Use "location" consistently to refer to @n, + to avoid confusions with lalr1.cc's notion of Position. + Suggested by Paul Eggert. + +2003-02-20 Akim Demaille + + * data/lalr1.cc (position.hh): Make sure "columns" never pushes + before initial_columns. + (location.hh): Use consistent variable names when defining the + operator<<. + Use "last" so that we subtract from Positions, not from unsigned. + +2003-02-20 Akim Demaille + + * data/lalr1.cc (position.hh): New subfile, including the extended + and Doxygen'ed documentation of class Position. + (location.hh): Use it. + Document a` la Doxygen. + With the help of Benoit Perrot. + +2003-02-20 Akim Demaille + + * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define + AT_YACC_IF. + Redefine AT_YYERROR_SEES_LOC_IF using it. + (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is + not defined. + Don't use the location in yy::Parser::error_ and + yy::Parser::print_ when not %locations. + Activate more lalr1.cc tests. + +2003-02-19 Akim Demaille + + * data/lalr1.cc: When displaying a line number, be sure to make it + an int. + +2003-02-19 Akim Demaille + + * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_): + Remove, useless. + (YYABORT, YYACCEPT, YYERROR): New. + * tests/calc.at: Renable the lalr1.cc test. + +2003-02-19 Akim Demaille + + * tests/calc.at (AT_CHECK_CALC): Check different scenarios of + error recovery, mixing with/without pops and discarding of the + lookahead. + Exercise YYERROR. + Disable the lalr1.cc tests as currently it doesn't support YYERROR. + +2003-02-17 Paul Eggert + + * tests/atlocal.in (LDFLAGS, LIBS): New vars. + * tests/testsuite.at (AT_COMPILE): Use them. + This fixes the testsuite problem reported by Robert Lentz in + . + +2003-02-12 Paul Eggert + + * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]: + Avoid subscript error in yycheck. Bug reported by Andrew Suffield in + . + * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise. + Check for malloc failure, for consistency with yacc.c. + (yytname_size): Remove, for consistency with yacc.c. + + The bug still remains in data/lalr1.cc, as I didn't have time + to fix it there. + +2003-02-06 Akim Demaille + + * configure.ac (GXX): Rename as... + (CXX): this, to keep the original Autoconf semantics. + Require 2.57. + * data/lalr1.cc: Fix b4_copyright invocations. + If YYDEBUG is not defined, don't depend upon name_ being defined. + (location.hh): Include string and iostream. + (Position::filename): New member. + (Position::Position ()): New. + (operator<< (Position)): New. + (operator- (Position, int)): New. + (Location::first, Location::last): Rename as... + (Location::begin, Location::end): these, to mock the conventional + iterator names. + (operator<< (Location)): New. + * tests/atlocal.in (CXX): New. + * tests/testsuite.at (AT_COMPILE_CXX): New. + * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the + locations in a more synthetic way. + (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if + lalr1.cc is used. + Adjust the C locations to match those from Emacs: first column is + column 0. + Change all the expected results. + Conform to the GCS: simplify the locations when applicable. + (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS) + (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace + these CPP macros with the m4 macros new defined by... + (AT_CHECK_PUSHDEFS): this, i.e.: + (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS) + (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS) + New macros. + (AT_CHECK_POPDEFS): Undefine them. + (AT_CHECK_CALC_LALR1_CC): New. + Use it for the first lalr1.cc test. + +2003-02-04 Akim Demaille + + * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on + Location as is defined. + +2003-02-04 Akim Demaille + + * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon + name_ being defined. + +2003-02-03 Paul Eggert + + * src/gram.h (start_symbol): Remove unused decl. + + Use more-consistent naming conventions for local vars. + + * src/derives.c (derives_compute): Change type of local var from + int to rule_number. + * src/gram.c (grammar_rules_partial_print): Likewise. + * src/print.c (print_core): Likewise. + * src/reduce.c (reduce_grammar_tables): Likewise. + + * src/gram.c (grammar_dump): Change name of item_number * + local var from r to rp. + * src/nullable.c (nullable_compute): Likewise. + + * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var. + + * src/gram.h (symbol_number_as_item_number): Use sym, not s, + for symbol or symbol_number var. + * src/reader.c (grammar_start_symbol_set): Likewise. + * src/reader.h (grammar_start_symbol_set, grammar_symbol_append): + Likewise. + * src/state.c (transitions_to): Likewise. + * src/state.h: Likewise. + * src/tables.c (symbol_number_to_vector_number): Likewise. + + * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for + char * var. + + * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE + var. + + * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size + var. + + * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr): + Use str, not s, for char * var. Use ch, not c, for character var. + Use size for size var. + + * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for + char * var. + (uniqstr_print, uniqst_print_processor): Use ustr, not s, for + uniqstr var. + * src/uniqstr.h: Likewise. + + * src/vcg.c (get_color_str, get_textmode_str, get_shape_str, + get_layoutalgorithm_str, get_decision_str, get_orientation_str, + get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str, + get_view_str, get_linestyle_str, get_arrowstyle_str): Rename + param to have same name as that of enum, so that we don't use + "s" to stand for a non-state. + +2003-02-02 Akim Demaille + + * src/scan-skel.l: Scan more than one inert character per yylex + invocation. + +2003-02-01 Paul Eggert + + Version 1.875a. + + * po/LINGUAS: Add ms. + +2003-01-30 Akim Demaille + + * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck. + +2003-01-29 Paul Hilfinger + + * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead + of $1. + + Changes in response to error report by S. Eken: GLR mode does not + handle negative $ indices or $ indices in embedded rules correctly. + See . + + * data/glr.c (b4_rhs_value): Change to use YYFILL macro. + (b4_rhs_location): Ditto. + (yyfill): New function to copy from stack tree into array + incrementally. + (yyuserAction): Modify to allow incremental move of semantic values + to rhs array when in GLR mode. + Define YYFILL to use in user-defined actions to fill semantic array + as needed. + Remove dummy use of yystack, as there is now a guaranteed use. + (yydoAction): Modify to allow incremental move of semantic values + to rhs array when in GLR mode. + (yyresolveAction): Ditto. + (yyglrShiftDefer): Update comment. + (yyresolveStates): Use X == NULL for pointers, not !X. + (yyglrReduce): Ditto. + (yydoAction): Ditto + + * tests/glr-regr1.at: Rename to ... + * tests/glr-regression.at: Add new regression test for the problems + described above (adapted from S. Eken). + Update copyright notice. + * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at. + * tests/Makefile.am: Ditto. + +2003-01-28 Paul Eggert + + * data/lalr1.cc: Do not use @output_header_name@ unless + b4_defines_flag is set. This fixes two bugs reported by + Tim Van Holder in + + and . + +2003-01-21 Paul Eggert + + * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that + we don't need to worry about yyerrlab1 being reported as an + "unused label" by non-GCC C compilers. The downside is that if + locations are used then a couple of statements are duplicated each + time YYERROR is invoked, but the upside is that the warnings + should vanish. + (yyerrlab1): Move code to YERROR. + (yyerrlab2): Remove. Change uses back to yyerrlab1. + This reverts some of the 2002-12-27 change. + +2003-01-17 Paul Eggert + + * src/output.c (symbol_printers_output): Fix typo that led + to core dump. Problem reported by Antonio Rus in + . + +2003-01-13 Akim Demaille , + Quoc Peyrot , + Robert Anisko + + * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop + when the stacks contain one element, as the loop would otherwise + free the last state, and then use the top state (the one we just + popped). This means that the initial elements will not be freed + explicitly, as is the case in yacc.c; it is not a problem, as + these elements have fake values. + +2003-01-11 Paul Eggert + + * NEWS: %expect-violations are now just warnings, reverting + to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2 + bootstrapping problem reported by Matthias Klose; see + . + * src/conflicts.c (conflicts_print): Likewise. + * tests/conflicts.at (%expect not enough, %expect too much, + %expect with reduce conflicts): Likewise. + * doc/bison.texinfo (Expect Decl): Document this. Also mention + that the warning is enabled if the number of conflicts changes + (not necessarily increases). + + * src/getargs.c (version): Update copyright year. + +2003-01-09 Akim Demaille + + * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@. + +2003-01-08 Paul Eggert + + * Makefile.maint (WGETFLAGS): + New macro, containing "-C off" to disable proxy caches. + All uses of $(WGET) changed to $(WGET) $(WGETFLAGS). + (rel-check): Use $(WGET) instead of wget. + +2003-01-06 Paul Eggert + + * doc/bison.texinfo (Generalized LR Parsing): Add a reference to + the GLR paper of Scott, Johnstone and Hussain. + +2003-01-04 Paul Eggert + + * configure.ac (AC_ARG_ENABLE): Add --disable-yacc. + (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST. + * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@. + (EXTRA_LIBRARIES): New var, for liby.a. + * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@. + (EXTRA_SCRIPTS): New var, for yacc. + + * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined, + since GNU C++ (as of 3.2.1) does not allow attributes on labels. + Problem reported by Nelson H. F. Beebe. + +2003-01-03 Paul Eggert + + * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to + (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5 + when compiling Bison 1.875's `bitset bset = obstack_alloc + (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe. + + * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition. + ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not + grow to a huge size with typical invocation. + + * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined): + Use the pattern recommended by Autoconf 2.57, except also protect + against double-definition. + * src/system.h: Likewise. + Portability issues reported by Nelson H. F. Beebe. + + * data/glr.c (yybool): Renamed from bool, to avoid collisions in C. + All uses changed. Provide a definition in both C and C++. + (yytrue, yyfalse): Define even if defined (__cplusplus). + + * lib/bitset_stats.c (bitset_stats_list): Remove unused var. + Reported by Nelson H. F. Beebe. + + * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno. + +2003-01-02 Paul Eggert + + * data/yacc.c (yyerrlab1): Append `;' after attribute, to + pacify the buggy "smart preprocessor" in MacOS 10.2.3. + Bug reported by Nelson H. F. Beebe. + +2003-01-01 Paul Eggert + + * Version 1.875. + +2002-12-30 Paul Eggert + + * src/scan-gram.l (","): + Moved here from... + (","): Here. This causes stray "," to be treated + more uniformly. + + * src/scan-gram.l ("}"): Output ";" before the + last brace in braced code when not in Yacc mode, for compatibility + with Bison 1.35. This resurrects the 2001-12-15 patch to + src/reader.c. + + * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias + yystype. This follows up the 2002-12-24 YYSTYPE bug fix. + +2002-12-28 Paul Eggert + + * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be + that of SYM's type. This fixes Debian bug 168069, reported by + Thomas Olsson. + +2002-12-28 Paul Eggert + + Version 1.75f. + + Switch back to the Yacc style of conflict reports, undoing some + of the 2002-07-30 change. + * doc/bison.texinfo (Understanding): Use Yacc style for + conflict reports. Also, use new way of locating rules. + * src/conflicts.c (conflict_report): + Renamed from conflict_report_yacc, removing the old + 'conflict_report'. Translate the entire conflict report at once, + so that we don't assume that "," has the same interpretation in + all languages. + (conflicts_output): Use Yacc-style conflict report for each state, + instead of our more-complicated style. + (conflicts_print): Use Yacc-style conflict report, except print + the input file name when not emulating Yacc. + * tests/conflicts.at (Unresolved SR Conflicts, Defaulted + Conflicted Reduction, %expect not enough, %expect too much, + %expect with reduce conflicts): Switch to Yacc-style conflict reports. + * tests/existing.at (GNU Cim Grammar): Likewise. + * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise. + + * src/complain.c (warn_at, warn, complain_at, complain, fatal_at, + fatal): Don't invoke fflush; it's not needed and it might even be + harmful for stdout, as stdout might not be open. + * src/reduce.c (reduce_print): Likewise. + +2002-12-27 Paul Eggert + + Fix a bug where error locations were not being recorded correctly. + This problem was originally reported by Paul Hilfinger in + . + + * data/yacc.c (yyparse): New local var yylerrsp, to record the + top of the location stack's error locations. + (yyerrlab): Set it. When discarding a token, push its location + onto yylerrsp so that we don't lose track of the error's end. + (yyerrlab1): Now is only the target of YYERROR, so that we can + properly record the location of the action that failed. For GCC + 2.93 and later, insert an __attribute__ ((__unused__)) to avoid + GCC warning about yyerrlab1 being unused if YYERROR is unused. + (yyerrlab2): New label, which yyerrlab now falls through to. + Compute the error's location by applying YYLLOC_DEFAULT to + the locations of all the symbols that went into the error. + * doc/bison.texinfo (Location Default Action): Mention that + YYLLOC_DEFAULT is also invoked for syntax errors. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): + Error locations include the locations of all the tokens that were + discarded, not just the last token. + +2002-12-26 Paul Eggert + + * src/files.c: Include quote.h. + (compute_output_file_names): Warn if we detect conflicting + outputs to the same file. This should catch the misunderstanding + exemplified by Debian Bug 165349, reported by Bruce Stephens.. + + * src/conflicts.c (conflicts_print): If the user specifies + "%expect N", report an error if there are any reduce/reduce + conflicts. This is what the manual says should happen. + This fixes Debian bug 130890, reported by Anthony DeRobertis. + * tests/conflicts.at (%expect with reduce conflicts): New test. + + Don't use m4_include on relative file names, as it doesn't work as + desired if there happens to be a file with that name under ".". + + * m4sugar/version.m4: Remove; it was included but it wasn't used. + * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4. + * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4. + * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4. + * src/output.c (output_skeleton): Use full path names when + specifying a file to include; don't rely on include path, as + it's unreliable when the working file contains a file with + that name. + +2002-12-25 Paul Eggert + + Remove obsolete references to bison.simple and bison.hairy. + Problem mentioned by Aubin Mahe in + . + * data/glr.c: Comment fix. + * doc/bison.1: Remove references. Also, mention "yacc". + + * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL + with -g option. + + * src/parse-gram.y (declaration): Use enum "report_states" rather + than its numeric value 1. + + * src/scan-skel.l ("@output ".*\n): Close any old yyout before + opening a new one. This fixes Debian bug 165349, reported by + Bruce Stephens. + +2002-12-24 Paul Eggert + + Version 1.75e. + + * Makefile.maint (cvs-update): Don't assume that the shell + supports $(...), as Solaris sh doesn't. + + * src/parse-gram.y (lloc_default): Remove test for empty + nonterminals at the end, since it didn't change the result. + +2002-12-24 Paul Eggert + + If the user does not define YYSTYPE as a macro, Bison now declares it + using typedef instead of defining it as a macro. POSIX requires this. + For consistency, YYLTYPE is also declared instead of defined. + + %union directives can now have a tag before the `{', e.g., the + directive `%union foo {...}' now generates the C code + `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility. + The default union tag is `YYSTYPE', for compatibility with Solaris 9 + Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE' + instead of `yyltype'. + + `yystype' and `yyltype' are now obsolescent macros instead of being + typedefs or tags; they are no longer documented and will be + withdrawn in a future release. + + * data/glr.c (b4_location_type): Remove. + (YYSTYPE): Renamed from yystype. + (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef. + (struct YYLTYPE): Renamed from struct yyltype. + (YYLTYPE): Renamed from yyltype. + (yyltype, yystype): New (and obsolescent) macros, + for backward compatibility. + * data/yacc.c: Likewise. + + * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user + does not specify a union tag. This is for compatibility with + Solaris 9 yacc. + + * src/parse-gram.y (add_param): 2nd arg is now char * not char + const *, since it is now modified by stripping surrounding { }. + (current_braced_code): Remove. + (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION, + PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include + trailing " {...}". Now of type . + (grammar_declaration): Adjust to bundled tokens. + (code_content): Remove; stripping is now done by add_param. + (print_token_value): Print contents of bundled tokens. + (token_name): New function. + + * src/reader.h (braced_code, current_braced_code): Remove. + (token_name): New decl. + + * src/scan-gram.l (handle_dollar, handle_at): Now takes int + token_type, not braced_code code_kind. All uses changed. + (SC_PRE_CODE): New state, for scanning after a keyword that + has (or usually has) an immediately-following braced code. + (token_type): New local var, to keep track of which token type + to return when scanning braced code. + ("%destructor", "%lex-param", + "%parse-param", "%printer", + "%union"): Set token type and BEGIN SC_PRE_CODE + instead of returning a token type immediately. + ("{"): Set token type. + ("}"): Use it. + (handle_action_dollar, handle_action_at): Now returns bool + indicating success. Fail if ! current_rule; this prevents a core dump. + (handle_symbol_code_dollar, handle_symbol_code_at): + Remove; merge body into caller. + (handle_dollar, handle_at): Complain in invalid contexts. + + * NEWS, doc/bison.texinfo: Document the above. + * NEWS: Fix years and program names in copyright notice. + +2002-12-17 Paul Eggert + + * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error + Reporting, Table of Symbols): Omit mentions of %lex-param and + %parse-param from the documentation for now. + +2002-12-15 Paul Eggert + + Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke + GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no + lookahead symbol, and which sets yychar in parser actions) and it + disagreed with the Bison documentation. Bug + reported by Andrew Walrond. + + * data/yacc.c (YYTRANSLATE): Don't check for negative argument, + as the caller now does that. + (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken. + (YYEMPTY): Parenthesize right hand side, since others use it. + (yyparse): Don't assume that our generated code is the only code + that sets yychar. + +2002-12-13 Paul Eggert + + Version 1.75d. + + POSIX requires a "yacc" command. + * src/Makefile.am (bin_SCRIPTS): New macro, for yacc. + (MOSTLYCLEANFILES): Add yacc. + (yacc): New rule. + * doc/bison.texinfo (Invocation, Bison Options): Mention yacc + as an alias for bison y. + + * po/LINGUAS: Add da. + + * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around + problem with latest . + (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro. + + * doc/fdl.texi: Upgrade to 1.2. + * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h + lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c, + lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with + gnulib. + * config/install-sh: Sync with autotools. + + Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in + . + * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless + locations are requested. + (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless + locations are requested. + +2002-12-12 Paul Eggert + + Remove unportable casts and storage allocation tricks. + While we're at it, remove almost all casts, since they + usually aren't needed and are a sign of trouble. + + * configure.ac (AC_CHECK_TYPES): Check for uintptr_t. + + * src/derives.c (derives_compute): Do not subtract NTOKENS from + the pointer DSET returned by malloc; this isn't portable. + Instead, always use DSET[i - NTOKENS] rather than DSET[i]. + Similarly for DERIVES. + * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP. + * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE. + * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap + + * src/derives.c (derives_compute): Do not bother invoking + int_of_rule_number, since rule numbers are integers. + + * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N) + rather than XMALLOC (char, N). + + * src/files.c (filename_split): Rewrite to avoid cast. + + * src/gram.h (symbol_number_as_item_number, + item_number_as_symbol_number, rule_number_as_item_number, + item_number_as_rule_number): + Now inline functions rather than macros, to avoid casts. + * src/state.h (state_number_as_int): Likewise. + * src/tables.c (state_number_to_vector_number, + symbol_number_to_vector_number): Likewise. + + * src/gram.h (int_of_rule_number): Remove; no longer used. + + * src/lalr.c (add_lookback_edge): Use malloc rather than calloc, + since the resulting storage is always stored into. + + * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place + where it's needed. + + * src/muscle_tab.c (muscle_m4_output): + Now inline. Return bool, not int. + * src/state.c (state_compare): Likewise. + * src/symtab.c (symbol_check_defined, + symbol_check_alias_consistency, symbol_pack, symbol_translation, + hash_compare_symbol, hash_symbol): + Likewise. + * src/uniqstr.c (uniqstr_print): Likewise. + * src/muscle_tab.c (muscle_m4_output_processor): + New function, to avoid casts. + * src/state.c (state_comparator, stage_hasher): Likewise. + * src/symtab.c (symbol_check_defined_processor, + symbol_check_alias_consistency_processor, symbol_pack_processor, + symbol_translation_processor, hash_symbol_comparator, + hash_symbol_hasher): Likewise. + * src/uniqstr.c (uniqstr_print_processor): Likewise. + * src/muscle_tab.c (muscles_m4_output): + Use new functions instead of casting old functions unportably. + * src/state.c (state_hash_new): Likewise. + * src/symtab.c (symbols_new, symbols_do, symbols_check_defined, + symbols_token_translations_init): + Likewise. + * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise. + + * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local + var instead of casting to long, to avoid casts. + (prepare_states): Use MALLOC rather than alloca, so that we don't + have to worry about alloca. + * src/state.c (state_hash_lookup): Likewise. + + * src/scan-gram.l ("'"): Use unsigned char + local var instead of casting to unsigned char, to avoid casts. + + * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC, + STATE_ALLOC): Remove. + (transitions_new, errs_new, reductions_new, state_new): Use malloc + rather than calloc, and use offsetof to avoid allocating slightly + too much storage. + (state_new): Initialize all members. + + * src/state.c (state_hash): Use unsigned accumulator, not signed. + + * src/symtab.c (symbol_free): Remove; unused. + (symbol_get): Remove cast in lhs of assignment. + (symbols_do): Now static. Accept generic arguments, not + hashing-related ones. + + * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast. + (symbol_processor): Remove. + (symbols_do): Remove decl; now static. + + * src/system.h (alloca): Remove; decl no longer needed. + (): Include, for offsetof. + (, ): Include if available. + (uintptr_t): New type, if system lacks it. + (CALLOC, MALLOC, REALLOC): New macros. + All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these + new macros. + + * src/tables.c (table_size): Now int, to pacify GCC. + (table_grow, table_ninf_remap): Use signed table size. + (save_row): Don't bother initializing locals when not needed. + (default_goto, goto_actions, pack_vector): Remove unnecessary casts. + * src/uniqstr.c (hash_compare_uniqstr): Likewise. + + * src/vcg.h: Correct misspellings. + + * src/vcg_defaults.h (G_CMAX): Now INT_MAX. + + + * src/getargs.c (getargs): Don't assume EOF == -1. + +2002-12-09 Paul Eggert + + Change identifier spellings to avoid collisions with names + that are reserved by POSIX. + + Don't use names ending in _t, since POSIX reserves them. + For consistency, remove _e and _s endings -- they're weren't + needed to remove ambiguity. All uses changed. + * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in + turn was just renamed from struniq_t. + * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor, + which in turn was just renamed from struniq_processor_t. + (hash_compare_uniqstr): Renamed from hash_compare_struniq, which + in turn was renamed from hash_compare_struniq_t. + * src/LR0.c (struct state_list): Renamed from struct state_list_s. + (state_list): Renamed from state_list_t. + * src/assoc.h (assoc): Renamed from assoc_t. + * src/conflicts.c (enum conflict_resolution): Renamed from + enum conflict_resolution_e. + * src/derives.c (struct rule_list): Renamed from struct rule_list_s. + (rule_list): Renamed from rule_list_t. + * src/getargs.h (enum trace): Renamed from enum trace_e. + (enum report): Renamed from enum report_e. + * src/gram.h (item_number): Renamed from item_number_t. + (rule_number): Renamed from rule_number_t. + (struct rule_s): Remove the "rule_s" part; not used. + (rule): Renamed from rule_t. + (rule_filter): Renamed from rule_filter_t. + * src/lalr.c (struct goto_list): Renamed from struct goto_list_s. + (goto_list): Renamed from goto_list_t. + * src/lalr.h (goto_number): Renamed from goto_number_t. + * src/location.h (location): Renamed from location_t. + * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t, + and moved here from: + * src/muscle_tab.h (muscle_entry_t): here. + * src/nullable.c (struct rule_list): Renamed from struct rule_list_s. + (rule_list): Renamed from rule_list_t. + * src/print_graph.c (static_graph): Renamed from graph. + * src/reader.h (braced_code): Renamed from braced_code_t. + Remove brace_code_e tag. + * src/relation.h (relation_node): Renamed from relation_node_t. + (relation_nodes): Renamed from relation_nodes_t. + (relation): Renamed from relation_t. + * src/state.h (state_number): Renamed from state_number_t. + (struct state): Renamed from struct state_s. + (state): Renamed from state_t. + (transitions): Renamed from transitions_t. Unused (and + misspelled) transtion_s tag removed. + (errs): Renamed from errs_t. Unused errs_s tag removed. + (reductions): Renamed from reductions_t. Unused tag + reductions_s removed. + * src/symlist.h (symbol_list): Renamed from symbol_list_t. + (struct symbol_list): Renamed from struct symbol_list_s. + * src/symtab.h (symbol_number): Renamed from symbol_number_t. + (struct symbol): Renamed from struct symbol_s. + (symbol): Renamed from symbol_t. + * src/tables.c (vector_number): Renamed from vector_number_t. + (action_number): Renamed from action_t. + * src/tables.h (base_number): Renamed from base_t. + * src/vcg.h (enum color): Renamed from enum color_e. + (enum textmode): Renamed from enum textmode_e. + (enum shape): Renamed from enum shape_e. + (struct colorentry): Renamed from struct colorentry_s. + (struct classname): Renamed from struct classname_s. + (struct infoname): Renamed from struct infoname_s. + (enum layoutalgorithm): Renamed from enum layoutalgorithm_e. + (enum decision): Renamed from enum decision_e. + (enum orientation): Renamed from enum orientation_e. + (enum alignment): Renamed from enum alignment_e. + (enum arrow_mode): Renamed from enum arrow_mode_e. + (enum crossing_type): Renamed from enum crossing_type_e. + (enum view): Renamed from enum view_e. + (struct node): Renamed from struct node_s. + (node): Renamed from node_t. + (enum linestyle): Renamed from enum linestyle_e. + (enum arrowstyle): Renamed from enum arrowstyle_e. + (struct edge): Renamed from struct edge. + (edge): Renamed from edge_t. + (struct graph): Renamed from struct graph_s. + (graph): Renamed from graph_t. + * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator): + Rename value_t -> value. + * tests/input.at (Torturing the Scanner): Rename value_t -> value, + value_t_as_yystype -> value_as_yystype. + + Don't include in the mainstream code, since it + reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'. + * lib/get-errno.c, lib/get-errno.h: New files. + * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h, + get-errno.c. + * src/files.c (xfopen, xfclose): Use get_errno instead of errno. + * src/output.c (output_skeleton): Likewise. + * src/scan-gram.l ({int}): Use set_errno and get_errno + instead of errno. + (\\x[0-9abcdefABCDEF]+): + Likewise. + (handle_action_dollar, handle_action_at): Likewise. + * src/system.h: Do not include . + (TAB_EXT): Renamed from EXT_TAB. + (OUTPUT_EXT): Renamed from EXT_OUTPUT. + + Avoid str[a-z]*, since reserves that name space. + Change all instances of "struniq" in names to "uniqstr", and + likewise for "STRUNIQ" and "UNIQSTR". + * src/uniqstr.c: Renamed from src/struniq.c. + * src/uniqstr.h: Renamed from src/struniq.h. + * src/Makefile.am (bison_SOURCES): Adjust to these renamings. + * src/files.c (strsuffix): Remove; unused. + (concat2): Renamed from stringappend. Now static. + * src/files.h (strsuffix, stringappend): Remove; unused. + * src/parse-gram.y (): Renamed from . + (): Renamed from . + * src/scan-gram.l (obstack_for_string): Renamed from string_obstack. + * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch. + (struct graph_s.expand): Renamed from struct graph_s.stretch. + * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH. + (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE. + (N_EXPAND): Renamed from N_STRETCH. + + Avoid *_MAX and *_MIN, since reserves that name space. + * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX. + * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX): + Remove; unused. + * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX. + * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX. + * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX. + * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused. + (BASE_MAXIMUM): Renamed from BASE_MAX. + (BASE_MINIMUM): Renamed from BASE_MIN. + (ACTION_MAX): Remove; unused. + (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN. + Unnecessary casts removed from above defines. + + + Fix misspelling in names. + * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e. + * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from + G_NODE_ALIGNEMENT. + + + * lib/timevar.c (timevar_report): Renamed from time_report, + for consistency with other names. + * lib/timevar.h (timevar_report): New decl. + * src/system.h (time_report): Remove; decl is now in lib/timevar.h. + + + Sort include-file uses. + + Reorder all include files under src to be in the order "system.h". + then the ../lib include files in angle brackets (alphabetized), + then the . include files in double-quotes (alphabetized). Fix + dependency breakages encountered in this process, as follows: + * src/closure.h, src/derives.h, src/state.h: Include "gram.h". + * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff. + * src/state.h: Include "symtab.h". + +2002-12-08 Paul Eggert + + * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__, + since this causes problems when __file__ contains character + sequences like "@" that are treated specially by src/scan-skel.l. + Instead, just use the file's basename. This fixes the bug + reported by Martin Mokrejs in + . + +2002-12-06 Paul Eggert + + Add support for rules that do not have trailing semicolons, as + POSIX requires. Improve the quality of locations in Bison + diagnostics. + + * src/location.c: Include . + (empty_location): Now const. + (location_print): New function. Follow the recommendation of the + GNU Coding Standards for locations that span file boundaries. + * src/location.h: Do not include ; no longer needed. + (boundary): New type. + (location_t): Use it. This allows locations to span file boundaries. + All member uses changed: file -> start.file or end.file (as needed), + first_line -> start.line, first_column -> start.column, + last_line -> end.line, last_column -> end.column. + (equal_boundaries): New function. + (LOCATION_RESET, LOCATION_STEP): Remove. + (LOCATION_PRINT): Remove. All callers changed to use location_print. + (empty_location): Now const. + (location_print): New decl. + * src/parse-gram.y (lloc_default): New function, which handles + empty locations more accurately. + (YYLLOC_DEFAULT): Use it. + (%token COLON): Remove. + (%token ID_COLON): New token. + (rules): Use it. + (declarations, rules): Remove trailing semicolon. + (declaration, rules_or_grammar_declaration): + Allow empty (";") declaration. + (symbol_def): Remove empty actions; no longer needed. + (rules_or_grammar_declaration): Remove trailing semicolon. + (semi_colon.opt): Remove. + * src/reader.h: Include location.h. + (scanner_cursor): New decl. + * src/reduce.c (nonterminals_reduce): Use warn_at rather than + rolling our own. + * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead + of *loc. + (STEP): Remove. No longer needed, now that adjust_location does + the work. All uses removed. + (scanner_cursor): New var. + (adjust_location): Renamed from extend_location. It now sets + *loc and adjusts the scanner cursor. All uses changed. + Don't bother testing for CR. + (handle_syncline): Remove location arg; now updates scanner cursor. + All callers changed. + (unexpected_end_of_file): Now accepts start boundary of token or + comment, not location. All callers changed. Update scanner cursor, + not the location. + (SC_AFTER_IDENTIFIER): New state. + (context_state): Renamed from c_context. All uses changed. + (id_loc, code_start, token_start): New local vars. + (): New initial context. Move all + processing of Yacc white space and equivalents here. + ({id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER + instead of returning ID immediately, since we need to search for + a subsequent colon. + ("'", "\""): Save token_start. + ("%{", "{", "%%"): Save code_start. + (): New state, looking for a colon. + (, , ): + BEGIN context_state at end, not INITIAL. + ("\"", "'", + "}", "%}", <>): + Return correct token start. + (): Save start boundary when + the start of a character, string or multiline comment is found. + * tests/conflicts.at (S/R in initial, Defaulted Conflicted + Reduction): Adjust reported locations to match the more-precise + results now expected. + * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise. + * tests/reduce.at (Useless Rules, Reduced Automaton, + Underivable Rules): Likewise. + * tests/regression.at (Invalid inputs): No longer `expecting ";" + or "|"' now that so many other tokens are allowed by the new grammar. + + * src/complain.h (current_file): Remove duplicate decl; + current_file is now owned by files.h. + * src/complain.c, src/scan-gram.l: Include files.h. + +2002-12-06 Paul Eggert + + * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule] + promotes to int; it might be unsigned int. + * data/yacc.c (yy_reduce_print): Likewise. + + * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should + be #defined in the prologue, not in the Bison declarations. + This fixes Debian Bug 102878, reported by Shaul Karl. + +2002-12-02 Paul Eggert + + * configure.ac (AC_REPLACE_FUNCS): Add strtoul. + * lib/strtoul.c: New file, from gnulib. + This fixes a porting bug reported by Peter Klein in + . + +2002-11-30 Paul Eggert + + * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue, + and put only a forward declaration in the prologue. This is for + consistency with the other scanner helper functions. + + Type clashes now generate warnings, not errors, since it + appears that POSIX may allow some grammars with type clashes. + * src/reader.c (grammar_current_rule_check): Warn about + type clashes instead of complaining. + * tests/input.at (Type Clashes): Expect warnings, not complaints. + + Add Yacc library, since POSIX requires it. + * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu. + * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros. + * lib/main.c, lib/yyerror.c: New files. + + gram_error can be static; it need not be extern. + * src/reader.h (gram_error): Remove decl. + * src/parse-gram.y (gram_error): Now static. Add static decl. + (print_token_value): Omit parameter names from forward decl, + for consistency. + +2002-11-29 Paul Eggert + + * doc/bison.texinfo: Emphasize that yylex and yyerror must + be declared before being used. E.g., one should typically + declare them in the prologue. Use GNU coding style in examples. + Put "const" consistently after the type it modifies. Mention + that C99 supports "inline". Mention that yyerror traditionally + returns "int". + + %parse-param and %lex-param now take just one argument, the + declaration; the argument name is deduced from the declaration. + + * doc/bison.texinfo (Parser Function, Pure Calling, Error + Reporting, Table of Symbols): Document this. + * src/parse-gram.y (add_param): New function. + (COMMA): Remove. + (declaration): Implement new rule for %parse-param and %lex-param. + * src/scan-gram.l: "," now elicits a warning, rather than being + a token; this is more compatible with byacc. + * tests/calc.at (Simple LALR Calculator): Adopt new convention. + +2002-11-27 Paul Eggert + + Rename identifiers to avoid real and potential collisions. + + * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput, + to avoid collision with lex macro described by Bruce Lilly in + . + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise. + * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value. + * src/parse-gram.y (print_token_value): Renamed from yyprint. + All uses changed. + (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed. + The name "yycontrol" violates the name space rules, and this stuff + wasn't being used anyway. + (input): Remove action; this stuff wasn't being used. + (gram_error): Rename local variable yylloc -> loc. + * src/reader.h (struct gram_control_s, gram_control_t): Remove. + (YY_DECL): Don't use "yy" at start of local variables. + All uses changed, e.g., yylloc -> loc. + * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed. + (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed. + (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed. + (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed. + + * src/parse-gram.y (gram_error): loc is now const *. + * src/reader.h (gram_error): Likewise. + +2002-11-24 Paul Eggert + + Version 1.75c. + + * tests/actions.at (Actions after errors): Use an output format + more similar to that of the Printers and Destructors test. + Test the position of the ';' token too. + (Printers and Destructors): Likewise. + (Printers and Destructors: %glr-parser): Remove for now, to avoid + unnecessarily alarming people when the test fails. + + * data/yacc.c (yyerrlab1): Move this label down, so that the + parser does not discard the lookahead token if the user code + invokes YYERROR. This change is required for POSIX conformance. + + * lib/error.c: Sync with gnulib. + +2002-11-22 Paul Eggert + + * lib/quotearg.c, lib/quotearg.h: Sync with gnulib. + * lib/mbswidth.c, lib/mbswidth.h: Likewise. + * lib/xmalloc.c: Likewise. + +2002-11-20 Paul Eggert + + * lib/argmatch.c, lib/argmatch.h: Sync with gnulib. + +2002-11-20 Paul Eggert + + Avoid use of , as the GNU Coding Standards hint that one + should use `if (! x) abort ();' rather than `assert (x);', and + anyway it's one less thing to worry about configuring. + + * data/glr.c, lib/hash.c, src/system.h: Do not include . + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise, + and replace all instances of assert with abort. + * tests/calc.at (_AT_DATA_CALC_Y): Likewise. + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise. + + * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates, + yyresolveAction, yyprocessOneStack): Use abort rather than assert. + * lib/hash.c (hash_lookup, hash_get_first, hash_get_next, + hash_find_entry, hash_rehash, hash_insert): Likewise. + * src/conflicts.c (resolve_sr_conflict): Likewise. + * src/lalr.c (set_goto_map, map_goto): Likewise. + * src/nullable.c (nullable_compute): Likewise. + * src/output.c (prepare_rules, token_definitions_output): Likewise. + * src/reader.c (packgram, reader): Likewise. + * src/state.c (state_new, state_free, state_transitions_set, + state_reduction_find): Likewise. + * src/symtab.c (symbol_user_token_number_set, symbol_make_alias, + symbol_pack): Likewise. + * src/tables.c (conflict_row, pack_vector): Likewise. + * src/vcg.c (get_color_str, get_textmode_str, get_shape_str, + get_layoutalgorithm_str, get_decision_str, get_orientation_str, + get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str, + get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise. + + * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef. + (ARGMATCH_CONSTRAINT): New macro. + (ARGMATCH_ASSERT): Use it. + + * src/system.h (verify): New macro. + * src/getargs.c (trace_argmatch, report_argmatch): Use verify + rather than assert. + * src/tables.c (tables_generate): Likewise. + + * src/struniq.c (struniq_assert): Now returns void, and aborts + if the assertion is false. + (struniq_assert_p): Remove. + * src/struniq.h: Likewise. + +2002-11-18 Paul Eggert + + * data/glr.c (yygetLRActions): Replace `yyindex' with + `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch. + This fixes the regression with Sun ONE Studio 7 cc that I reported in + . + +2002-11-18 Akim Demaille + + * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a + space. + From Tim Van Holder. + +2002-11-17 Paul Eggert + + Pacify Sun ONE Studio 7 lint. Also, rename "ParseError" + to "SyntaxError" for consistency with my 2002-11-15 change. + + * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do + not define to {}, since this breaks the common use of `YYDPRINTF + ((...));' if a single statement is desired (e.g. before `else'). + Work around GCC warnings by surrounding corresponding calls with + {} if needed. + (yyhasResolvedValue): Remove unused function. + (yymergeOptionSets, yyresolvStack): Use `continue;' for empty + loop body. + (yyreportSyntaxError): Renamed from yyreportParseError. + (yyrecoverSyntaxError): Renamed from yyrecoverParseError. + All uses changed. + * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of + extern when possible. Remove unused initializations. + +2002-11-16 Akim Demaille + + Augment the similarity between GLR and LALR traces. + + * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print) + (YY_REDUCE_PRINT): New. + (yyparse): Use them. + * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for + YYDPRINT here. + (yyglrReduce, yyrecoverParseError, yyparse): Don't report the + state reached after the reduction/recovery, since... + (yyparse, yyprocessOneStack): Report the state we are entering in. + +2002-11-16 Akim Demaille + + * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types): + Add support for --trace=skeleton. + * src/scan-skel.l: %option debug. + Scan strings of non-@ or \n instead of character by character. + (scan_skel): Handle trace_skeleton. + (QPUTS): New. + (@output_parser_name@, @output_header_name@): ``Restore'' their + support (used to be M4 macros). + * data/yacc.c: Quote larger chunks, a la glr.c. + * data/lalr1.cc: Likewise. + The header guards are no longer available, so use some other + string than `YYLSP_NEEDED'. + +2002-11-16 Akim Demaille + + Make the ``Printers and Destructors'' test more verbose, taking + `yacc.c''s behavior as (possibly wrong) reference. + + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf + instead of fprint on stdout. + Set and report the last_line of the symbols. + Consistently display values and locations. + +2002-11-16 Paul Eggert + + * data/yacc.c: Avoid over-quoting of __line__ and __file__. + +2002-11-15 Paul Eggert + + * tests/actions.at (Actions after errors): New test case. + + * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo, + src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h, + tests/action.at, tests/calc.at, tests/conflicts.at, + tests/cxx-type.at, tests/regression.at: + "parse error" -> "syntax error" for POSIX compatibility. + "parsing stack overflow..." -> "parser stack overflow" so + that code matches Bison documentation. + +2002-11-15 Akim Demaille + + * src/parse-gram.y (declaration): Have %parse-param and %lex-param + take two BRACED_CODE, not two string_content. + Free the scanner's obstack when we are done. + (code_content): New. + * tests/calc.at: Adjust. + * doc/bison.texinfo: Adjust. + Also, make sure to include the `,' for these declarations. + +2002-11-15 Tim Van Holder + + * m4/prereq.m4: Removed the commented jm_PREREQ_HASH + definition; avoids potential autoreconf problems. + +2002-11-15 Akim Demaille + + Always check the value returned by yyparse. + + * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value + returned by yyparse. + (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument. + Adjust calls. + * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value + returned by yyparse. + +2002-11-14 Paul Hilfinger + + * data/glr.c (yyFail): Always set yyerrflag. Corrects regression + on input.at test. + +2002-11-14 Paul Eggert + + * src/output.c (output_skeleton): Call xfopen instead of + duplicating xfopen's body. + + Fix bugs reported by Nelson H. F. Beebe in + . + + * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that + "$CC -E foo.h" is allowed, as this doesn't work with the Portland + Group compiler. Instead, use "$CC -E bar.c". Include the .h + file twice in the grammar, as an extra check. + + * tests/input.at (Torturing the Scanner): Surround the + backslash-newline tests with "#if 0", to make it less likely that + we'll run into compiler bugs. Bring back solitary \ inside + comment, but add a closing comment to work around HP C bug. Don't + test backslash-newline in C character constant. + +2002-11-14 Akim Demaille + + * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit + status of the compiler. + Calling `exit 1' is no longer needed. + Reported by Nelson H. F. Beebe. + +2002-11-14 Akim Demaille + + * tests/atlocal.in (CPPFLAGS): We have config.h. + * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR): + New. + * tests/actions.at, tests/calc.at, tests/conflicts.at, + * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at, + * tests/regression.at, tests/torture.at: Use them for all the + grammars that are to be compiled. + * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as... + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this. + * doc/bison.texinfo (GLR Parsers): Document `inline'. + +2002-11-14 Akim Demaille + + * doc/bison.texinfo: Various formatting changes (alignments in + samples, additional @group/@end group, GCS in samples. + Use @deffn instead of simple @table to define the directives, + macros, variables etc. + +2002-11-13 Paul Eggert + + Fix some bugs reported by Albert Chin-A-Young in + . + + * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c + -o c"; the HP C compiler chatters during compilation. + Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c". + * tests/headers.at (export YYLTYPE): Likewise. + + * tests/input.at (Torturing the Scanner): Remove lines containing + solitary backslashes, as they tickle a bug in the HP C compiler. + + * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid // + comments, since they're not portable. Use GNU coding style. + +2002-11-13 Akim Demaille + + * data/yacc.c: Leave bigger chunks of quoted text. + (YYDSYMPRINTF): New. + Use it to report symbol activities. + * data/glr.c (YYDSYMPRINTF): New. + Use it. + +2002-11-12 Paul Eggert + + Version 1.75b. + + * data/glr.c (yydoAction): Return YYRESULTTAG, not int. + (yyglrReduce): Return yyok, not 0. + This should avoid the enumerated-type warnings reported + by Nelson H. F. Beebe in + . + + * lib/bbitset.h (BITSET_INLINE): Remove. + * lib/bitset.h [! BITSET_INLINE]: Remove. + (bitset_set, bitset_reset, bitset_test): Rename local vars + to avoid shadowing warnings by GCC. + + * data/glr.c (inline): Remove #define. It's the user's + responsibility to #define it away, just like 'const'. + This fixes one of the bugs reported by Nelson H. F. Beebe in + . + + * Makefile.maint (po-check): Scan .l and .y files instead of the + .c and the .h files that they generate. This fixes the bug + reported by Tim Van Holder in: + + Look for N_ as well as for _. Try to avoid matching #define for + N_ and _. + * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c, + src/system.h. Add src/parse-gram.y, src/scan-gram.l. + * src/scan-gram.l: Revamp regular expressions so that " and ' + do not confuse xgettext. + + * src/struniq.h (struniq_new): Do not declare the return type + to be 'const'; this violates the C standard. + * src/struniq.c (struniq_new): Likewise. + +2002-11-12 Albert Chin-A-Young + + * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the + duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq + linker. + +2002-11-12 Akim Demaille + + * Makefile.maint: Sync with Autoconf: + (local_updates): New. + +2002-11-12 Akim Demaille + + * po/POTFILES.in (src/lalr.c, src/state.c): Remove + +2002-11-12 Akim Demaille + + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the + locations. + +2002-11-12 Akim Demaille + + * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT, + not yyvalue. + +2002-11-12 Akim Demaille + + * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New. + Use it to test the GLR parser. + +2002-11-12 Akim Demaille + + * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton + defines it. + * data/glr.c (yystos): New. + (b4_yysymprint_generate, b4_yydestruct_generate): Invoke. + (YYDSYMPRINT): New. + (yyval): Don't define it, it is handled via M4. + (yyrecoverParseError): Free verbosely the discarded symbols. + * data/yacc.c (yysymprint): Remove, rather... + (b4_yysymprint_generate): invoke. + * data/c.m4 (b4_yysymprint_generate): New. + Accept pointers as arguments, as opposed to the version from + yacc.c. + (b4_yydestruct_generate): Likewise. + * tests/cations.at (Printers and Destructors): Use Bison directives + instead of CPP macros. + Don't rely on internal details. + +2002-11-12 Akim Demaille + + * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New. + * data/yacc.c: Rename yychar1 as yytoken, as in glr.c. + Don't work on yychar (i.e., do set it to YYEMPTY, don't match + it against YYEMPTY and so forth), work on yytoken (i.e., set + it to YYEMPTY etc.). + (yydestruct): Replace with a b4_yydestruct_generate invocation. + (b4_symbol_actions): Remove. + * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands + for 0, end-of-input. + +2002-11-12 Akim Demaille + + * doc/bison.texinfo (Destructor Decl): New. + +2002-11-12 Akim Demaille + + * src/tables.c (tables_generate): Use free for pointers that + cannot be NULL, not XFREE. + (pack_vector): Use assert, not fatal, for bound violations. + * src/state.c (state_new): Likewise. + * src/reader.c (reader): Likewise. + * src/lalr.c (set_goto_map): Likewise. + * src/location.h (LOCATION_PRINT): If first_line is 0, just issue + the file name. + +2002-11-12 Akim Demaille + + * src/scan-gram.l, src/reader.h (scanner_last_string_free): + Restore. + * src/scan-gram.l (last_string): Is global to the file, not to + yylex. + * src/parse-gram.y (input): Don't append the epilogue here, + (epilogue.opt): do it here, and free the scanner's obstack. + * src/reader.c (epilogue_set): Rename as... + (epilogue_augment): this. + * data/c.m4 (b4_epilogue): Defaults to empty. + +2002-11-12 Akim Demaille + + * src/getargs.c (long_options): Remove duplicates. + * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar: + Remove. + * doc/bison.rnh: Remove. + * doc/bison.texinfo (VMS Invocation): Remove. + +2002-11-12 Akim Demaille + + * src/struniq.h, src/struniq.c (struniq_t): Is const. + (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New. + + Use struniq for symbols. + + * src/symtab.h (symbol_t): The tag member is a struniq. + (symbol_type_set): Adjust. + * src/symtab.c (symbol_new): Takes a struniq. + (symbol_free): Don't free the tag member. + (hash_compare_symbol_t, hash_symbol_t): Rename as... + (hash_compare_symbol, hash_symbol): these. + Use the fact that tags as struniqs. + (symbol_get): Use struniq_new. + * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get): + Returns a strniq. + * src/reader.h (merger_list, grammar_currentmerge_set): The name + and type members are struniqs. + * src/reader.c (get_merge_function) + (grammar_current_rule_merge_set): Adjust. + (TYPE, current_type): Are struniq. + + Use struniq for file names. + + * src/files.h, src/files.c (infile): Split into... + (grammar_file, current_file): these. + * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust. + * src/reduce.c (reduce_print): Likewise. + * src/getargs.c (getargs): Likewise. + * src/complain.h, src/complain.c: Likewise. + * src/main.c (main): Call struniqs_new early enough to use it for + file names. + Don't free the input file name. + +2002-11-12 Akim Demaille + + * src/symtab.c (symbol_free): Remove dead deactivated code: + type_name are properly removed. + Don't use XFREE to free items that cannot be NULL. + * src/struniq.h, src/struniq.c: New. + * src/main.c (main): Initialize/free struniqs. + * src/parse-gram.y (%union): Add astruniq member. + (yyprint): Adjust. + * src/scan-gram.l (<{tag}>): Return a struniq. + Free the obstack bit that used to store it. + * src/symtab.h (symbol_t): The 'type_name' member is a struniq. + +2002-11-11 Paul Eggert + + Revamp to fix many (but not all) of the C- and M4-related quoting + problems. Among other things, this fixes the Bison bug reported + by Jan Hubicka when processing the Bash grammar; see: + + + Use new @ escapes consistently. Represent brackets with @{ and @} + rather than @<:@ and @:>@, since this works a bit better with dumb + editors like vi. Represent @ with @@, since @ is now consistently + an escape. Use @oline@ and @ofile@ rather than __oline__ and + __ofile__, to avoid unexpected expansions. Similarly, use @output + rather than #output. + + * data/c.m4 (b4_copyright): Omit file name from comment, since + the file name could contain "*/". + (b4_synclines_flag): Don't quote the 2nd argument; it should already + be quoted. All uses changed. + + * data/glr.c: Use new @ escapes consistently. + (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name, + b4_output_header_suffix, b4_output_header_name, b4_header_guard): + Remove, since they couldn't handle arbitrary characters in file + names. + * data/lalr1.cc: Likewise. + * data/yacc.c: Likewise. + + * src/files.c (output_infix): Remove; all uses removed. + * src/files.h: Likewise. + + * data/glr.c: Remove use of "#ifdef b4_header_guard", since it + mishandled funny characters in file names, and anyway it isn't + needed any more. + * data/yacc.c: Likewise. + * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard. + + * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would. + * data/yacc.c: Likewise. + + * src/muscle_tab.c: Include quotearg.h, since we need to quote C + strings now. + (muscle_init): Quote filename as a C string. + * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused. + (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros. + * src/output.c (escaped_file_name_output): New function. + (prepare_symbols): Quote tokens for M4. + (prepare): Don't insert output_infix, output_prefix, + output_parser_name, output_header_name; this is now down by scan-skel. + Insert skeleton as a C string. + + * src/output.c (user_actions_output, symbol_destructors_output, + symbol_printers_output): Quote filenames for C and M4. + * src/reader.c (prologue_augment, epilogue_set): Likewise. + + * src/scan-gram.l (): Don't worry about any backslash + escapes other than \\ and \'; this simplifies the code. + (): Likewise, for \\ and \". + (): Escape $ and @, too. + Use new escapes @{ and @} for [ and ]. + + * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing + them with auto vars. + Switch to new escape scheme, where @ is the escape character uniformly. + Abort if a stray escape character is found. Avoid unbounded input + buffer when parsing non-escaped text. + + * tests/input.at (Torturing the Scanner): Add tests that @oline@, + __oline__, #output, $@, and @{ do not have unintended meanings. + +2002-11-09 Paul Eggert + + Fix the test failure due to GCC warnings described in + . + * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which + evaluate to 0 if it's impossible for NINF to be in the respective + table. + (yygetLRActions, yyrecoverParseError): Use them. + + * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were + counted in the token inserted at end of file. Now takes + location_t *, not location_t, so that the location can be + adjusted. All uses changed. + + * tests/regression.at (Invalid inputs): Adjust wording in + diagnostic to match the new behavior. + + * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR, + AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR, + AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x)) + abort ();'. This reduces the runtime of the "Many lookaheads" + test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running + GCC 3.2. + +2002-11-07 Paul Eggert + + * src/parse-gram.y (CHARACTER): Remove unused token. + All uses removed. + + * src/scan-gram.l: Remove stack option. We no longer use the + stack, since the stack was never deeper than 1; instead, use the + new auto var c_context to record the stacked value. + + Remove nounput option. At an unexpected end of file, we now unput + the minimal input necessary to end cleanly; this simplifies the + code. + + Avoid unbounded token sizes where this is easy. + + (unexpected_end_of_file): New function. + Use it to systematize the error message on unexpected EOF. + (last-string): Now auto, not static. + (YY_OBS_FREE): Remove unnecessary do while (0) wrapper. + (scanner_last_string_free): Remove; not used. + (percent_percent_count): Move decl to just before use. + (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file, + not the (never otherwised-used) CHARACTER. + +2002-11-07 Akim Demaille + + Let yyerror always receive the msg as last argument, so that + yyerror can be variadic. + + * data/yacc.c (b4_yyerror_args): New. + Use it when calling yyerror. + * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New. + Use it when calling yyerror. + * doc/bison.texinfo (Error Reporting): Adjust. + * tests/calc.at (_AT_DATA_CALC_Y): Adjust. + * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust. + +2002-11-06 Akim Demaille + + #line should have quoted strings. + Ideally, this should be done by m4_quotearg. + + * src/scan-skel.l: Include quotearg.h. + Quote __ofile__. + * src/output.c (symbol_printers_output) + (symbol_destructors_output): Quote the file name. + +2002-11-06 Akim Demaille + + * tests/regression.at (Invalid inputs): Adjust to the recent + messages. + +2002-11-06 Akim Demaille + + Restore --no-lines. + Reported by Jim Kent. + + * data/c.m4 (b4_syncline): New. + * data/glr.c, data/yacc.c, data/lalr1.cc: Use it. + * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline. + * src/output.c (user_actions_output): Likewise. + (prepare): Define 'b4_synclines_flag'. + * src/muscle_tab.c (muscle_init): Don't define b4_linef. + +2002-11-06 Akim Demaille + + * src/main.c (main): Free `infile'. + * src/scan-gram.l (handle_syncline): New. + Recognize `#line'. + * src/output.c (user_actions_output, symbol_destructors_output) + (symbol_printers_output): Use the location's file name, not + infile. + * src/reader.c (prologue_augment, epilogue_set): Likewise. + +2002-11-05 Paul Hilfinger + + * src/tables.c (matching_state): Don't allow states to match if + either has GLR conflict entries. + +2002-11-05 Paul Eggert + + * src/scan-gram.l: Use more accurate diagnostics, e.g. + "integer out of range" rather than "invalid value". + * tests/input.at (Invalid $n, Invalid @n): Change expected wording + accordingly. + + Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires. + Also, remove one static variable in the scanner. + + * src/scan-gram.l (braces_level): Now auto, not static. + Initialize to zero if the compiler is being picky. + (INITIAL): Clear braces_level instead of incrementing it. + (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code, + as POSIX 1003.1-2001 requires. + * src/system.h (IF_LINT): New macro, taken from coreutils. + * configure.ac: Define "lint" if --enable-gcc-warnings. + +2002-11-05 Akim Demaille + + * src/scan-gram.l: When it starts with `%', complain about the + whole directive, not just that `invalid character: %'. + +2002-11-04 Akim Demaille + + * Makefile.maint: Update from Autoconf. + (update, cvs-update, po-update, do-po-update): New. + +2002-11-04 Akim Demaille + + * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex + and yyerror. + Have yyerror `use' its arguments. + * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF + returns true when location & yacc & pure & parse-param. + (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments. + +2002-11-04 Akim Demaille + + * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid + clashes. + * src/scan-gram.l: Use [\'] instead of ['] to pacify + font-lock-mode. + Use complain_at. + Use quote, not quote_n since LOCATION_PRINT no longer uses the + slot 0. + +2002-11-03 Paul Eggert + + * src/reader.c (get_merge_function, grammar_current_rule_check): + Use consistent diagnostics for reporting type name clashes. + Quote the types with <>, for consistency with Yacc. + * tests/input.at (Type Clashes): Adjust to diagnostic changes. + +2002-11-03 Akim Demaille + + * data/c.m4 (b4_identification, b4_user_args, b4_parse_param): + New. + * data/yacc.m4 (b4_pure_args, b4_Pure_args): New. + (b4_parse_param): Remove. + Use b4_identification. + Propagate b4_pure_args where needed to pass them to yyerror. + * data/glr.m4 (b4_parse_param): Remove. + (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args) + (b4_lpure_formals): New. + Use b4_identification. + (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by + b4_user_formals and b4_user_args. + (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer) + (yyreportAmbiguity): When using a pure parser, also need + the location, and the parse-params. + Adjust callers. + (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError): + When using a pure parser, also need the parse-params. + Adjust callers. + * tests/calc.at: Test pure (%pure-parser) and absolutely pure + (%pure-parser + %parse-param) LALR and GLR parsers. + (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF, + AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF, + AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF. + (_AT_DATA_CALC_Y): Equip for purity of yyerror. + (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF. + * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity. + * doc/bison.texinfo: Untabify the whole file. + (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM. + (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM. + (Error Reporting): Adjust to these new directives. + Document %error-verbose, deprecate YYERROR_VERBOSE. + +2002-11-03 Akim Demaille + + * tests/calc.at: Change all the AT_CHECK_CALC_LALR and + AT_CHECK_CALC_GLR invocations to use % directives, instead of + command line options. + * tests/cxx-type.at: Formatting changes. + +2002-11-03 Paul Eggert + + * src/scan-gram.l: Revamp to fix POSIX incompatibilities, + to count columns correctly, and to check for invalid inputs. + + Use mbsnwidth to count columns correctly. Account for tabs, too. + Include mbswidth.h. + (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS. + (extend_location): New function. + (YY_LINES): Remove. + + Handle CRLF in C code rather than in Lex code. + (YY_INPUT): New macro. + (no_cr_read): New function. + + Scan UCNs, even though we don't fully handle them yet. + (convert_ucn_to_byte): New function. + + Handle backslash-newline correctly in C code. + (SC_LINE_COMMENT, SC_YACC_COMMENT): New states. + (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.; + all uses changed. + (tag, splice): New EREs. Do not allow NUL or newline in tags. + Use {splice} wherever C allows backslash-newline. + YY_STEP after space, newline, vertical-tab. + ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT). + + (letter, id): Don't assume ASCII; e.g., spell out a-z. + + ({int}, handle_action_dollar, handle_action_at): Check for integer + overflow. + + (YY_STEP): Omit trailing semicolon, so that it's more like C. + + (): Allow \0 and \00 + as well as \000. Check for UCHAR_MAX, not 255. + Allow \x with an arbitrary positive number of digits, as in C. + Check for overflow here. + Allow \? and UCNs, for compatibility with C. + + (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision + with quote slot used by complain_at. + + * tests/input.at: Add tests for backslash-newline, m4 quotes + in symbols, long literals, and funny escapes in strings. + + * configure.ac (jm_PREREQ_MBSWIDTH): Add. + * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c. + * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext. + * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4. + * m4/mbswidth.m4: New file, from GNU coreutils. + + * doc/bison.texinfo (Grammar Outline): Document // comments. + (Symbols): Document that trigraphs have no special meaning in Bison, + nor is backslash-newline allowed. + (Actions): Document that trigraphs have no special meaning. + + * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove; + no longer used. + +2002-11-02 Paul Eggert + + * src/reader.c: Don't include quote.h; not needed. + (get_merge_function): Reword warning to be consistent with + type clash diagnostic in grammar_current_rule_check. + + * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two + bug in trigraph handling. + + * src/output.c (prepare_symbols): When printing token names, + escape "[" as "@<:@" and likewise for "]". + + * src/system.h (errno): Remove declaration, as we are now + assuming C89 or better, and C89 guarantees errno. + +2002-10-30 Paul Eggert + + * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write): + Check for close failures. + * src/files.h (xfclose): Return void, not int, since it always + returned zero. + * src/files.c (xfclose): Likewise. Report I/O error if ferror + indicates one. + * src/output.c (output_skeleton): Use xfclose rather than fclose + and ferror. xfclose now checks ferror. + + * data/glr.c (YYLEFTMOST_STATE): Remove. + (yyreportTree): Use a stack-based leftmost state. This avoids + our continuing battles with bogus warnings about initializers. + +2002-10-30 Akim Demaille + + * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only + #if. + +2002-10-29 Paul Hilfinger + + * tests/glr-regr1.at: New test for reported regressions. + * tests/testsuite.at: Add glr-regr1.at test. + * tests/Makefile.am: Add glr-regr1.at test. + +2002-10-24 Paul Eggert + + Version 1.75a. + + * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration. + * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since + we use malloc. Don't assume 'A' through 'Z' are contiguous. + Don't assume strdup exists; POSIX says its an XSI extension. + Check for buffer overflow on input. + +2002-10-24 Akim Demaille + + * src/output.c (output_skeleton): Don't disable M4sugar comments + too soon: it results in comments being expanded. + * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the + first output. + +2002-10-24 Akim Demaille + + * data/yacc.c (m4_int_type): New. + * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed + char' as only yacc.c wants K&R portability. + * data/glr.c (yysigned_char): Remove. + * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name. + Reported by Quoc Peyrot. + +2002-10-23 Paul Eggert + + * src/main.c (main): With --trace=time, report times even if a + non-fatal error occurs. Formerly, the times were reported in some + such cases but not in others. + * src/reader.c (reader): Just return if a complaint has been issued, + instead of exiting, so that 'main' can report times. + +2002-10-22 Akim Demaille + + * src/system.h: Include sys/types. + Reported by Bert Deknuydt. + +2002-10-23 Paul Eggert + + * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX. + Suggested by Art Haas. + +2002-10-22 Paul Eggert + + * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit + decl; not needed any more. + * src/main.c (main): Use return to exit, undoing yesterday's change. + The last OS that we could find where this wouldn't work is + SunOS 3.5, and that's too old to worry about now. + + * data/glr.c (struct yyltype): Define members even when not + doing locations. This is more consistent with yacc.c, and it + works around the following bug reports: + http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html + http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html + + * doc/bison.texinfo: Minor spelling and typographical fixes. Use + @acronym consistently. Standardize on "Yacc" instead of "YACC", + "Algol" instead of "ALGOL". Give a bit more history about BNF. + +2002-10-22 Akim Demaille + + * data/README: New. + +2002-10-21 Paul Eggert + + Be consistent about 'bool'; the old code used an enum in one + module and an int in another, and this violates the C standard. + * m4/stdbool.m4: New file, from coreutils 4.5.3. + * configure.ac (AC_HEADER_STDBOOL): Add. + * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4. + * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a) + * src/symtab.c (hash_compare_symbol_t): Likewise. + * src/system.h (bool, false, true): Use a definition consistent + with ../lib/hash.c. All uses changed. + + * src/complain.c (warning_issued): Renamed from warn_message_count, + so that we needn't worry about integer overflow (!). + Now of type bool. All uses changed. + (complaint_issued): Renamed from complain_message_count; likewise. + + * src/main.c (main): Use exit to exit with failure. + + * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS + rather than 1 and 0. + * src/main.c (main): Likewise. + * src/getargs.c (getargs): Likewise. + * src/reader.c (reader): Likewise. + + * src/getarg.c (getargs): Remove duplicate code for + "Try `bison --help'". + + * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2. + What was that "2" for? + + * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)). + * src/getargs.c (usage): Likewise. + + * src/getargs.c (getargs): When there are too few operands, report + the last one. When there are too many, report the first extra + one. This is how diffutils does it. + +2002-10-20 Paul Eggert + + Remove K&R vestiges. + * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove. + * src/complain.c (VA_START): Remove. Assume prototypes. + (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro. + (private_strerror, warn_at, warn, complain_at, complain, fatal_at, + fatal): Assume prototypes. + * src/complain.h: Assume prototypes. + * src/system.h (PARAMS): Remove. + Include unconditionally, since it's guaranteeed even + for a freestanding C89 compiler. + (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them. + * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype. + +2002-10-20 Akim Demaille + + * src/muscle_tab.c (muscle_grow): Remove trailing debugging code. + * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New. + (yyuserAction, yydoAction, yyglrReduce, yyresolveValue) + (yyresolveStates, yyresolveAction, yyresolveStack) + (yyprocessOneStack): Use them. + (yy_reduce_print): New. + * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param. + +2002-10-20 Akim Demaille + + * data/c.m4 (b4_c_ansi_args): Recognize functions with no + arguments and output `void'. + (b4_c_function): Rename as... + (b4_c_function_def): this. + (b4_c_function_decl, b4_c_ansi_function_def) + (b4_c_ansi_function_decl): New. + Change the interpretation of the arguments: before `int, foo', now + `int foo, foo'. + * data/yacc.c (yyparse): Prototype and define thanks to these. + Adjust b4_c_function_def uses. + * data/glr.c (yyparse): Likewise, but ANSI only. + +2002-10-20 Akim Demaille + + * src/output.c (prepare): Move the definition of `tokens_number', + `nterms_number', `undef_token_number', `user_token_number_max' + to... + (prepare_tokens): Here. + (prepare_tokens): Rename as... + (prepare_symbols): this. + (prepare): Move the definition of `rules_number' to... + (prepare_rules): here. + (prepare): Move the definition of `last', `final_state_number', + `states_number' to... + (prepare_states): here. + * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'. + +2002-10-20 Akim Demaille + + * src/tables.h, src/tables.c, src/output.c: Comment changes. + +2002-10-20 Akim Demaille + + * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to... + * data/c.m4: here. + +2002-10-20 Akim Demaille + + * src/output.c (prepare): Use MUSCLE_INSERT_STRING. + * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as + `pair'. + (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth', + `name' to... + * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type) + (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name): + These. + +2002-10-19 Paul Eggert + + Do not create a temporary file, as that involves security and + cleanup headaches. Instead, use a pair of pipes. + Derived from a suggestion by Florian Krohm. + * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files. + * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove. + * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove. + (BISON_PREREQ_SUBPIPE): Add. + * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c. + Add subpipe.h, subpipe.c. + * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4. + * po/POTFILES.in: Add lib/subpipe.c. + * src/output.c: Include "subpipe.h". + (m4_invoke): Remove decl. + (scan_skel): New decl. + (output_skeleton): Use pipe rather than temporary file for m4 input. + Check that m4sugar.m4 is readable, to avoid deadlock. + Check for pipe I/O error. + * src/scan-skel.l (readpipe): Remove decl. + (scan_skel): New function, to be used in place of m4_invoke. + Read from stream rather than file. + + * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to + float, as this generates a warning on Solaris 8 + GCC 3.2 with + --enable-gcc-warnings. Instead, divide into 1.0 rather than 1; + this generates a more-accurate value anyway. + + * lib/timevar.c (timervar_accumulate): Rename locals to + avoid confusion with similarly-named more-global. + * src/muscle_tab.c (muscle_pair_list_grow): Likewise. + + * src/output.c (prepare): Use xstrdup to convert char const * + to char *, to avoid GCC warning. + +2002-10-19 Akim Demaille + + * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS, + LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS. + Use them to have `calc.y' ready for %pure-parser. + * data/yacc.c (YYLEX): Pass a yylex return type to + b4_c_function_call. + +2002-10-19 Akim Demaille + + Prototype support of %lex-param and %parse-param. + + * src/parse-gram.y: Add the definition of the %lex-param and + %parse-param tokens, plus their rules. + Drop the `_' version of %glr-parser. + Add the "," token. + * src/scan-gram.l (INITIAL): Scan them. + * src/muscle_tab.c: Comment changes. + (muscle_insert, muscle_find): Rename `pair' as `probe'. + * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused. + (muscle_entry_s): The `value' member is no longer const. + Adjust all dependencies. + * src/muscle_tab.c (muscle_init): Adjust: use + MUSCLE_INSERT_STRING. + Initialize the obstack earlier. + * src/muscle_tab.h, src/muscle_tab.c (muscle_grow) + (muscle_pair_list_grow): New. + * data/c.m4 (b4_c_function_call, b4_c_args): New. + * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param. + * tests/calc.at: Use %locations, not --locations. + (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser. + +2002-10-19 Akim Demaille + + * src/getargs.c (usage): Take status as argument and exit + accordingly. + Report the traditional `Try ... --help' message when status != 0. + (usage, version): Don't take a FILE * as arg, it is pointless. + (getargs): When there is an incorrect number of arguments, make it + an error, and report it GNUlically thanks to `usage ()'. + +2002-10-18 Paul Eggert + + * data/glr.c (yyreportParseError): Don't assume that sprintf + yields the length of the printed string, as this is not true + on SunOS 4.1.4. Reported by Peter Klein. + + * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc. + * tests/conflicts.at (%nonassoc and eof): Likewise. + Fixes SunOS 4.1.4 test failure reported by Peter Klein. + +2002-10-17 Akim Demaille + + * src/getargs.h (trace_e): Add trace_scan, and trace_parse. + * src/getargs.c (trace_types, trace_args): Adjust. + * src/reader.c (grammar_current_rule_prec_set) + (grammar_current_rule_dprec_set, grammar_current_rule_merge_set): + Standardize error messages. + And s/@prec/%prec/! + (reader): Use trace_flag to enable scanner/parser debugging, + instead of an adhoc scheme. + * src/scan-gram.l: Remove trailing debugging code. + +2002-10-16 Paul Eggert + + * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as + MUSCLE_TAB_H. + + * NEWS: Officially drop support for building Bison with K&R C, + since it didn't work anyway and it's not worth worrying about. + * Makefile.maint (wget_files): Remove ansi2knr.c. + (ansi2knr.c-url_prefix): Remove. + * lib/.cvsignore: Remove ansi2knr, ansi2knr.*. + * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove. + * src/Makefile.am (AUTOMAKE_OPTIONS): Remove. + +2002-10-15 Paul Eggert + + Stop using the "enum_" trick for K&R-style function definitions; + it confused me, and I was the author! Instead, assume that people + who want to use K&R C compilers (when using these modules in GCC, + perhaps?) will run ansi2knr. + + * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove. + All uses of "enum_" changed to "enum ". + * lib/ebitset.c (enum_ebitset_find_mode): Likewise. + * lib/lbitset.c (enum_lbitset_find_mode): Likewise. + + * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or, + abitset_and_or_cmp, abitset_andn, abitset_andn_cmp, + abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy, + abitset_copy1, abitset_disjoint_p, abitset_empty_p, + abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse, + abitset_not, abitset_ones, abitset_or, abitset_or_and, + abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set, + abitset_size, abitset_small_list, abitset_subset_p, abitset_test, + abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero): + Use function prototypes; this removes the need for declaring + static functions simply to provide their prototypes. + * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_, + bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_, + bitset_count_, bitset_create, bitset_dump, bitset_first, + bitset_free, bitset_init, bitset_last, bitset_next, + bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p, + bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev, + bitset_print, bitset_release_memory, bitset_toggle_, + bitset_type_choose, bitset_type_get, bitset_type_name_get, + debug_bitset): Likewise. + * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise. + * lib/bitset_stats.c (bitset_log_histogram_print, + bitset_percent_histogram_print, bitset_stats_and, + bitset_stats_and_cmp, bitset_stats_and_or, + bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp, + bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy, + bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p, + bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable, + bitset_stats_equal_p, bitset_stats_free, bitset_stats_init, + bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not, + bitset_stats_ones, bitset_stats_or, bitset_stats_or_and, + bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print, + bitset_stats_print_1, bitset_stats_read, bitset_stats_reset, + bitset_stats_set, bitset_stats_size, bitset_stats_subset_p, + bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get, + bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp, + bitset_stats_zero): Likewise. + * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free, + bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure, + bitsetv_dump, debug_bitsetv): Likewise. + * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn, + ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_, + ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add, + ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find, + ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove, + ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p, + ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list, + ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp, + ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset, + ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test, + ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero): + Likewise. + * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp, + lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy, + lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc, + lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free, + lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p, + lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init, + lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones, + lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune, + lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size, + lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor, + lbitset_xor_cmp, lbitset_zero): Likewise. + +2002-10-14 Akim Demaille + + Version 1.75. + +2002-10-14 Akim Demaille + + * tests/Makefile.am (maintainer-check-posix): New. + +2002-10-14 Akim Demaille + + * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc + member. + +2002-10-14 Akim Demaille + + * src/tables.c (table_ninf_remap): base -> tab. + Reported by Matt Rosing. + +2002-10-14 Paul Eggert + + * tests/action.at, tests/calc.at, tests/conflicts.at, + tests/cxx-type.at, tests/headers.at, tests/input.at, + tests/regression.at, tests/synclines.at, tests/torture.at: + Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c", + so that the tests still work even if POSIXLY_CORRECT is set. + * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise. + + * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char, + for portability to K&R hosts. Fix typo: signed char is guaranteed + only to 127, not to 128. + * data/glr.c (yysigned_char): New type. + * data/yacc.c (yysigned_char): Likewise. + * tests/regression.at (Web2c Actions): signed char -> yysigned_char. + +2002-10-13 Paul Eggert + + * data/yacc.c (yyparse): Rewrite to avoid "comparison is always + true due to limited range of data type" warning from GCC. + + * data/c.m4 (b4_token_defines): Protect against double-inclusion + by wrapping enum yytokentype's definition inside #ifndef + YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12. + +2002-10-13 Akim Demaille + + * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction): + Un yy- yyrhs to avoid the name clash with the global YYRHS. + +2002-10-13 Akim Demaille + + * Makefile.maint: Update from Autoconf 2.54. + * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54. + +2002-10-13 Akim Demaille + + * src/print.c (print_state): Separate the list of solved conflicts + from the other items. + * tests/conflicts.at (Resolved SR Conflicts): Adjust. + +2002-10-13 Akim Demaille + + Let nondeterministic skeletons be usable with deterministic + tables. + + With the patch, GAWK compiled by GCC without -O2 passes its test + suite using a GLR parser driven by LALR tables. It fails with -O2 + because `struct stat' gives two different answers on my machine: + 88 (definition of an auto var) and later 96 (memset on this var). + Hence the stack is badly corrumpted. The headers inclusion is to + blame: if I move the awk.h inclusion before GLR's system header + inclusion, the two struct stat have the same size. + + * src/tables.c (pack_table): Always create conflict_table. + (token_actions): Always create conflict_list. + * data/glr.c (YYFLAG): Remove, unused. + +2002-10-13 Akim Demaille + + * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code. + (O0FLAGS): New. + (VALGRIND, GXX): New. + * tests/atlocal.in (CFLAGS): Use O0FLAGS. + * tests/bison.in: Run $PREBISON a pre-command. + * tests/Makefile.am (maintainer-check, maintainer-check-valgrind) + (maintainer-check-g++): New. + * Makefile.am (maintainer-check): New. + +2002-10-13 Akim Demaille + + * data/glr.c: Formatting changes. + Tweak some trace messages to match yacc.c's. + +2002-10-13 Akim Demaille + + GLR parsers sometimes raise parse errors instead of performing the + default reduction. + Reported by Charles-Henry de Boysson. + + * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't + check the length of the traces when %glr. + (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from + GLR's traces. + (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New. + Test GLR parsers. + * data/glr.c (YYLEFTMOST_STATE): Fix its value. + (yyltype): Remove the yy prefix from the member names. + (yytable): Complete its comment. + (yygetLRActions): Map error action number from YYTABLE from + YYTABLE_NINF to 0. + (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF + (which was a bug: it should have been YYTABEL_NINF, and yet it was + not satisfying as we could compare an YYACTION computed from + YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the + only value for error actions. + (yyreportParseError): In verbose parse error messages, don't issue + `error' in the list of expected tokens. + * data/yacc.c (yyparse) : Rewrite the decoding of the + next action to perform to match glr.c's decoding. + (yytable): Complete its comment. + +2002-10-13 Paul Eggert + + Fix problem reported by Henrik Grubbstroem in + : + "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected, + because the Bison parser reads the second action before reducing + the first one. + * src/scan-gram.l (rule_length): New static var. + Use it to keep track of the rule length in the scanner, since + we can't expect the parser to be in lock-step sync with the scanner. + (handle_action_dollar, handle_action_at): Use this var. + * tests/actions.at (Exotic Dollars): Test for the problem. + +2002-10-12 Paul Eggert + + * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include . + * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for . + Include when checking for clock_t and struct tms. + Use same include order as source. + This is for the SunOS 4.1.4 porting bug reported by Peter Klein in + . + + * lib/timevar.c: Update copyright date and clarify comments. + (get_time) [IN_GCC]: Keep the GCC version for reference. + + * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import + GCC version as of today, then merge Bison's changes. + Change "GCC" to "Bison" in copyright notice. timevar.def's + author is Akim, so change that too. + + * src/reader.c (grammar_current_rule_check): + Don't worry about the default action if $$ is untyped. + Prevents bogus warnings reported by Jim Gifford in + . + + * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE. + * data/glr.c, data/lalr1.cc, data/yacc.c: + Output token definitions before the first part of user declarations. + Fixes compatibility problem reported by Jim Gifford for kbd in + . + +2002-10-11 Paul Eggert + + * data/yacc.c (yyreport_parse_error): Remove, putting its body into... + (yyparse): here. This undoes some of the 2002-07-25 change. + Compatibility problem reported by Ralf S. Engelschall with + OSSP cfg . + +2002-10-11 Akim Demaille + + * tests/regression.at Characters Escapes): New. + * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and + characters. + Reported by Jan Nieuwenhuizen. + +2002-10-11 Akim Demaille + + * po/id.po: New. + +2002-10-10 Paul Eggert + + Portability fixes for bitsets; this also avoids several GCC + warnings. + + * lib/abitset.c: Include , for offsetof. + * lib/lbitset.c: Likewise. + + * lib/abitset.c (abitset_bytes): Return a size that is aligned + properly for vectors of objects. Do not assume that adding a + header size to a multiple of a word size yields a value that is + properly aligned for the whole union. + * lib/bitsetv.c (bitsetv_alloc): Likewise. + + * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new, + unique names for structures. + * lib/ebitset.c (ebitset_bytes): Likewise. + * lib/lbitset.c (lbitset_bytes): Likewise. + + * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p, + abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p, + abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn, + abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor, + abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp, + abitset_andn_or, abitset_andn_or_cmp, abitset_or_and, + abitset_or_and_cmp, abitset_copy): Supply prototype decls, + to improve the type-checking that GCC can do. + * lib/bitset.c (bitset_op4_cmp): Likewise. + * lib/bitset_stats.c (bitset_stats_count, + bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero, + bitset_stats_copy, bitset_stats_disjoint_p, + bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p, + bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn, + bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp, + bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or, + bitset_stats_and_or_cmp, bitset_stats_andn_or, + bitset_stats_andn_or_cmp, bitset_stats_or_and, + bitset_stats_or_and_cmp): Likewise. + * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn, + lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor, + lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not, + lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise. + + * lib/abitset.h: Include bitset.h, not bbitset.h. + * lib/ebitset.h: Likewise. + * lib/lbitset.h: Likewise. + + * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types. + All instances of parameters of type enum bitset_opts are now of + type enum_bitset_opts, to conform to the C Standard, and similarly + for enum_bitset_type. + * lib/ebitset.c (enum_ebitset_find_mode): Likewise. + * lib/lbitset.c (enum_lbitset_find_mode): Likewise. + + Do not use "struct bitset_struct" to mean different things in + different modules. Not only is this confusing, it violates + the C Standard, which requires that structure types in different + modules must be compatible if one is to be passed to the other. + * lib/bbitset.h (bitset): Now points to a union, not to a struct. + All instances of "struct bitset_struct *" replaced with "bitset". + * lib/bitset.h (struct bitset_struct): Remove, replacing with.... + (union bitset_union, struct abitset_struct, struct ebitset_struct, + struct lbitset_struct, struct bitset_stats_struct): New types. + All uses of struct bitset_struct changed to union bitset_union, + etc. + * lib/abitset.c (struct abitset_struct, abitset, + struct bitset_struct): Remove. + * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats, + struct bitset_struct): Remove. + * lib/ebitset.c (struct ebitset_struct, ebitset, struct + bitset_struct): Remove. + * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct): + Likewise. + + Do not call a function of type T using a call that assumes the + function is of a different type U. Standard C requires that a + function must be called with a type that is compatible with its + definition. + * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_): + New decls. + * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_): + New functions. + * lib/ebitset.c (PFV): Remove. + * lib/lbitset.c (PFV): Likewise. + * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or, + ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New + decls. + (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions. + (ebitset_vtable): Use them. + * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or, + lbitset_xor): New functions. + (lbitset_vtable): Use them. + + * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p): + Declare. + + * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a + GCC warning. + * lib/lbitset.c (LBITSET_CURRENT1): Likewise. + Use offsetof, for simplicity. + +2002-10-06 Paul Eggert + + * lib/bitset.h (bitset_reset): Do not assume that bitset_word is + the same width as int. This reapplies a hunk of the 2002-08-12 patch + , + which was inadvertently undone by the 2002-09-30 patch. + * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is + the same width as int. + +2002-10-04 Paul Eggert + + Version 1.50. + + * configure.ac (AC_INIT), NEWS: Increment version number. + + * doc/bison.texinfo: Minor spelling, grammar, and white space + fixes. + (Symbols): Mention that any negative value returned from yylex + signifies end-of-input. Warn about negative chars. Mention + the portable Standard C character set. + + The GNU coding standard says CFLAGS and YFLAGS are reserved + for the installer to set. + * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS. + * src/Makefile.am (AM_CFLAGS): Likewise. + (AM_YFLAGS): Renamed from YFLAGS. + + Fix some MAX and MIN problems. + * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN. + * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX. + * src/symtab.h (SYMBOL_NUMBER_MAX): New macro. + * src/reader.c (reader): Use it. + + * tests/regression.at (Braces parsing): Use grep, not fgrep, as + POSIX 1003.1-2001 has removed fgrep. + +2002-10-04 Michael Hayes + + * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be + interpreted as signed. + * lib/ebitset.c (ebitset_list): Fix bug. + +2002-10-01 Paul Eggert + + More fixes for 64-bit hosts and large bitsets. + + * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list, + abitset_size, abitset_list, abitset_list_reverse, abitset_list): + Use bitset_bindex, not int or unsigned int or size_t, to count bits. + * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count, + struct bitset_vtable.list, struct bitset_vtable.list_reverse, + bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last, + bitset_count_): Likewise. + * lib/bitset.h (bitset_iterator.num, bitset_iterator.i, + bitset_first, bitset_last): Likewise. + * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list, + bitset_stats_list_reverse, bitset_stats_size, + bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse): + Likewise. + * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise. + * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free, + bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure, + bitsetv_reflexive_transitive_closure): Likewise. + * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise. + * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse): + Likewise. + * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge): + Likewise. + + * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes): + Use size_t, not unsigned int, to count bytes. + * lib/abitset.h (abitset_bytes): Likewise. + * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc): + Likewise. + * lib/bitset.h (bitset_bytes): Likewise. + * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise. + * lib/bitset_stats.h (bitset_stats_bytes): Likewise. + * lib/bitsetv.c (bitsetv_alloc): Likewise. + * lib/ebitset.c (ebitset_bytes): Likewise. + * lib/ebitset.h (ebitset_bytes): Likewise. + * lib/lbitset.c (lbitset_bytes): Likewise. + * lib/lbitset.h (lbitset_bytes): Likewise. + + * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p, + abitset_subset_p, abitset_disjoint_p, abitset_and, + abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or, + abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or, + abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp, + abitset_or_and, abitset_or_and_cmp): + Use bitset_windex instead of unsigned int. + * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise. + * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow, + ebitset_elt_add, ebitset_elt_remove, ebitset_weed, + ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init): + Likewise. + * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise. + + * lib/bitset.c (bitset_print): + Use proper printf formats for widths of integer types. + * lib/bitset_stats.c (bitset_percent_histogram_print, + bitset_log_histogram_print, bitset_stats_print_1): Likewise. + * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise. + * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise. + * lib/lbitset.c (lbitset_bytes): Likewise. + + * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX, + BITSET_SIZE_MAX): New macros. + (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that + sizeof (bitset_word) == sizeof (bitset_windex). All uses changed + to BITSET_WINDEX_MAX. + + * lib/bitset.c (bitset_next, bitset_prev, bitset_first, + bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value, + since we now return the bitset_bindex type (not int). + + * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow + when computing sizes. + * lib/ebitset.c (ebitset_elts_grow): Likewise. + + * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation + and avoid cast to unsigned. + +2002-09-30 Akim Demaille + + * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h, + * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c: + Updates from Michael Hayes. + +2002-09-30 Art Haas + + * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER + invocations. + * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not + defined. + +2002-09-27 Akim Demaille + + Version 1.49c. + +2002-09-27 Akim Demaille + + * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7. + (Because of AC_LIBSOURCE). + +2002-09-27 Akim Demaille + + Playing with Autoscan. + + * configure.ac: Remove the old LIBOBJ tweaks. + (AC_REPLACE_FUNCS): Add strrchr and strtol. + * lib/strrchr.c: New. + * lib/strtol.c: New, from the Coreutils 4.5.1. + +2002-09-27 Akim Demaille + + Playing with Autoscan. + + * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New. + * lib/Makefile.am (libbison_a_SOURCES): No longer include + argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd. + * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the + Coreutils 4.5.1. + +2002-09-24 Akim Demaille + + * doc/bison.texinfo (Stack Overflow): xref to Recursion. + (Frequently Asked Questions, Parser Stack Overflow): New. + +2002-09-13 Akim Demaille + + Playing with autoscan. + + * src/reader.c (get_merge_function): Use xstrdup, not strdup. + * src/files.c (skeleton_find): Remove, unused. + * m4/memcmp.m4: New, from the Coreutils 4.5.1. + * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP. + +2002-09-13 Akim Demaille + + * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3. + * Makefile.am (AUTOMAKE_OPTIONS): Don't. + +2002-09-13 Akim Demaille + + * configure.ac: Require 2.54. + s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/. + s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/. + * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4: + Remove, provided by Autoconf macros. + +2002-09-12 Akim Demaille + + * m4/prereq.m4: Update, from Coreutils 4.5.1. + +2002-09-12 Akim Demaille + + * m4/prereq.m4: Update, from Fileutils 4.1.5. + * configure.ac (jm_PREREQ_TEMPNAME): Invoke it. + Reported by Martin Mokrejs. + +2002-09-10 Akim Demaille + + * src/parse-gram.y: Associate a human readable string to each + token type. + * tests/regression.at (Invalid inputs): Adjust. + +2002-09-10 Gary V. Vaughan + + * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships + with an Autoconf-2.5x style configure.ac. + +2002-09-06 Paul Eggert + + * doc/bison.texinfo (Conditions): Make explicit that the GPL + exception applies only to yacc.c. This is a modification of a + patch originally suggested by Akim Demaille. + +2002-09-06 Akim Demaille + + * data/c.m4 (b4_copyright): Move the GPL exception comment from + here to... + * data/yacc.c: here. + + * data/lalr1.cc (struct yyltype): Don't define it, since we use + LocationType. + (b4_ltype): Default to yy::Location from location.hh. + +2002-09-04 Jim Meyering + + * data/yacc.c: Guard the declaration of yytoknum also with + `#ifdef YYPRINT', so it is declared only when used. + +2002-09-04 Akim Demaille + + * configure.in: Rename as... + * configure.ac: this. + Bump to 1.49c. + +2002-09-04 Akim Demaille + + * src/assoc.c, src/closure.c, src/gram.c, src/injections.c, + * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't + translate maintainer only messages. + +2002-08-12 Paul Eggert + + Version 1.49b. + + * Makefile.am (SUBDIRS): Remove intl. + (DISTCLEANFILES): Remove. + * NEWS: Mention that GNU M4 is now required. Clarify what is + meant by "larger grammars". Mention the pt_BR translation. + * configure.in (AC_CHECK_DECLS): Add getenv, getopt. + (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var. + Bump version from 0.11.2 to 0.11.5. + (BISON_PREREQ_STAGE): Remove. + (AM_GNU_GETTEXT): Use external gettext. + (AC_OUTPUT): Remove intl/Makefile. + + * config/depcomp, config/install-sh: Sync with Automake 1.6.3. + + * data/glr.c: Include string.h, for strlen. + (yyreportParseError): Use size_t for yysize. + (yy_yypstack): No longer nested inside yypstates, as nested + functions are not portable. Do not assume size_t is the + same width as int. + (yypstates): Do not assume that ptrdiff_t is the same width + as int, and similarly for yyposn and YYINDEX. + + * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage. + + * lib/Makefile.am (INCLUDES): Do not include from the intl + directory, which has been removed. + * src/Makefile.am (INCLUDES): Likewise. + + * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h. + (bitsets_sources, additional_bitsets_sources, timevars_sources): + New vars. + + * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension. + * tests/Makefile.am (EXTRA_DIST): Likewise. + + * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list): + Do not assume that bitset_windex is the same width as unsigned. + + * lib/abitset.c (abitset_unused_clear): Do not assume that + bitset_word is the same width as int. + * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise. + * lib/bitset.h (bitset_set, bitset_reset): Likewise. + * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise. + * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise. + * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise. + + * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for + portability to one's complement hosts!). + * lib/ebitset.c (ebitset_op1): Likewise. + * lib/lbitset.c (lbitset_op1): Likewise. + + * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar. + * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h, + lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c: + Sync with fileutils. + * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c, + lib/gettext.h: Sync with diffutils. + + * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c, + lib/strspn.c, lib/tempname.c: Use GPL, not LGPL. + + * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use + PROTOTYPES to check for prototypes, and "defined __STDC__" to + check for void *. + + * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not + size_t; the old version tried to do this but casted improperly. + (bitset_bindex, bitset_windex): Now size_t, not unsigned long. + (bitset_test): Now returns int, not unsigned long. + + * lib/bitset_stats.c: Include "gettext.h". + (_): New macro. + (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't + name locals "index", as it generates unnecessary warnings on some + hosts that have an "index" function. + + * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print, + bitset_stats_read, bitset_stats_write): Wrap strings in _() if + they need translation. + * src/LR0.c (state_list_append, new_itemsets, get_state, + append_states, generate_states): Likewise. + * src/assoc.c (assoc_to_string): Likewise. + * src/closure.c (print_closure, set_firsts, closure): Likewise. + * src/gram.c (grammar_dump): Likewise. + * src/injections.c (injections_compute): Likewise. + * src/lalr.c (lookaheads_print): Likewise. + * src/relation.c (relation_transpose): Likewise. + * src/scan-gram.l: Likewise. + * src/tables.c (table_grow, pack_vector): Likewise. + + * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4, + glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4. + * m4/malloc.m4, m4/realloc.m4: Sync with diffutils. + * m4/mbstate_t.m4: Sync with fileutils. + * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T. + + * po/LINGUAS: Add pt_BR. + * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c, + src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c, + lib/timevar.c. + Use src/parse-gram.y instead of src/parse-gram.c, as the gettext + manual recommends. + Similarly, use src/scan-gram.l instead of src/scan-gram.c. + + * src/complain.c (strerror_r): Remove decl; not needed. + (strerror): Use same pattern as ../lib/error.c. + + * src/files.c, src/files.h (compute_header_macro): Remove; unused. + + * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int. + + * src/main.c (main): Cast result of bindtextdomain and textdomain + to void, to avoid a GCC warning when --disable-nls is in effect. + + * src/scan-gram.l: Use strings rather than escapes when possible, + to minimize the number of warnings from xgettext. + (handle_action_dollar, handle_action_at): Don't use isdigit, + as it mishandles negative chars and it may not work as expected + outside the C locale. + + * src/symtab.c (symbol_get): Don't cast LHS of an assignment; + this is a GCC extension and is not portable to other compilers. + + * src/system.h (alloca): Use same pattern as ../lib/error.c. + Do not include ; no longer needed. + Do not include ; no longer needed (and generates + warnings on OpenBSD 3.0). + + * tests/cxx-type.at (yylex): Do not pass signed char to isupper; + it's not portable. + + * tests/regression.at: Do not use 'cc -c input.c -o input'; + Sun C rejects this. Instead, use 'cc -c input.c -o input.o'. + + * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero + exit status as failure, not just exit status 1. Sun C exits + with status 2 sometimes. + + * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro. + Use it for the two large tests. + +2002-08-02 Akim Demaille + + * src/conflicts.c (conflicts_output): Don't output rules never + reduced here, since anyway that computation doesn't work. + * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p) + (rule_useless_p, rule_never_reduced_p): New. + (grammar_rules_partial_print): Use a filter instead of a range. + Display the title only if needed. + (grammar_rules_print): Adjust. + (grammar_rules_never_reduced_report): New. + * src/tables.c (action_row): Move the computation of rules never + reduced to... + (token_actions): here. + * src/main.c (main): Make the parser before making the report, so + that rules never reduced are computed. + Call grammar_rules_never_reduced_report. + * src/print.c (print_results): Report rules never reduced. + * tests/conflicts.at, tests/reduce.at: Adjust. + +2002-08-01 Akim Demaille + + Instead of attaching lookaheads and duplicating the rules being + reduced by a state, attach the lookaheads to the reductions. + + * src/state.h (state_t): Remove the `lookaheads', + `lookaheads_rule' member. + (reductions_t): Add a `lookaheads' member. + Use a regular array for the `rules'. + * src/state.c (reductions_new): Initialize the lookaheads member + to 0. + (state_rule_lookaheads_print): Adjust. + * src/state.h, src/state.c (state_reductions_find): New. + * src/conflicts.c (resolve_sr_conflict, set_conflicts) + (count_rr_conflicts): Adjust. + * src/lalr.c (LArule): Remove. + (add_lookback_edge): Adjust. + (state_lookaheads_count): New. + (states_lookaheads_initialize): Merge into... + (initialize_LA): this. + (lalr_free): Adjust. + * src/main.c (main): Don't free nullable and derives too early: it + is used by --verbose. + * src/print.c, src/print_graph.c, src/tables.c: Adjust. + +2002-08-01 Akim Demaille + + * src/derives.h, src/derives.c (derives): A `rule_t***' instead of + `rule_number_t**'. + (set_derives, free_derives): Rename as... + (derives_compute, derives_free): this. + Adjust all dependencies. + * src/nullable.c (set_nullable, free_nullable): Rename as... + (nullable_compute, nullable_free): these. + (rule_list_t): Store rule_t *, not rule_number_t. + * src/state.c (state_rule_lookaheads_print): Directly compare rule + pointers, instead of their numbers. + * src/main.c (main): Call nullable_free, and derives_free earlier, + as they were lo longer used. + +2002-08-01 Akim Demaille + + * lib/timevar.c (get_time): Include children time. + * src/lalr.h (LA, LArule): Don't export them: used with the + state_t. + * src/lalr.c (LA, LArule): Static. + * src/lalr.h, src/lalr.c (lalr_free): New. + * src/main.c (main): Call it. + * src/tables.c (pack_vector): Check whether loc is >= to the + table_size, not >. + (pack_tables): Don't free froms, tos, conflict_tos, and pos... + (tables_generate): do it, since that's also it which allocates + them. + Don't free LA and LArule, main does. + +2002-07-31 Akim Demaille + + Separate parser tables computation and output. + + * src/output.c (nvectors, base_t, base, base_ninf, conflict_table) + (conflict_list, conflict_list_cnt, table, check, table_ninf) + (yydefgoto, yydefact, high): Move to... + * src/tables.h, src/tables.c: here. + * src/output.c (vector_number_t, VECTOR_NUMBER_MAX) + (VECTOR_NUMBER_MIN, state_number_to_vector_number) + (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN) + (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX) + (ACTION_MIN, actrow, order, nentries, pos, conflrow) + (conflict_list_free, table_size, lowzero, table_grow, conflict_row) + (action_row, save_row, token_actions, save_column, default_goto) + (goto_actions, sort_actions, matching_state, pack_vector) + (table_ninf_remap, pack_table, prepare_actions): Move to... + * src/tables.c: here. + * src/tables.h, src/tables.c(tables_generate, tables_free): New. + * src/output.c (token_actions, output_base, output_conflicts) + (output_check): Merge into... + (prepare_actions): this. + (actions_output): Rename as... + (user_actions_output): this. + * src/main.c (main): Call tables_generate and tables_free. + +2002-07-31 Akim Demaille + + Steal GCC's --time-report support. + + * lib/timevar.c, lib/timevar.h, lib/timevar.def: New, + stolen/adjusted from GCC. + * m4/stage.m4: Remove time related checks. + * m4/timevar.m4: New. + * configure.in: Adjust. + * src/system.h: Adjust to using timevar.h. + * src/getargs.h, src/getargs.c: Support trace_time for + --trace=time. + * src/main.c (stage): Remove. + (main): Replace `stage' invocations with timevar calls. + * src/output.c: Insert pertinent timevar calls. + +2002-07-31 Akim Demaille + + Let --trace have arguments. + + * src/getargs.h (enum trace_e): New. + * src/getargs.c (trace_args, trace_types, trace_argmatch): New. + (long_options, short_options): --trace/-T takes an optional + argument. + Change all the uses of trace_flag to reflect the new flags. + * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets. + + Strengthen `stage' portability. + + * m4/stage.m4 (BISON_PREREQ_STAGE): New. + * configure.in: Use it. + Don't check for malloc.h and sys/times.h. + * src/system.h: Include them when appropriate. + * src/main.c (stage): Compile only when mallinfo, struct mallinfo, + times and struct tms are available. + +2002-07-30 Akim Demaille + + In verbose parse error message, don't report `error' as an + expected token. + * tests/actions.at (Printers and Destructors): Adjust. + * tests/calc.at (Calculator $1): Adjust. + * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose + error message, do not report the parser accepts the error token in + that state. + +2002-07-30 Akim Demaille + + Normalize conflict related messages. + + * src/complain.h, src/complain.c (warn, complain): New. + * src/conflicts.c (conflicts_print): Use them. + (conflict_report_yacc): New, extracted from... + (conflicts_print): here. + * tests/conflicts.at, tests/existing.at: Adjust. + +2002-07-30 Akim Demaille + + Report rules which are never reduced by the parser: those hidden + by conflicts. + + * src/LR0.c (save_reductions): Don't make the final state too + different: save its reduction (accept) instead of having a state + without any action (no shift or goto, no reduce). + Note: the final state is now a ``regular'' state, i.e., the + parsers now contain `reduce 0' as default reduction. + Nevertheless, since they decide to `accept' when yystate = + final_state, they still will not reduce rule 0. + * src/print.c (print_actions, print_reduction): Adjust. + * src/output.c (action_row): Track reduced rules. + (token_actions): Report rules never reduced. + * tests/conflicts.at, tests/regression.at: Adjust. + +2002-07-30 Akim Demaille + + `stage' was accidentally included in a previous patch. + Initiate its autoconfiscation. + + * configure.in: Look for malloc.h and sys/times.h. + * src/main.c (stage): Adjust. + Report only when trace_flag. + +2002-07-29 Akim Demaille + + * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not + state_number_t. + (errs_t): symbol_t*, not symbol_number_t. + (reductions_t): rule_t*, not rule_number_t. + (FOR_EACH_SHIFT): New. + * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c + * src/print.c, src/print_graph.c: Adjust. + +2002-07-29 Akim Demaille + + Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $. + + * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as... + (endtoken, accept): these. + * src/reader.c (reader): Set endtoken's default tag to "$end". + Set undeftoken's tag to "$undefined" instead of "$undefined.". + * doc/bison.texinfo (Table of Symbols): Mention $accept and $end. + Adjust. + +2002-07-29 Akim Demaille + + * src/reduce.c (reduce_grammar): When the language is empty, + complain about the start symbol, not the axiom. + Use its location. + * tests/reduce.at (Empty Language): New. + +2002-07-26 Akim Demaille + + * src/reader.h, src/reader.c (gram_error): ... can't get + yycontrol without making too strong assumptions on the parser + itself. + * src/output.c (prepare_tokens): Use the real 0th value of + token_translations instead of `0'. + * src/parse-gram.y (yyerror): Don't rely on yycontrol being + visible here. + * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc + for the time being: %locations ought to provide it to yyerror. + +2002-07-25 Akim Demaille + + * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1. + * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./. + * tests/regression.at (Web2c Actions): Adjust. + +2002-07-25 Akim Demaille + + Stop storing rules from 1 to nrules + 1. + + * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c + * src/nullable.c, src/output.c, src/print.c, src/reader.c + * src/reduce.c: Allocate and free from &rules[0], not &rules[1]. + Iterate from 0 to nrules. + Use rule_number_as_item_number and item_number_as_rule_number. + Adjust to `derive' now containing possibly 0. + * src/gram.h (rule_number_as_item_number, item_number_as_rule_number): + Handle the `- 1' part in rule numbers from/to item numbers. + * src/conflicts.c (log_resolution): Fix the message which reversed + shift and reduce. + * src/output.c (action_row): Initialize default_rule to -1. + (token_actions): Adjust. + * tests/sets.at (Nullable, Firsts): Fix the previously bogus + expected output. + * tests/conflicts.at (Resolved SR Conflicts): Likewise. + +2002-07-25 Akim Demaille + + * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg) + (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls) + (b4_c_knr_arg_decl): New. + * data/yacc.c: Use it to define yysymprint, yydestruct, and + yyreport_parse_error. + +2002-07-25 Akim Demaille + + * data/yacc.c (yyreport_parse_error): New, extracted from... + (yyparse): here. + (yydestruct, yysymprint): Move above yyparse. + Be K&R compliant. + +2002-07-25 Akim Demaille + + * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New, + replace... + (b4_sint_type, b4_uint_type): these. + * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for. + * tests/regression.at (Web2c Actions): Adjust. + +2002-07-25 Akim Demaille + + * src/gram.h (TIEM_NUMBER_MAX): New. + (item_number_of_rule_number, rule_number_of_item_number): Rename + as... + (rule_number_as_item_number, item_number_as_rule_number): these. + Adjust dependencies. + * src/output.c (vector_number_t, VECTOR_NUMBER_MAX) + (VECTOR_NUMBER_MIN, state_number_to_vector_number) + (symbol_number_to_vector_number): New. + (order): Of vector_number_t* type. + (base_t, BASE_MAX, BASE_MIN): New. + (froms, tos, width, pos, check): Of base_t type. + (action_number_t, ACTION_MIN, ACTION_MAX): New. + (actrow): Of action_number_t type. + (conflrow): Of unsigned int type. + (table_ninf, base_ninf): New. + (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value. + (muscle_insert_int_table, muscle_insert_base_table) + (muscle_insert_rule_number_table): New. + (prepare_tokens): Output `toknum' as int_table. + (action_row): Returns a rule_number_t. + Use ACTION_MIN, not SHRT_MIN. + (token_actions): yydefact is rule_number_t*. + (table_ninf_remap): New. + (pack_table): Use it for `base' and `table'. + * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove, + replaced with... + (YYPACT_NINF, YYTABLE_NINF): these. + (yypact, yytable): Compute their types instead of hard-coded + `short'. + * tests/regression.at (Web2c Actions): Adjust. + +2002-07-19 Akim Demaille + + * src/scan-gram.l (id): Can start with an underscore. + +2002-07-16 Akim Demaille + + * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New. + Adjust all former `associativity' dependencies. + * src/symtab.c (symbol_new): Default associativity is `undef', not + `right'. + (symbol_check_alias_consistence): Adjust. + +2002-07-09 Akim Demaille + + * doc/bison.texinfo: Properly set the ``header'' part. + Use @dircategory ``GNU programming tools'' as per Texinfo's + documentation. + Use @copying. + +2002-07-09 Akim Demaille + + * lib/quotearg.h: Protect against multiple inclusions. + * src/location.h (location_t): Add a `file' member. + (LOCATION_RESET, LOCATION_PRINT): Adjust. + * src/complain.c (warn_at, complain_at, fatal_at): Drop + `error_one_per_line' support. + +2002-07-09 Akim Demaille + + * src/complain.h, src/complain.c (warn, complain): Remove, unused. + * src/reader.c (lineno): Remove. + Adjust all dependencies. + (get_merge_function): Take a location and use complain_at. + * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise. + * tests/regression.at (Invalid inputs, Mixing %token styles): + Adjust. + +2002-07-09 Akim Demaille + + * src/parse-gram.y (rules_or_grammar_declaration): Add an error + recovery rule, and forbid extensions when --yacc. + (gram_error): Use complain_at. + * src/reader.c (reader): Exit if there were parse errors. + +2002-07-09 Akim Demaille + + * tests/synclines.at (AT_SYNCLINES_COMPILE): New. + (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs. + Reported by R Blake . + +2002-07-09 Akim Demaille + + * data/yacc.c: Output the copyright notive in the header. + +2002-07-03 Akim Demaille + + * src/output.c (froms, tos): Are state_number_t. + (save_column): sp, sp1, and sp2 are state_number_t. + (prepare): Rename `final' as `final_state_number', `nnts' as + `nterms_number', `nrules' as `rules_number', `nstates' as + `states_number', and `ntokens' as `tokens_number'. Remove `nsym', + unused. + * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust. + * data/lalr1.cc (nsym_): Remove, unused. + +2002-07-03 Akim Demaille + + * src/lalr.h, src/lalr.c (goto_number_t): New. + * src/lalr.c (goto_list_t): New. + Propagate them. + * src/nullable.c (rule_list_t): New. + Propagate. + * src/types.h: Remove. + +2002-07-03 Akim Demaille + + * src/closure.c (print_fderives): Use rule_rhs_print. + * src/derives.c (print_derives): Use rule_rhs_print. + (rule_list_t): New, replaces `shorts'. + (set_derives): Add comments. + * tests/sets.at (Nullable, Firsts): Adjust. + +2002-07-03 Akim Demaille + + * src/output.c (prepare_actions): Free `tally' and `width'. + (prepare_actions): Allocate and free `order'. + * src/symtab.c (symbols_free): Free `symbols'. + * src/scan-gram.l (scanner_free): Clear Flex's scanners memory. + * src/output.c (m4_invoke): Move to... + * src/scan-skel.l: here. + (<>): Close yyout, and free its name. + +2002-07-03 Akim Demaille + + Fix some memory leaks, and fix a bug: state 0 was examined twice. + + * src/LR0.c (new_state): Merge into... + (state_list_append): this. + (new_states): Merge into... + (generate_states): here. + (set_states): Don't ensure a proper `errs' state member here, do it... + * src/conflicts.c (conflicts_solve): here. + * src/state.h, src/state.c: Comment changes. + (state_t): Rename member `shifts' as `transitions'. + Adjust all dependencies. + (errs_new): For consistency, also take the values as argument. + (errs_dup): Remove. + (state_errs_set): New. + (state_reductions_set, state_transitions_set): Assert that no + previous value was assigned. + (state_free): New. + (states_free): Use it. + * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as + temporary storage: use `errs' and `nerrs' as elsewhere. + (set_conflicts): Allocate and free this `errs'. + +2002-07-02 Akim Demaille + + * lib/libiberty.h: New. + * lib: Update the bitset implementation from upstream. + * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c, + * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE. + * src/main.c: Adjust bitset stats calls. + +2002-07-01 Paul Eggert + + * src/scan-gram.l (): Convert to unsigned + char, so that negative chars don't collide with $. + +2002-06-30 Akim Demaille + + Have the GLR tests be `warning' checked, and fix the warnings. + + * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG + (yyuserAction, yyreportAmbiguity): `Use' all the arguments. + (yyremoveDeletes): `yyi' and `yyj' are size_t. + Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies. + (yyaddDeferredAction): static. + (yyglrReduce): yyi, yyk, amd yyposn are size_t. + (yyreportParseError): yyprefix is const. + yytokenp is used only when verbose. + (yy__GNUC__): Replace with __GNUC__. + (yypdumpstack): yyi is size_t. + (yypreference): Un-yy local variables and arguments, to avoid + clashes with `yyr1'. Anyway, we are not in the user name space. + (yytname_size): be an int, as is compared with ints. + * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New. + Use them. + * tests/cxx-gram.at: Use quotation to protect $1. + Use AT_COMPILE to enable warnings hunts. + Prototype yylex and yyerror. + `Use' argc. + Include `string.h', not `strings.h'. + Produce and prototype stmtMerge only when used. + yylex takes a location. + +2002-06-30 Akim Demaille + + We spend a lot of time in quotearg, in particular when --verbose. + + * src/symtab.c (symbol_get): Store a quoted version of the key. + (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove. + Adjust all callers. + +2002-06-30 Akim Demaille + + * src/state.h (reductions_t): Rename member `nreds' as num. + (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'. + * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types. + +2002-06-30 Akim Demaille + + * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT) + (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED) + (shifts_to): Rename as... + (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION) + (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE) + (TRANSITION_IS_DISABLED, transitions_to): these. + +2002-06-30 Akim Demaille + + * src/print.c (print_shifts, print_gotos): Merge into... + (print_transitions): this. + (print_transitions, print_errs, print_reductions): Align the + lookaheads columns. + (print_core, print_transitions, print_errs, print_state, + print_grammar): Output empty lines separator before, not after. + (state_default_rule_compute): Rename as... + (state_default_rule): this. + * tests/conflicts.at (Defaulted Conflicted Reduction), + (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust. + * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust. + +2002-06-30 Akim Demaille + + Display items as we display rules. + + * src/gram.h, src/gram.c (rule_lhs_print): New. + * src/gram.c (grammar_rules_partial_print): Use it. + * src/print.c (print_core): Likewise. + * tests/conflicts.at (Defaulted Conflicted Reduction), + (Unresolved SR Conflicts): Adjust. + (Unresolved SR Conflicts): Adjust and rename as... + (Resolved SR Conflicts): this, as was meant. + * tests/regression.at (Web2c Report): Adjust. + +2002-06-30 Akim Demaille + + * src/print.c (state_default_rule_compute): New, extracted from... + (print_reductions): here. + Pessimize, but clarify the code. + * tests/conflicts.at (Defaulted Conflicted Reduction): New. + +2002-06-30 Akim Demaille + + * src/output.c (action_row): Let default_rule be always a rule + number. + +2002-06-30 Akim Demaille + + * src/closure.c (print_firsts, print_fderives, closure): + Use BITSET_EXECUTE. + * src/lalr.c (lookaheads_print): Likewise. + * src/state.c (state_rule_lookaheads_print): Likewise. + * src/print_graph.c (print_core): Likewise. + * src/print.c (print_reductions): Likewise. + * src/output.c (action_row): Likewise. + Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL. + +2002-06-30 Akim Demaille + + * src/print_graph.c: Use report_flag. + +2002-06-30 Akim Demaille + + * src/lalr.c (traverse, digraph, matrix_print, transpose): Move + to... + * src/relation.h, src/relation.c (traverse, relation_digraph) + (relation_print, relation_transpose): New. + +2002-06-30 Akim Demaille + + * src/state.h, src/state.c (shifts_to): New. + * src/lalr.c (build_relations): Use it. + +2002-06-30 Akim Demaille + + * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number) + (item_number_of_rule_number, rule_number_of_item_number): New. + * src/LR0.c, src/closure.c, src/derives.c, src/derives.h, + * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c, + * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h: + Propagate their use. + Much remains to be done, in particular wrt `shorts' from types.h. + +2002-06-30 Akim Demaille + + * src/symtab.c (symbol_new): Initialize the `printer' member. + +2002-06-30 Akim Demaille + + * src/LR0.c (save_reductions): Remove, replaced by... + * src/state.h, src/state.c (state_reductions_set): New. + (reductions, errs): Rename as... + (reductions_t, errs_t): these. + Adjust all dependencies. + +2002-06-30 Akim Demaille + + * src/LR0.c (state_list_t, state_list_append): New. + (first_state, last_state): Now symbol_list_t. + (this_state): Remove. + (new_itemsets, append_states, save_reductions): Take a state_t as + argument. + (set_states, generate_states): Adjust. + (save_shifts): Remove, replaced by... + * src/state.h, src/state.c (state_shifts_set): New. + (shifts): Rename as... + (shifts_t): this. + Adjust all dependencies. + * src/state.h (state_t): Remove the `next' member. + +2002-06-30 Akim Demaille + + * src/vcg.c (quote): Use slot 2, since we often pass symbol tag + escaped in slot 0. + +2002-06-30 Akim Demaille + + Use hash.h for the state hash table. + + * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove. + (allocate_storage): Use state_hash_new. + (free_storage): Use state_hash_free. + (new_state, get_state): Adjust. + * src/lalr.h, src/lalr.c (states): Move to... + * src/states.h (state_t): Remove the `link' member, no longer + used. + * src/states.h, src/states.c: here. + (state_hash_new, state_hash_free, state_hash_lookup) + (state_hash_insert, states_free): New. + * src/states.c (state_table, state_compare, state_hash): New. + * src/output.c (output_actions): Do not free states now, since we + still need to know the final_state number in `prepare', called + afterwards. Do it... + * src/main.c (main): here: call states_free after `output'. + +2002-06-30 Akim Demaille + + * src/state.h, src/state.c (state_new): New, extracted from... + * src/LR0.c (new_state): here. + * src/state.h (STATE_ALLOC): Move to... + * src/state.c: here. + * src/LR0.h, src/LR0.c (nstates, final_state): Move to... + * src/state.h, src/state.c: here. + +2002-06-30 Akim Demaille + + * src/reader.c (gensym): Rename as... + * src/symtab.h, src/symtab.c (dummy_symbol_get): this. + (getsym): Rename as... + (symbol_get): this. + +2002-06-30 Akim Demaille + + * src/state.h (state_number_t, STATE_NUMBER_MAX): New. + * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h, + * src/output.c, src/print.c, src/print_graph.c: Propagate. + * src/LR0.h, src/LR0.h (final_state): Is a state_t*. + +2002-06-30 Akim Demaille + + Make the test suite pass with warnings checked. + + * tests/actions.at (Printers and Destructors): Improve. + Avoid unsigned vs. signed issues. + * tests/calc.at: Don't exercise the scanner here, do it... + * tests/input.at (Torturing the Scanner): here. + +2002-06-28 Paul Hilfinger + + * data/glr.c: Correct typo in Emacs-mode directive. Slightly + reorganize first lines parallel to yacc.c. + +2002-06-28 Akim Demaille + + * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define) + (b4_token_enum, b4_token_defines): New, factored from... + * data/lalr1.cc, data/yacc.c, glr.c: here. + +2002-06-28 Akim Demaille + + * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for + unused variables. + * src/output.c (merger_output): static. + +2002-06-28 Akim Demaille + + * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../. + * src/conflicts.c (conflicts_total_count): `i' is unsigned, to + pacify GCC. + * src/output.c (save_row): Initialize all the variables to pacify GCC. + +2002-06-27 Paul Hilfinger + + Accumulated changelog for new GLR parsing features. + + * src/conflicts.c (count_total_conflicts): Change name to + conflicts_total_count. + * src/conflicts.h: Ditto. + * src/output.c (token_actions): Use the new name. + (output_conflicts): Change conflp => conflict_list_heads, and + confl => conflict_list for better readability. + * data/glr.c: Use the new names. + * NEWS: Add self to GLR announcement. + + * src/reader.c (free_merger_functions): Cleanup: XFREE->free. + + * doc/bison.texinfo (GLR Parsers): Make corrections suggested by + Akim Demaille. + + * data/bison.glr: Change name to glr.c + * data/glr.c: Renamed from bison.glr. + * data/Makefile.am: Add glr.c + + * src/getargs.c: + + * src/symlist.h: Add dprec and merger fields to symbol_list_s. + * src/symlist.c (symbol_list_new): Initialize dprec and merger fields. + + Originally 2002-06-16 Paul Hilfinger + + * data/bison.glr: Be sure to restore the + current #line when returning to the skeleton contents after having + exposed the input file's #line. + + Originally 2002-06-13 Paul Hilfinger + + * data/bison.glr: Bring up to date with changes to bison.simple. + + Originally 2002-06-03 Paul Hilfinger + + * data/bison.glr: Correct definitions that use b4_prefix. + Various reformatting. + (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack. + (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove + yytokenp argument; now part of stack. + (yychar): Define to behave as documented. + (yyclearin): Ditto. + + Originally 2002-05-14 Paul Hilfinger + + * src/reader.h: Add declaration for free_merger_functions. + + * src/reader.c (merge_functions): New variable. + (get_merge_function): New function. + (free_merger_functions): New function. + (readgram): Check for %prec that is not followed by a symbol. + Handle %dprec and %merge declarations. + (packgram): Initialize dprec and merger fields in rules array. + + * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list, + conflict_list_cnt, conflict_list_free): New variables. + (table_grow): Also grow conflict_table. + (prepare_rules): Output dprec and merger tables. + (conflict_row): New function. + (action_row): Output conflict lists for GLR parser. Don't use + default reduction in conflicted states for GLR parser so that there + are spaces for the conflict lists. + (save_row): Also save conflict information. + (token_actions): Allocate conflict list. + (merger_output): New function. + (pack_vector): Pack conflict table, too. + (output_conflicts): New function to output yyconflp and yyconfl. + (output_check): Allocate conflict_tos. + (output_actions): Output conflict tables, also. + (output_skeleton): Output b4_mergers definition. + (prepare): Output b4_max_rhs_length definition. + Use 'bison.glr' as default skeleton for GLR parsers. + + * src/gram.c (glr_parser): New flag. + (grammar_free): Call free_merger_functions. + + * src/conflicts.c (count_rr_conflicts): Augment to optionally count + all pairs of conflicting reductions, rather than just all tokens + causing conflicts. Needed to size conflict tables. + (conflicts_output): Modify call to count_rr_conflicts for new + interface. + (conflicts_print): Ditto. + (count_total_conflicts): New function. + + * src/reader.h (merger_list): New type. + (merge_functions): New variable. + + * src/lex.h (tok_dprec, tok_merge): New token types. + + * src/gram.h (rule_s): Add dprec and merger fields. + (glr_parser): New flag. + + * src/conflicts.h (count_total_conflicts): New function. + + * src/options.c (option_table): Add %dprec, %merge, and %glr-parser. + + * doc/bison.texinfo (Generalized LR Parsing): New section. + (GLR Parsers): New section. + (Language and Grammar): Mention GLR parsing. + (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR + Correct typo ("tge" -> "the"). + + * data/bison.glr: New skeleton for GLR parsing. + + * tests/cxx-gram.at: New tests for GLR parsing. + + * tests/testsuite.at: Include cxx-gram.at. + + * tests/Makefile.am: Add cxx-gram.at. + + * src/parse-gram.y: + + * src/scan-gram.l: Add %dprec, %glr-parser, %merge. + + * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser. + +2002-06-27 Akim Demaille + + * src/options.h, src/options.c: Remove. + * src/getargs.c (short_options, long_options): New. + +2002-06-27 Akim Demaille + + * data/bison.simple, data/bison.c++: Rename as... + * data/yacc.c, data/lalr1.cc: these. + * doc/bison.texinfo (Environment Variables): Remove. + +2002-06-25 Raja R Harinath + + * src/getargs.c (report_argmatch): Initialize strtok(). + +2002-06-20 Akim Demaille + + * data/bison.simple (b4_symbol_actions): New, replaces... + (b4_symbol_destructor, b4_symbol_printer): these. + (yysymprint): Be sure to call YYPRINT only for tokens, and using + user token numbers. + +2002-06-20 Akim Demaille + + * data/bison.simple (yydestructor): Rename as... + (yydestruct): this. + +2002-06-20 Akim Demaille + + * src/symtab.h, src/symtab.c (symbol_type_set) + (symbol_destructor_set, symbol_precedence_set): The location is + the last argument. + Adjust all callers. + +2002-06-20 Akim Demaille + + * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser + internals. + * src/reader.h, src/reader.c (grammar_current_rule_prec_set): + Takes a location. + * src/symtab.h, src/symtab.c (symbol_class_set) + (symbol_user_token_number_set): Likewise. + Adjust all callers. + Promote complain_at. + * tests/input.at (Type Clashes): Adjust. + +2002-06-20 Akim Demaille + + * data/bison.simple (YYLEX): Fix the declaration when + %pure-parser. + +2002-06-20 Akim Demaille + + * data/bison.simple (yysymprint): Don't print the token number, + just its name. + * tests/actions.at (Destructors): Rename as... + (Printers and Destructors): this. + Also exercise %printer. + +2002-06-20 Akim Demaille + + * data/bison.simple (YYDSYMPRINT): New. + Use it to remove many of the #if YYDEBUG/if (yydebug). + +2002-06-20 Akim Demaille + + * src/symtab.h, src/symtab.c (symbol_t): printer and + printer_location are new members. + (symbol_printer_set): New. + * src/parse-gram.y (PERCENT_PRINTER): New token. + Handle its associated rule. + * src/scan-gram.l: Adjust. + (handle_destructor_at, handle_destructor_dollar): Rename as... + (handle_symbol_code_at, handle_symbol_code_dollar): these. + * src/output.c (symbol_printers_output): New. + (output_skeleton): Call it. + * data/bison.simple (yysymprint): New. Cannot be named yyprint + since there are already many grammar files with a user `yyprint'. + Replace the calls to YYPRINT to calls to yysymprint. + * tests/calc.at: Adjust. + * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was + taking advantage of parser very internal details (stack size!). + +2002-06-20 Akim Demaille + + * src/scan-gram.l: Complete the scanner with the missing patterns + to pacify Flex. + Use `quote' and `symbol_tag_get' where appropriate. + +2002-06-19 Akim Demaille + + * tests/actions.at (Destructors): Augment to test locations. + * data/bison.simple (yydestructor): Pass it the current location + if locations are enabled. + Prototype only when __STDC__ or C++. + Change the argument names to move into the yy name space: there is + user code here. + +2002-06-19 Akim Demaille + + * data/bison.simple (b4_pure_if): New. + Use it instead of #ifdef YYPURE. + +2002-06-19 Akim Demaille + + * data/bison.simple (b4_location_if): New. + Use it instead of #ifdef YYLSP_NEEDED. + +2002-06-19 Akim Demaille + + Prepare @$ in %destructor, but currently don't bind it in the + skeleton, as %location use is not cleaned up yet. + + * src/scan-gram.l (handle_dollar, handle_destructor_at) + (handle_action_at): New. + (handle_at, handle_action_dollar, handle_destructor_dollar): Take + a braced_code_t and a location as additional arguments. + (handle_destructor_dollar): Instead of requiring `b4_eval', just + unquote one when outputting `b4_dollar_dollar'. + Adjust callers. + * data/bison.simple (b4_eval): Remove. + (b4_symbol_destructor): Adjust. + * tests/input.at (Invalid @n): Adjust. + +2002-06-19 Zack Weinberg + + * doc/bison.texinfo: Document ability to have multiple + prologue sections. + +2002-06-18 Akim Demaille + + * src/files.c (compute_base_names): When computing the output file + names from the input file name, strip the directory part. + +2002-06-18 Akim Demaille + + * data/bison.simple.new: Comment changes. + Reported by Andreas Schwab. + +2002-06-18 Matt Kraai + + * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that + there are no `label `yyoverflowlab' defined but not used' warnings + when yyoverflow is defined. + +2002-06-18 Akim Demaille + + * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a + new member. + (symbol_destructor_set): Adjust. + * src/output.c (symbol_destructors_output): Output the destructor + locations. + Output the symbol name. + * data/bison.simple (b4_symbol_destructor): Adjust. + +2002-06-18 Cris Bailiff + and Akim Demaille + + * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy + what's left on the stack when the error recovery hits EOF. + * tests/actions.at (Destructors): Complete to exercise this case. + +2002-06-17 Akim Demaille + + * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of + arguments is really empty, not only equal to `[]'. + * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new + member. + (symbol_destructor_set): New. + * src/output.c (symbol_destructors_output): New. + * src/reader.h (brace_code_t, current_braced_code): New. + * src/scan-gram.l (BRACED_CODE): Use it to branch on... + (handle_dollar): Rename as... + (handle_action_dollar): this. + (handle_destructor_dollar): New. + * src/parse-gram.y (PERCENT_DESTRUCTOR): New. + (grammar_declaration): Use it. + * data/bison.simple (yystos): Is always defined. + (yydestructor): New. + * tests/actions.at (Destructors): New. + * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep. + +2002-06-17 Akim Demaille + + * src/symlist.h, src/symlist.c (symbol_list_length): New. + * src/scan-gram.l (handle_dollar, handle_at): Compute the + rule_length only when needed. + * src/output.c (actions_output, token_definitions_output): Output + the full M4 block. + * src/symtab.c: Don't access directly to the symbol tag, use + symbol_tag_get. + * src/parse-gram.y: Use symbol_list_free. + +2002-06-17 Akim Demaille + + * src/reader.h, src/reader.c (symbol_list, symbol_list_new) + (symbol_list_prepend, get_type_name): Move to... + * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new) + (symbol_list_prepend, symbol_list_n_type_name_get): here. + Adjust all callers. + (symbol_list_free): New. + * src/scan-gram.l (handle_dollar): Takes a location. + * tests/input.at (Invalid $n): Adjust. + +2002-06-17 Akim Demaille + + * src/reader.h, src/reader.c (symbol_list_new): Export it. + (symbol_list_prepend): New. + * src/parse-gram.y (%union): `list' is a new member. + (symbols.1): New, replaces... + (terms_to_prec.1, nterms_to_type.1): these. + * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set) + Take a location as additional argument. + Adjust all callers. + +2002-06-15 Akim Demaille + + * src/parse-gram.y: Move %token in the declaration section so that + we don't depend upon CVS Bison. + +2002-06-15 Akim Demaille + + * src/state.h, src/state.c (state_rule_lookaheads_print): New. + * src/print.c (print_core): Use it. + +2002-06-15 Akim Demaille + + * src/conflicts.c (log_resolution): Accept the rule involved in + the sr conflicts instead of the lookahead number that points to + that rule. + (flush_reduce): Accept the current lookahead vector as argument, + instead of the index in LA. + (resolve_sr_conflict): Accept the current number of lookahead + bitset to consider for the STATE, instead of the index in LA. + (set_conflicts): Adjust. + * src/lalr.c, src/lalr.h, src/state.h: Comment changes. + +2002-06-15 Akim Demaille + + * src/state.h (state_t): Replace the `lookaheadsp' member, a + short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**). + Adjust all dependencies. + * src/lalr.c (initialize_lookaheads): Split into... + (states_lookaheads_count, states_lookaheads_initialize): these. + (lalr): Adjust. + +2002-06-15 Akim Demaille + + * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved + out of... + (grammar_rules_print): here. + * src/reduce.c (reduce_output): Use it. + * tests/reduce.at (Useless Rules, Reduced Automaton) + (Underivable Rules): Adjust. + +2002-06-15 Akim Demaille + + Copy BYacc's nice way to report the grammar. + + * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print): + New. + Don't print the rules' location, it is confusing and useless. + (rule_print): Use grammar_rhs_print. + * src/print.c (print_grammar): Use grammar_rules_print. + +2002-06-15 Akim Demaille + + Complete and rationalize `useless thing' warnings. + + * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n) + (symbol_tag_print): New. + Use them everywhere in place of accessing directly the tag member. + * src/gram.h, src/gram.c (rule_print): New. + Use it where a rule used to be printed `by hand'. + * src/reduce.c (nonterminals_reduce): Report the use nonterminals. + (reduce_grammar_tables): Report the useless rules. + (reduce_print): Useless things are a warning, not an error. + Report it as such. + * tests/reduce.at (Useless Nonterminals, Useless Rules): + (Reduced Automaton, Underivable Rules): Adjust. + * tests/regression.at (Web2c Report, Web2c Report): Adjust. + * tests/conflicts.at (Unresolved SR Conflicts) + (Solved SR Conflicts): Adjust. + +2002-06-15 Akim Demaille + + Let symbols have a location. + + * src/symtab.h, src/symtab.c (symbol_t): Location is a new member. + (getsym): Adjust. + Adjust all callers. + * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at): + Use location_t, not int. + * src/symtab.c (symbol_check_defined): Take advantage of the + location. + * tests/regression.at (Invalid inputs): Adjust. + +2002-06-15 Akim Demaille + + * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New. + (input): Don't try to initialize yylloc here, do it in the + scanner. + * src/scan-gram.l (YY_USER_INIT): Initialize yylloc. + * src/gram.h (rule_t): Change line and action_line into location + and action_location, of location_t type. + Adjust all dependencies. + * src/location.h, src/location.c (empty_location): New. + * src/reader.h, src/reader.c (grammar_start_symbol_set) + (grammar_symbol_append, grammar_rule_begin, grammar_rule_end) + (grammar_current_rule_symbol_append) + (grammar_current_rule_action_append): Expect a location as argument. + * src/reader.c (grammar_midrule_action): Adjust to attach an + action's location as dummy symbol location. + * src/symtab.h, src/symtab.c (startsymbol_location): New. + * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust + the line numbers. + +2002-06-14 Akim Demaille + + Grammar declarations may be found in the grammar section. + + * src/parse-gram.y (rules_or_grammar_declaration): New. + (declarations): Each declaration may end with a semicolon, not + just... + (grammar_declaration): `"%union"'. + (grammar): Branch to rules_or_grammar_declaration. + +2002-06-14 Akim Demaille + + * src/main.c (main): Invoke scanner_free. + +2002-06-14 Akim Demaille + + * src/output.c (m4_invoke): Extracted from... + (output_skeleton): here. + Free tempfile. + +2002-06-14 Akim Demaille + + * src/parse-gram.y (directives, directive, gram) + (grammar_directives, precedence_directives, precedence_directive): + Rename as... + (declarations, declaration, grammar, grammar_declaration) + (precedence_declaration, precedence_declarator): these. + (symbol_declaration): New. + +2002-06-14 Akim Demaille + + * src/files.c (action_obstack): Remove, unused. + (output_obstack): Remove it, and all its dependencies, as it is no + longer needed. + * src/reader.c (epilogue_set): Build the epilogue in the + muscle_obstack. + * src/output.h, src/output.c (muscle_obstack): Move to... + * src/muscle_tab.h, src/muscle_tab.h: here. + (muscle_init): Initialize muscle_obstack. + (muscle_free): New. + * src/main.c (main): Call it. + +2002-06-14 Akim Demaille + + * src/location.h: New, extracted from... + * src/reader.h: here. + * src/Makefile.am (noinst_HEADERS): Merge into + (bison_SOURCES): this. + Add location.h. + * src/parse-gram.y: Use location_t instead of Bison's. + * src/reader.h, src/reader.c (prologue_augment, epilogue_set): + Use location_t instead of ints. + +2002-06-14 Akim Demaille + + * data/bison.simple, data/bison.c++: Be sure to restore the + current #line when returning to the skeleton contents after having + exposed the input file's #line. + +2002-06-12 Akim Demaille + + * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too + eager. + * tests/actions.at (Exotic Dollars): New. + +2002-06-12 Akim Demaille + + * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst + ['"/] too eagerly. + * tests/input.at (Torturing the Scanner): New. + +2002-06-11 Akim Demaille + + * src/scan-gram.l (YY_OBS_INIT): Remove, replace with... + [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE] + [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment. + * src/reader.h, src/scan-gram.l (scanner_initialize): this. + * src/reader.c (reader): Use it. + +2002-06-11 Akim Demaille + + * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval. + Adjust all callers. + (scanner_last_string_free): New. + +2002-06-11 Akim Demaille + + * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as... + (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these. + (last_string, YY_OBS_FREE): New. + Use them when returning an ID. + +2002-06-11 Akim Demaille + + Have Bison grammars parsed by a Bison grammar. + + * src/reader.c, src/reader.h (prologue_augment): New. + * src/reader.c (copy_definition): Remove. + + * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment) + (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action) + (grammar_current_rule_prec_set, grammar_current_rule_check) + (grammar_current_rule_symbol_append) + (grammar_current_rule_action_append): Export. + * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_ + (symbol_list_action_append): Remove. + Hook the routines from reader. + * src/scan-gram.l: In INITIAL, characters and strings are tokens. + * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now. + + * src/reader.c (read_declarations): Remove, unused. + + * src/parse-gram.y: Handle the epilogue. + * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as... + (grammar_start_symbol_set): this. + * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet. + * src/reader.c (readgram): Remove, unused. + (reader): Adjust to insert eoftoken and axiom where appropriate. + + * src/reader.c (copy_dollar): Replace with... + * src/scan-gram.h (handle_dollar): this. + * src/parse-gram.y: Remove `%thong'. + + * src/reader.c (copy_at): Replace with... + * src/scan-gram.h (handle_at): this. + + * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at): + New. + + * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the + time being. + + * src/reader.h, src/reader.c (grammar_rule_end): New. + + * src/parse.y (current_type, current_class): New. + Implement `%nterm', `%token' support. + Merge `%term' into `%token'. + (string_as_id): New. + * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the + type name. + + * src/parse-gram.y: Be sure to handle properly the beginning of + rules. + + * src/parse-gram.y: Handle %type. + * src/reader.c (grammar_rule_end): Call grammar_current_rule_check. + + * src/parse-gram.y: More directives support. + * src/options.c: No longer handle source directives. + + * src/parse-gram.y: Fix %output. + + * src/parse-gram.y: Handle %union. + Use the prologue locations. + * src/reader.c (parse_union_decl): Remove. + + * src/reader.h, src/reader.c (epilogue_set): New. + * src/parse-gram.y: Use it. + + * data/bison.simple, data/bison.c++: b4_stype is now either not + defined, then default to int, or to the contents of %union, + without `union' itself. + Adjust. + * src/muscle_tab.c (muscle_init): Don't predefine `stype'. + + * src/output.c (actions_output): Don't output braces, as they are + already handled by the scanner. + + * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of + characters to themselves. + + * tests/reduce.at (Reduced Automaton): End the grammars with %% so + that the epilogue has a proper #line. + + * src/parse-gram.y: Handle precedence/associativity. + + * src/symtab.c (symbol_precedence_set): Requires the symbol to be + a terminal. + * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters. + * tests/calc.at: Do not use `%token "foo"' as it makes not sense + at all to define terminals that cannot be emitted. + + * src/scan-gram.l: Escape M4 characters. + + * src/scan-gram.l: Working properly with escapes in user + strings/characters. + + * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR) + (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING' + grammar. + Use more modest sizes, as for the time being the parser does not + release memory, and therefore the process swallows a huge amount + of memory. + + * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the + stricter %token grammar. + + * src/symtab.h (associativity): Add `undef_assoc'. + (symbol_precedence_set): Do nothing when passed an undef_assoc. + * src/symtab.c (symbol_check_alias_consistence): Adjust. + + * tests/regression.at (Invalid %directive): Remove, as it is now + meaningless. + (Invalid inputs): Adjust to the new error messages. + (Token definitions): The new grammar doesn't allow too many + eccentricities. + + * src/lex.h, src/lex.c: Remove. + * src/reader.c (lastprec, skip_to_char, read_signed_integer) + (copy_character, copy_string2, copy_string, copy_identifier) + (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl) + (parse_muscle_decl, parse_dquoted_param, parse_skel_decl) + (parse_action): Remove. + * po/POTFILES.in: Adjust. + +2002-06-11 Akim Demaille + + * src/reader.c (parse_action): Don't store directly into the + rule's action member: return the action as a string. + Don't require `rule_length' as an argument: compute it. + (grammar_current_rule_symbol_append) + (grammar_current_rule_action_append): New, eved out from + (readgram): here. + Remove `action_flag', `rulelength', unused now. + +2002-06-11 Akim Demaille + + * src/reader.c (grammar_current_rule_prec_set). + (grammar_current_rule_check): New, eved out from... + (readgram): here. + Remove `xaction', `first_rhs': useless. + * tests/input.at (Type clashes): New. + * tests/existing.at (GNU Cim Grammar): Adjust. + +2002-06-11 Akim Demaille + + * src/reader.c (grammar_midrule_action): New, Eved out from + (readgram): here. + +2002-06-11 Akim Demaille + + * src/reader.c (grammar_rule_begin, previous_rule, current_rule): + New. + (readgram): Use them as replacement of inlined code, crule and + crule1. + +2002-06-11 Akim Demaille + + * src/reader.c (grammar_end, grammar_symbol_append): New. + (readgram): Use them. + Make the use of `p' as local as possible. + +2002-06-10 Akim Demaille + + GCJ's parser requires the tokens to be defined before the prologue. + + * data/bison.simple: Output the token definition before the user's + prologue. + * tests/regression.at (Braces parsing, Duplicate string) + (Mixing %token styles): Check the output from bison. + (Early token definitions): New. + +2002-06-10 Akim Demaille + + * src/symtab.c (symbol_user_token_number_set): Don't complain when + assigning twice the same user number to a token, so that we can + use it in... + * src/lex.c (lex): here. + Also use `symbol_class_set' instead of hand written code. + * src/reader.c (parse_assoc_decl): Likewise. + +2002-06-10 Akim Demaille + + * src/symtab.c, src/symtab.c (symbol_class_set) + (symbol_user_token_number_set): New. + * src/reader.c (parse_token_decl): Use them. + Use a switch instead of ifs. + Use a single argument. + +2002-06-10 Akim Demaille + + Remove `%thong' support as it is undocumented, unused, duplicates + `%token's job, and creates useless e-mail traffic with people who + want to know what it is, why it is undocumented, unused, and + duplicates `%token's job. + + * src/reader.c (parse_thong_decl): Remove. + * src/options.c (option_table): Remove "thong". + * src/lex.h (tok_thong): Remove. + +2002-06-10 Akim Demaille + + * src/symtab.c, src/symtab.c (symbol_type_set) + (symbol_precedence_set): New. + * src/reader.c (parse_type_decl, parse_assoc_decl): Use them. + (value_components_used): Remove, unused. + +2002-06-09 Akim Demaille + + Move symbols handling code out of the reader. + + * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken) + (axiom): Move to... + * src/symtab.h, src/symtab.c: here. + + * src/gram.c (start_symbol): Remove: use startsymbol->number. + * src/reader.c (startval): Rename as... + * src/symtab.h, src/symtab.c (startsymbol): this. + * src/reader.c: Adjust. + + * src/reader.c (symbol_check_defined, symbol_make_alias) + (symbol_check_alias_consistence, symbol_pack, symbol_translation) + (token_translations_init) + Move to... + * src/symtab.c: here. + * src/reader.c (packsymbols): Move to... + * src/symtab.h, src/symtab.c (symbols_pack): here. + * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as + argument. + +2002-06-03 Akim Demaille + + * src/muscle_tab.c (muscle_insert, muscle_find): Declarations, + then statements. + +2002-06-03 Akim Demaille + + * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize + structs with non literals. + * src/scan-skel.l: never-interactive. + * src/conflicts.c (enum conflict_resolution_e): No trailing + comma. + * src/getargs.c (usage): Split long literal strings. + Reported by Hans Aberg. + +2002-05-28 Akim Demaille + + * data/bison.c++: Use C++ ostreams. + (cdebug_): New member. + +2002-05-28 Akim Demaille + + * src/output.c (output_skeleton): Be sure to allocate enough room + for `/' _and_ for `\0' in full_skeleton. + +2002-05-28 Akim Demaille + + * data/bison.c++: Catch up with bison.simple: + 2002-05-24 Paul Hilfinger + and Paul Eggert : `error' handing. + 2002-05-26 Akim Demaille : stos_, token_number_, + and popping traces. + +2002-05-27 Paul Hilfinger + + * src/output.c (output_skeleton): Put an explicit path in front of + the skeleton file name, rather than relying on the -I directory, + to partially alleviate effects of having a skeleton file lying around + in the current directory. + +2002-05-27 Paul Hilfinger + + * src/conflicts.c (log_resolution): Correct typo: + obstack_printf should be obstack_fgrow1. + +2002-05-26 Akim Demaille + + * src/state.h (state_t): `solved_conflicts' is a new member. + * src/LR0.c (new_state): Set it to 0. + * src/conflicts.h, src/conflicts.c (print_conflicts) + (free_conflicts, solve_conflicts): Rename as... + (conflicts_print, conflicts_free, conflicts_solve): these. + Adjust callers. + * src/conflicts.c (enum conflict_resolution_e) + (solved_conflicts_obstack): New, used by... + (log_resolution): this. + Adjust to attach the conflict resolution to each state. + Complete the description with the precedence/associativity + information. + (resolve_sr_conflict): Adjust. + * src/print.c (print_state): Output its solved_conflicts. + * tests/conflicts.at (Unresolved SR Conflicts) + (Solved SR Conflicts): Exercise --report=all. + +2002-05-26 Akim Demaille + + * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c, + * src/nullable.c, src/output.c, src/print.c, src/print_graph.c, + * src/reader.c, src/reduce.c, src/state.h, src/symtab.h + (token_number_t, item_number_as_token_number) + (token_number_as_item_number, muscle_insert_token_number_table): + Rename as... + (symbol_number_t, item_number_as_symbol_number) + (symbol_number_as_item_number, muscle_insert_symbol_number_table): + these, since it is more appropriate. + +2002-05-26 Akim Demaille + + * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional + `Error:' lines. + * data/bison.simple (yystos) [YYDEBUG]: New. + (yyparse) [YYDEBUG]: Display the symbols which are popped during + error recovery. + * tests/regression.at (Web2c Actions): Adjust: yystos is output now. + +2002-05-25 Akim Demaille + + * doc/bison.texinfo (Debugging): Split into... + (Tracing): this new section, its former contents, and... + (Understanding): this new section. + * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced + by... + (report_flag): this. + Adjust all dependencies. + (report_args, report_types, report_argmatch): New. + (usage, getargs): Report/support -r, --report. + * src/options.h + (struct option_table_struct): Rename as.., + (struct option_table_s): this. + Rename the `set_flag' member to `flag' to match with getopt_long's + struct. + * src/options.c (option_table): Split verbose into an entry for + %verbose, and another for --verbose. + Support --report/-r, so remove -r from the obsolete --raw. + * src/print.c: Attach full item sets and lookaheads reports to + report_flag instead of trace_flag. + * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1. + +2002-05-24 Paul Hilfinger + and Paul Eggert + + * data/bison.simple (yyparse): Correct error handling to conform to + POSIX and yacc. Specifically, after syntax error is discovered, + do not reduce further before shifting the error token. + Clean up the code a bit by removing the labels yyerrdefault, + yyerrhandle, yyerrpop. + * NEWS: Document the above. + +2002-05-20 Paul Hilfinger + + * data/bison.simple (yyr1): Don't use yy_token_number_type as element + type; it isn't always big enough, since it doesn't necessarily + include non-terminals. + (yytranslate): Expand definition of yy_token_number_type, so that + the latter can be removed. + (yy_token_number_type): Remove, only one use. + * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple--- + don't use TokenNumberType as element type. + + * tests/regression.at: Modify expected output to agree with change + to yyr1 and yytranslate. + +2002-05-13 Florian Krohm + + * src/reader.c (parse_action): Use copy_character instead of + obstack_1grow. + +2002-05-13 Akim Demaille + + * tests/regression.at (Token definitions): Prototype yylex and + yyerror. + +2002-05-12 Paul Hilfinger + + * src/scan-skel.l: Correct off-by-one error in handling of __oline__. + * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect + 32-bit arithmetic. + * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto. + +2002-05-07 Akim Demaille + + * tests/synclines.at: Be sure to prototype yylex and yyerror to + avoid GCC warnings. + +2002-05-07 Akim Demaille + + Kill GCC warnings. + + * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop + over the RHS of each rule. + * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int. + * src/state.h (state_t): Member `nitems' is unsigned short. + * src/LR0.c (get_state): Adjust. + * src/reader.c (packgram): Likewise. + * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type + `Type'. + (muscle_insert_int_table): Remove, unused. + (prepare_rules): Remove `max'. + +2002-05-06 Akim Demaille + + * src/closure.c (print_firsts): Display of the symbol tags. + (bitmatrix_print): Move to... + * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump): + here. + * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust. + +2002-05-06 Akim Demaille + + * src/muscle_tab.c (muscle_m4_output): Must return TRUE for + hash_do_for_each. + +2002-05-06 Akim Demaille + + * src/LR0.c (new_state, get_state): Instead of using the global + `kernel_size' and `kernel_base', have two new arguments: + `core_size' and `core'. + Adjust callers. + +2002-05-06 Akim Demaille + + * src/reader.c (packgram): No longer end `ritem' with a 0 + sentinel: it is not used. + +2002-05-05 Akim Demaille + + New experimental feature: display the lookaheads in the report and + graph. + + * src/print (print_core): When --trace-flag, display the rules + lookaheads. + * src/print_graph.c (print_core): Likewise. + Swap the arguments. + Adjust caller. + +2002-05-05 Akim Demaille + + * tests/torture.at (Many lookaheads): New test. + +2002-05-05 Akim Demaille + + * src/output.c (GENERATE_OUTPUT_TABLE): Replace with... + (GENERATE_MUSCLE_INSERT_TABLE): this. + (output_int_table, output_unsigned_int_table, output_short_table) + (output_token_number_table, output_item_number_table): Replace with... + (muscle_insert_int_table, muscle_insert_unsigned_int_table) + (muscle_insert_short_table, muscle_insert_token_number_table) + (muscle_insert_item_number_table): these. + Adjust all callers. + (prepare_tokens): Don't free `translations', since... + * src/reader.h, src/reader.c (grammar_free): do it. + Move to... + * src/gram.h, src/gram.c (grammar_free): here. + * data/bison.simple, data/bison.c++: b4_token_number_max is now + b4_translate_max. + +2002-05-05 Akim Demaille + + * src/output.c (output_unsigned_int_table): New. + (prepare_rules): `i' is unsigned. + `prhs', `rline', `r2' are unsigned int. + Rename muscle `rhs_number_max' as `rhs_max'. + Output muscles `prhs_max', `rline_max', and `r2_max'. + Free rline and r1. + * data/bison.simple, data/bison.c++: Adjust to use these muscles + to compute types instead of constant types. + * tests/regression.at (Web2c Actions): Adjust. + +2002-05-04 Akim Demaille + + * src/symtab.h (SALIAS, SUNDEF): Rename as... + (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these. + Adjust dependencies. + * src/output.c (token_definitions_output): Be sure not to output a + `#define 'a'' when fed with `%token 'a' "a"'. + * tests/regression.at (Token definitions): New. + +2002-05-03 Paul Eggert + + * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE + for K&R C. + +2002-05-03 gettextize + + * Makefile.am (SUBDIRS): Remove intl. + (EXTRA_DIST): Add config/config.rpath. + +2002-05-03 Akim Demaille + + * data/bison.simple (m4_if): Don't output empty enums. + And actually, output valid enum definitions :(. + +2002-05-03 Akim Demaille + + * configure.bat: Remove, completely obsolete. + * Makefile.am (EXTRA_DIST): Adjust. + Don't distribute config.rpath... + * config/Makefile.am (EXTRA_DIST): Do it. + +2002-05-03 Akim Demaille + + * configure.in (GETTEXT_VERSION): New. + Suggested by Bruno Haible for the forthcoming Gettext 0.10.3. + +2002-05-03 Akim Demaille + + * data/bison.simple (b4_token_enum): New. + (b4_token_defines): Use it to output tokens both as #define and + enums. + Suggested by Paul Eggert. + * src/output.c (token_definitions_output): Don't output spurious + white spaces. + +2002-05-03 Akim Demaille + + * data/m4sugar/m4sugar.m4: Update from CVS Autoconf. + +2002-05-02 Robert Anisko + + * data/bison.c++: Adapt expansion of $s and @s to the C++ parser. + Update the stack class, give a try to deque as the default container. + +2002-05-02 Akim Demaille + + * data/bison.simple (yyparse): Do not implement @$ = @1. + (YYLLOC_DEFAULT): Adjust to do it. + * doc/bison.texinfo (Location Default Action): Fix. + +2002-05-02 Akim Demaille + + * src/reader.c (parse_braces): Merge into... + (parse_action): this. + +2002-05-02 Akim Demaille + + * configure.in (ALL_LINGUAS): Remove. + * po/LINGUAS, hr.po: New. + +2002-05-02 Akim Demaille + + Remove the so called hairy (semantic) parsers. + + * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove. + * src/gram.h, src/gram.c (semantic_parser): Remove. + (rule_t): Remove the guard and guard_line members. + * src/lex.h (token_t): remove tok_guard. + * src/options.c (option_table): Remove %guard and %semantic_parser + support. + * src/output.c, src/output.h (guards_output): Remove. + (prepare): Adjust. + (token_definitions_output): Don't output the `T' + tokens (???). + (output_skeleton): Don't output the guards. + * src/files.c, src/files.c (attrsfile): Remove. + * src/reader.c (symbol_list): Remove the guard and guard_line + members. + Adjust dependencies. + (parse_guard): Remove. + * data/bison.hairy: Remove. + * doc/bison.texinfo (Environment Variables): Remove occurrences of + BISON_HAIRY. + +2002-05-02 Akim Demaille + + * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action) + (parse_guard): Rename the formal argument `stack_offset' as + `rule_length', which is more readable. + Adjust callers. + (copy_at, copy_dollar): Instead of outputting the hard coded + values of $$, $n and so forth, output invocation to b4_lhs_value, + b4_lhs_location, b4_rhs_value, and b4_rhs_location. + Note: this patch partially drops `semantic-parser' support: it + always does `rule_length - n', where semantic parsers ought to + always use `-n'. + * data/bison.simple, data/bison.c++ (b4_lhs_value) + (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New. + +2002-05-02 Akim Demaille + + * configure.in (AC_INIT): Bump to 1.49b. + (AM_INIT_AUTOMAKE): Short invocation. + +2002-05-02 Akim Demaille + + Version 1.49a. + +2002-05-01 Akim Demaille + + * src/skeleton.h: Remove. + +2002-05-01 Akim Demaille + + * src/skeleton.h: Fix the #endif. + Reported by Magnus Fromreide. + +2002-04-26 Paul Eggert + + * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL): + Define if we define YYSTYPE and YYLTYPE, respectively. + (YYCOPY): Fix [] quoting problem in the non-GCC case. + +2002-04-25 Robert Anisko + + * src/scan-skel.l: Postprocess quadrigraphs. + + * src/reader.c (copy_character): New function, used to output + single characters while replacing `[' and `]' with quadrigraphs, to + avoid troubles with M4 quotes. + (copy_comment): Output characters with copy_character. + (read_additionnal_code): Likewise. + (copy_string2): Likewise. + (copy_definition): Likewise. + + * tests/calc.at: Exercise M4 quoting. + +2002-04-25 Akim Demaille + + * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space + between `!' and the command. + Reported by Paul Eggert. + +2002-04-24 Robert Anisko + + * tests/calc.at: Exercise prologue splitting. + + * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and + `b4_post_prologue' instead of `b4_prologue'. + + * src/output.c (prepare): Add the `pre_prologue' and `post_prologue' + muscles. + (output): Free pre_prologue_obstack and post_prologue_obstack. + * src/files.h, src/files.c (attrs_obstack): Remove. + (pre_prologue_obstack, post_prologue_obstack): New. + * src/reader.c (copy_definition): Add a parameter to specify the + obstack to fill, instead of using attrs_obstack unconditionally. + (read_declarations): Pass pre_prologue_obstack to copy_definition if + `%union' has not yet been seen, pass post_prologue_obstack otherwise. + +2002-04-23 Paul Eggert + + * data/bison.simple: Remove unnecessary commentary and white + space differences from 1_29-branch. + Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE). + + (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY, + YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or + if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial + constructors or destructors. + + (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack. + +2002-04-23 Akim Demaille + + * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels. + * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's + location with columns. + * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'. + All reported by Paul Eggert. + +2002-04-22 Akim Demaille + + * src/reduce.c (dump_grammar): Move to... + * src/gram.h, src/gram.c (grammar_dump): here. + Be sure to separate long item numbers. + Don't read the members of a rule's prec if its nil. + +2002-04-22 Akim Demaille + + * src/output.c (table_size, table_grow): New. + (MAXTABLE): Remove, replace uses with table_size. + (pack_vector): Instead of dying when the table is too big, grow it. + +2002-04-22 Akim Demaille + + * data/bison.simple (yyr1): Its type is that of a token number. + * data/bison.c++ (r1_): Likewise. + * tests/regression.at (Web2c Actions): Adjust. + +2002-04-22 Akim Demaille + + * src/reader.c (token_translations_init): 256 is now the default + value for the error token, i.e., it will be assigned another + number if the user assigned 256 to one of her tokens. + (reader): Don't force 256 to error. + * doc/bison.texinfo (Symbols): Adjust. + * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR) + (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3 + etc. instead of 10, 20, 30 (which was used to `jump' over error + (256) and undefined (2)). + +2002-04-22 Akim Demaille + + Propagate more token_number_t. + + * src/gram.h (token_number_as_item_number) + (item_number_as_token_number): New. + * src/output.c (GENERATE_OUTPUT_TABLE): New. + Use it to create output_item_number_table and + output_token_number_table. + * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c, + * src/lex.c, src/nullable.c, src/output.c, src/print.c, + * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h, + * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts. + +2002-04-22 Akim Demaille + + * src/output.h, src/output.c (get_lines_number): Remove. + +2002-04-19 Akim Demaille + + * doc/bison.texinfo (Actions): Make clear that `|' is not the same + as Lex/Flex'. + (Debugging): More details about enabling the debugging features. + (Table of Symbols): Describe $$, $n, @$, and @n. + Suggested by Tim Josling. + +2002-04-19 Akim Demaille + + * doc/bison.texinfo: Remove the uses of the obsolete @refill. + +2002-04-10 Akim Demaille + + * src/system.h: Rely on HAVE_LIMITS_H. + Suggested by Paul Eggert. + +2002-04-09 Akim Demaille + + * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the + full stderr, and strip it according to the bison options, instead + of composing the error message from different bits. + This makes it easier to check for several error messages. + Adjust all the invocations. + Add an invocation exercising the error token. + Add an invocation demonstrating a stupid error message. + (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0. + Adjust the tests. + Error message are for stderr, not stdout. + +2002-04-09 Akim Demaille + + * src/gram.h, src/gram.c (error_token_number): Remove, use + errtoken->number. + * src/reader.c (reader): Don't specify the user token number (2) + for $undefined, as it uselessly prevents using it. + * src/gram.h (token_number_t): Move to... + * src/symtab.h: here. + (state_t.number): Is a token_number_t. + * src/print.c, src/reader.c: Use undeftoken->number instead of + hard coded 2. + (Even though this 2 is not the same as above: the number of the + undeftoken remains being 2, it is its user token number which + might not be 2). + * src/output.c (prepare_tokens): Rename the `maxtok' muscle with + `user_token_number_max'. + Output `undef_token_number'. + * data/bison.simple, data/bison.c++: Use them. + Be sure to map invalid yylex return values to + `undef_token_number'. This saves us from gratuitous SEGV. + + * tests/conflicts.at (Solved SR Conflicts) + (Unresolved SR Conflicts): Adjust. + * tests/regression.at (Web2c Actions): Adjust. + +2002-04-08 Akim Demaille + + * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/. + Adding #line. + Remove the duplicate `typedefs'. + (RhsNumberType): Fix the declaration and various other typos. + Use __ofile__. + * data/bison.simple: Use __ofile__. + * src/scan-skel.l: Handle __ofile__. + +2002-04-08 Akim Demaille + + * src/gram.h (item_number_t): New, the type of item numbers in + RITEM. Note that it must be able to code symbol numbers as + positive number, and the negation of rule numbers as negative + numbers. + Adjust all dependencies (pretty many). + * src/reduce.c (rule): Remove this `short *' pointer: use + item_number_t. + * src/system.h (MINSHORT, MAXSHORT): Remove. + Include `limits.h'. + Adjust dependencies to using SHRT_MAX and SHRT_MIN. + (shortcpy): Remove. + (MAXTABLE): Move to... + * src/output.c (MAXTABLE): here. + (prepare_rules): Use output_int_table to output rhs. + * data/bison.simple, data/bison.c++: Adjust. + * tests/torture.at (Big triangle): Move the limit from 254 to + 500. + * tests/regression.at (Web2c Actions): Ajust. + + Trying with bigger grammars shows various phenomena: at 3000 (28Mb + of grammar file) bison is killed by my system, at 2000 (12Mb) bison + passes, but produces negative #line number, once fixed, GCC is + killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of + C), it passes. + * src/state.h (state_h): Code input lines on ints, not shorts. + +2002-04-08 Akim Demaille + + * src/reduce.c (reduce_grammar): First reduce the nonterminals, + and then the grammar. + +2002-04-08 Akim Demaille + + * src/system.h: No longer using strndup. + +2002-04-07 Akim Demaille + + * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New. + * src/output.c (output_table_data): Return the longest number. + (prepare_tokens): Output `token_number_max'). + * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type): + New. + Use them to define yy_token_number_type/TokenNumberType. + Use this type for yytranslate. + * tests/torture.at (Big triangle): Push the limit from 124 to + 253. + * tests/regression.at (Web2c Actions): Adjust. + +2002-04-07 Akim Demaille + + * tests/torture.at (Big triangle): New. + (GNU AWK Grammar, GNU Cim Grammar): Move to... + * tests/existing.at: here. + +2002-04-07 Akim Demaille + + * src/gram.h, src/gram.c (nitems): Remove, it is an alias of + nritems. + Adjust dependencies. + +2002-04-07 Akim Demaille + + * src/reader.c: Normalize increments to prefix form. + +2002-04-07 Akim Demaille + + * src/reader.c, symtab.c: Remove debugging code. + +2002-04-07 Akim Demaille + + Rename all the `bucket's as `symbol_t'. + + * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c, + * src/reader.c, src/reader.h, src/reduce.c, src/state.h, + * src/symtab.c, src/symtab.h (bucket): Rename as... + (symbol_t): this. + (symbol_list_new, bucket_check_defined, bucket_make_alias) + (bucket_check_alias_consistence, bucket_pack, bucket_translation) + (bucket_new, bucket_free, hash_compare_bucket, hash_bucket) + (buckets_new, buckets_free, buckets_do): Rename as... + (symbol_list_new, symbol_check_defined, symbol_make_alias) + (symbol_check_alias_consistence, symbol_pack, symbol_translation) + (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t) + (symbols_new, symbols_free, symbols_do): these. + +2002-04-07 Akim Demaille + + Use lib/hash for the symbol table. + + * src/gram.c (ntokens): Initialize to 1, to reserve a slot for + EOF. + * src/lex.c (lex): Set the `number' member of new terminals. + * src/reader.c (bucket_check_defined, bucket_make_alias) + (bucket_check_alias_consistence, bucket_translation): New. + (reader, grammar_free, readgram, token_translations_init) + (packsymbols): Adjust. + (reader): Number the predefined tokens. + * src/reduce.c (inaccessable_symbols): Just use hard coded numbers + for predefined tokens. + * src/symtab.h (bucket): Remove all the hash table related + members. + * src/symtab.c (symtab): Replace by... + (bucket_table): this. + (bucket_new, bucket_free, hash_compare_bucket, hash_bucket) + (buckets_new, buckets_do): New. + +2002-04-07 Akim Demaille + + * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems) + (start_symbol, max_user_token_number, semantic_parser) + (error_token_number): Initialize. + * src/reader.c (grammar, start_flag, startval, typed, lastprec): + Initialize. + (reader): Don't. + (errtoken, eoftoken, undeftoken, axiom): Extern. + +2002-04-07 Akim Demaille + + * src/gram.h (rule_s): prec and precsym are now pointers + to the bucket giving the priority/associativity. + Member `associativity' removed: useless. + * src/reduce.c, src/conflicts.c: Adjust. + +2002-04-07 Akim Demaille + + * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c: + Properly escape the symbols' TAG when outputting them. + +2002-04-07 Akim Demaille + + * src/lalr.h (LA): Is a bitsetv, not bitset*. + +2002-04-07 Akim Demaille + + * src/lalr.h, src/lalr.c (LAruleno): Replace with... + (LArule): this, which is an array to rule_t*. + * src/print.c, src/conflicts.c: Adjust. + +2002-04-07 Akim Demaille + + * src/gram.h (rule_t): Rename `number' as `user_number'. + `number' is a new member. + Adjust dependencies. + * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number. + +2002-04-07 Akim Demaille + + As a result of the previous patch, it is no longer needed + to reorder ritem itself. + + * src/reduce.c (reduce_grammar_tables): Don't sort RITEM. + +2002-04-07 Akim Demaille + + Be sure never to walk through RITEMS, but use only data related to + the rules themselves. RITEMS should be banished. + + * src/output.c (output_token_translations): Rename as... + (prepare_tokens): this. + In addition to `translate', prepare the muscles `tname' and + `toknum', which were handled by... + (output_rule_data): this. + Remove, and move the remainder of its outputs into... + (prepare_rules): this new routines, which also merges content from + (output_gram): this. + (prepare_rules): Be sure never to walk through RITEMS. + (output_stos): Rename as... + (prepare_stos): this. + (output): Always invoke prepare_states, after all, just don't use it + in the output if you don't need it. + +2002-04-07 Akim Demaille + + * src/LR0.c (new_state): Display `nstates' as the name of the + newly created state. + Adjust to initialize first_state and last_state if needed. + Be sure to distinguish the initial from the final state. + (new_states): Create the itemset of the initial state, and use + new_state. + * src/closure.c (closure): Now that the initial state has its + items properly set, there is no need for a special case when + creating `ruleset'. + + As a result, now the rule 0, reducing to $axiom, is visible in the + outputs. Adjust the test suite. + + * tests/conflicts.at (Solved SR Conflicts) + (Unresolved SR Conflicts): Adjust. + * tests/regression.at (Web2c Report, Rule Line Numbers): Idem. + * tests/conflicts.at (S/R in initial): New. + +2002-04-07 Akim Demaille + + * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over + the RHS of the rules. + * src/output.c (output_gram): Likewise. + +2002-04-07 Akim Demaille + + * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's + bucket. + Adjust all dependencies. + * src/reduce.c (nonterminals_reduce): Don't forget to renumber the + `number' of the buckets too. + * src/gram.h: Include `symtab.h'. + (associativity): Move to... + * src/symtab.h: here. + No longer include `gram.h'. + +2002-04-07 Akim Demaille + + * src/gram.h, src/gram.c (rules_rhs_length): New. + (ritem_longest_rhs): Use it. + * src/gram.h (rule_t): `number' is a new member. + * src/reader.c (packgram): Set it. + * src/reduce.c (reduce_grammar_tables): Move the useless rules at + the end of `rules', and count them out of `nrules'. + (reduce_output, dump_grammar): Adjust. + * src/print.c (print_grammar): It is no longer needed to check for + the usefulness of a rule, as useless rules are beyond `nrules + 1'. + * tests/reduce.at (Reduced Automaton): New test. + +2002-04-07 Akim Demaille + + * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a + lacking `+ 1' to nrules, Bison reported as useless a token if it + was used solely to set the precedence of the last rule... + +2002-04-07 Akim Demaille + + * data/bison.c++, data/bison.simple: Don't output the current file + name in #line, to avoid useless diffs between two identical + outputs under different names. + +2002-04-07 Akim Demaille + + * src/closure.c, src/print.c, src/reader.c, src/reduce.c: + Normalize loops to using `< nrules + 1', not `<= nrules'. + +2002-04-07 Akim Demaille + + * TODO: Update. + +2002-04-07 Akim Demaille + + * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename + bucket.value as bucket.number. + +2002-04-07 Akim Demaille + + * src/closure.c, src/derives.c, src/gram.h, src/lalr.c, + * src/nullable.c, src/output.c, src/print.c, src/print_graph.c, + * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the + RHS, instead of being an index in RITEMS. + +2002-04-04 Paul Eggert + + * doc/bison.texinfo: Update copyright date. + (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII. + (Symbols): Warn about running Bison in one character set, + but compiling and/or running in an incompatible one. + Warn about character code 256, too. + +2002-04-03 Paul Eggert + + * src/bison.data (YYSTACK_ALLOC): Depend on whether + YYERROR_VERBOSE is nonzero, not whether it is defined. + + Merge changes from bison-1_29-branch. + +2002-03-20 Paul Eggert + + Merge fixes from Debian bison_1.34-1.diff. + + * configure.in (AC_PREREQ): 2.53. + +2002-03-20 Akim Demaille + + * src/conflicts.c (log_resolution): Argument `resolution' is const. + +2002-03-19 Paul Eggert + + * src/bison.simple (YYCOPY): New macro. + (YYSTACK_RELOCATE): Use it. + Remove Type arg; no longer needed. All callers changed. + (yymemcpy): Remove; no longer needed. + + * Makefile.am (AUTOMAKE_OPTIONS): 1.6. + * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove. + +2002-03-19 Akim Demaille + + Test and fix the #line outputs. + + * tests/atlocal.at (GCC): New. + * tests/synclines.at (AT_TEST_SYNCLINE): New macro. + (Prologue synch line, %union synch line, Postprologue synch line) + (Action synch line, Epilogue synch line): New tests. + * src/reader.c (parse_union_decl): Define the muscle stype_line. + * data/bison.simple, data/bison.c++: Use it. + +2002-03-19 Akim Demaille + + * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts) + (Solved SR Conflicts, %expect not enough, %expect right) + (%expect too much): Move to... + * tests/conflicts.at: this new file. + +2002-03-19 Akim Demaille + + * data/m4sugar/m4sugar.m4: Update from CVS Autoconf. + * data/bison.simple, data/bison.c++: Handle the `#define' part, so + that we can move to enums for instance. + * src/output.c (token_definitions_output): Output a list of + `token-name, token-number' instead of the #define. + (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'. + +2002-03-14 Akim Demaille + + Use Gettext 0.11.1. + +2002-03-09 Robert Anisko + + * data/bison.c++: Make the user able to add members to the generated + parser by subclassing. + +2002-03-05 Robert Anisko + + * src/reader.c (read_additionnal_code): `c' should be an integer, not + a character. + Reported by Nicolas Tisserand and Nicolas Burrus. + +2002-03-04 Robert Anisko + + * src/reader.c: Warn about lacking semi-colons, do not complain. + +2002-03-04 Robert Anisko + + * data/bison.c++: Remove a debug line. + +2002-03-04 Robert Anisko + + * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge + location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and + provide a default implementation. + +2002-03-04 Akim Demaille + + * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'. + * tests/output.at (AT_CHECK_OUTPUT): Likewise. + * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto. + * tests/semantic.at (Parsing Guards): Similarly. + * src/reader.at (readgram): Complain if the last rule is not ended + with a semi-colon. + +2002-03-04 Akim Demaille + + * src/warshall.h, src/warshall.c (bitmatrix_print): Move to... + * src/closure.c: here. + (set_firsts): Use bitsetv_reflexive_transitive_closure instead of + RTC. + * src/warshall.h, src/warshall.c: Remove. + * tests/sets.at (Broken Closure): Adjust. + +2002-03-04 Akim Demaille + + * src/output.c (output_skeleton): tempdir is const. + bytes_read is unused. + +2002-03-04 Akim Demaille + + * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c, + * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c: + Update. + From Michael Hayes. + +2002-03-04 Akim Demaille + + * src/closure.c (closure): `r' is unused. + +2002-03-04 Akim Demaille + + * tests/sets.at (Broken Closure): Add the ending `;'. + * src/reader.at (readgram): Complain if a rule is not ended with a + semi-colon. + +2002-03-04 Akim Demaille + + * src/conflicts.c (set_conflicts): Use bitset_disjoint_p. + (count_sr_conflicts): Use bitset_count. + * src/reduce.c (inaccessable_symbols): Ditto. + (bits_size): Remove. + * src/warshall.h, src/warshall.c: Convert to bitsetv. + +2002-03-04 Akim Demaille + + * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c, + * src/reduce.c: Remove the `bitset_zero's following the + `bitset_create's, as now it is performed by the latter. + +2002-03-04 Akim Demaille + + * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h, + * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h, + * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the + latest sources from Michael. + +2002-03-04 Akim Demaille + + * src/output.c (output): Don't free the grammar. + * src/reader.c (grammar_free): New. + * src/main.c (main): Call it and don't free symtab here. + +2002-03-04 Akim Demaille + + * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer + before returning. + Reported by Benoit Perrot. + +2002-03-04 Akim Demaille + + Use bitset operations when possible, not loops over bits. + + * src/conflicts.c (set_conflicts, count_sr_conflicts): Use + bitset_or. + * src/print.c (print_reductions): Use bitset_and, bitset_andn. + * src/reduce.c (useless_nonterminals): Formatting changes. + * src/warshall.c (TC): Use bitset_or. + +2002-03-04 Akim Demaille + + * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused. + * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET): + Ditto. + +2002-03-04 Akim Demaille + + * src/lalr.c (F): Now a bitset*. + Adjust all dependencies. + +2002-03-04 Akim Demaille + + * src/conflicts.c (shiftset, lookaheadset): Now bitset. + Adjust all dependencies. + +2002-03-04 Akim Demaille + + * src/L0.c, src/LR0.h (nstates): Be size_t. + Adjust comparisons (signed vs unsigned). + * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a + bitset*. + Adjust all dependencies. + +2002-03-04 Akim Demaille + + * src/closure.c (firsts): Now, also a bitset. + Adjust all dependencies. + (varsetsize): Remove, now unused. + * src/warshall.h, src/warshall.c: Now work on arrays of bitsets. + +2002-03-04 Akim Demaille + + * src/print.c: Convert to use bitset.h, not hand coded iterations + over ints. + +2002-03-04 Akim Demaille + + * src/reduce.c: Convert to use bitset.h, not hand coded BSet. + +2002-03-04 Akim Demaille + + * src/closure.c (ruleset): Be a bitset. + (rulesetsize): Remove. + +2002-03-04 Akim Demaille + + * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c, + * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, + * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New. + * src/closure.c (fderives): Be an array of bitsets. + +2002-02-28 Robert Anisko + + * data/bison.c++: Merge the two generated headers. Insert a copyright + notice in each output file. + +2002-02-28 Akim Demaille + + * data/bison.c++: Copy the prologue of bison.simple to fetch + useful M4 definitions, such as b4_header_guard. + +2002-02-25 Akim Demaille + + * src/getargs.c (version): Give the name of the authors, and use a + translator friendly scheme for the bgr + copyright notice. + +2002-02-25 Akim Demaille + + * src/output.c (header_output): Remove, now handled completely via + M4. + +2002-02-25 Akim Demaille + + * m4/m4.m4: New, from CVS Autoconf. + * configure.in: Invoke it. + * src/output.c (output_skeleton): Use its result instead of the + hard coded name. + +2002-02-25 Akim Demaille + + * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from + Fileutils 4.1.5. + * configure.in: Invoke UTILS_FUNC_MKSTEMP. + * src/output.c (output_skeleton): Use mkstemp to create a real + temporary file. + Move the filling of `skeleton' and its muscle to... + (prepare): here. + (output): Move the definition of the prologue muscle to... + (prepare): here. + * src/system.h (DEFAULT_TMPDIR): New. + +2002-02-14 Paul Eggert + + Remove the support for C++ namespace cleanliness; it was + causing more problems than it was curing, since it didn't work + properly on some nonstandard C++ compilers. This can wait + for a proper C++ parser. + + * NEWS: Document this. + * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention + of C++, as it's treated like C now. + * src/bison.simple (YYSTD): Remove. + (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL): + Treat C++ just like Standard C instead of trying to support + namespace cleanliness. + +2002-02-14 Akim Demaille + + * tests/regression.at (else): Adjust to Andreas' change. + +2002-02-14 Akim Demaille + + * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c. + +2002-02-13 Andreas Schwab + + * src/output.c (output_rule_data): Don't output NULL, it might + not be defined yet. + +2002-02-11 Robert Anisko + + * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue. + (Copyright notice): Update. + +2002-02-11 Akim Demaille + + * tests/regression.at (%nonassoc and eof): Don't include + nonportable headers. + +2002-02-08 Robert Anisko + + * data/bison.c++: Correct error recovery. Make the user able to + initialize the starting location. + +2002-02-07 Akim Demaille + + * tests/input.at: New. + +2002-02-07 Robert Anisko + + * data/bison.c++: Replace some direct m4 expansions by constants. Be + more consistent when naming methods and variables. Put preprocessor + directives around tables only needed for debugging. + +2002-02-07 Robert Anisko + + * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in + C++ parsers. + (yy::b4_name::parse): Use print_. + +2002-02-07 Robert Anisko + + * data/bison.c++ (yy::b4_name::parse): Error recovery is back. + +2002-02-07 Robert Anisko + + * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in + C++ parsers. + (yy::b4_name::parse): Build verbose error messages, and use error_. + +2002-02-06 Robert Anisko + + * data/bison.c++: Fix m4 quoting in comments. + +2002-02-06 Robert Anisko + + * data/bison.c++: Adjust the parser code. Fix some muscles that were + not expanded by m4. + +2002-02-05 Akim Demaille + + * data/bison.c++: Adjust to the M4 back end. + More is certainly needed. + +2002-02-05 Akim Demaille + + Give a try to M4 as a back end. + + * lib/readpipe.c: New, from wdiff. + * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and + BISON_HAIRY. + * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS + specific values. Now it is m4 that performs the lookup. + * src/parse-skel.y: Remove. + * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New. + * src/output.c (actions_output, guards_output) + (token_definitions_output): No longer keeps track of the output + line number, hence remove the second argument. + (guards_output): Check against the guard member of a rule, not the + action member. + Adjust callers. + (output_skeleton): Don't look for the skeleton location, let m4 do + that. + Create `/tmp/muscles.m4'. This is temporary, a proper temporary + file will be used. + Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton. + (prepare): Given that for the time being changesyntax is not + usable in M4, rename the muscles using `-' to `_'. + Define `defines_flag', `output_parser_name' and `output_header_name'. + * src/output.h (actions_output, guards_output) + (token_definitions_output): Adjust prototypes. + * src/scan-skel.l: Instead of scanning the skeletons, it now + processes the output of m4: `__oline__' and `#output'. + * data/bison.simple: Adjust to be used by M4(sugar). + * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up + to date. + * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR' + instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'. + * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New, + shamelessly stolen from CVS Autoconf. + +2002-02-05 Akim Demaille + + * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version. + * configure.in: Check for the declarations of free and malloc. + * src/muscle_tab.c: Adjust. + +2002-02-05 Akim Demaille + + * src/muscle_tab.c (muscle_init): Don't default to NULL muscle + which have no values. + +2002-02-05 Akim Demaille + + * src/bison.simple, src/bison.hairy, src/bison.c++: Move to... + * data/: here. + +2002-01-29 Paul Eggert + + * src/bison.simple (YYSIZE_T): Do not define merely because + YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined. + On some platforms, does not declare YYSTD (size_t). + +2002-01-27 Akim Demaille + + Fix `%nonassoc and eof'. + + * src/state.c (errs_dup): Aaaah! The failure was due to bytes + which were not properly copied! Replace + memcpy (res->errs, src->errs, src->nerrs); + with + memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0])); + !!! + * tests/regression.at (%nonassoc and eof): Adjust to newest + Autotest: `.' is not in the PATH. + +2002-01-27 Akim Demaille + + * tests/sets.at (AT_EXTRACT_SETS): New. + (Nullable): Use it. + (Firsts): New. + +2002-01-26 Akim Demaille + + * tests/actions.at, tests/calc.at, tests/headers.at, + * tests/torture.at: Adjust to the newest Autotest which no longer + forces `.' in the PATH. + +2002-01-25 Akim Demaille + + * tests/regression.at (%nonassoc and eof): New. + Suggested by Robert Anisko. + +2002-01-24 Akim Demaille + + Bison dumps core when trying to complain about broken input files. + Reported by Cris van Pelt. + + * src/lex.c (parse_percent_token): Be sure to set token_buffer. + * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge + into... + (Invalid inputs): Strengthen: exercise parse_percent_token. + +2002-01-24 Robert Anisko + + * src/Makefile.am: Add bison.c++. + * src/bison.c++: New skeleton. + +2002-01-21 Paolo Bonzini + + * po/it.po: New. + +2002-01-21 Kees Zeelenberg + + * src/files.c (skeleton_find) [MSDOS]: Fix cp definition. + +2002-01-20 Marc Autret + + * src/files.c (compute_output_file_names): Fix + +2002-01-20 Marc Autret + + * tests/output.at: New test. + * src/files.c (compute_base_names): Don't map extensions when + the YACC flag is set, use defaults. + Reported by Evgeny Stambulchik. + +2002-01-20 Marc Autret + + * src/system.h: Need to define __attribute__ away for non-GCC + compilers as well (i.e., the vendor C compiler). + Suggested by Albert Chin-A-Young. + +2002-01-11 Tim Van Holder + + * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the + canonical definition. + * src/system.h: Use the canonical definition for PARAMS (avoids + a conflict with the macro from lib/hash.h). + +2002-01-11 Akim Demaille + + * configure.in: Use AC_FUNC_STRNLEN. + Fixes the failures observed on AIX 4.3 by H.Merijn Brand. + +2002-01-09 Akim Demaille + + * src/files.c, src/files.h (output_infix): New. + (tab_extension): Remove. + (compute_base_names): Compute the former, drop the latter. + * src/output.c (prepare): Insert the muscles `output-infix', and + `output-suffix'. + * src/parse-skel.y (string, string.1): New. + (section.header): Use it. + (section.yacc): Remove. + (prefix): Remove too. + * src/scan-skel.l: Adjust. + * src/bison.simple, src/bison.hairy: Adjust. + +2002-01-09 Akim Demaille + + * configure.in (WERROR_CFLAGS): Compute it. + * src/Makefile.am (CFLAGS): Pass it. + * tests/atlocal.in (CFLAGS): Idem. + * src/files.c: Fix a few warnings. + (get_extension_index): Remove, unused. + +2002-01-08 Akim Demaille + + * src/getargs.c (AS_FILE_NAME): New. + (getargs): Use it to convert DOSish file names. + * src/files.c (base_name): Rename as full_base_name to avoid + clashes with `base_name ()'. + (filename_split): New. + (compute_base_names): N-th rewrite, using filename_split. + +2002-01-08 Akim Demaille + + * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c: + New, stolen from the Fileutils 4.1. + * lib/Makefile.am (libbison_a_SOURCES): Adjust. + * configure.in: Check for the presence of memrchr, and of its + prototype. + +2002-01-07 Tim Van Holder + + * lib/hash.h (__P): Added definition for this macro. + * src/Makefile.am: Add parse-skel.c and scan-skel.c to + BUILT_SOURCES, to ensure they are generated first. + * src/parse-skel.y: Use YYERROR_VERBOSE instead of + %error-verbose to allow bootstrapping with bison 1.30x. + +2002-01-06 Akim Demaille + + * src/reader.c (parse_braces): Don't fetch the next char, the + convention is to fetch on entry. + * tests/torture.at (GNU Cim Grammar): Reintroduce their weird + 'switch' without a following semicolon. + * tests/regression.at (braces parsing): New. + +2002-01-06 Akim Demaille + + Bison is dead wrong in its RR conflict reports. + + * tests/torture.at (GNU Cim Grammar): New. + * src/conflicts.c (count_rr_conflicts): Fix. + +2002-01-06 Akim Demaille + + Creating package.m4 from configure.ac causes too many problems. + + * tests/Makefile.am (package.m4): Create it by hand, + AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf. + +2002-01-06 Akim Demaille + + * src/Makefile.am (bison_SOURCES): Add parse-skel.h and + skeleton.h. + +2002-01-04 Paul Eggert + + * doc/bison.texinfo (Debugging): + Remove YYSTDERR; it's no longer defined or used. + Also, s/cstdio.h/cstdio/. + +2002-01-03 Akim Demaille + + * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf. + +2002-01-03 Akim Demaille + + * src/parse-skel.y (process_skeleton): Don't bind the parser's + tracing code to --trace, wait for a better --trace option, with + args. + +2002-01-03 Akim Demaille + + * src/bison.simple (YYSTDERR): Remove, replace `stderr'. + The ISO C++ standard is extremely clear about it: stderr is + considered a macro, not a regular symbol (see table 94 `Header + synopsis', [lib.c.files] 27.8.2 C Library files). + Therefore std:: does not apply to it. It still does with fprintf. + Also, s/cstdio.h/cstdio/. + +2002-01-03 Akim Demaille + + * lib/quotearg.c: Use `#include "..."' instead of `#include <...>' + for non system headers. + +2002-01-02 Akim Demaille + + Equip the skeleton chain with location tracking, runtime trace, + pure parser and scanner. + + * src/parse-skel.y: Request a pure parser, locations, and prefix + renaming. + (%union): Having several members with the same type does not help + type mismatches, simplify. + (YYPRINT, yyprint): New. + (yyerror): ``Rename'' (there is a #define yyerror skel_error) as... + (skel_error): this. + Handle locations. + * src/scan-skel.l: Adjust to these changes. + * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP) + (LOCATION_PRINT, skel_control_t): New. + +2001-12-30 Akim Demaille + + * src/parse-skel.y: Get rid of the shift/reduce conflict: + replace `gb' with BLANKS. + * src/scan-skel.l: Adjust. + +2001-12-30 Akim Demaille + + * src/system.h: We don't need nor want bcopy. + Throw away MS-DOS crap: we don't need getpid. + * configure.in: We don't need strndup. It was even causing + problems: because Flex includes the headers *before* us, + _GNU_SOURCE is not defined by config.h, and therefore strndup was + not visible. + * lib/xstrndup.c: New. + * src/scan-skel.l: Use it. + Be sure to initialize yylval.muscle member when scanning a MUSCLE. + * src/parse-skel.y: Use %directives instead of #defines. + +2001-12-30 Akim Demaille + + * src/skeleton.h: New. + * src/output.c (output_parser, output_master_parser): Remove, dead + code. + * src/output.h (get_lines_number, actions_output, guards_output) + (token_definitions_output): Prototype them. + * src/parse-skel.y: Add the license notice. + Include output.h and skeleton.h. + (process_skeleton): Returns void, and takes a single parameter. + * src/scan-skel.l: Add the license notice. + Include skeleton.h. + Don't use %option yylineno: it seems that then Flex imagines + REJECT has been used, and therefore it won't reallocate its + buffers (which makes no other sense to me than a bug). It results + in warnings for `unused: yy_flex_realloc'. + +2001-12-30 Robert Anisko + + * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING) + (MUSCLE_INSERT_PREFIX): ...to there. + * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING) + (MUSCLE_INSERT_PREFIX): Move from here... + + * src/bison.hairy: Add a section directive. Put braces around muscle + names. This parser skeleton is still broken, but Bison should not + choke on a bad muscle 'syntax'. + * src/bison.simple: Add a section directive. Put braces around muscle + names. + + * src/files.h (strsuffix, stringappend): Add declarations. + (tab_extension): Add declaration. + (short_base_name): Add declaration. + + * src/files.c (strsuffix, stringappend): No longer static. These + functions are used in the skeleton parser. + (tab_extension): New. + (compute_base_names): Use the computations done in this function + to guess if the generated parsers should have '.tab' in their + names. + (short_base_name): No longer static. + + * src/output.c (output_skeleton): New. + (output): Disable call to output_master_parser, and give a try to + a new skeleton handling system. + (guards_output, actions_output): No longer static. + (token_definitions_output, get_lines_number): No longer static. + + * configure.in: Use AM_PROG_LEX and AC_PROG_YACC. + + * src/Makefile.am (bison_SOURCES): Add scan-skel.l and + parse-skel.y. + + * src/parse-skel.y: New file. + * src/scan-skel.l: New file. + +2001-12-29 Akim Demaille + + %name-prefix is broken. + + * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy". + Adjust all dependencies. + * tests/headers.at (export YYLTYPE): Strengthen this test: use + %name-prefix. + + Renaming yylval but not yylloc is not consistent. Now we do. + + * src/bison.simple: Prefix yylloc if used. + * doc/bison.texinfo (Decl Summary): Document that. + +2001-12-29 Akim Demaille + + * doc/bison.texinfo: Promote `%long-directive' over + `%long_directive'. + Remove all references to fixed-output-files, yacc is enough. + +2001-12-29 Akim Demaille + + * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the + user prologue. These are defaults. + * tests/actions.at (Mid-rule actions): Make sure the user can + define YYDEBUG and YYERROR_VERBOSE. + +2001-12-29 Akim Demaille + + * src/output.c (header_output): Don't forget to export YYLTYPE and + yylloc. + * tests/headers.at (export YYLTYPE): New, make sure it does. + * tests/regression.at (%union and --defines, Invalid CPP headers): + Move to... + * tests/headers.at: here. + +2001-12-29 Akim Demaille + + * src/gram.h (rule_s): Member `assoc' is of type `associativity'. + +2001-12-29 Akim Demaille + + * tests/actions.at (Mid-rule actions): Output on a single line + instead of several. + +2001-12-29 Akim Demaille + + * doc/bison.texinfo: Formatting changes. + +2001-12-29 Akim Demaille + + Don't store the token defs in a muscle, just be ready to output it + on command. Now possible via `symbols'. Fixes a memory leak. + + * src/output.c (token_definitions_output): New. + (output_parser, header_output): Use it. + * src/reader.c (symbols_save): Remove. + +2001-12-29 Akim Demaille + + * src/bison.simple: Do not provide a default for YYSTYPE and + YYLTYPE before the user's prologue. Otherwise it's hardly... a + default. + +2001-12-29 Akim Demaille + + Mid-rule actions are simply... ignored! + + * src/reader.c (readgram): Be sure to attach mid-rule actions to + the empty-rule associated to the dummy symbol, not to the host + rule. + * tests/actions.at (Mid-rule actions): New. + +2001-12-29 Akim Demaille + + Memory leak. + + * src/reader.c (reader): Free grammar. + +2001-12-29 Akim Demaille + + Memory leak. + + * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here, + since it allocates it for each state, although only one is needed. + (allocate_storage): Do it here. + +2001-12-29 Akim Demaille + + * src/options.h, src/options.c (create_long_option_table): Rename + as... + (long_option_table_new): this, with a clearer prototype. + (percent_table): Remove, unused, + * src/getargs.c (getargs): Adjust. + +2001-12-29 Akim Demaille + + * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c + * src/print.c, src/print_graph.c, src/state.h: Rename state_table + as states. + +2001-12-29 Akim Demaille + + * src/lalr.c (build_relations): Rename `states' as `states1'. + Sorry, I don't understand exactly what it is, no better name... + +2001-12-29 Akim Demaille + + * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c + * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c + * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table + as rules. + +2001-12-29 Akim Demaille + + * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long + ago. + +2001-12-29 Akim Demaille + + * src/reader.c, src/reader.h (user_toknums): Remove. + Adjust all users to use symbols[i]->user_token_number. + +2001-12-29 Akim Demaille + + * src/gram.c, src/gram.h (sprec, sassoc): Remove. + Adjust all users to use symbols[i]->prec or ->assoc. + +2001-12-29 Akim Demaille + + * src/reader.c, src/reader.h (tags): Remove. + Adjust all users to use symbols[i]->tag. + +2001-12-29 Akim Demaille + + * src/gram.h, src/gram.c (symbols): New, similar to state_table + and rule_table. + * src/reader.c (packsymbols): Fill this table. + Drop sprec. + * src/conflicts.c (resolve_sr_conflict): Adjust. + * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a + single table. + Use symbols[i]->tag instead of tags[i]. + +2001-12-29 Akim Demaille + + * tests/calc.at (_AT_DATA_CALC_Y): Also use %union. + In addition, put a comment in there, to replace... + * tests/regression.at (%union and C comments): Remove. + +2001-12-29 Akim Demaille + + * tests/regression.at (Web2c Actions): Blindly move the actual + output as expected output. The contents *seem* right to me, but I + can't pretend reading perfectly parser tables... Nonetheless, all + the other tests pass correctly, the table look OK, even though the + presence of `$axiom' is to be noted: AFAICS it is useless (but + harmless). + +2001-12-29 Akim Demaille + + * src/reader.c (readgram): Don't add the rule 0 if there were no + rules read. In other words, add it _after_ having performed + grammar sanity checks. + Fixes the `tests/regression.at (Invalid input: 1)' Failure. + +2001-12-29 Akim Demaille + + * tests/regression.at (Web2c Report): Catch up: the rule 0 is now + visible, and some states have now a different number. + +2001-12-29 Akim Demaille + + * src/reader.c (readgram): Bind the initial rule's lineno to that + of the first rule. + * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts): + (Solved SR Conflicts): Adjust rule 0's line number. + +2001-12-29 Akim Demaille + + Fix the `GAWK Grammar' failure. + + * src/LR0.c (final_state): Initialize to -1 so that we do compute + the reductions of the first state which was mistakenly confused + with the final state because precisely final_state was initialized + to 0. + * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads, + now noticed by Bison. + * tests/regression.at (Rule Line Numbers): Adjust: state 0 does + have a reduction on $default. + +2001-12-29 Akim Demaille + + * src/gram.c (ritem_print): Be sure to subtract 1 when displaying + rule line numbers. + * src/closure.c (print_closure): Likewise. + * src/derives.c (print_derives): Likewise. + * tests/sets.at (Nullable): Adjust: the rule numbers are correct + now. + +2001-12-29 Akim Demaille + + * src/lalr.c (lookaheads_print): New. + (lalr): Call it when --trace-flag. + * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads + are dumped. + +2001-12-29 Akim Demaille + + * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0', + when walking through ritem, even via rule->rhs. + * src/reduce.c (dump_grammar, useful_production, reduce_output) + (useful_production, useless_nonterminals): Likewise. + (reduce_grammar_tables): Likewise, plus update nritems. + * src/nullable.c (set_nullable): Likewise. + * src/lalr.c (build_relations): Likewise. + * tests/sets.at (Nullable): Adjust. + Fortunately, now, the $axiom is no longer nullable. + +2001-12-29 Akim Demaille + + * src/LR0.c (generate_states): Use nritems, not nitems, nor using + the 0-sentinel. + * src/gram.c (ritem_longest_rhs): Likewise. + * src/reduce.c (nonterminals_reduce): Likewise. + * src/print_graph.c (print_graph): Likewise. + * src/output.c (output_rule_data): Likewise. + * src/nullable.c (set_nullable): Likewise. + +2001-12-29 Akim Demaille + + * src/output.c: Comment changes. + +2001-12-27 Paul Eggert + + * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special + cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and + Sparc, as they were causing more porting problems than the + (minor) performance improvement was worth. + + Also, catch up with 1.31's YYSTD. + +2001-12-27 Akim Demaille + + * src/output.c (output_gram): Rely on nritems, not the + 0-sentinel. See below. + Use -1 as separator, not 0. + * src/bison.simple (yyparse): Subtract 1 to the rule numbers. + Rely on -1 as separator in yyrhs, instead of 0. + * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue + twice `Now at end of input', therefore there are two lines less to + expect. + +2001-12-27 Akim Demaille + + * tests/regression.at (Unresolved SR Conflicts): + (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes + below. + +2001-12-27 Akim Demaille + + * src/LR0.c (new_state): Recognize the final state by the fact it + is reached by eoftoken. + (insert_start_shifting_state, insert_eof_shifting_state) + (insert_accepting_state, augment_automaton): Remove, since now + these states are automatically computed from the initial state. + (generate_states): Adjust. + * src/print.c: When reporting a rule number to the user, subtract + 1, so that the axiom rule is rule 0, and the first user rule is 1. + * src/reduce.c: Likewise. + * src/print_graph.c (print_core): For the time being, just as for + the report, depend upon --trace-flags to dump the full set of + items. + * src/reader.c (readgram): Once the grammar read, insert the rule + 0: `$axiom: START-SYMBOL $'. + * tests/set.at: Adjust: rule 0 is now displayed, and since the + number of the states has changed (the final state is no longer + necessarily the last), catch up. + +2001-12-27 Akim Demaille + + Try to make the use of the eoftoken valid. Given that its value + is 0 which was also used as a sentinel in ritem, (i) make sure >= 0 + is used instead of > 0 where appropriate, (ii), depend upon nritems + instead of the 0-sentinel. + + * src/gram.h, src/gram.c (nritems): New. + Expected to be duplication of nitems, but for the time being... + * src/reader.c (packgram): Assert nritems and nitems are equal. + * src/LR0.c (allocate_itemsets, new_itemsets): Adjust. + * src/closure.c (print_closure, print_fderives): Likewise. + * src/gram.c (ritem_print): Likewise. + * src/print.c (print_core, print_grammar): Likewise. + * src/print_graph.c: Likewise. + +2001-12-27 Akim Demaille + + * src/main.c (main): If there are complains after grammar + reductions, then output the report anyway if requested, then die. + * src/symtab.c (bucket_new): Initialize `value' to -1, not 0. + * src/reader.c (eoftoken): New. + (parse_token_decl): If the token being defined has value `0', it + is the eoftoken. + (packsymbols): No longer hack `tags' to insert `$' by hand. + Be sure to preserve the value of the eoftoken. + (reader): Make sure eoftoken is defined. + Initialize nsyms to 0: now eoftoken is created just like the others. + * src/print.c (print_grammar): Don't special case the eof token. + * src/regression.at: Adjust: `$' has value 0, not -1, which was a + lie anyway, albeit pleasant. + * tests/calc.at: Exercise error messages with eoftoken. + Change the grammar so that empty input is invalid. + Adjust expectations. + When yyungeting, be sure to use a valid yylloc: use last_yylloc. + +2001-12-27 Akim Demaille + + * configure.in: Check the protos of strchr ans strspn. + Replace strchr if needed. + * src/system.h: Provide the protos of strchr, strspn and memchr if + missing. + * lib/strchr.c: New. + * src/reader.c (symbols_save): Use strchr. + +2001-12-27 Akim Demaille + + * src/print.c, src/print_graph.c (escape): New. + Use it to quote the TAGS outputs. + * src/print_graph.c (print_state): Now errors are in red, and + reductions in green. + Prefer high to wide: output the state number on a line of its own. + +2001-12-27 Akim Demaille + + * src/state.h, src/state.c (reductions_new): New. + * src/LR0.c (set_state_table): Let all the states have a + `reductions', even if reduced to 0. + (save_reductions): Adjust. + * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust. + * src/print.c (print_reductions, print_actions): Adjust. + * src/output.c (action_row): Adjust. + +2001-12-27 Akim Demaille + + * src/state.h, src/state.c (errs_new, errs_dup): New. + * src/LR0.c (set_state_table): Let all the states have an errs, + even if reduced to 0. + * src/print.c (print_errs, print_reductions): Adjust. + * src/output.c (output_actions, action_row): Adjust. + * src/conflicts.c (resolve_sr_conflict): Adjust. + +2001-12-27 Akim Demaille + + * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL. + +2001-12-27 Akim Demaille + + * src/conflicts.c, src/conflicts.h (print_reductions): Move to... + * src/print.c: here. + (lookaheadset, shiftset): New, used as additional storage by + print_reductions. + (print_results): Adjust. + (print_shifts, print_gotos, print_errs): New, extracted from... + (print_actions): here. + * src/print_graph.c (print_actions): Remove dead code. + +2001-12-27 Akim Demaille + + * src/reader.c (copy_dollar, copy_at): Better checking of `n' in + `$n' and `@n'. + +2001-12-27 Akim Demaille + + * src/lalr.c (add_lookback_edge): Use state_t instead of ints. + (build_relations): Adjust. + +2001-12-27 Akim Demaille + + * src/lalr.c (set_goto_map): Remove a wrong but benign loop + duplication. + +2001-12-27 Akim Demaille + + * src/reader.c (packgram): Catch nitems overflows. + +2001-12-27 Akim Demaille + + * src/files.c, src/files.h (guard_obstack): Remove. + * src/output.c (output): Adjust. + * src/reader.c (parse_braces): New, factoring... + (copy_action, copy_guard): these two which are renamed as... + (parse_action, parse_guard): these. + As a voluntary consequence, using braces around guards is now + mandatory. + +2001-12-27 Akim Demaille + + * src/gram.h (rule_t): `guard' and `guard_line' are new members. + * src/reader.c (symbol_list): `guard' and `guard_line' are new + members. + (symbol_list_new): Adjust. + (copy_action): action_line is the first line, not the last. + (copy_guard): Just as for actions, store the `action' only, not + the switch/case/break flesh. + Don't parse the user action that might follow the guard, let... + (readgram): do it, i.e., now, there can be an action after a + guard. + In other words the guard is just explicitly optional. + (packgram): Adjust. + * src/output.c (guards_output): New. + (output_parser): Call it when needed. + (output): Also free the guard and attrs obstacks. + * src/files.c, src/files.h (obstack_save): Remove. + (output_files): Remove. + As a result, if one needs the former `.act' file, using an + appropriate skeleton which requires actions and guards is now + required. + * src/main.c (main): Adjust. + * tests/semantic.at: New. + * tests/regression.at: Use `input.y' as input file name. + Avoid 8+3 problems by requiring input.c when the test needs the + parser. + +2001-12-27 Akim Demaille + + * src/reader.c (symbol_list_new): Be sure to initialize all the + fields. + +2001-12-27 Akim Demaille + + All the hacks using a final pseudo state are now useless. + + * src/LR0.c (set_state_table): state_table holds exactly nstates. + * src/lalr.c (nLA): New. + (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it + instead of lookaheadsp from the pseudo state (nstate + 1). + +2001-12-27 Akim Demaille + + * src/output.c (action_row, token_actions): Use a state_t instead + of a integer, and nlookaheads instead of the following state's + lookaheadsp. + +2001-12-27 Akim Demaille + + * src/conflicts.c (log_resolution, flush_shift) + (resolve_sr_conflict, set_conflicts, solve_conflicts) + (count_sr_conflicts, count_rr_conflicts, conflicts_output) + (conflicts_print, print_reductions): Use a state_t instead of an + integer when referring to a state. + As much as possible, depend upon nlookaheads, instead of the + `lookaheadsp' member of the following state (since lookaheads of + successive states are successive, the difference between state n + 1 + and n served as the number of lookaheads for state n). + * src/lalr.c (add_lookback_edge): Likewise. + * src/print.c (print_core, print_actions, print_state) + (print_results): Likewise. + * src/print_graph.c (print_core, print_actions, print_state) + (print_graph): Likewise. + * src/conflicts.h: Adjust. + +2001-12-27 Akim Demaille + + * src/bison.hairy: Formatting/comment changes. + ANSIfy. + Remove `register' indications. + Add plenty of `static'. + +2001-12-27 Akim Demaille + + * src/output.c (prepare): Drop the muscle `ntbase' which + duplicates ntokens. + * src/bison.simple: Formatting/comment changes. + Use YYNTOKENS only, which is documented, but not YYNTBASE, which + is an undocumented synonym. + +2001-12-22 Akim Demaille + + * src/output.c (output_table_data): Change the prototype to use + `int' for array ranges: some invocations do pass an int, not a + short. + Reported by Wayne Green. + +2001-12-22 Akim Demaille + + Some actions of web2c.y are improperly triggered. + Reported by Mike Castle. + + * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/. + * tests/regression.at (Web2c): Rename as... + (Web2c Report): this. + (Web2c Actions): New. + +2001-12-22 Akim Demaille + + Reductions in web2c.y are improperly reported. + Reported by Mike Castle. + + * src/conflicts.c (print_reductions): Fix. + * tests/regression.at (Web2c): New. + +2001-12-18 Akim Demaille + + Some host fail on `assert (!"foo")', which expands to + ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__)) + Reported by Nelson Beebee. + + * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with + `#define it_succeeded 0' and `assert (it_succeeded)'. + +2001-12-17 Marc Autret + + * src/bison.simple: Don't hard code the skeleton line and filename. + * src/output.c (output_parser): Rename 'line' as 'output_line'. + New line counter 'skeleton_line' (skeleton-line muscle). + +2001-12-17 Paul Eggert + + * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that + YYDEBUG must be defined to a nonzero value. + + * src/bison.simple (yytname): Do not assume that the user defines + YYDEBUG to a properly parenthesized expression. + +2001-12-17 Akim Demaille + + * src/state.h (state_t): Rename lookaheads as lookaheadsp. + nlookaheads is a new member. + Adjust all users. + * src/lalr.h (nlookaheads): Remove this orphan declaration. + * src/lalr.c (initialize_lookaheads): Set nlookaheads for each + state. + +2001-12-17 Akim Demaille + + * src/files.h, src/files.c (open_files, close_files): Remove. + * src/main.c (main): Don't open/close files, nor invoke lex_free, + let... + * src/reader.c (reader): Do it. + +2001-12-17 Akim Demaille + + * src/conflicts.c (print_reductions): Formatting changes. + +2001-12-17 Akim Demaille + + * src/conflicts.c (flush_shift): Also adjust lookaheadset. + (flush_reduce): New. + (resolve_sr_conflict): Adjust. + +2001-12-17 Akim Demaille + + * src/output.c (output_obstack): Be static and rename as... + (format_obstack): this, to avoid any confusion with files.c's + output_obstack. + * src/reader.h (muscle_obstack): Move to... + * src/output.h: here, since it's defined in output.c. + +2001-12-17 Akim Demaille + + * src/output.c (action_row, save_column, default_goto) + (sort_actions, matching_state, pack_vector): Better variable + locality. + +2001-12-17 Akim Demaille + + * src/output.c: Various formatting changes. + +2001-12-17 Akim Demaille + + * src/files.c (output_files): Free the output_obstack. + * src/main.c (main): Call print and print_graph conditionally. + * src/print.c (print): Work unconditionally. + * src/print_graph.c (print_graph): Work unconditionally. + * src/conflicts.c (log_resolution): Output only if verbose_flag. + +2001-12-16 Marc Autret + + * src/output.c (actions_output): Fix. When we use %no-lines, + there is one less line per action. + +2001-12-16 Marc Autret + + * src/bison.simple: Remove a useless #line directive. + s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'. + * src/output.c (get_lines_number): New. + (output_parser): Adjust, now takes care about the lines of a + output muscles. + Fix line numbering. + (actions_output): Computes the number of lines taken by actions. + (output_master_parser): Insert new skeleton which is the name of + the output parser file name. + +2001-12-15 Marc Autret + + * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility. + +2001-12-15 Marc Autret + + * src/output.c (output_gram): Keep track of the hairy one. + +2001-12-15 Akim Demaille + + Make `make distcheck' work. + + * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses + system.h which uses libgettext.h. + +2001-12-15 Akim Demaille + + * src/nullable.c (set_nullable): Useless rules must be skipped, + otherwise, since we range over their symbols, we might look at a + nonterminal which no longer ``exists'', i.e., it is not counted in + `nvars', hence we overflow our arrays. + +2001-12-15 Akim Demaille + + The header can also be produced directly, without any obstack! + Yahoo! + + * src/files.c, src/files.h (defines_obstack): Remove. + (compute_header_macro): Global. + (defines_obstack_save): Remove. + * src/reader.c (parse_union_decl): No longer output to + defines_obstack: its content can be found in the `stype' muscle + anyway. + (output_token_translations): Merge into... + (symbols_output): this. + Rename as... + (symbols_save): this. + (reader): Adjust. + * src/output.c (header_output): New. + (output): Call it. + +2001-12-15 Akim Demaille + + * src/reader.c (parse_union_decl): Instead of handling two obstack + simultaneously, use one to define the `stype' muscle, and use the + value of the latter to fill defines_obstack. + (copy_comment): Remove. + (copy_comment2): Work for a single obstack. + Rename as... + (copy_comment): this. + +2001-12-15 Akim Demaille + + * src/lex.c, src/lex.h (xgetc): No longer static. + * src/reader.c (parse_union_decl): Revamp. + +2001-12-15 Akim Demaille + + Still making progress in separating Bison into (i) input, (ii) + process, (iii) output: now we can directly output the parser file + without using table_obstack at all. + + * src/files.c, src/files.h (table_obstack): Bye bye. + (parser_file_name): New. + * src/files.c (compute_output_file_names): Compute it. + * src/output.c (actions_output, output_parser) + (output_master_parser): To a file instead of an obstack. + +2001-12-15 Akim Demaille + + Attach actions to rules, instead of pre-outputting them to + actions_obstack. + + * src/gram.h (rule_t): action and action_line are new members. + * src/reader.c (symbol_list): Likewise. + (copy_action): Save the actions within the rule. + (packgram): Save them in rule_table. + * src/output.c (actions_output): New. + (output_parser): Use it on `%%actions'. + (output_rule_data): Don't free rule_table. + (output): Do it. + (prepare): Don't save the `action' muscle. + * src/bison.simple: s/%%action/%%actions/. + +2001-12-15 Akim Demaille + + * src/reader.c (copy_action): When --yacc, don't append a `;' + to the user action: let it fail if lacking. + Suggested by Arnold Robbins and Tom Tromey. + +2001-12-14 Akim Demaille + + * src/lex.c (literalchar): Simply return the char you decoded, non + longer mess around with obstacks and int pointers. + Adjust all callers. + +2001-12-14 Akim Demaille + + * src/lex.c (literalchar): Don't escape the special characters, + just decode them, and keep them as char (before, eol was output as + the 2 char string `\n' etc.). + * src/output.c (output_rule_data): Use quotearg to output the + token strings. + +2001-12-13 Paul Eggert + + * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE): + Do not infringe on the global user namespace when using C++. + (YYFPRINTF, YYSTDERR): New macros, needed for the above. + All uses of `fprintf' and `stderr' changed. + + * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR. + +2001-12-13 Akim Demaille + + The computation of nullable is broken: it doesn't handle empty + RHS's properly. + + * tests/torture.at (GNU AWK Grammar): New. + * tests/sets.at (Nullable): New. + * src/nullable.c (set_nullable): Instead of blindly looping over + `ritems', loop over the rules, and then over their rhs's. + + Work around Autotest bugs. + + * src/warshall.c (bitmatrix_print): Don't use `+--+' as table + frame, because Autotest understand lines starting with a `+' as + traces from the shell. Then, they are not processed properly. + Admittedly an Autotest bug, but we don't have time to wait for + Autotest to catch up. + * tests/regression.at (Broken Closure): Adjust to the new table + frames. + Move to... + * tests/sets.at: here. + +2001-12-13 Akim Demaille + + * src/closure.c (closure): Use nrules instead of playing tricks + with BITS_PER_WORD. + +2001-12-13 Akim Demaille + + * src/print.c (print_actions): Output the handling of `$' as the + traces do: shifting the token EOF. Before EOF was treated as a + nonterminal. + * tests/regression.at: Adjust some tests. + * src/print_graph.c (print_core): Complete the set of items via + closure. The next-to-final and final states are still unsatisfying, + but that's to be addressed elsewhere. + No longer output the rule numbers, but do output the state number. + A single loop for the shifts + gotos is enough, but picked a + distinct color for each. + (print_graph): Initialize and finalize closure. + +2001-12-13 Akim Demaille + + * src/reader.c (readgram): Remove dead code, an strip useless + braces. + (get_type): Remove, unused. + +2001-12-12 Akim Demaille + + * src/complain.h, src/complain.c: Remove error_one_per_line, rely + on that of lib/error.c. + +2001-12-12 Akim Demaille + + Some hosts don't like `/' in includes. + + * src/system.h: Include libgettext.h without qualifying the path. + * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove + $(top_srcdir). + +2001-12-11 Marc Autret + + * src/output.c (output_parser): Remove useless muscle. + +2001-12-11 Marc Autret + + * src/bison.simple: Remove #line just before %%epilogue. It + is now handled in ... + * src/reader.c (read_additionnal_code): Add the output of a + #line for the epilogue. + +2001-12-10 Marc Autret + + * src/reader.c (copy_definition): Re-use CPP-outed code which + replace precedent remove. + * src/bison.simple: Remove #line before %%prologue because + %%input-line is wrong at this time. + +2001-12-10 Marc Autret + + * src/reader.c (symbols_output): Clean up. + * src/output.c (output_gram, output): Clean up. + +2001-12-10 Akim Demaille + + * src/lalr.c (initialize_lookaheads): New. Extracted from... + * src/LR0.c (set_state_table): here. + * src/lalr.c (lalr): Call it. + +2001-12-10 Akim Demaille + + * src/state.h (shifts): Remove the `number' member: shifts are + attached to state, hence no longer need to be labelled with a + state number. + +2001-12-10 Akim Demaille + + Now that states have a complete set of members, the linked list of + shifts is useless: just fill directly the state's shifts member. + + * src/state.h (shifts): Remove the `next' member. + * src/LR0.c (first_state, last_state): Remove. + Adjust the callers. + (augment_automaton): Don't look for the shifts that must be added + a shift on EOF: it is those of the state we looked for! But now, + since shifts are attached, it is no longer needed to looking + merely by its id: its number. + +2001-12-10 Akim Demaille + + * src/LR0.c (augment_automaton): Better variable locality. + Remove an impossible branch: if there is a state corresponding to + the start symbol being shifted, then there is shift for the start + symbol from the initial state. + +2001-12-10 Akim Demaille + + * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state' + only when appropriate: when insert_start_shifting_state' is not + invoked. + * tests/regression.at (Rule Line Numbers): Adjust. + +2001-12-10 Akim Demaille + + * src/LR0.c (augment_automaton): Now that all states have shifts, + merge the two cases addition shifts to the initial state. + +2001-12-10 Akim Demaille + + * src/lalr.c (set_state_table): Move to... + * src/LR0.c: here. + * src/lalr.c (lalr): Don't call it... + * src/LR0.c (generate_states): do it. + * src/LR0.h (first_state): Remove, only the table is used. + +2001-12-10 Akim Demaille + + * src/LR0.h (first_shift, first_reduction): Remove. + * src/lalr.c: Don't use first_shift: find shifts through the + states. + +2001-12-10 Akim Demaille + + * src/LR0.c: Attach shifts to states as soon as they are + computed. + * src/lalr.c (set_state_table): Instead of assigning shifts to + state, just assert that the mapping was properly done. + +2001-12-10 Akim Demaille + + * src/LR0.c (insert_start_shift): Rename as... + (insert_start_shifting_state): this. + (insert_eof_shifting_state, insert_accepting_state): New. + (augment_automaton): Adjust. + Better locality of the variables. + When looking if the start_symbol is shifted from the initial + state, using `while (... symbol != start_symbol ...)' sounds + better than `while (... symbol < start_symbol ...)': If fail + to see how the order between symbols could be relevant! + +2001-12-10 Akim Demaille + + * src/getargs.h: Don't declare `spec_name_prefix' and + `spec_file_prefix', declared by src/files.h. + * src/files.c, src/files.h: Default for spec_name_prefix is "yy". + * src/muscle_tab.c (muscle_init): Default prefix to NULL. + * src/output.c (prepare): Adjust. + * src/reader.c (symbols_output): Likewise. + * src/vmsgetargs.c: Vaguely adjust, but who cares? + +2001-12-10 Akim Demaille + + * src/muscle_tab.c (muscle_init): NULL is a better default than + `"0"'. + +2001-12-10 Akim Demaille + + * src/reader.c (reader): Calling symbols_output once is enough. + +2001-12-10 Akim Demaille + + Now that states have a complete set of members, the linked list of + reductions is useless: just fill directly the state's reductions + member. + + * src/state.h (struct reductions): Remove member `number' and + `next'. + * src/LR0.c (first_reduction, last_reduction): Remove. + (save_reductions): Don't link the new reductions, store them in + this_state. + * src/lalr.c (set_state_table): No need to attach reductions to + states, it's already done. + * src/output.c (output_actions): No longer free the shifts, then + the reductions, then the states: free all the states and their + members. + +2001-12-10 Akim Demaille + + * src/options.c (OPTN, DRTV, BOTH): New. + (option_table): Use them. + + * src/muscle_tab.c: Don't include xalloc.h and string.h: that's + the job of system.h. + * src/options.c: Don't include stdio.h and xalloc.h for the same + reasons. + +2001-12-10 Akim Demaille + + * src/output.c (output, prepare): Make sure the values of the + muscles `action' and `prologue' are 0-terminated. + +2001-12-10 Akim Demaille + + Clean up GCC warnings. + + * src/reader.c (copy_action): `buf' is not used. + (parse_skel_decl): Be static. + * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'. + * src/options.h (create_long_option_table): Have a real prototype. + * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete) + (hash_delete_at): Return const void *. + Adjust casts to preserve the const. + +2001-12-10 Akim Demaille + + * configure.in: Require 2.52g. + M4 is not needed, but AUTOM4TE is. + * m4/m4.m4: Remove. + * tests/Makefile.am: Adjust. + +2001-12-10 Akim Demaille + + One structure for states is enough, even though theoretically + there are LR(0) states and LALR(1) states. + + * src/lalr.h (state_t): Remove. + (state_table): Be state_t **, not state_t *. + * src/state.h (core, CORE_ALLOC): Rename as... + (state_t, STATE_ALLOC): this. + Add the LALR(1) members: shifts, reductions, errs. + * src/LR0.c (state_table): Rename as... + (state_hash): this, to avoid name clashes with the global + `state_table'. + * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c + * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust. + +2001-12-10 Akim Demaille + + Bison dumps core on bash.y. + Reported by Pascal Bart. + + * src/warshall.c (bitmatrix_print): New. + (TC): Use it. + When performing a transitive closure R(i, j) && R(j, k) => R(i, k), + j must be the outer loop. + * tests/regression.at (Broken Closure): New. + +2001-12-05 Akim Demaille + + * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and + its argument. + Reported by Peter Hamorsky. + +2001-12-05 Akim Demaille + + * src/conflicts.c (err_table): Remove. + (resolve_sr_conflict): Adjust. + * src/lalr.h (state_t.reduction_table, state_t.shift_table): + Rename as... + (state_t.reductions, state_t.shifts): this. + +2001-12-05 Akim Demaille + + * src/reduce.c (reduce_grammar_tables): No longer disable the + removal of useless rules via CPP but via `if (0)', so that the + compiler still check the code is valid. + For instance, it should have noticed `rline' no longer exists: use + the `line' member of rule_t. + * src/gram.c (dummy, rline): Remove, unused. + +2001-12-05 Akim Demaille + + * src/output.c (pack_vector): Use assert, not berror. + * src/main.c (berror): Remove, unused. + +2001-12-05 Akim Demaille + + New experimental feature: if --verbose --trace output all the + items of a state, not only its kernel. + + * src/print.c (print_core): If `trace_flag', then invoke closure + before outputting the items of the state (print_core is no longer + a correct name them). + (print_results): Invoke new_closure/free_closure if needed. + +2001-12-05 Akim Demaille + + * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount. + * src/closure.c, src/closure.h (itemsetsize): Rename as... + (nitemset): for consistency with the rest of the project. + +2001-12-05 Akim Demaille + + * src/closure.c (print_closure): Improve. + (closure): Use it for printing input and output. + +2001-12-05 Akim Demaille + + * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are + indexed by nonterminals. + +2001-12-05 Akim Demaille + + * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of + what it was!). + * src/warshall.h: Remove accidental duplication of the content. + +2001-12-05 Akim Demaille + + * src/closure.c (set_fderives): De-obfuscate. + +2001-12-05 Akim Demaille + + * src/closure.c (print_firsts, print_fderives): De-obfuscate. + +2001-12-05 Akim Demaille + + * src/closure.c (set_firsts): De-obfuscate. + +2001-12-05 Akim Demaille + + * src/output.c (action_row): De-obfuscate + using the good o' techniques: arrays not pointers, variable + locality, BITISSET, RESETBIT etc. + +2001-12-05 Akim Demaille + + Pessimize the code to simplify it: from now on, all the states + have a valid SHIFTS, which NSHIFTS is possibly 0. + + * src/LR0.c (shifts_new): Be global and move to.. + * src/state.c, src/state.h: here. + * src/conflicts, src/lalr.c, src/output.c, src/print.c, + * src/print_graph: Adjust. + +2001-12-05 Akim Demaille + + * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New. + * src/conflicts.c: Use it. + Restore a few missing `if (!SHIFT_IS_DISABLED)' which were + incorrectly ``simplified''. + +2001-12-05 Akim Demaille + + * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate + using the good o' techniques: arrays not pointers, variable + locality, BITISSET, RESETBIT etc. + +2001-12-05 Akim Demaille + + * src/state.h (SHIFT_SYMBOL): New. + * src/conflicts.c: Use it to deobfuscate. + +2001-12-05 Akim Demaille + + * src/conflicts.c (count_sr_conflicts, count_rr_conflicts) + (print_reductions): De-obfuscate using the good o' techniques: + arrays not pointers, variable locality, BITISSET. + +2001-12-05 Akim Demaille + + * src/conflicts.c (print_reductions): Arrays, not pointers. + Use BITISSET. + +2001-12-05 Akim Demaille + + * src/conflicts.c (print_reductions): Pessimize, but clarify. + +2001-12-05 Akim Demaille + + * src/conflicts.c (print_reductions): Improve variable locality. + +2001-12-05 Akim Demaille + + * src/conflicts.c (print_reductions): Pessimize, but clarify. + +2001-12-05 Akim Demaille + + * src/conflicts.c (print_reductions): Improve variable locality. + +2001-12-05 Akim Demaille + + * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New. + * src/lalr.c: Use them. + +2001-12-05 Akim Demaille + + * src/LR0.c (augment_automaton): Formatting changes. + Better variable locality. + +2001-12-05 Akim Demaille + + * src/lalr.c (matrix_print): New. + (transpose): Use it. + Use arrays instead of pointers. + +2001-12-05 Akim Demaille + + * src/lalr.c (maxrhs): Move to... + * src/gram.c, src/gram.h (ritem_longest_rhs): here. + * src/lalr.c (build_relations): Adjust. + +2001-12-05 Akim Demaille + + * src/lalr.c (transpose): Free the memory allocated to the + argument, as it is replaced by the results by the unique caller. + (build_relations): Merely invoke transpose: it handles the memory + deallocation. + Improve variable locality. + Avoid variables used as mere abbreviations. + (compute_lookaheads): Use arrays instead of pointers. + +2001-12-05 Akim Demaille + + * src/lalr.c (initialize_F): Improve variable locality. + Avoid variables used as mere abbreviations. + +2001-12-05 Akim Demaille + + * src/derives.c (print_derives): Display the ruleno. + * src/lalr.c (initialize_F, transpose): Better variable locality + to improve readability. + Avoid variables used as mere abbreviations. + +2001-12-05 Akim Demaille + + * src/lalr.c (traverse): Use arrays instead of pointers. + +2001-12-05 Akim Demaille + + * src/nullable.c (set_nullable): Use a for loop to de-obfuscate + the handling of squeue. + `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'. + +2001-12-05 Akim Demaille + + Because useless nonterminals are now kept alive (instead of being + `destroyed'), we now sometimes examine them, and store information + related to them. Hence we need to know their number, and adjust + memory allocations. + + * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer + static. + * src/LR0.c (allocate_itemsets): The memory allocated to + `symbol_count' was used for two different purpose: once to count + the number of occurrences of each symbol, and later reassigned to + `shift_symbol', containing the symbol that can be shifted from a + given state. + Deobfuscate, i.e., allocate, use and free `symbol_count' here + only, and... + (new_itemsets): Allocate `shift_symbol' here. + (allocate_itemsets): symbol_count includes useless nonterminals. + Make room for them. + (free_storage): Use `free', not `XFREE', for pointers that cannot + be null. + +2001-12-05 Akim Demaille + + * src/nullable.c (set_nullable): Deobfuscate the handling of + ritem. + `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'. + +2001-12-05 Akim Demaille + + * src/gram.c, src/gram.h (ritem_print): New. + * src/gram.c (dummy): Remove, now there is actual code in gram.c. + (This useless function was defined only to work around VMS linkers + that can't handle compilation units with variables only). + * src/reduce.c (dump_grammar): Use it to trace the construction of + ritem. + +2001-12-04 Paul Eggert + + * src/bison.simple (union yyalloc): Change member names + to be the same as the stack names. + (yyparse): yyptr is now union yyalloc *, not char *. + (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning, + and may generate better code on some machines. + (yystpcpy): Use prototype if __STDC__ is defined, not just + if __cplusplus is defined. + +2001-11-30 Akim Demaille + + * configure.in (WARNING_CFLAGS): Add -Werror when possible. + (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU + Gettext doesn't compile cleanly, and dies with -Werror. + * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS): + Include WARNING_CFLAGS here. + * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared + before being defined. + +2001-11-27 Paul Eggert + + * lib/quotearg.h (quotearg_n, quotearg_n_style): + First arg is int, not unsigned. + * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise. + (SIZE_MAX, UINT_MAX): New macros. + (quotearg_n_options): Abort if N is negative. + Avoid overflow check on hosts where size_t is 64 bits and int + is 32 bits, as overflow is impossible there. + Fix off-by-one typo that caused unnecessary reallocation. + +2001-11-29 Paul Eggert + + Name space cleanup in generated parser. + + * doc/bison.texinfo (Bison Parser): Discuss system headers + and their effect on the user name space. + + * src/bison.simple: + (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX, + YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary, + i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE). + + (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing + on user names when possible. + + (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn. + Simplify test for whather exists. + + (): Include if we will use malloc, and if standard C or C++. + + (): Include if YYDEBUG. + + (yymemcpy): Renamed from __yy_memcpy. Do not define unless + ! defined (yyoverflow) && ! defined (yymemcpy). + + (yymemcpy, yyparse): Rename local variables as needed so that + they all begin with 'yy'. + + (yystrlen, yystpcpy): New functions. + + (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES. + All uses changed. + + (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy + instead of relying on string.h functions. Use YYSTACK_ALLOC + and YYSTACK_FREE instead of malloc and free. + +2001-11-30 Akim Demaille + + * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions + before their first uses. + (YYBISON, YYPURE): Move to the top of the output. + +2001-11-30 Akim Demaille + + * tests/reduce.at (Useless Nonterminals): Fix. + +2001-11-30 Akim Demaille + + * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty + if body instead of `;' to pacify GCC's warnings. + +2001-11-30 Akim Demaille + + Instead of mapping the LHS of unused rules to -1, keep the LHS + valid, but flag the rules as invalid. + + * src/gram.h (rule_t): `useful' is a new member. + * src/print.c (print_grammar): Adjust. + * src/derives.c (set_derives): Likewise. + * src/reader.c (packgram, reduce_output): Likewise. + * src/reduce.c (reduce_grammar_tables): Likewise. + * tests/reduce.at (Underivable Rules, Useless Rules): New. + +2001-11-30 Akim Demaille + + * src/reduce.c (reduce_output): Formatting changes. + * src/print.c (print_results, print_grammar): Likewise. + * tests/regression.at (Rule Line Numbers) + (Solved SR Conflicts, Unresolved SR Conflicts): Adjust. + +2001-11-30 Akim Demaille + + * src/reduce.c (nonterminals_reduce): Instead of throwing away + useless nonterminals, move them at the end of the symbol arrays. + (reduce_output): Adjust. + * tests/reduce.at (Useless Nonterminals): Adjust. + +2001-11-30 Akim Demaille + + * src/reduce.c: Various comment/formatting changes. + (nonterminals_reduce): New, extracted from... + (reduce_grammar_tables): here. + (reduce_grammar): Call nonterminals_reduce. + +2001-11-29 Paul Eggert + + * src/bison.simple (YYSTACK_REALLOC): Remove. + (YYSTACK_ALLOC): Resurrect this macro, with its old meaning. + (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE): + New macros. + (union yyalloc): New type. + (__yy_memcpy): Last arg is size_t, not unsigned int, to remove + an arbitrary restriction on hosts where size_t is wider than int. + + (yyparse): Don't dump core if alloca or malloc fails; instead, report + a parser stack overflow. Allocate just one block of memory for all + three stacks, instead of allocating three blocks; this typically is + faster and reduces fragmentation. + + Do not limit the number of items in the stack to a value that fits + in 'int', as this is an arbitrary limit on hosts with 64-bit + size_t and 32-bit int. + +2001-11-29 Marc Autret + + * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead + of defining YYERROR_VERBOSE. + [AT_DATA]: $4 is now out of C declarations in the prologue. + +2001-11-28 Marc Autret + + * src/reader.c (parse_dquoted_param): New. + (parse_skel_decl): Use it. + * src/lex.h: Add its prototype. + * src/lex.c (literalchar): Become not static. + +2001-11-28 Marc Autret + + * src/output.h: And put its extern declaration here. + * src/output.c (error_verbose): Define here. + (prepare): Echo name modification. + * src/getargs.h: Clean its extern declaration. + * src/getargs.c (error_verbose_flag): Remove. + (getargs): Remove case 'e'. + * src/options.c (option_table): 'error-verbose' is now seen as simple + percent option. + Include output.h. + + * src/reader.c (read_declarations): Remove case tok_include. + (parse_include_decl): Remove. + * src/lex.h (token_t): Remove tok_include. + * src/options.c (option_table): 'include' is now a simple command line + option. + +2001-11-28 Marc Autret + + * src/bison.simple: Adjust muscle names. + * src/muscle_tab.c (muscle_init): Also rename the muscles. + * src/output.c (prepare): s/_/-/ for the muscles names. + (output_parser): When scanning for a muscle, allow '-' instead of '_'. + +2001-11-28 Marc Autret + + * src/bison.simple: Fix debug. + [YYERROR_VERBOSE]: Re-integrate as an internal macro. + +2001-11-28 Akim Demaille + + * src/LR0.c (shifts_new): New. + (save_shifts, insert_start_shift, augment_automaton): Use it. + +2001-11-28 Akim Demaille + + * src/closure.c (closure): `b' and `ruleno' denote the same value: + keep ruleno only. + +2001-11-28 Akim Demaille + + * src/closure.c (closure): Instead of looping over word in array + then bits in words, loop over bits in array. + +2001-11-28 Akim Demaille + + * src/closure.c (closure): No longer optimize the special case + where all the bits of `ruleset[r]' are set to 0, to make the code + clearer. + +2001-11-28 Akim Demaille + + * src/closure.c (closure): `r' and `c' are new variables, used to + de-obfuscate accesses to RULESET and CORE. + +2001-11-28 Akim Demaille + + * src/reduce.c (reduce_print): Use ngettext. + (dump_grammar): Improve the trace accuracy. + +2001-11-28 Akim Demaille + + * src/reduce.c (dump_grammar): Don't translate trace messages. + +2001-11-28 Akim Demaille + + * tests/reduce.at (Useless Terminals, Useless Nonterminals): New. + * src/reduce.c (reduce_grammar_tables): Do not free useless tags, + as all tags are free'ed afterwards. + From Enrico Scholz. + +2001-11-27 Paul Eggert + + * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to + use alloca when we didn't want to, and vice versa. + +2001-11-27 Marc Autret + + * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle + initialization. + * src/output.c (prepare): Remove its update. + +2001-11-27 Marc Autret + + * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition. + Use %error-verbose. + +2001-11-27 Marc Autret + + * src/bison.simple: Remove YYERROR_VERBOSE using. + Use %%error_verbose. + (yyparse): Likewise. + * src/output.c (prepare): Give its final value. + * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'. + * src/getargs.h: Add its extern declaration. + * src/getargs.c (error_verbose_flag): New int. + (getargs): Update to catch new case. + * src/options.c (option_table): 'error-verbose' is a new option. + (shortopts): Update. + +2001-11-27 Akim Demaille + + * src/system.h: Use intl/libgettext.h. + * src/Makefile.am (INCLUDES): Add -I $(top_srcdir). + +2001-11-27 Akim Demaille + + * tests/torture.at (Exploding the Stack Size with Malloc): + s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/. + +2001-11-27 Akim Demaille + + * src/files.c: Include error.h. + Reported by Hans Aberg. + +2001-11-26 Marc Autret + + * src/reader.c (parse_include_decl): New, not yet implemented. + (read_declarations): Add case tok_include. + * src/getargs.h (include): Add its extern definition. + * src/getargs.c (include): New const char *. + (getargs): Add case '-I'. + * src/options.c (option_table): Add include as command line and + percent option. + * src/lex.h (token_t): Add tok_include. + +2001-11-26 Akim Demaille + + * src/reader.c (readgram): Make sure rules for mid-rule actions + have a lineno equal to that of their host rule. + Reported by Hans Aberg. + * tests/regression.at (Rule Line Numbers): New. + +2001-11-26 Akim Demaille + + * src/LR0.c (allocate_itemsets): kernel_size contains ints, not + size_ts. + +2001-11-26 Akim Demaille + + * src/complain.c, src/complain.h (error): Remove, provided by + lib/error.[ch]. + +2001-11-26 Akim Demaille + + * src/reader.c (read_declarations): Don't abort on tok_illegal, + issue an error message. + * tests/regression.at (Invalid %directive): New. + Reported by Hans Aberg. + +2001-11-26 Akim Demaille + + * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE. + * lib/Makefile.am (libbison_a_SOURCES): Adjust. + +2001-11-26 Akim Demaille + + * src/conflicts.c (conflicts_print): Don't complain at all when + there are no reduce/reduce conflicts, and as many shift/reduce + conflicts as expected. + * tests/regression.at (%expect right): Adjust. + +2001-11-23 Akim Demaille + + * lib/alloca.c: Update, from fileutils. + +2001-11-23 Akim Demaille + + * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@. + +2001-11-23 Akim Demaille + + * src/system.h: Include alloca.h. + * src/main.c (main) [C_ALLOCA]: Call alloca (0). + +2001-11-23 Akim Demaille + + * src/print_graph.c (print_actions): Remove `rule', unused. + * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to + pacify GCC's signed < unsigned warnings. + * src/closure.c (itemsetsize): Likewise. + * src/reader.c (symbol_list_new): Static. + +2001-11-23 Akim Demaille + + Attaching lineno to buckets is stupid, since only one copy of each + symbol is kept, only the line of the first occurrence is kept too. + + * src/symtab.h, src/symtab.c (bucket): Remove the line member. + * src/reader.c (rline_allocated): Remove, unused. + (symbol_list): Have a `line' member. + (symbol_list_new): New. + (readgram): Use it. + * src/print.c (print_grammar): Output the rule line numbers. + * tests/regression.at (Solved SR Conflicts) + (Unresolved SR Conflicts): Adjust. + Reported by Hans Aberg. + +2001-11-22 Marc Autret + + * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0. + +2001-11-22 Marc Autret + + * src/muscle_tab.c (muscle_init): Remove initialization of + skeleton muscle. + * src/output.c (output_master_parser): Do it here. + +2001-11-20 Akim Demaille + + * po/sv.po: New. + * configure.in (ALL_LINGUAS): Adjust. + * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no + longer contains strings to translate. + +2001-11-19 Akim Demaille + + * src/conflicts.c (conflicts_print): Add a missing \n. + +2001-11-19 Akim Demaille + + * src/nullable.c (nullable_print): New. + (set_nullable): Call it when tracing. + Better locality of variables. + +2001-11-19 Akim Demaille + + * src/print.c (print_actions): Better locality of variables. + +2001-11-19 Akim Demaille + + * src/derives.c (print_derives): Fix and enrich. + * src/closure.c (print_fderives): Likewise. + +2001-11-19 Akim Demaille + + * src/closure.c (itemsetend): Remove, replaced with... + (itemsetsize): new. + +2001-11-19 Akim Demaille + + * src/LR0.c (kernel_end): Remove, replaced with... + (kernel_size): new. + +2001-11-19 Akim Demaille + + * src/conflicts.c (set_conflicts): Use arrays instead of pointers + to clarify. + +2001-11-19 Akim Demaille + + * src/closure.c (closure): Use arrays instead of pointers to clarify. + +2001-11-19 Akim Demaille + + * src/closure.c, src/derives.c, src/nullable.c: Adjust various + trace messages. + * src/LR0.c: Likewise. + (allocate_itemsets): Use arrays instead of pointers to clarify. + +2001-11-19 Akim Demaille + + * src/getargs.c (statistics_flag): Replace with... + (trace_flag): New. + (longopts): Accept --trace instead of --statistics. + * src/getargs.h, src/options.c: Adjust. + * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c, + * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE. + +2001-11-19 Akim Demaille + + * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer + pointers to clarify the code. + (save_reductions, save_shifts): Factor common parts of alternatives. + +2001-11-19 Akim Demaille + + * src/LR0.c (new_state, get_state): Complete TRACE code. + * src/closure.c: Include `reader.h' to get `tags', needed by the + trace code. + Rename the conditional DEBUG as TRACE. + Output consistently TRACEs to stderr, not stdout. + * src/derives.c: Likewise. + * src/reduce.c: (inaccessable_symbols): Using if is better style + than goto. + Use `#if TRACE' instead of `#if 0' for tracing code. + +2001-11-19 Akim Demaille + + * src/system.h (LIST_FREE, shortcpy): New. + * src/LR0.c: Use them. + * src/output.c (free_itemsets, free_reductions, free_shifts): + Remove, replaced by LIST_FREE. + +2001-11-19 Akim Demaille + + * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC) + (REDUCTIONS_ALLOC): New. + * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory + allocation. + +2001-11-19 Akim Demaille + + * src/LR0.c (new_state): Complete trace code. + * src/nullable.c (set_nullable): Don't translate traces. + +2001-11-19 Akim Demaille + + * src/print_graph.c (print_core): Better locality of variables. + * src/print.c (print_core): Likewise. + +2001-11-19 Akim Demaille + + * src/vcg.c: You do the output, so you are responsible of the + handling of VCG syntax, in particular: use quotearg. + * src/print_graph.c: Don't. + (print_actions): Don't output the actions as part of the nodes, + since that's the job of the edges. + (print_state): Don't output by hand: fill the node description, + and ask for its output. + +2001-11-19 Akim Demaille + + * src/bison.simple (yyparse): When verbosely reporting an error, + no longer put additional quotes around token names. + * tests/calc.at: Adjust. + +2001-11-19 Akim Demaille + + * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'. + * src/reader.c (record_rule_lines, rline, rline_allocated): Remove. + * src/output.c: Adjust. + +2001-11-19 Akim Demaille + + * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of... + (rule_t): this. + * src/conflicts.c, src/reader.c, src/reduce.c: Adjust. + +2001-11-19 Akim Demaille + + * src/gram.h (rule_t): New. + (rule_table): New. + (rrhs, rlhs): Remove, part of state_t. + * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c, + * src/lalr.c, src/nullable.c, src/output.c, src/print.c, + * src/reader.c, src/reduce.c: Adjust. + +2001-11-19 Akim Demaille + + * src/reader.c (symbols_output): New, extracted from... + (packsymbols): Here. + (reader): Call it. + +2001-11-19 Akim Demaille + + * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with... + (maxrhs): this new function. + +2001-11-19 Akim Demaille + + * src/lalr.c (F): New macro to access the variable F. + Adjust. + +2001-11-19 Akim Demaille + + * src/lalr.h (LA): New macro to access the variable LA. + * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c: + * src/lalr.c: Adjust. + +2001-11-19 Akim Demaille + + * src/lalr.c (initialize_LA): Only initialize LA. Let... + (set_state_table): handle the `lookaheads' members. + +2001-11-19 Akim Demaille + + * src/lalr.h (lookaheads): Removed array, whose contents is now + a member of... + (state_t): this structure. + * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c: + Adjust. + +2001-11-19 Akim Demaille + + * src/lalr.h (consistent): Removed array, whose contents is now + a member of... + (state_t): this structure. + * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c: + Adjust. + +2001-11-19 Akim Demaille + + * src/lalr.h (reduction_table, shift_table): Removed arrays, whose + contents are now members of... + (state_t): this structure. + * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c: + Adjust. + +2001-11-19 Akim Demaille + + * src/lalr.h (state_t): New. + (state_table): Be a state_t * instead of a core **. + (accessing_symbol): Remove, part of state_t. + * src/lalr.c: Adjust. + (set_accessing_symbol): Merge into... + (set_state_table): this. + * src/print_graph.c, src/conflicts.c: Adjust. + +2001-11-14 Akim Demaille + + * tests/calc.at, tests/output.at, tests/regression.at, + * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g: + now the tests are run in private dirs, therefore AC_CLEANUP and + family can be simplified to 0-ary. + * tests/atlocal.in: Now that we run `elsewhere' than in tests/, + use abs. path to find config.h. + * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's + stderr, there can be way too much random noise. + Instead pass -Werror to GCC and rely on the exit status. + Reported by Wolfram Wagner. + +2001-11-14 Akim Demaille + + * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be + defined only if yyoverflow is defined, to avoid `warning: unused + variable `yyvs1''. + Reported by The Test Suite. + +2001-11-14 Akim Demaille + + * src/print.c: Include reduce.h. + Reported by Hans Aberg. + +2001-11-14 Akim Demaille + + * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer): + Revert a previous patch: these are really const. + * src/conflicts.c (conflict_report): Additional useless pair of + braces to pacify GCC's warnings for `if () if () {} else {}'. + * src/lex.c (parse_percent_token): Replace equal_offset with + arg_offset. + arg is const. + Be sure to strdup `arg' when used, since there is no reason for + token_buffer not to change. + +2001-11-14 Akim Demaille + + * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper + definition. + * src/main.c (main): Use them. + Suggested by Hans Aberg. + +2001-11-12 Akim Demaille + + * src/system.h (ngettext): Now that we use ngettext, be sure to + provide a default definition when NLS are not used. + +2001-11-12 Akim Demaille + + * doc/bison.texinfo: Use `$' as shell prompt, not `%'. + Use @kbd to denote user input. + (Language and Grammar): ANSIfy the example. + Adjust its layout for info/notinfo. + (Location Tracking Calc): Output error messages to stderr. + Output locations in a more GNUtically correct way. + Fix a couple of Englishos. + Adjust @group/@end group pairs. + +2001-11-12 Akim Demaille + + %expect was not functioning at all. + + * src/conflicts.c (expected_conflicts): Set to -1. + (conflict_report): Use ngettext. + (conflicts_print): Check %expect and make its violation an error. + * doc/bison.texinfo (Expect Decl): Adjust. + * configure.in (AM_GNU_GETTEXT): Ask for ngettext. + * tests/regression.at (%expect not enough, %expect right) + (%expect too much): New. + +2001-11-12 Akim Demaille + + * tests/regression.at (Conflicts): Rename as... + (Unresolved SR Conflicts): this. + (Solved SR Conflicts): New. + +2001-11-12 Akim Demaille + + * src/reduce.c (print_results): Rename as... + (reduce_output): This. + Output to OUT, passed as argument, instead of output_obstack. + (dump_grammar): Likewise. + (reduce_free): New. + Also free V1. + (reduce_grammar): No longer call reduce_output, since... + * src/print.c (print_results): do it. + * src/main.c (main): Call reduce_free; + +2001-11-12 Akim Demaille + + * src/conflicts.c (print_reductions): Accept OUT as argument. + Output to it, not to output_obstack. + * src/print.c (print_actions): Adjust. + +2001-11-12 Akim Demaille + + * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return + the result instead of using... + (src_total, rrc_total, src_count, rrc_count): Remove. + (any_conflicts): Remove. + (print_conflicts): Split into... + (conflicts_print, conflicts_output): New. + * src/conflicts.h: Adjust. + * src/main.c (main): Invoke both conflicts_output and conflicts_print. + * src/print.c (print_grammar): Issue `\n' between two rules. + * tests/regression.at (Conflicts): New. + Reported by Tom Lane. + +2001-11-12 Akim Demaille + + * tests/regression.at (Invalid input): Remove, duplicate with + ``Invalid input: 1''. + +2001-11-12 Akim Demaille + + * tests/torture.at (AT_DATA_STACK_TORTURE) + (Exploding the Stack Size with Alloca) + (Exploding the Stack Size with Malloc): New. + +2001-11-12 Akim Demaille + + * src/bison.simple (YYSTACK_REALLOC): New. + (yyparse) [!yyoverflow]: Use it and free the old stack. + Reported by Per Allansson. + +2001-11-12 Pascal Bart + + * src/bison.simple: Define type yystype instead of YYSTYPE, and + define CPP macro, which substitute YYSTYPE by yystype. + * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do + with yyltype/YYLTYPE. This allows inclusion of the generated + header within the parser if the compiler, such as GGC, accepts + multiple equivalent #defines. + From Akim. + +2001-11-05 Akim Demaille + + * src/reader.c (symbols_output): New, extracted from... + (packsymbols): here. + (reader): Adjust. + +2001-11-05 Akim Demaille + + * src/lex.c (parse_percent_token): s/quotearg/quote/. + +2001-11-05 Akim Demaille + + * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up + pattern. + +2001-11-05 Akim Demaille + + * src/options.h (struct option_table_struct): set_flags is void*. + * src/options.c (longopts): Support `--output' and `%output'. + (usage): Adjust. + * src/lex.h (tok_setopt): Remove, replaced with... + (tok_intopt, tok_stropt): these new guys. + * src/lex.c (getopt.h): Not needed. + (token_buffer, unlexed_token_buffer): Not const. + (percent_table): Promote `-' over `_' in directive names. + Active `%name-prefix', `file-prefix', and `output'. + (parse_percent_token): Accept possible arguments to directives. + Promote `-' over `_' in directive names. + +2001-11-04 Akim Demaille + + * doc/bison.texinfo (Decl Summary): Split the list into + `directives for grammars' and `directives for bison'. + Sort'em. + Add description of `%name-prefix', `file-prefix', and `output'. + Promote `-' over `_' in directive names. + (Bison Options): s/%locactions/%locations/. Nice Freudian slip. + Simplify the description of `--name-prefix'. + Promote `-' over `_' in directive names. + Promote `--output' over `--output-file'. + Fix the description of `--defines'. + * tests/output.at: Exercise %file-prefix and %output. + +2001-11-02 Akim Demaille + + * doc/refcard.tex: Update. + +2001-11-02 Akim Demaille + + * src/symtab.h (SUNDEF): New. + * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to + stand for `uninitialized', instead of 0. + * src/reader.c (packsymbols, parse_thong_decl): Adjust. + * src/lex.c (lex): Adjust. + + * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF. + Number it 0. + Let yylex return it instead of a plain 0. + Reported by Dick Streefland. + +2001-11-02 Akim Demaille + + * tests/regression.at (Mixing %token styles): New test. + +2001-11-02 Akim Demaille + + * src/reader.c (parse_thong_decl): Formatting changes. + (token_translations_init): New, extracted from... + (packsymbols): Here. + Adjust. + +2001-11-01 Akim Demaille + + * tests/regression.at (AT_TEST_CPP_GUARD_H): New. + Check that `9foo.y' produces correct cpp guards. + * src/files.c (compute_header_macro): Prepend `BISON_' to CPP + guards. + Reported by Wwp. + +2001-11-01 Akim Demaille + + * tests/regression.at (Invalid input: 2): New. + * src/lex.c (unlexed_token_buffer): New. + (lex, unlex): Adjust: when unlexing, be sure to save token_buffer + too. + Reported by Wwp. + +2001-11-01 Akim Demaille + + * tests/calc.at: Catch up with 1.30. + * configure.in: Bump to 1.49a. + Adjust to newer Autotest. + +2001-10-19 Pascal Bart + + * src/conflicts.c: Move global variables rrc_total and src_total ... + (print_conflicts): here. + * src/output.c (output): Free global variable user_toknums. + * src/lex.c (token_obstack): Become static. + +2001-10-18 Akim Demaille + + * tests/atlocal.in (GCC): Add. + * tests/calc.at: s/m4_match/m4_bmatch/. + s/m4_patsubst/m4_bpatsubst/. + (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC. + * configure.in: AC_SUBST(GCC). + +2001-10-14 Marc Autret + + * src/options.c (create_long_option_table): Fix. + +2001-10-10 Akim Demaille + + * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA. + +2001-10-04 Akim Demaille + + * src/reader.c (parse_union_decl): Push the caracters in + union_obstack, not attrs_obstack. + +2001-10-04 Akim Demaille + + Merge in the branch 1.29. + + * src/reader.c (packsymbols): Use a temporary obstack for + `%%tokendef', since output_stack is already used elsewhere. + + 2001-10-02 Akim Demaille + + Bump 1.29d. + + 2001-10-02 Akim Demaille + + Version 1.29c. + + 2001-10-02 Akim Demaille + + * tests/regression.at (Invalid CPP headers): New. + From Alexander Belopolsky. + * src/files.c (compute_header_macro): Map non alnum chars to `_'. + + 2001-10-02 Akim Demaille + + * tests/regression.at (Invalid input): New. + * src/lex.c (lex): Be sure to set `token_buffer' in any case. + Reported by Shura. + + 2001-10-02 Akim Demaille + + * tests/calc.at: Now that --debug works, the tests must be adjusted. + + 2001-10-02 Akim Demaille + + * src/output.c (output_parser): Assert `skeleton'. + * src/files.c (skeleton_find): Look harder for skeletons on DOSish + systems. + From Shura. + + 2001-10-01 Marc Autret + + * src/lex.h: Echo modifications. + * src/lex.c (unlex): Parameter is now token_t. + From Hans Aberg. + + 2001-10-01 Marc Autret + + * src/main.c: Include lex.h. + From Hans Aberg. + + 2001-09-29 Akim Demaille + + * src/getargs.c (longopts): `--debug' is `-t', not `-d'. + + 2001-09-28 Akim Demaille + + * tests/testsuite.at: Update to newer Autotest. + * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped. + + 2001-09-27 Akim Demaille + + Position independent wrapper. + + * tests/bison: Remove. + * tests/bison.in: New. + * configure.in: Adjust. + + 2001-09-27 Paul Eggert + + Port quotearg fixes from tar 1.13.24. + + * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct + tm to be declared. + (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC. + (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT. + + * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4. + * m4/mbrtowc.m4: New file. + * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h. + Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc). + + 2001-09-27 Akim Demaille + + Bump to 1.29c. + + 2001-09-27 Akim Demaille + + Version 1.29b. + + 2001-09-25 Akim Demaille + + * src/system.h: Include `xalloc.h'. + Remove it from the C files. + * src/files.c (output_files): Free the obstacks. + * src/lex.c (init_lex): Rename as... + (lex_init): this. + (lex_free): New. + * src/main.c (main): Use it. + + 2001-09-24 Marc Autret + + * src/vcg.c (open_edge, close_edge, open_node, close_node): Change + to output informations in fout (FILE*). + (open_graph, close_graph): Likewise. + (output_graph, output_edge, output_node): Likewise. + * src/vcg.h: Update function prototypes. + * src/print_graph.c (print_graph): Open output graph file. + (print_actions): Adjust. + * src/files.h: Remove extern declaration. + * src/files.c: Remove graph_obstack declaration. + (open_files): Remove graph_obstack initialization. + (output_files): Remove graph_obstack saving. + + 2001-09-24 Marc Autret + + * src/files.c (compute_output_file_names): Fix. + + 2001-09-24 Marc Autret , + Akim Demaille + + * src/reader.c (reader): Remove call to free_symtab (). + * src/main.c (main): Call it here. + Include symtab.h. + * src/conflicts.c (initialize_conflicts): Rename as... + (solve_conflicts): this. + * src/print.c (print_core, print_actions, print_state) + (print_grammar): Dump to a file instead a `output_obstack'. + (print_results): Dump `output_obstack', and then proceed with the + FILE *. + * src/files.c (compute_output_file_names, close_files): New. + (output_files): Adjust. + * src/main.c (main): Adjust. + + 2001-09-23 Marc Autret + + * src/files.c (compute_header_macro): Computes header macro name + from spec_defines_file when given. + + 2001-09-23 Marc Autret + + * src/files.c (output_files): Add default extensions. + + 2001-09-22 Akim Demaille + + * src/conflicts.c (finalize_conflicts): Rename as... + (free_conflicts): this. + + 2001-09-22 Akim Demaille + + * src/gram.c (gram_free): Rename back as... + (dummy): this. + (output_token_translations): Free `token_translations'. + * src/symtab.c (free_symtab): Free the tag field. + + 2001-09-22 Akim Demaille + + Remove `translations' as it is always set to true. + + * src/gram.h: Adjust. + * src/reader.c (packsymbols, parse_token_decl): Adjust + * src/print.c (print_grammar): Adjust. + * src/output.c (output_token_translations): Adjust. + * src/lex.c (lex): Adjust. + * src/gram.c: Be sure the set pointers to NULL. + (dummy): Rename as... + (gram_free): this. + + 2001-09-22 Akim Demaille + + * configure.in: Invoke AM_LIB_DMALLOC. + * src/system.h: Use dmalloc. + * src/LR0.c: Be sure to have pointers initialized to NULL. + (allocate_itemsets): Allocate kernel_items only if needed. + + 2001-09-22 Akim Demaille + + * configure.in: Bump to 1.29b. + * tests/Makefile.am (DISTCLEANFILES): Add package.m4. + * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't + need xmalloc.c in calc.y. + From Pascal Bart. + + 2001-09-21 Akim Demaille + + Version 1.29a. + * Makefile.maint, config/config.guess, config/config.sub, + * config/missing: Update from masters. + * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend + upon package.m4. + * configure.in (ALL_LINGUAS): Add `tr'. + + 2001-09-21 Akim Demaille + + * tests/Makefile.am (package.m4): Move to... + ($(srcdir)/$(TESTSUITE)): here. + + 2001-09-20 Akim Demaille + + * src/complain.c: No longer try to be standalone: use system.h. + Don't assume __STDC__ is defined to 1. Just test if it is defined. + * src/complain.h: Likewise. + * src/reduce.c (useless_nonterminals, inaccessable_symbols): + Remove the unused variable `n'. + From Albert Chin-A-Young. + + 2001-09-18 Marc Autret + + * doc/bison.1: Update. + * doc/bison.texinfo (Bison Options): Update --defines and --graph + descriptions. + (Option Cross Key): Update. + Add --graph. + + 2001-09-18 Marc Autret + + * tests/regression.at: New test (comment in %union). + + 2001-09-18 Marc Autret + + * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment + do that. + Reported by Keith Browne. + + 2001-09-18 Marc Autret + + * tests/output.at: Add tests for --defines and --graph. + + 2001-09-18 Marc Autret + + * tests/output.at: Removes tests of %{header,src}_extension features. + + 2001-09-18 Akim Demaille + + * tests/Makefile.am (package.m4): New. + * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'. + (_AT_CHECK_CALC_ERROR): Likewise. + Factor the `, ' part of verbose error messages. + + 2001-09-18 Marc Autret + + * src/getargs.c (longopts): Declare --defines and --graph as options + with optional arguments. + * src/files.h: Add extern declarations. + * src/files.c (spec_graph_file, spec_defines_file): New. + (output_files): Update. + Remove CPP-outed code. + + 2001-09-18 Marc Autret + + Turn off %{source,header}_extension feature. + + * src/files.c (compute_exts_from_gf): Update. + (compute_exts_from_src): Update. + (output_files): CPP-out useless code. + * src/files.h: Remove {header,source}_extension extern declarations. + * src/reader.c (parse_dquoted_param): CPP-out. + (parse_header_extension_decl): Remove. + (parse_source_extension_decl): Remove. + (read_declarations): Remove cases tok_{hdrext,srcext}. + * src/lex.c (percent_table): Remove {header,source}_extension entries. + * src/lex.h (token_t): Remove tok_hdrext and tok_srcext. + + 2001-09-10 Akim Demaille + + * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT): + (AT_CHECK_BISON_PERCENT_FLAGS): Merge into... + (AT_CHECK_OUTPUT): this. + Merely check ls' exit status, its output is useless. + + 2001-09-10 Akim Demaille + + * tests/calc.at: Use m4_match. + (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'. + + 2001-09-10 Marc Autret , + Akim Demaille + + * src/vcg.h (graph_s): color, textcolor, bordercolor are now + enum color_e. + * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm + to `normal'. + * src/reader.c (parse_token_decl): Initialize token with tok_eof. + * src/lex.h: Adjust prototype. + (token_t): Add `tok_undef'. + * src/lex.c (struct percent_table_struct): Retval is now a token_t. + (parse_percent_token): Now returns token_t. + Add default statement in switch. + (lex): Separate `c' as an input variable, from the token_t result + part. + (unlexed): Is a token_t. + + 2001-09-10 Akim Demaille + + * configure.in: Bump to 1.29a. + + 2001-09-07 Akim Demaille + + Version 1.29. + + 2001-08-30 Akim Demaille + + * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove. + * m4/atconfig.m4: Remove. + * tests/testsuite.at, tests/atlocal.in, tests/output.at, + * tests/bison: New. + * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER, + m4_if, m4_patsubst, and m4_regexp. + * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an + `input' file instead of echo. + + 2001-08-29 Akim Demaille + + Bump to 1.28e. + + 2001-08-29 Akim Demaille + + Version 1.28d. + + 2001-08-29 Paul Eggert + + * src/bison.simple (yyparse): Don't take the address of an + item before the start of an array, as that doesn't conform to + the C Standard. + + 2001-08-29 Robert Anisko + + * doc/bison.texinfo (Location Tracking Calc): New node. + + 2001-08-29 Paul Eggert + + * src/output.c (output): Do not define const, as this now + causes more problems than it cures. + + 2001-08-29 Akim Demaille + + * doc/bison.texinfo: Modernize `@node' and `@top' use: just name + the nodes. + Be sure to tag the `detailmenu'. + + 2001-08-29 Akim Demaille + + * Makefile.maint (do-po-update): Wget refuses to overwrite files: + download in a tmp dir. + + 2001-08-28 Marc Autret + + * config/depcomp: New file. + + 2001-08-28 Marc Autret + + * doc/bison.1 (mandoc): Adjust. + From Juan Manuel Guerrero. + + 2001-08-28 Marc Autret + + * src/print_graph.c (print_state): Fix. + + 2001-08-27 Marc Autret + + * src/vcg.h (classname_s, infoname_s, node_s): Constify the + char * members. + Echo modifications to the functions prototypes. + * src/vcg.c (add_classname, add_infoname): Adjust arguments. + + 2001-08-27 Marc Autret + + * src/vcg.c: Include `xalloc.h'. + (add_colorentry): New. + (add_classname): New. + (add_infoname): New. + * src/vcg.h: Add new prototypes. + + 2001-08-27 Akim Demaille + + * Makefile.maint: Sync. again with CVS Autoconf. + + 2001-08-27 Akim Demaille + + * Makefile.maint: Formatting changes. + (po-update, cvs-update, update): New targets. + (AMTAR): Remove. + + 2001-08-27 Akim Demaille + + * Makefile.am (AUTOMAKE_OPTIONS): 1.5. + * Makefile.maint: Sync. with CVS Autoconf. + + 2001-08-27 Marc Autret + + * src/vcg.h (struct infoname_s): New. + (struct colorentry_s): New. + (graph_s): New fields {vertical,horizontal}_order in structure. + Add `infoname' field. + Add `colorentry' field; + * src/vcg_defaults.h (G_VERTICAL_ORDER): New. + (G_HORIZONTAL_ORDER): New. + (G_INFONAME): New. + (G_COLORENTRY): New. + * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order. + Add output of `infoname'. + Add output of `colorentry'. + + 2001-08-27 Marc Autret + + * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'. + This one shadowed a global parameter. + + 2001-08-24 Marc Autret + + * src/print_graph.c (node_output_size): Declared POSIX `size_t' type, + instead of `unsigned'. + (print_state): Do not call obstack_object_size () in obstack_grow () + to avoid macro variables shadowing. + + 2001-08-23 Marc Autret + + * src/lex.c (percent_table): Typo: s/naem/name/. + Add graph option. + Normalize new options declarations. + + 2001-08-20 Pascal Bart + + * tests/suite.at: Exercise %header_extension and %source_extension. + + 2001-08-16 Marc Autret + + * src/reader.c (parse_dquoted_param): New. + (parse_header_extension_decl): Use it. + (parse_source_extension_decl): Likewise. + + 2001-08-16 Marc Autret + + * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'. + (get_xxxx_str): Use assert () instead of complain (). + Remove return invokations in default cases. + (get_decision_str): Modify default behaviour. Remove second argument. + Echo modifications on calls. + (output_graph): Fix. + + 2001-08-16 Marc Autret + + * src/getargs.c (usage): Update with ``-g, --graph''. + + 2001-08-16 Marc Autret + + * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'. + (Option Cross Key): Likewise. + * doc/bison.1: Update. + +2001-09-25 Pascal Bart + + * src/output.c (output_master_parser): Don't finish action_obstack. + (output_parser): Don't care about the muscle action, here. + (prepare): Copy the action_obstack in the action muscle. + (output): Free action_obstack. + +2001-09-23 Pascal Bart + + * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which + will contain `%union' declaration. + (parse_union_decl): Delete #line directive output. + (parse_union_decl): Substitute /attrs_obstack/union_obstack for all + informations about %union. + (parse_union_decl): Copy the union_obstack in the muscle stype. + * src/bison.simple: Add new #line directive. + Add typdef %%stype YYSTYPE. + +2001-09-23 Pascal Bart + + * src/bison.simple: Add new `#line' directive. + +2001-09-22 Pascal Bart + + * src/bison.simple: New `#line' directive. + * src/output.c (output_parser): Support new dynamic muscle input_line. + +2001-09-22 Marc Autret + + * src/output.c (output_master_parser): New. + (output_parser): Be more re-entrant. + +2001-09-21 Marc Autret + + * src/reader.c (copy_definition, parse_union_decl): Update and use + `linef' muscle. + (copy_action): Likewise. + Use obstack_1grow (). + * src/muscle_tab.c (muscle_init): Add muscle `linef'. + +2001-09-21 Marc Autret + + * src/options.c (option_table): Adjust. + * src/lex.c (parse_percent_token): Fix. + +2001-09-20 Pascal Bart + + * src/options.c (symtab.h): Include it, need by lex.h. + +2001-09-20 Pascal Bart + + * src/lex.c (parse_percent_token): Change type of variable `tx', which + is now an option_table_struct*. + (option_strcmp): New function option_strcmp. + (parse_percent_token): Call option_strcmp. + * src/getargs.c (xalloc.h, options.h): Include it. + (getargs): Call create_long_option_table. + (getargs): Free longopts at the end of the function. + (shortopts): Move in options.c. + * src/options.c (create_long_option_table): New function. Convert + information from option_table to option structure. + * src/reader.c (options.h): Include it. + + * src/Makefile.am: Adjust. + * src/options.c (option_table): Create from longopts and percent_table. + * src/getargs.c (longopts): Delete. + * src/lex.c (struct percent_table_struct): Delete. + (percent_table): Delete. + (options.h): Include it. + * src/options.c: Create. + * src/options.h: Create. + Declare enum opt_access_e. + Define struct option_table_struct. + +2001-09-20 Marc Autret + + * doc/bison.texinfo: Adjust terminologies about prologue and epilogue + sections of Bison. + +2001-09-19 Pascal Bart + + * src/bison.simple: s/%%filename/%%skeleton. + * src/muscle_tab.c (getargs.h): Include it. + (muscle_init): Insert new muscle skeleton. + +2001-09-18 Pascal Bart + + * src/output.c (output_parser): Delete unused variable actions_dumped. + +2001-09-07 Pascal Bart + + * src/output.c (output): Delete call to reader_output_yylsp. + * src/reader.c (reader): Likewise. + * src/reader.h: Delete declaration of reader_output_yylsp. + +2001-09-02 Marc Autret + + * src/reader.c: Include muscle_tab.h. + (parse_union_decl): Update. + (parse_macro_decl): Rename parse_muscle_decl. + Update to use renamed functions and variable. + (read_declarations, copy_action, read_additionnal_code, : Updated + with correct variables and functions names. + (packsymbols, reader): Likewise. + + * src/reader.h (muscle_obstack): Extern declaration update. + + * src/output.c: Include muscle_tab.h + In all functions using macro_insert, change by using muscle_insert (). + (macro_obstack): Rename muscle_obstack. + Echo modifications in the whole file. + (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT. + (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING. + (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX. + + * src/muscle_tab.h: Update double inclusion macros. + (macro_entry_s): Rename muscle_entry_s. + Update prototypes. + + * src/muscle_tab.c: Include muscle_tab.h. + Rename macro_tabble to muscle_table. + (mhash1, mhash2, mcmp): Use muscle_entry. + (macro_init): Rename muscle_init. Update. + (macro_insert): Rename muscle_insert. Update. + (macro_find): Rename muscle_find. Update. + + * src/main.c: Include muscle_tab.h. + (main): Call muscle_init (). + * src/Makefile.am (bison_SOURCES): Echo modifications. + +2001-09-02 Marc Autret + + Now the files macro_tab.[ch] are named muscle_tab.[ch]. + + * src/muscle_tab.c, src/muscle_tab.h: Add files. + +2001-09-02 Marc Autret + + * src/macrotab.c, src/macrotab.h: Remove. + +2001-09-01 Pascal Bart + + * src/reader.c (copy_guard): Use muscle to specify the `#line' + filename. + +2001-09-01 Marc Autret + + * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set + to an explicit value to activate the feature. We do it here. + +2001-08-31 Pascal Bart + + * src/output.c (prepare): Delete the `filename' muscule insertion. + * src/reader.c (copy_action): Use `filename' muscule with `#line'. + (parse_union_decl): Likewise. + * src/macrotab.c (macro_init): Initialize filename by infile. + +2001-08-31 Marc Autret + + * src/bison.simple (YYLSP_NEEDED): New definition. + * src/output.c (prepare): Add macro insertion of `locations_flag' + +2001-08-31 Pascal Bart + + * src/output.c (prepare): Delete insertion of previous muscles, + and insert the `prefix' muscles. + * src/macrotab.c (macro_init): Likewise. + (macro_init): Initialization prefix directive by `yy'. + * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval, + %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar, + yylval, yydebug, yyerror, yynerrs and yyparse. + New directive `#define' to substitute yydebug, ... with option + name_prefix. + +2001-08-31 Pascal Bart + + * src/main.c (main): Standardize. + * src/output.c (output_table_data, output_parser): Likewise. + * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise. + +2001-08-31 Pascal Bart , Marc Autret + + * src/reader.c (read_additionnal_code): Rename %%user_code to + %%epilogue. + * src/output.c (output): Rename %%declarations to %%prologue. + * src/bison.simple: Echo modifications. + +2001-08-31 Marc Autret + + * src/reader.c (readgram): CleanUp. + (output_token_defines): Likewise. + (packsymbols): Likewise. + (reader): Likewise. + * src/output.c (output): CPP-out useless code. + +2001-08-31 Pascal Bart + + * src/reader.c (reader): Delete obsolete call to function + output_trailers and output_headers. + * src/output.h: Remove obsolete functions prototypes of output_headers + and output_trailers. + +2001-08-30 Pascal Bart + + * src/main.c: Include macrotab.h. + * src/macrotab.h (macro_entry_s): Constify fields. + Adjust functions prototypes. + * src/macrotab.c (macro_insert): Constify key and value. + (macro_find): Constify key. + (macro_insert): Include 'xalloc.h' + (macro_insert): Use XMALLOC. + (macro_find): Constify return value. + * src/output.c (output_table_data): Rename table to table_data. + (output_parser): Constify macro_key, macro_value. + +2001-08-30 Marc Autret + + * src/reader.c (parse_skel_decl): New. + (read_declarations): Add case `tok_skel', call parse_skel_decl (). + * src/lex.h (token_t): New token `tok_skel'. + * src/lex.c (percent_table): Add skeleton option entry. + Standardize. + +2001-08-29 Marc Autret + + * src/bison.simple: Add %%user_code directive at the end. + * src/reader.c (read_additionnal_code): New. + (reader): Use it. + * src/output.c (output_program): Remove. + (output): Update. + +2001-08-28 Marc Autret + + * src/output.c (output_actions): Clean up. + (output_gram): CPP-out useless code. + * src/reader.c (reader): Clean up, CPP-out useless code. + +2001-08-28 Pascal Bart + + * src/output.c (output): Copy attrs_obstack in the '%%definitions' + directive. + * src/bison.simple: Add `%%definitions'. + +2001-08-28 Marc Autret + + * config/depcomp: New file. + +2001-08-27 Paul Eggert + + * src/bison.simple (yyparse): Don't take the address of an + item before the start of an array, as that doesn't conform to + the C Standard. + +2001-08-27 Robert Anisko + + * src/output.c (output): Remove the initialization of the macro + obstack. It was done too late here. + + * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was + completely wrong. + (reader): Initialize the macro obstack here, since we need it to grow + '%define' directives. + + * src/reader.h: Declare the macro obstack as extern. + +2001-08-27 Robert Anisko + + * src/output.c (output_parser): Fix. Store single '%' characters in + the output obstack instead of throwing them away. + +2001-08-27 Akim Demaille + + * Makefile.am (AUTOMAKE_OPTIONS): 1.5. + +2001-08-25 Robert Anisko + + * lib/Makefile.am: Adjust. + +2001-08-25 Robert Anisko + + * src/bison.simple: Update and add '%%' directives. + +2001-08-25 Robert Anisko + + * src/reader.c (reader): Remove calls to 'output_headers' and + 'output_trailers'. Remove some C output. + (readgram): Disable a piece of code that was writing a default + definition for 'YYSTYPE'. + (reader_output_yylsp): Remove. + (packsymbols): Output token defintions to a macro. + (copy_definition): Disable C output. + + * src/reader.c (parse_macro_decl): New function used to parse macro + declarations. + (copy_string2): Put the body of copy_string into this new function. + Add a parameter to let the caller choose whether he wants to copy the + string delimiters or not. + (copy_string): Be a simple call to copy_string2 with the last argument + bound to true. + (read_declarations): Add case for macro definition. + (copy_identifier): New. + (parse_macro_decl): Read macro identifiers using copy_identifier + rather than lex. + +2001-08-25 Robert Anisko + + * src/output.c (prepare): Add prefixed names. + (output_parser): Output semantic actions. + (output_parser): Fix bug on '%%line' directives. + + * src/output.c (output_headers): Remove. The C code printed by this + function should now be in the skeletons. + (output_trailers): Remove. + (output): Disable call to 'reader_output_yylsp'. + (output_rule_data): Do not output tables to the table obstack. + + * src/output.c: Remove some C dedicated output. + Improve the use of macro and output obstacks. + (output_defines): Remove. + + * src/output.c (output_token_translations): Associate 'translate' + table with a macro. No output to the table obstack. + (output_gram): Same for 'rhs' and 'prhs'. + (output_stos): Same for 'stos'. + (output_rule_data): Same for 'r1' and 'r2'. + (token_actions): Same for 'defact'. + (goto_actions): Same for 'defgoto'. + (output_base): Same for 'pact' and 'pgoto'. + (output_table): Same for 'table'. + (output_check): Same for 'check'. + + * src/output.c (output_table_data): New function. + (output_short_table): Remove. + (output_short_or_char_table): Remove. + + * src/output.c (output_parser): Replace most of the skeleton copy code + with something new. Skeletons are now processed character by character + rather than line by line, and Bison looks for '%%' macros. This is the + first step in making Bison's output process (a lot) more flexible. + (output_parser): Use the macro table. + +2001-08-25 Robert Anisko + + * src/main.c (main): Initialize the macro table. + +2001-08-25 Robert Anisko + + * src/lex.c (percent_table): Add tok_define. + * src/lex.h: Add tok_define. + +2001-08-25 Robert Anisko + + * src/macrotab.c: New file. + * src/macrotab.h: New file. + * src/Makefile.am: Update. + +2001-08-25 Robert Anisko + + * lib/hash.c: New file. + * lib/hash.h: New file. + * lib/Makefile.am: Update. + +2001-08-15 Akim Demaille + + Version 1.28c. + +2001-08-15 Marc Autret + + * src/reader.c (readgram): Indent output macro YYSTYPE. + (packsymbols): Likewise. + (output_token_defines): Likewise. + * src/files.c: Standardize. + (compute_header_macro): New. + (defines_obstack_save): New. Use compute_header_macro. + (output_files): Update. Use defines_obstack_save. + +2001-08-15 Akim Demaille + + * doc/bison.texinfo (Table of Symbols): Document + YYSTACK_USE_ALLOCA. + +2001-08-15 Akim Demaille + + * missing: Update from CVS Automake. + * config/config.guess, config/config.sub, config/texinfo.tex: + Update from gnu.org. + +2001-08-15 Akim Demaille + + * Makefile.maint: Sync with CVS Autoconf. + +2001-08-14 Pascal Bart + + * doc/bison.texinfo: Include GNU Free Documentation License from + `fdl.texi'. + * doc/fdl.texi: Add to package. + +2001-08-14 Marc Autret + + Turn on %{source,header}_extension features. + + * src/lex.c (percent_table): Un-CPP out header_extension and + source_extension. + * src/files.c (compute_exts_from_gf): Compare pointers with NULL. + (compute_exts_from_src): Remove conditions. It restores priorities + between options. + +2001-08-14 Marc Autret + + * src/files.c (compute_base_names): Add extensions computing when + `--file-prefix' used. + Standardize function calls. + +2001-08-13 Marc Autret + + * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users + defining it (defined but null disables alloca). + +2001-08-13 Marc Autret + + * src/bison.simple (_yy_memcpy): CPP reformat. + +2001-08-13 Pascal Bart + + * tests/atconfig.in (CPPFLAGS): Fix. + +2001-08-10 Pascal Bart + + * doc/bison.texinfo: Include GNU General Public License from + `gpl.texi'. + * doc/gpl.texi: Add to package. + +2001-08-10 Marc Autret + + * src/print_graph.h: Fix. + * src/reader.c (read_declarations): Use parse_header_extension_decl (). + +2001-08-10 Akim Demaille + + * src/system.h: Provide default declarations for stpcpy, strndup, + and strnlen. + +2001-08-10 Robert Anisko + + * doc/bison.texinfo (Locations): Update @$ stuff. + +2001-08-09 Robert Anisko + + * src/bison.simple (YYLLOC_DEFAULT): Update. + (yyparse): Adjust. + +2001-08-08 Marc Autret + + * doc/bison.texinfo: Change @samp{$<@dots{}>} to + @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule. + Reported by Fabrice Bauzac. + +2001-08-08 Marc Autret + + * src/vcg_default.h: Use NULL instead of 0 to initialize pointers. + * src/vcg.c (output_node): Fix. + * src/vcg.h: Cleanup. + * src/print_graph.c: Add comments. + (node_output_size): New global variable. Simplify the formatting of + the VCG graph output. + (print_actions): Unused code is now used. It notifies the final state + and no action states in the VCG graph. It also give the reduce actions. + The `shift and goto' edges are red and the `go to state' edges are + blue. + Get the current node name and node_obstack by argument. + (node_obstack): New variable. + (print_state): Manage node_obstack. + (print_core): Use node_obstack given by argument. + A node is not only computed here but in print_actions also. + (print_graph): CPP out useless code instead of commenting it. + +2001-08-07 Pascal Bart + + * tests/atconfig.in (CPPFLAGS): Fix. + +2001-08-07 Akim Demaille + + * src/print_graph.c (quote): New. + (print_core): Use it. + +2001-08-06 Akim Demaille , Marc Autret + + * src/vcg.c (complain.h): Include it. + Unepitaize `return' invocations. + [NDEBUG] (main): Remove. + * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members. + * src/files.c (open_files): Initialize graph_obstack. + * src/print_graph.c (print_actions): CPP out useless code. + (print_core): Don't output the last `\n' in labels. + Use `quote'. + * src/files.c (output_files): Output the VCG file. + * src/main.c (main): Invoke print_graph (); + +2001-08-06 Marc Autret + + Automaton VCG graph output. + Using option ``-g'' or long option ``--graph'', you can generate + a gram_filename.vcg file containing a VCG description of the LALR (1) + automaton of your grammar. + + * src/main.c: Call to print_graph() function. + * src/getargs.h: Update. + * src/getargs.c (options): Update to catch `-g' and `--graph' options. + (graph_flag): New flag. + (longopts): Update. + (getargs): Add case `g'. + * src/files.c (graph_obstack): New obstack struct. + (open_files): Initialize new obstack. + (output_files): Saves graph_obstack if required. + * src/files.h (graph_obstack): New extern declaration. + * src/Makefile.am: Add new source files. + +2001-08-06 Marc Autret + + * src/print_graph.c, src/print_graph.h (graph): New. + * src/vcg.h: New file. + * src/vcg.c: New file, VCG graph handling. + +2001-08-06 Marc Autret + + Add of %source_extension and %header_extension which specify + the source or/and the header output file extension. + + * src/files.c (compute_base_names): Remove initialisation of + src_extension and header_extension. + (compute_exts_from_gf): Update. + (compute_exts_from_src): Update. + (output_files): Update. + * src/reader.c (parse_header_extension_decl): New. + (parse_source_extension_decl): New. + (read_declarations): New case statements for the new tokens. + * src/lex.c (percent_table): Add entries for %source_extension + and %header_extension. + * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext. + +2001-08-06 Marc Autret + + * configure.in: Bump to 1.28c. + * doc/bison.texinfo: Texinfo thingies. + +2001-08-04 Pascal Bart + + * tests/atconfig.in (CPPFLAGS): Add. + * tests/calc.at (AT_CHECK): Use CPPFLAGS. + +2001-08-03 Akim Demaille + + Version 1.28b. + +2001-08-03 Akim Demaille + + * tests/Makefile.am (check-local): Ship testsuite. + * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions. + Include `string.h'. + +2001-08-03 Akim Demaille + + * configure.in: Try using -Wformat when compiling. + +2001-08-03 Akim Demaille + + * configure.in: Bump to 1.28b. + +2001-08-03 Akim Demaille + + * src/complain.c: Adjust strerror_r portability issues. + +2001-08-03 Akim Demaille + + Version 1.28a. + +2001-08-03 Akim Demaille + + * src/getargs.c, src/getarg.h (skeleton)): Constify. + * src/lex.c (literalchar): Avoid name clashes on `buf'. + * src/getargs.c: Include complain.h. + * src/files.c, src/files.h (skeleton_find): Avoid name clashes. + * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1. + +2001-08-03 Akim Demaille + + * src/reader.c (readgram): Display hidden chars in error messages. + +2001-08-03 Akim Demaille + + Update to gettext 0.10.39. + +2001-08-03 Akim Demaille + + * lib/strspn.c: New. + +2001-08-01 Marc Autret + + * doc/bison.texinfo: Update. + * doc/bison.1 (mandoc): Update. + * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h. + * src/files.c: Support output files extensions computing. + (src_extension): New static variable. + (header_extension): New static variable. + (tr): New function. + (get_extension_index): New function, gets the index of an extension + filename in a string. + (compute_exts_from_gf): New function, computes extensions from the + grammar file extension. + (compute_exts_from_src): New functions, computes extensions from the + C source file extension, file given by ``-o'' option. + (compute_base_names): Update. + (output_files): Update. + +2001-08-01 Robert Anisko + + * doc/bison.texi: Document @$. + (Locations): New section. + +2001-07-18 Akim Demaille + + * Makefile.maint, GNUmakefile: New, from Autoconf 2.52. + * config/prev-version.txt, config/move-if-change: New. + * Makefile.am: Adjust. + +2001-07-08 Pascal Bart + + * src/bison.simple (yyparse): Suppress warning `comparaison + between signed and unsigned'. + +2001-07-05 Pascal Bart + + * src/getargs.h (raw_flag): Remove. + * src/getargs.c: Die on `-r'/`--raw'. + * src/lex.c (parse_percent_token): Die on `%raw'. + * src/reader.c (output_token_defines): Suppress call to `raw_flag'. + * tests/calc.at: Suppress test with option `--raw'. + +2001-07-14 Akim Demaille + + * config/: New. + * configure.in: Require Autoconf 2.50. + Update to gettext 0.10.38. + +2001-03-16 Akim Demaille + + * doc/bison.texinfo: ANSIfy the examples. + +2001-03-16 Akim Demaille + + * getargs.c (skeleton): New variable. + (longopts): --skeleton is a new option. + (shortopts, getargs): -S is a new option. + * getargs.h: Declare skeleton. + * output.c (output_parser): Use it. + +2001-03-16 Akim Demaille + + * m4/strerror_r.m4: New. + * m4/error.m4: Run AC_FUNC_STRERROR_R. + * lib/error.h, lib/error.c: Update. + +2001-03-16 Akim Demaille + + * src/getargs.c (longopts): Clean up. + +2001-02-21 Akim Demaille + + * src/reader.c (gensym): `gensym_count' is your own. + Use a static buf to create the symbol name, as token_buffer is no + longer a buffer. + +2001-02-08 Akim Demaille + + * src/conflicts.c (conflict_report): Be sure not to append to res + between two calls, which could happen if both first sprintf were + skipped, but not the first cp += strlen. + +2001-02-08 Akim Demaille + + * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c: + New, from fileutils 4.0.37. + * configure.in: Require Autoconf 2.49c. I took some time before + making this decision. This is the only way out for portability + issues in Bison, it would mean way too much duplicate effort to + import in Bison features implemented in 2.49c since 2.13. + AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above. + +2001-02-02 Akim Demaille + + * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37. + * lib/xalloc.h, lib/xmalloc.c: Update. + +2001-01-19 Akim Demaille + + Get rid of the ad hoc handling of token_buffer in the scanner: use + the obstacks. + + * src/lex.c (token_obstack): New. + (init_lex): Initialize it. No longer call... + (grow_token_buffer): this. Remove it. + Adjust all the places which used it to use the obstack. + +2001-01-19 Akim Demaille + + * src/lex.h: Rename all the tokens: + s/\bENDFILE\b/tok_eof/g; + s/\bIDENTIFIER\b/tok_identifier/g; + etc. + Let them be enums, not #define, to ease debugging. + Adjust all the code. + +2001-01-18 Akim Demaille + + * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private. + * src/lex.c (maxtoken, grow_token_buffer): Static. + +2001-01-18 Akim Demaille + + Since we now use obstacks, more % directives can be enabled. + + * src/lex.c (percent_table): Also accept `%yacc', + `%fixed_output_files', `%defines', `%no_parser', `%verbose', and + `%debug'. + Handle the actions for `%semantic_parser' and `%pure_parser' here, + instead of returning a token. + * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused. + * src/reader.c (read_declarations): Adjust. + * src/files.c (open_files): Don't call `compute_base_names', don't + compute `attrsfile' since they depend upon data which might be + *in* the input file now. + (output_files): Do it here. + * src/output.c (output_headers): Document the fact that this patch + introduces a guaranteed SEGV for semantic parsers. + * doc/bison.texinfo: Document them. + * tests/suite.at: Exercise these %options. + +2000-12-20 Akim Demaille + + Also handle the output file (--verbose) with obstacks. + + * files.c (foutput): Remove. + (output_obstack): New. + Adjust all dependencies. + * src/conflicts.c: Return a string. + * src/system.h (obstack_grow_string): Rename as... + (obstack_sgrow): this. Be ready to work with non literals. + (obstack_fgrow4): New. + +2000-12-20 Akim Demaille + + * src/files.c (open_files): Fix the computation of short_base_name + in the case of `-o foo.tab.c'. + +2000-12-20 Akim Demaille + + * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at) + (copy_dollar): Now that everything uses obstacks, get rid of the + FILE * parameters. + +2000-12-20 Akim Demaille + + * src/files.c (open_files): Actually the `.output' file is based + on the short_base_name, not base_name. + * tests/suite.at (Checking output file names): Adjust. + +2000-12-20 Akim Demaille + + * src/bison.s1: Remove, we now use directly... + * src/bison.simple: this. + * src/Makefile.am: Use pkgdata instead of data. + +2000-12-20 Akim Demaille + + * src/files.c (guard_obstack): New. + (open_files): Initialize it. + (output_files): Dump it... + * src/files.h: Export it. + * src/reader.c (copy_guard): Use it. + +2000-12-19 Akim Demaille + + * src/files.c (outfile, defsfile, actfile): Removed as global + vars. + (open_files): Don't compute them. + (output_files): Adjust. + (base_name, short_base_name): Be global. + Adjust dependencies. + +2000-12-19 Akim Demaille + + * src/files.c (strsuffix): New. + (stringappend): Be just like strcat but allocate. + (base_names): Eve out from open_files. + Try to simplify the rather hairy computation of base_name and + short_base_name. + (open_files): Use it. + * tests/suite.at (Checking output file names): New test. + +2000-12-19 Akim Demaille + + * src/system.h (obstack_grow_literal_string): Rename as... + (obstack_grow_string): this. + * src/output.c (output_parser): Recognize `%% actions' instead of + `$'. + * src/bison.s1: s/$/%% actions/. + * src/bison.hairy: Likewise. + +2000-12-19 Akim Demaille + + * src/output.c (output_parser): Compute the `#line' lines when + there are. + * src/Makefile.am (bison.simple): Be a simple copy of bison.s1. + Suggested by Hans Aberg. + +2000-12-19 Akim Demaille + + Let the handling of the skeleton files be local to the procedures + that use it. + + * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No + longer static. + (fparser, open_extra_files): Remove. + (open_files, output_files): Don't take care of fparser. + * src/files.h: Adjust. + * src/output.c (output_parser): Open and close the file to the + skeleton. + * src/reader.c (read_declarations): When %semantic_parser, open + fguard. + +2000-12-19 Akim Demaille + + * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here... + * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here. + +2000-12-19 Akim Demaille + + * src/files.c (open_files): Yipee! We no longer need all the code + looking for `/tmp' since we have no tmp file. + +2000-12-19 Akim Demaille + + * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C): + New macros. + * src/files.c (open_files): Less dependency on MSDOS etc. + +2000-12-14 Akim Demaille + + * src/bison.s1 (YYLLOC_DEFAULT): New macro. + Provide a default definition. + Use it when executing the default @ action. + * src/reader.c (reader_output_yylsp): No longer include + `timestamp' and `text' in the default YYLTYPE. + +2000-12-12 Akim Demaille + + * src/reader.c (copy_definition, parse_union_decl, copy_action) + (copy_guard): Quote the file names. + Reported by Laurent Mascherpa. + +2000-12-12 Akim Demaille + + * src/output.c (output_headers, output_program, output): Be sure + to escape special characters when outputting filenames. + (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove. + (output_headers): Don't depend on them, Use ACTSTR. + +2000-11-17 Akim Demaille + + * lib/obstack.h: Formatting changes. + (obstack_grow, obstack_grow0): Don't cast WHERE at all: it + prevents type checking. + (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't + cast the value to (void *): assigning a `foo *' to a `void *' + variable is valid. + (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int. + * src/reader.c (parse_union_decl): Typo: use obstack_1grow to + append characters. + +2000-11-17 Akim Demaille + + * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename + as... + (suite.m4, regression.m4, calc.m4): these. + * tests/atgeneral.m4: Update from CVS Autoconf. + +2000-11-17 Akim Demaille + + * tests/regression.m4 (%union and --defines): New test, + demonstrating a current bug in the obstack implementation. + +2000-11-17 Akim Demaille + + * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New + macros. + Use them to declare the variables which are global or local to + `yyparse'. + +2000-11-17 Akim Demaille + + * acconfig.h: Remove, no longer used. + +2000-11-07 Akim Demaille + + * src: s/Copyright (C)/Copyright/g. + +2000-11-07 Akim Demaille + + * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just + defining. + * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/. + +2000-11-07 Akim Demaille + + * src/bison.s1 (YYLEX): Use #if instead of #ifdef. + Merge in a single CPP if/else. + +2000-11-07 Akim Demaille + + * src/output.c (output): Remove useless variables. + * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second + argument `data' for consistency with the prototypes. + Qualify it `const'. + (obstack_copy, obstack_copy0): Rename the second argument as + `address' for consistency. Qualify it `const'. + * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow) + (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify + `const' their input argument (`data' or `address'). + Adjust the corresponding macros to include `const' in casts. + +2000-11-03 Akim Demaille + + * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/. + s/PFILE1/BISON_HAIRY/. + Adjust dependencies. + +2000-11-03 Akim Demaille + + For some reason, this was not applied. + + * src/files.c [VMS]: No longer include `ssdef.h', no longer define + `unlink': it's no longer used. + +2000-11-03 Akim Demaille + + * src/files.c (skeleton_find): New function, eved out of... + (open_files, open_extra_files): here. + +2000-11-03 Akim Demaille + + Don't use `atexit'. + + * src/files.c (obstack_save): New function. + (done): Rename as... + (output_files): this. + Use `obstack_save'. + * src/main.c (main): Don't use `atexit' to register `done', since + it no longer has to remove tmp files, just call `output_files' + when there are no errors. + +2000-11-02 Akim Demaille + + * src/files.c [VMS]: No longer include `ssdef.h', no longer define + `unlink': it's no longer used. + * src/files.h: Formatting changes. + +2000-11-02 Akim Demaille + + Remove the last uses of mktemp and unlink/delete. + + * src/files.c (fdefines, ftable): Removed. + (defines_ostack, table_obstack): New. + Adjust dependencies of the former into uses of the latter. + * src/output.c (output_short_or_char_table, output_short_table): + Convert to using obstacks. + * src/reader.c (copy_comment2): Accept one FILE * and two + obstacks. + (output_token_defines, reader_output_yylsp): Use obstacks. + * src/system.h (obstack_fgrow3): New. + * po/POTFILES.in: Adjust. + +2000-11-01 Akim Demaille + + Change each use of `fattrs' into a use of `attrs_obstack'. + + * src/reader.c (copy_at): Typo: s/yylloc/yyloc/. + * src/files.c (fattrs): Remove. + (attrs_obstack): New. + Adjust all dependencies. + (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile. + +2000-11-01 Akim Demaille + + Introduce obstacks. + Change each use of `faction' into a use of `action_obstack'. + + * lib/obstack.h, lib/obstack.c: New files. + * src/files.c (faction): Remove. + (action_obstack): New. + Adjust all dependencies. + +2000-10-20 Akim Demaille + + * lib/quote.h (PARAMS): New macro. Use it. + +2000-10-16 Akim Demaille + + * src/output.c (output_short_or_char_table): New function. + (output_short_table, output_token_translations): Use it. + (goto_actions): Use output_short_table. + +2000-10-16 Akim Demaille + + * src/symtab.c (bucket_new): New function. + (getsym): Use it. + + * src/output.c (output_short_table): New argument to display the + comment associated with the table. + Adjust dependencies. + (output_gram): Use it. + (output_rule_data): Nicer output layout for YYTNAME. + +2000-10-16 Akim Demaille + + * src/lex.c (read_typename): New function. + (lex): Use it. + * src/reader.c (copy_dollar): Likewise. + +2000-10-16 Akim Demaille + + * src/reader.c (copy_comment2): Expect the input stream to be on + the `/' which is suspected to open a comment, instead of being + called after `//' or `/*' was read. + (copy_comment, copy_definition, parse_union_decl, copy_action) + (copy_guard): Adjust. + +2000-10-16 Akim Demaille + + * src/reader.c (parse_expect_decl): Use `skip_white_space' and + `read_signed_integer'. + +2000-10-16 Akim Demaille + + * src/reader.c (copy_dollar): New function. + (copy_guard, copy_action): Use it. + +2000-10-16 Akim Demaille + + * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c: + * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4: + New files, from Fileutils 4.0.27. + * src/main.c (printable_version): Remove. + * src/lex.c, src/reader.c: Use `quote'. + +2000-10-04 Akim Demaille + + * lib/error.c, lib/error.h: New files, needed by xmalloc.c. + +2000-10-04 Akim Demaille + + * doc/bison.texinfo: Various typos spotted by Neil Booth. + +2000-10-04 Akim Demaille + + When a literal string is used to define two different tokens, + `bison -v' segfaults. + Reported by Piotr Gackiewicz, and fixed by Neil Booth. + + * tests/regression.m4: New file. + Include the core of the sample provided by Piotr Gackiewicz. + * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed + properly. + +2000-10-04 Akim Demaille + + * src/reader.c (parse_expect_decl): Keep `count' within the size + of `buffer'. + From Neil Booth. + +2000-10-02 Paul Eggert + + * bison.s1 (yyparse): Assign the default value + unconditionally, to avoid a GCC warning and make the parser a + tad smaller. + +2000-10-02 Akim Demaille + + * src/getargs.c (getargs): Don't dump `--help' on unrecognized + options. + +2000-10-02 Akim Demaille + + * src/derives.c, src/print.c, src/reduce.c: To ease the + translation, move some `\n' out of the translated strings. + +2000-10-02 Akim Demaille + + The location tracking mechanism is precious for parse error + messages. Nevertheless, it is enabled only when `@n' is used in + the grammar, which is a different issue (you can use it in error + message, but not in the grammar per se). Therefore, there should + be another means to enable it. + + * src/getargs.c (getargs): Support `--locations'. + (usage): Report it. + * src/getargs.h (locationsflag): Export it. + * src/lex.c (percent_table): Support `%locations'. + * src/reader.c (yylsp_needed): Remove this variable, now replaced + with `locationsflag'. + * doc/bison.texinfo: Document `--locations' and `%locations'. + Sort the options. + * tests/calc.m4: Test it. + + For regularity of the names, replace each + (nolineflag, toknumflag, rawtokenumflag, noparserflag): with... + (no_lineflag, token_tableflag, rawflag, no_parserflag): this. + In addition replace each `flag' with `_flag'. + +2000-10-02 Akim Demaille + + Also test parse error messages, including with YYERROR_VERBOSE. + + * tests/calc.m4 (calc.y): Add support for `exp = exp' (non + associative). + Use it to check the computations. + Use it to check `nonassoc' is honored. + (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed + `--yyerror-verbose'. + (_AT_CHECK_CALC): Adjust to this option. + (_AT_CHECK_CALC_ERROR): New macro to check parse error messages. + +2000-10-02 Akim Demaille + + Test also `--verbose', `--defines' and `--name-prefix'. Testing + the latter demonstrates a flaw in the handling of non debugging + parsers introduced by myself on 2000-03-16: `#define yydebug 0' + was used in order to simplify: + + #if YYDEBUG + if (yydebug) + { + ... + } + #endif + + into + + if (yydebug) + { + ... + } + + unfortunately this leads to a CPP conflict when + `--name-prefix=foo' is used since it produces `#define yydebug + foodebug'. + + * src/bison.s1 [!YYDEBUG]: Do not define yydebug. + (YYDPRINTF): New macro. + Spread its use. + * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from + the bison options. + Also test `--verbose', `--defines' and `--name-prefix'. + +2000-10-02 Akim Demaille + + Improve the readability of the produced parsers. + + * src/bison.s1: Formatting changes. + Improve the comment related to the `$' mark. + (yydefault): Don't fall through to `yyresume': `goto' there. + * src/output.c (output_parser): When the `$' is met, skip the end + of its line. + New variable, `number_of_dollar_signs', to check there's exactly + one `$' in the parser skeleton. + +2000-10-02 Akim Demaille + + * lib/xstrdup.c: New file, from the fileutils. + * src/reader.c (parse_token_decl, get_type_name, parse_type_decl) + (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup' + instead of strlen + xmalloc + strcpy. + * src/symtab.c (copys): Remove, use xstrdup instead. + +2000-10-02 Akim Demaille + + * src/gram.h (associativity): New enum type which replaces the + former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with + `right_assoc', `left_assoc' and `non_assoc'. + Adjust all dependencies. + * src/reader.c: Formatting changes. + (LTYPESTR): Don't define it, use it as a literal in + `reader_output_yylsp'. + * src/symtab.h (symbol_class): New enum type which replaces the + former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with + `sunknown', `stoken and `snterm'. + +2000-10-02 Akim Demaille + + * src/getargs.c (fixed_outfiles): Rename as... + (yaccflag): for consistency and accuracy. + Adjust dependencies. + +2000-10-02 Akim Demaille + + Use the more standard files `xalloc.h' and `xmalloc.c' instead of + Bison's `allocate.c' and `alloc.h'. This patch was surprisingly + difficult and introduced a lot of core dump. It turns out that + Bison used an implementation of `xmalloc' based on `calloc', and + at various places it does depend upon the initialization to 0. I + have not tried to isolate the pertinent places, and all the former + calls to Bison's `xmalloc' are now using `XCALLOC'. Someday, + someone should address this issue. + + * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove. + * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New + files. + Adjust dependencies. + * src/warshall.h: New file. + Propagate. + +2000-10-02 Akim Demaille + + Various anti-`extern in *.c' changes. + + * src/system.h: Include `assert.h'. + +2000-10-02 Akim Demaille + + * src/state.h (nstates, final_state, first_state, first_shift) + (first_reduction): Move their exportation from here... + * src/LR0.h: to here. + Adjust dependencies. + * src/getargs.c (statisticsflag): New variable. + Add support for `--statistics'. + Adjust dependencies. + + Remove a lot of now useless `extern' statements in most files. + +2000-10-02 Akim Demaille + + * src/LR0.h: New file. + Propagate its use. + +2000-10-02 Akim Demaille + + * src/print.h: New file. + Propagate its use. + * src/print.c: Formatting and ordering changes. + (verbose, terse): Replace with... + (print_results): this new function. + Adjust dependencies. + +2000-10-02 Akim Demaille + + * src/conflicts.c (conflict_report): New function. + (conflict_log, verbose_conflict_log): Replace with... + (print_conflicts): this function. + Adjust dependencies. + * src/conflicts.h: New file. + Propagate its inclusion. + +2000-10-02 Akim Demaille + + * src/nullable.h: New file. + Propagate its inclusion. + * src/nullable.c: Formatting changes. + +2000-10-02 Akim Demaille + + * src/reduce.h: New file. + Propagate its inclusion. + * src/reduce.c: Topological sort and other formatting changes. + (bool, TRUE, FALSE): Move their definition to... + * src/system.h: here. + +2000-10-02 Akim Demaille + + * src/files.c: Formatting changes. + (tryopen, tryclose, openfiles): Rename as... + (xfopen, xfclose, open_files): this. + (stringappend): static. + * src/files.h: Complete the list of exported symbols. + Propagate its use. + +2000-10-02 Akim Demaille + + * src/reader.h: New file. + Propagate its use instead of tedious list of `extern' and + prototypes. + * src/reader.c: Formatting changes, topological sort, + s/register//. + +2000-10-02 Akim Demaille + + * src/lex.h: Prototype `lex.c' exported functions. + * src/reader.c: Adjust. + * src/lex.c: Formatting changes. + (safegetc): Rename as... + (xgetc): this. + +2000-10-02 Akim Demaille + + * src/lalr.h: New file. + Propagate its inclusion instead of prototypes and `extern'. + * src/lalr.c: Formatting changes, topological sorting etc. + +2000-10-02 Akim Demaille + + * src/output.c (token_actions): Introduce a temporary array, + YYDEFACT, that makes it possible for this function to use + output_short_table. + +2000-10-02 Akim Demaille + + `user_toknums' is output as a `short[]' in `output.c', while it is + defined as a `int[]' in `reader.c'. For consistency with the + other output tables, `user_toknums' is now defined as a table of + shorts. + + * src/reader.c (user_toknums): Be a short table instead of an int + table. + Adjust dependencies. + + Factor the short table outputs. + + * src/output.c (output_short_table): New function. + * src/output.c (output_gram, output_stos, output_rule_data) + (output_base, output_table, output_check): Use it. + +2000-10-02 Akim Demaille + + * src/output.c (output): Topological sort of the functions, in + order to get rid of the `static' prototypes. + No longer use `register'. + * src/output.h: New file. + Propagate its inclusion in files explicitly prototyping functions + from output.c. + +2000-09-21 Akim Demaille + + * src/atgeneral.m4: Update from Autoconf. + +2000-09-21 Akim Demaille + + * src/closure.h: New file. + * src/closure.c: Formatting changes, topological sort over the + functions, use of closure.h. + (initialize_closure, finalize_closure): Rename as... + (new_closure, free_closure): these. Adjust dependencies. + * src/LR0.c: Formatting changes, topological sort, use of + cloture.h. + (initialize_states): Rename as... + (new_states): this. + * src/Makefile.am (noinst_HEADERS): Adjust. + +2000-09-20 Akim Demaille + + * src/acconfig.h: Don't protect config.h against multiple + inclusion. + Don't define PARAMS. + * src/system.h: Define PARAMS. + Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the + purpose of config.h. system.h must not try to fix wrong + definitions in config.h. + +2000-09-20 Akim Demaille + + * src/derives.h: New file. + * src/main.c, src/derives.h: Use it. + Formatting changes. + * src/Makefile.am (noinst_HEADERS): Adjust. + +2000-09-20 Akim Demaille + + * tests/atgeneral.m4: Update from Autoconf. + * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC) + (AT_CHECK_CALC): New macros. + Use these macros to test bison with options `', `--raw', + `--debug', `--yacc', `--yacc --debug'. + +2000-09-19 Akim Demaille + + * src/output.c: Formatting changes. + * src/machine.h: Remove, leaving its contents in... + * src/system.h: here. + Include stdio.h. + Adjust all dependencies on stdio.h and machine.h. + * src/getargs.h: New file. + Let all `extern' declarations about getargs.c be replaced with + inclusion of `getargs.h'. + * src/Makefile.am (noinst_HEADERS): Adjust. + + * tests/calc.m4 (yyin): Be initialized in main, not on the global + scope. + (yyerror): Returns void, not int. + * doc/bison.texinfo: Formatting changes. + +2000-09-19 Akim Demaille + + * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not + portable. + +2000-09-18 Akim Demaille + + * configure.in: Append WARNING_CFLAGS to CFLAGS. + * src/Makefile.am (INCLUDES): Don't. + Be ready to fetch headers in lib/. + +2000-09-18 Akim Demaille + + * doc/bison.texinfo: Update the copyright. + ANSIfy and GNUify the examples. + Remove the old menu. + +2000-09-18 Akim Demaille + + First set of tests: use the `calc' example from the documentation. + + * src/bison.s1 (yyparse): Condition the code using `yytname' which + is defined only when YYDEBUG is. + * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13. + * src/files.c (tryopen, tryclose): Formatting changes. + Move to the top and be static. + * src/reader.c (read_signed_integer): Likewise. + * tests/calc.m4: New file. + * Makefile.am, suite.m4: Adjust. + * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY. + +2000-09-18 Akim Demaille + + Add support for an Autotest test suite for Bison. + + * m4/m4.m4, m4/atconfig.m4: New files. + * m4/Makefile.am (EXTRA_DIST): Adjust. + * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New + files. + * src/getargs.c: Display a more standard --version message. + * src/reader.c (reader): Formatting changes. + No longer depend upon VERSION_STRING. + * configure.in: No longer use `dnl'. + Set up the test suite and the new directory `tests/. + (VERSION_STRING): Remove. + +2000-04-14 Akim Demaille + + * src/reader.c (copy_comment2): New function, same as former + `copy_comment', but outputs into two FILE *. + (copy_comment): Use it. + (parse_union_decl): Use it. + (get_type, parse_start_decl): Use the same `invalid' message. + (parse_start_decl, parse_union_decl): Use the same `multiple' + message. + (parse_union_decl, copy_guard, copy_action): Use the same + `unmatched' message. + * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'. + +2000-03-31 Akim Demaille + + * src/files.c (tryopen, tryclose): Move to the top. + Be static. + +2000-03-31 Akim Demaille + + * src/main.c (main): Don't call `done', exit does it. + +2000-03-31 Akim Demaille + + * allocate.c: s/return (foo)/return foo/. + * lalr.c: Likewise. + * LR0.c: Likewise. + * output.c: Likewise. + * reader.c: Likewise. + * symtab.c: Likewise. + * vmsgetargs.c: Likewise. + +2000-03-31 Akim Demaille + + Clean up the error reporting functions. + + * src/report.c: New file. + * src/report.h: Likewise. + * src/Makefile.am: Adjust. + * m4/error.m4: New file. + * m4/Makefile.am: Adjust. + * configure.in (jm_PREREQ_ERROR): Call it. + * src/main.c (int_to_string, banner, fatal_banner, warn_banner): + Remove. + (fatal, fatals): Remove. All callers use complain.c::fatal. + (warn, warni, warns, warnss, warnss): Remove. All callers use + complain.c::complain. + (toomany): Remove, use fatal instead. + * src/files.c (done): No argument, use complain_message_count. + * src/main.c (main): Register `done' to `atexit'. + + * src/getargs.c (usage): More `fputs', less `fprintf'. + +2000-03-28 Akim Demaille + + * lib/: New directory. + * Makefile.am (SUBDIRS): Adjust. + * configure.in: Adjust. + (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's + useless. + * src/alloca.c: Moved to lib/. + * src/getopt.c: Likewise. + * src/getopt1.c: Likewise. + * src/getopt.h: Likewise. + * src/ansi2knr.c: Likewise. + * src/ansi2knr.1: Likewise. + * src/Makefile.am: Adjust. + * lib/Makefile.am: New file. + +2000-03-28 Akim Demaille + + * src/getargs.c (usage): Refresh the help message. + +2000-03-17 Akim Demaille + + * src/getopt1.c: Updated from textutils 2.0e + * src/getopt.c: Likewise. + * src/getopt.h: Likewise. + +2000-03-17 Akim Demaille + + * src/Makefile.am (bison.simple): Fix the awk program: quote only + the file name, not the whole `#line LINE FILE'. + +2000-03-17 Akim Demaille + + On syntax errors, report the token on which we choked. + + * src/bison.s1 (yyparse): In the label yyerrlab, when + YYERROR_VERBOSE, add yychar in msg. + +2000-03-17 Akim Demaille + + * src/reader.c (copy_at): New function. + (copy_guard): Use it. + (copy_action): Use it. + +2000-03-17 Akim Demaille + + Be kind to translators, save some useless translations. + + * src/main.c (banner): New function. + (fatal_banner): Use it. + (warn_banner): Use it. + +2000-03-17 Akim Demaille + + * src/reader.c (copy_definition): Use copy_string and + copy_comment. Removed now unused `match', `ended', + `cplus_comment'. + (copy_comment, copy_string): Moved, to be visible from + copy_definition. + +2000-03-17 Akim Demaille + + * src/reader.c (copy_string): Declare `static inline'. No + problems with inline, since it is checked by configure. + (copy_comment): Likewise. + +2000-03-17 Akim Demaille + + * src/reader.c (packsymbols): Formatting changes. + +2000-03-17 Akim Demaille + + * src/reader.c (copy_comment): New function, factored out from: + (copy_action): Use it. Removed now unused `match', `ended', + `cplus_comment'. + (copy_guard): Likewise. + +2000-03-17 Akim Demaille + + * src/reader.c (copy_string): New function, factored out from: + (copy_action): Use it. + (copy_guard): Likewise. + +2000-03-17 Akim Demaille + + Change the handling of @s so that they behave exactly like $s. + There is now a pseudo variable @$ (readble and writable), location + of the lhs of the rule (by default ranging from the location of + the first symbol of the rhs, to the location of the last symbol, + or, if the rhs is empty, YYLLOC). + + * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of + yyval. + (yyparse): When providing a default semantic action, provide a + default location action. + (after the $): No longer change `*YYLSP', just stack YYLOC the + same way you stack YYVAL. + * src/reader.c (read_declarations): Use warns. + (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'. + (copy_action, case '@'): Likewise. + Use a standard error message, to save useless work from + translators. + +2000-03-17 Akim Demaille + + * src/bison.s1: Formatting and cosmetics changes. + * src/reader.c: Likewise. + Update the Copyright notice. + +2000-03-17 Akim Demaille + + * src/bison.s1 (#line): All set to `#line' only, since the + Makefile now handles them. + +2000-03-16 Akim Demaille + + * src/output.c (output_rule_data): Output the documentation of + some of the tables. + (Copyright notice): Update. + Formatting changes. + +2000-03-16 Akim Demaille + + * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to + remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough. + One `#if YYDEBUG' remains, since it uses variables which are + defined only if `YYDEBUG != 0'. + +2000-03-16 Akim Demaille + + * src/bison.s1 (yyparse): Reorganize the definitions of the stacks + and related variables so that the similarities are highlighted. + +2000-03-16 Akim Demaille + + * src/bison.s1: Properly indent CPP directives. + +2000-03-16 Akim Demaille + + * src/bison.s1: Properly indent the `alloca' CPP section. + +2000-03-16 Akim Demaille + + Do not hard code values of directories in `configure.in'. + Update the `configure' tool chain. + + * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by + src/makefile.am. + (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED. + (AC_OUTPUT): Add m4/Makefile. + Bump to bison 1.28a, 1.29 has never been released. + * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are + handled via src/Makefile.am. + (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS, + HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by + autoheader. + * Makefile.am (SUBDIRS): Add m4. + (ACLOCAL_AM_FLAGS): New variable. + (AUTOMAKE_OPTIONS): Add check-news. + * src/Makefile.am (bison.simple): Use awk to replace #line lines with + the proper line number and file name. + (DEFS): Propagate the location of bison library files and of the + locale files. + (INCLUDES): Added `-I ..' so that one can compile with srcdir != + builddir. + * acinclude.m4: Remove, replaced by the directory m4. + * m4/Makefile.am (EXTRA_DIST): New variable. + * m4/gettext.m4: New file, from the fileutils. + * m4/lcmessage.m4: Likewise + * m4/progtest.m4: Likewise. + * m4/bison-decl.m4: New file, extracted from former acinclude.m4. + +2000-03-10 Akim Demaille + + * src/closure.c: + Formatting changes of various comments. + Respect the GNU coding standards at various places. + Don't use `_()' when no translation is needed. + +1999-12-13 Jesse Thilo + + * src/files.c: + OS/2 honors TMPDIR environment variable. + +1999-12-13 Jesse Thilo + + * doc/bison.texinfo: Tweaked spelling and grammar. + Updated ISBN. + Removed reference to price of printed copy. + Mention BISON_SIMPLE and BISON_HAIRY. + +1999-12-13 Jesse Thilo + + * configure.in, NEWS: + Bison 1.29 released. + +1999-10-27 Jesse Thilo + + * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex: + Added reference card. + +1999-07-26 Jesse Thilo + + * po/ru.po: Added Russian translation. + +1999-07-26 Jesse Thilo + + * configure.in: Added Russian translation. + +1999-07-06 Jesse Thilo + + * configure.in, NEWS, README: + Released version 1.28. + +1999-06-14 Jesse Thilo + + * src/system.h: + Squashed redefinition warning on some systems. + + * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c: + Have configure build version string instead of relying on ANSI string + concatentation. + +1999-06-14 Jesse Thilo + + * po/POTFILES.in: Got rid of version.c. + +1999-06-14 Jesse Thilo + + * acconfig.h, configure.in: + Have configure build version string instead of relying on ANSI string + concatentation. + +1999-06-08 Jesse Thilo + + * doc/bison.1: + Dropped mention of `+' for long-named options. + +1999-05-30 Jesse Thilo + + * src/files.c: Added for unlink(). + + * src/Makefile.am, src/system.h: + I18n fixes. + +1999-05-30 Jesse Thilo + + * README: Added a FAQ list. + + * configure.in, acconfig.h: + I18n fixes. + +1999-05-30 Jesse Thilo + + * doc/FAQ, doc/Makefile.am: + Added a FAQ list. + +1999-05-19 Jesse Thilo + + * src/alloc.h, src/symtab.h, src/version.c: + Protected inclusion of "config.h" with HAVE_CONFIG_H. + +1999-04-18 Jesse Thilo + + * src/.cvsignore, src/Makefile.am: + Reorganized: sources in `src', documentation in `doc'. + + * src/lex.c (literalchar): + fixed the code for escaping double quotes (thanks + Jonathan Czisny.) + +1999-04-18 Jesse Thilo + + * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in: + Adjusted paths to reflect directory reorganization. + +1999-04-18 Jesse Thilo + + * doc/.cvsignore, doc/Makefile.am: + Reorganized: sources in `src', documentation in `doc'. + +1999-04-18 Jesse Thilo + + * configure.in: + Updated AC_INIT file to reflect directory reorganization. + + * configure.in, .cvsignore, Makefile.am, POTFILES.in: + Reorganized: sources in `src', documentation in `doc'. + +1999-04-13 Jesse Thilo + + * src/allocate.c: + Don't declare calloc() and realloc() if not necessary. + +1999-04-13 Jesse Thilo + + * configure.in, acconfig.h, acinclude.m4: + Don't declare calloc() and realloc() if not necessary. + +1999-03-23 Jesse Thilo + + * po/.cvsignore: Added i18n support. + +1999-03-23 Jesse Thilo + + * acconfig.h, configure.in, Makefile.am: + Added i18n support. + +1999-03-22 Jesse Thilo + + * src/bison.s1: Fixed #line numbers. + +1999-03-15 Jesse Thilo + + * po/es.po, po/fr.po, po/nl.po, po/de.po: + Added PO files from Translation Project. + +1999-03-03 Jesse Thilo + + * Makefile.am: + Added support for non-ANSI compilers (ansi2knr). + +1999-02-16 Jesse Thilo + + * configure.in: Bumped version number to 1.27. + + * Makefile.am: + Added `bison.simple' to list of files removed by `make distclean'. + +1999-02-12 Jesse Thilo + + * src/files.c, src/files.h: + Defined locations of parser files in config.h instead of Makefile. + +1999-02-12 Jesse Thilo + + * acconfig.h, acinclude.m4, configure.in, Makefile.am: + Defined locations of parser files in config.h instead of Makefile. + +1999-02-09 Jesse Thilo + + * Makefile.am: + Removed inappropriate use of $< macro. + +1999-02-05 Jesse Thilo + + * po/Makefile.in.in, po/POTFILES.in: + Add `po' directory skeleton. + +1999-01-27 Jesse Thilo + + * README: Document help-bison list. + + * configure.in: Add check for mkstemp(). + +1999-01-20 Jesse Thilo + + * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c: + Hush a few compiler warnings. + + * src/files.c: + Add tryclose(), which verifies that fclose was successful. + Hush a couple of compiler warnings. + +1999-01-20 Jesse Thilo + + * Makefile.am, OChangeLog: + ChangeLog is now automatically generated. Include the old version as + OChangeLog. + +1999-01-14 Jesse Thilo + + * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c: + Update FSF address. + +1999-01-14 Jesse Thilo + + * doc/bison.texinfo: Fix formatting glitch. + + * doc/bison.texinfo: Update FSF address. + +1999-01-14 Jesse Thilo + + * acconfig.h: Update FSF address. + +1999-01-08 Jesse Thilo + + * src/system.h: + Don't define PACKAGE here, since config.h defines it. + +1998-12-30 Jesse Thilo + + * src/reader.c: Update copyright date. + + * src/main.c: + Ditch sprintf to statically-sized buffers in fatal/warn functions in + favor of output directly to stderr (avoids buffer overruns). + + * src/reader.c: Some checks for premature EOF. + + * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c: + Use prototypes if the compiler understands them. + + * src/files.c: Honor TMPDIR on Unix hosts. + Use prototypes if the compiler understands them. + + * src/reader.c: + Fix a couple of buffer overrun bugs. + Use prototypes if the compiler understands them. + + * src/system.h: Include unistd.h and ctype.h. + Use #ifdef instead of #if for NLS symbols. + +1998-12-30 Jesse Thilo + + * doc/bison.texinfo: + Delete comment "consider using @set for edition number, etc..." since + we now are doing so. + +1998-12-30 Jesse Thilo + + * configure.in: + Use prototypes if the compiler understands them. + + * NEWS: Document 1.26 highlights. + + * Makefile.am: Require Automake 1.3 or later. + + * acconfig.h: + Use prototypes if the compiler understands them. + +1998-12-29 Jesse Thilo + + * src/version.c: + Use VERSION symbol from automake for version number. + +1998-12-29 Jesse Thilo + + * acconfig.h, configure.in, version.cin: + Use VERSION symbol from automake for version number. + +1998-11-28 Jesse Thilo + + * Makefile.am: + Distribute original version of simple parser (bison.s1), not built + version (bison.simple). + +1998-11-28 Jesse Thilo + + * doc/bison.texinfo: Add info dir entry. + + * doc/bison.texinfo: + Let automake put version number into documentation. + +1998-11-26 Jesse Thilo + + * src/bison.cld, src/build.com, src/vmshlp.mar: + Add non-RCS files from /gd/gnu/bison. + +1998-11-26 Jesse Thilo + + * doc/bison.1: + Document the BISON_HAIRY and BISON_SIMPLE variables. + +1998-11-25 Jesse Thilo + + * src/version.c: Build version.c automatically. + + * src/reader.c: + Fix token numbering (used to start at 258, not 257). + + * src/system.h: Include config.h. + + * src/getargs.c: Update bug report address. + + * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h: + Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org. + +1998-11-25 Jesse Thilo + + * Makefile.am: + Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1). + + * configure.in, version.cin: + Build version.c automatically. + + * AUTHORS: Add AUTHORS file. + + * README: Update bug report address. + + * bison.simple: + Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1). + + * configure.in, Makefile.am, Makefile.in, stamp-h.in: + Add automake stuff. + +1998-11-25 Jesse Thilo + + * doc/bison.texinfo: Clean up some formatting. + +1998-05-05 Richard Stallman + + * doc/bison.texinfo: + Explain better why to make a pure parser. + +1998-01-05 Richard Stallman + + * src/files.c (openfiles): + [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to + find a temporary directory, if possible. Do not unlink files while + they are open. + +1997-08-25 Richard Stallman + + * src/reader.c (stack_offset;): + Change some warni to warns. + + * src/lex.c (literalchar): Use warns, not warni. + +1997-06-28 Richard Stallman + + * src/bison.s1: Add a Bison version comment. + + * src/main.c (fatal, warn, berror): + Use program_name. + +1997-06-28 Richard Stallman + + * Makefile.in (bison_version): New variable. + (dist): Use that variable. + (bison.s1): Substitute the Bison version into bison.simple. + + * bison.simple: Add a Bison version comment. + +1997-06-18 Richard Stallman + + * src/main.c (fatal, warn, berror): + Make error messages standard. + (toomany): Improve error message text. + + * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c: + new.h renamed to alloc.h. + +1997-06-18 Richard Stallman + + * Makefile.in: new.h renamed to alloc.h. + +1997-05-24 Richard Stallman + + * src/lex.c (literalchar): + Fix the code for escaping \, " and '. + + (lex): Avoid trouble when there are many chars + to discard in a char literal with just several chars in it. + +1997-05-17 Richard Stallman + + * src/bison.s1: + Use malloc, if using alloca is troublesome. + (YYSTACK_USE_ALLOCA): New flag macro. + Define it for some systems and compilers. + (YYSTACK_ALLOC): New macro. + (yyparse): Use YYSTACK_ALLOC to allocate stack. + If it was malloc'd, free it. + +1997-05-17 Richard Stallman + + * bison.simple: + Use malloc, if using alloca is troublesome. + (YYSTACK_USE_ALLOCA): New flag macro. + Define it for some systems and compilers. + (YYSTACK_ALLOC): New macro. + (yyparse): Use YYSTACK_ALLOC to allocate stack. + If it was malloc'd, free it. + +1997-04-23 Richard Stallman + + * src/bison.s1: + (alloca) [__hpux]: Always define as __builtin_alloca. + +1997-04-23 Richard Stallman + + * bison.simple: + (alloca) [__hpux]: Always define as __builtin_alloca. + +1997-04-22 Richard Stallman + + * src/bison.s1: + [__hpux]: Include alloca.h (right for HPUX 10) + instead of declaring alloca (right for HPUX 9). + + * src/bison.s1 (__yy_memcpy): + Declare arg `count' as unsigned int. + (yyparse): Cast third arg to __yy_memcpy to unsigned int. + +1997-04-22 Richard Stallman + + * bison.simple: + [__hpux]: Include alloca.h (right for HPUX 10) + instead of declaring alloca (right for HPUX 9). + + * bison.simple (__yy_memcpy): + Declare arg `count' as unsigned int. + (yyparse): Cast third arg to __yy_memcpy to unsigned int. + +1997-01-03 Richard Stallman + + * src/allocate.c: [__STDC__ or _MSC_VER]: + Declare calloc and realloc to return void *. + +1997-01-02 Richard Stallman + + * src/system.h: + [_MSC_VER]: Include stdlib.h and process.h. + [_MSC_VER] (getpid): Define as macro--translate it to _getpid. + + * src/main.c (main): Return FAILURE as a value. + (printable_version): Declare arg as int, not char. + +1997-01-02 Richard Stallman + + * Makefile.in (dist): + Explicitly check for symlinks, and copy them. + +1996-12-19 Richard Stallman + + * src/files.c: + [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined. + +1996-12-18 Paul Eggert + + * src/bison.s1 (yyparse): + If __GNUC__ and YYPARSE_PARAM are both defined, + declare yyparse to have a void * argument. + +1996-12-18 Paul Eggert + + * bison.simple (yyparse): + If __GNUC__ and YYPARSE_PARAM are both defined, + declare yyparse to have a void * argument. + +1996-12-17 Richard Stallman + + * src/reduce.c (nbits): Add some casts. + +1996-08-12 Richard Stallman + + * src/bison.s1: Test _MSDOS as well as _MSDOS_. + +1996-08-12 Richard Stallman + + * bison.simple: Test _MSDOS as well as _MSDOS_. + +1996-07-31 Richard Stallman + + * src/bison.s1: + [__sun && __i386]: Include alloca.h. + +1996-07-31 Richard Stallman + + * bison.simple: + [__sun && __i386]: Include alloca.h. + +1996-07-30 Richard Stallman + + * src/bison.s1: Comment change. + + * src/bison.s1: Test _MSDOS_, not MSDOS. + +1996-07-30 Richard Stallman + + * bison.simple: Comment change. + + * bison.simple: Test _MSDOS_, not MSDOS. + +1996-06-01 Richard Stallman + + * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c: + Insert `_' macro around many string constants. + + * src/main.c: + Insert `_' macro around many string constants. + + (main): Call setlocale, bindtextdomain and textdomain. + + * src/system.h: [HAVE_LOCALE_H]: Include locale.h. + [! HAVE_LOCALE_H] (setlocale): Define as no-op. + [ENABLE_NLS]: Include libintl.h. + [ENABLE_NLS] (gettext): Define. + [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions. + (N_, PACKAGE, LOCALEDIR): New macros. + +1996-06-01 Richard Stallman + + * POTFILES.in: New file. + + * Makefile.in (allocate.o): + Define target explicitly. + + * Makefile.in (CFLAGS): Set to @CFLAGS@. + (LDFLAGS): Set to @LDFLAGS@. + (configure): Run autoconf only if preceding `cd' succeeds. + (bison.s1): Redirect output to temporary file then move the + temporary to the target, rather than redirecting directly to bison.s1. + (clean): Remove config.status and config.log. + (distclean): Don't remove config.status here. + +1996-05-12 Richard Stallman + + * src/bison.s1: + (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t. + +1996-05-12 Richard Stallman + + * bison.simple: + (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t. + +1996-05-11 Richard Stallman + + * src/bison.s1 (__yy_memcpy): + Really reorder the args, as was supposedly done on Feb 14 1995. + (yyparse): Calls changed accordingly. + +1996-05-11 Richard Stallman + + * Makefile.in (dist): Don't use $(srcdir). + + * bison.simple (__yy_memcpy): + Really reorder the args, as was supposedly done on Feb 14 1995. + (yyparse): Calls changed accordingly. + +1996-01-27 Richard Stallman + + * src/output.c (output_rule_data): + Test YYERROR_VERBOSE in the conditional + around the definition of ttyname. + +1995-12-29 Richard Stallman + + * src/bison.s1: + Fix line numbers in #line commands. + +1995-12-29 Richard Stallman + + * bison.simple: + Fix line numbers in #line commands. + +1995-12-27 Richard Stallman + + * src/bison.s1 (YYPARSE_PARAM_DECL): + In C++, make it always null. + (YYPARSE_PARAM_ARG): New macro. + (yyparse): Use YYPARSE_PARAM_ARG. + +1995-12-27 Richard Stallman + + * bison.simple (YYPARSE_PARAM_DECL): + In C++, make it always null. + (YYPARSE_PARAM_ARG): New macro. + (yyparse): Use YYPARSE_PARAM_ARG. + +1995-11-29 Richard Stallman + + * doc/bison.texinfo: + Describe literal string tokens, %raw, %no_lines, %token_table. + +1995-11-29 Daniel Hagerty + + * doc/bison.texinfo: Fixed update date + +1995-10-16 Richard Stallman + + * src/version.c: Version 1.25. + +1995-10-16 Richard Stallman + + * NEWS: *** empty log message *** + +1995-10-16 Richard Stallman + + * doc/bison.1, doc/bison.rnh: + Add new options. + +1995-10-15 Richard Stallman + + * src/vmsgetargs.c, src/getargs.c: + Added -n, -k, and -raw switches. + (noparserflag, toknumflag, rawtoknumflag): New variables. + + * src/symtab.h (SALIAS): + New #define for adding aliases to %token. + (struct bucket): Added `alias' field. + + * src/reduce.c (reduce_grammar): + Revise error message. + (print_notices): Remove final `.' from error message. + + * src/reader.c (reader_output_yylsp): + New function. + (readgram): Use `#if 0' around code that accepted %command + inside grammar rules: The documentation doesn't allow it, + and it will fail since the %command processors scan for the next %. + (parse_token_decl): Extended the %token + declaration to allow a multi-character symbol as an alias. + (parse_thong_decl): New function. + (read_declarations): Added %thong declarations. + (read_declarations): Handle NOOP to deal with allowing + % declarations as another means to specify the flags. + (readgram): Allow %prec prior to semantics embedded in a rule. + (skip_to_char, read_declarations, copy_definition) + (parse_token_decl, parse_start_decl, parse_type_decl) + (parse_assoc_decl, parse_union_decl, parse_expect_decl) + (get_type_name, copy_guard, copy_action, readgram) + (get_type, packsymbols): Revised most error messages. + Changed `fatal' to `warnxxx' to avoid aborting for error. + Revised and use multiple warnxxx functions to avoid using VARARGS1. + (read_declarations): Improve the error message for + an invalid character. Do not abort. + (read_declarations, copy_guard, copy_action): Use + printable_version to avoid unprintable characters in printed output. + (parse_expect_decl): Error if argument to %expect exceeds 10 digits. + (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type): + Allow the type of a non-terminal can be given + more than once, as long as all specifications give the same type. + + * src/output.c: + (output_headers, output_trailers, output, output_gram) + (output_rule_data): Implement noparserflag variable. + Implement toknumflag variable. + (output): Call reader_output_yylsp to output LTYPESTR. + + * src/main.c (main): + If reader sees an error, don't process the grammar. + (fatals): Updated to not use VARARGS1. + (printable_version, int_to_string, warn, warni, warns, warnss) + (warnsss): New error reporting functions. Avoid abort for error. + + * src/lex.h: + Added THONG and NOOP for alias processing. + Added SETOPT for the new code that allows setting options with %flags. + + * src/lex.c: + Include getopt.h. Add some extern decls. + (safegetc): New function to deal with EOF gracefully. + (literalchar); new function to deal with reading \ escapes. + (lex): Use literalchar. + (lex): Implemented "..." tokens. + (literalchar, lex, parse_percent_token): Made tokenbuffer + always contain the token. This includes growing the token + buffer while reading an integer. + (parse_percent_token): Replaced if-else statement with percent_table. + (parse_percent_token): Added % declarations as another + way to specify the flags -n, -l, and -r. Also added hooks for + -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires + major changes to files.c. + (lex) Retain in the incoming stream a character following + an incorrect '/'. + (skip_white_space, lex): Revised most error messages + and changed fatal to warn to avoid aborting. + (percent_table): Added %thong declarations. + + * src/gram.h: Comment changes. + + * src/files.c (openfiles, open_extra_files, done): + Add faction flag + and actfile file. Handle noparserflag. Both for -n switch. + + * src/conflicts.c (resolve_sr_conflict): + Remove use of alloca. + +1995-06-01 Jim Meyering + + * doc/bison.texinfo: *** empty log message *** + +1995-05-06 Richard Stallman + + * src/bison.s1: Comment change. + +1995-05-06 Richard Stallman + + * bison.simple: Comment change. + +1995-05-03 Richard Stallman + + * src/version.c: Version now 1.24. + + * src/bison.s1: Change distribution terms. + + * src/version.c: Version now 1.23. + +1995-05-03 Richard Stallman + + * doc/bison.texinfo: + Rewrite "Conditions for Using Bison". + Update version to 1.24. + +1995-05-03 Richard Stallman + + * bison.simple: Change distribution terms. + +1995-02-23 Richard Stallman + + * src/files.c: Test __VMS_POSIX as well as VMS. + +1995-02-14 Jim Meyering + + * src/bison.s1 (__yy_memcpy): + Renamed from __yy_bcopy to avoid + confusion. Reverse FROM and TO arguments to be consistent with + those of memcpy. + +1995-02-14 Jim Meyering + + * bison.simple (__yy_memcpy): + Renamed from __yy_bcopy to avoid + confusion. Reverse FROM and TO arguments to be consistent with + those of memcpy. + +1994-11-10 David J. MacKenzie + + * NEWS: reformat + + * NEWS: New file. + + * Makefile.in (DISTFILES): Include NEWS. + + * Makefile.in (DISTFILES): + Include install-sh, not install.sh. + + * configure.in: Update to Autoconf v2 macro names. + +1994-10-05 David J. MacKenzie + + * Makefile.in: fix typo + + * Makefile.in (prefix, exec_prefix): + Let configure set them. + +1994-09-28 David J. MacKenzie + + * Makefile.in: Set datadir to $(prefix)/share. + +1994-09-15 Richard Stallman + + * src/bison.s1: + Update copyright notice and GPL version. + +1994-09-15 Richard Stallman + + * bison.simple: + Update copyright notice and GPL version. + +1994-07-12 Richard Stallman + + * src/reduce.c, src/reader.c: + entered into RCS + +1994-05-05 David J. MacKenzie + + * Makefile.in: entered into RCS + +1994-03-26 Richard Stallman + + * src/bison.s1: entered into RCS + +1994-03-26 Richard Stallman + + * bison.simple: entered into RCS + +1994-03-25 Richard Stallman + + * src/main.c: entered into RCS + +1994-03-24 Richard Stallman + + * src/conflicts.c: entered into RCS + +1994-01-02 Richard Stallman + + * Makefile.in: *** empty log message *** + +1993-11-21 Richard Stallman + + * src/bison.s1: *** empty log message *** + +1993-11-21 Richard Stallman + + * doc/bison.texinfo: entered into RCS + + * doc/bison.texinfo: *** empty log message *** + +1993-11-21 Richard Stallman + + * bison.simple: *** empty log message *** + +1993-10-25 David J. MacKenzie + + * doc/bison.texinfo: *** empty log message *** + +1993-10-19 Richard Stallman + + * src/bison.s1: *** empty log message *** + +1993-10-19 Richard Stallman + + * bison.simple: *** empty log message *** + +1993-10-14 Richard Stallman + + * src/bison.s1: *** empty log message *** + +1993-10-14 Richard Stallman + + * bison.simple: *** empty log message *** + +1993-09-14 David J. MacKenzie + + * doc/bison.texinfo: *** empty log message *** + +1993-09-13 Noah Friedman + + * Makefile.in: *** empty log message *** + +1993-09-10 Richard Stallman + + * src/conflicts.c: *** empty log message *** + + * src/system.h: entered into RCS + +1993-09-10 Richard Stallman + + * doc/bison.1: entered into RCS + +1993-09-06 Noah Friedman + + * src/version.c: entered into RCS + +1993-09-06 Noah Friedman + + * Makefile.in: *** empty log message *** + +1993-07-30 David J. MacKenzie + + * Makefile.in: *** empty log message *** + +1993-07-24 Richard Stallman + + * src/bison.s1: *** empty log message *** + +1993-07-24 Richard Stallman + + * bison.simple: *** empty log message *** + +1993-07-08 David J. MacKenzie + + * Makefile.in: *** empty log message *** + +1993-07-04 Richard Stallman + + * src/bison.s1: *** empty log message *** + +1993-07-04 Richard Stallman + + * bison.simple: *** empty log message *** + +1993-06-26 David J. MacKenzie + + * src/getargs.c: entered into RCS + +1993-06-26 David J. MacKenzie + + * doc/bison.texinfo: *** empty log message *** + + * doc/bison.1: New file. + +1993-06-25 Richard Stallman + + * src/getargs.c: New file. + +1993-06-16 Richard Stallman + + * src/bison.s1: *** empty log message *** + +1993-06-16 Richard Stallman + + * bison.simple: *** empty log message *** + +1993-06-03 Richard Stallman + + * src/bison.s1: New file. + +1993-06-03 Richard Stallman + + * doc/bison.texinfo: *** empty log message *** + +1993-06-03 Richard Stallman + + * bison.simple: New file. + +1993-05-19 Richard Stallman + + * doc/bison.texinfo: New file. + +1993-05-07 Noah Friedman + + * Makefile.in: *** empty log message *** + +1993-04-28 Noah Friedman + + * src/reader.c: *** empty log message *** + +1993-04-23 Noah Friedman + + * src/alloc.h: entered into RCS + +1993-04-20 David J. MacKenzie + + * src/version.c: *** empty log message *** + + * src/files.c, src/allocate.c: + entered into RCS + + * src/reader.c: *** empty log message *** + + * src/lex.c: entered into RCS + + * src/conflicts.c: New file. + + * src/symtab.c: entered into RCS + + * src/alloc.h: New file. + + * src/LR0.c: entered into RCS + +1993-04-18 Noah Friedman + + * src/reader.c: New file. + + * src/version.c: *** empty log message *** + +1993-04-18 Noah Friedman + + * Makefile.in: *** empty log message *** + +1993-04-17 Noah Friedman + + * Makefile.in: *** empty log message *** + +1993-04-15 Richard Stallman + + * src/main.c, src/files.c: + New file. + +1993-04-15 Noah Friedman + + * configure.in: entered into RCS + + * configure.in: *** empty log message *** + + * configure.in: New file. + +1993-04-14 Richard Stallman + + * Makefile.in: New file. + +1993-04-13 Richard Stallman + + * src/version.c: New file. + +1993-03-25 Richard Stallman + + * src/output.c: entered into RCS + +1992-09-25 Richard Stallman + + * configure.bat: entered into RCS + +1992-06-22 Richard Stallman + + * src/vmsgetargs.c: entered into RCS + +1992-06-22 Richard Stallman + + * doc/bison.rnh: entered into RCS + +1992-04-20 David J. MacKenzie + + * README: entered into RCS + +1992-01-22 Richard Stallman + + * src/machine.h: entered into RCS + +1991-12-21 Richard Stallman + + * src/lalr.c, src/closure.c: + entered into RCS + +1991-12-20 Richard Stallman + + * src/state.h: entered into RCS + +1991-12-18 Richard Stallman + + * src/print.c, src/nullable.c, src/derives.c: + entered into RCS + +1991-11-03 David J. MacKenzie + + * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h: + entered into RCS + +1988-09-09 Richard Stallman + + * src/bison.hairy: entered into RCS + +1987-12-16 Richard Stallman + + * REFERENCES: entered into RCS + + + ----- + + Copyright (C) 1987-1988, 1991-2015 Free Software Foundation, + Inc. + + Copying and distribution of this file, with or without + modification, are permitted provided the copyright notice and this + notice are preserved. diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..6617eec --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,127 @@ +# Having a separate GNUmakefile lets me 'include' the dynamically +# generated rules created via cfg.mk (package-local configuration) +# as well as maint.mk (generic maintainer rules). +# This makefile is used only if you run GNU Make. +# It is necessary if you want to build targets usually of interest +# only to the maintainer. + +# Copyright (C) 2001, 2003, 2006-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# If the user runs GNU make but has not yet run ./configure, +# give them a diagnostic. +_gl-Makefile := $(wildcard [M]akefile) +ifneq ($(_gl-Makefile),) + +# Make tar archive easier to reproduce. +export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner + +# Allow the user to add to this in the Makefile. +ALL_RECURSIVE_TARGETS = + +include Makefile + +# Some projects override e.g., _autoreconf here. +-include $(srcdir)/cfg.mk + +# Allow cfg.mk to override these. +_build-aux ?= build-aux +_autoreconf ?= autoreconf -v + +include $(srcdir)/maint.mk + +# Ensure that $(VERSION) is up to date for dist-related targets, but not +# for others: rerunning autoreconf and recompiling everything isn't cheap. +_have-git-version-gen := \ + $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes) +ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL)) + _is-dist-target ?= $(filter-out %clean, \ + $(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS))) + _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS))) + ifneq (,$(_is-dist-target)$(_is-install-target)) + _curr-ver := $(shell cd $(srcdir) \ + && $(_build-aux)/git-version-gen \ + .tarball-version \ + $(git-version-gen-tag-sed-script)) + ifneq ($(_curr-ver),$(VERSION)) + ifeq ($(_curr-ver),UNKNOWN) + $(info WARNING: unable to verify if $(VERSION) is the correct version) + else + ifneq (,$(_is-install-target)) + # GNU Coding Standards state that 'make install' should not cause + # recompilation after 'make all'. But as long as changing the version + # string alters config.h, the cost of having 'make all' always have an + # up-to-date version is prohibitive. So, as a compromise, we merely + # warn when installing a version string that is out of date; the user + # should run 'autoreconf' (or something like 'make distcheck') to + # fix the version, 'make all' to propagate it, then 'make install'. + $(info WARNING: version string $(VERSION) is out of date;) + $(info run '$(MAKE) _version' to fix it) + else + $(info INFO: running autoreconf for new version string: $(_curr-ver)) +GNUmakefile: _version + touch GNUmakefile + endif + endif + endif + endif +endif + +.PHONY: _version +_version: + cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf) + $(MAKE) $(AM_MAKEFLAGS) Makefile + +else + +.DEFAULT_GOAL := abort-due-to-no-makefile +srcdir = . + +# The package can override .DEFAULT_GOAL to run actions like autoreconf. +-include ./cfg.mk + +# Allow cfg.mk to override these. +_build-aux ?= build-aux +_autoreconf ?= autoreconf -v + +include ./maint.mk + +ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile) +$(MAKECMDGOALS): abort-due-to-no-makefile +endif + +abort-due-to-no-makefile: + @echo There seems to be no Makefile in this directory. 1>&2 + @echo "You must run ./configure before running 'make'." 1>&2 + @exit 1 + +endif + +# Tell version 3.79 and up of GNU make to not build goals in this +# directory in parallel, in case someone tries to build multiple +# targets, and one of them can cause a recursive target to be invoked. + +# Only set this if Automake doesn't provide it. +AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) \ + dist distcheck tags ctags + +ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS) + +ifneq ($(word 2, $(MAKECMDGOALS)), ) +ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), ) +.NOTPARALLEL: +endif +endif diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..dadea5c --- /dev/null +++ b/INSTALL @@ -0,0 +1,368 @@ +Installation Instructions +************************* + + Copyright (C) 1994-1996, 1999-2002, 2004-2015 Free Software +Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command './configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the 'README' file for +instructions specific to this package. Some packages provide this +'INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The 'configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that +you can run in the future to recreate the current configuration, and a +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). + + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. + + If you need to do unusual things to compile the package, please try +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can +be considered for the next release. If you are using the cache, and at +some point 'config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. + + The simplest way to compile this package is: + + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. + + Running 'configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type 'make' to compile the package. + + 3. Optionally, type 'make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type 'make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the 'make install' phase executed with root + privileges. + + 5. Optionally, type 'make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior 'make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type 'make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide 'make + distcheck', which can by used by developers to test that all other + targets like 'make install' and 'make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the 'configure' script does not know about. Run './configure --help' +for details on some of the pertinent environment variables. + + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU 'make'. 'cd' to the +directory where you want the object files and executables to go and run +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. + + With a non-GNU 'make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use 'make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the 'lipo' tool if you have problems. + +Installation Names +================== + + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to 'configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +'make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, 'make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the +package recognizes. + + For packages that use the X Window System, 'configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of 'make' will be. For these packages, running './configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with 'make V=1'; while running './configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with 'make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX 'make' updates targets which have the same time stamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. + + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features 'configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, 'configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option '--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with '--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to 'configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the 'configure' command line, using 'VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified 'gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +'configure' Invocation +====================== + + 'configure' recognizes the following options to control how it +operates. + +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. + +'--help=short' +'--help=recursive' + Print a summary of the options unique to this package's + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' + script, and exit. + +'--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally 'config.cache'. FILE defaults to '/dev/null' to + disable caching. + +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to '/dev/null' (any error + messages will still be shown). + +'--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + 'configure' can determine that directory automatically. + +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. + +'--no-create' +'-n' + Run the configure checks, but stop before creating any output + files. + +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..b6135cb --- /dev/null +++ b/Makefile.am @@ -0,0 +1,104 @@ +## Process this file with automake to produce Makefile.in. + +# Copyright (C) 2001-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +AUTOMAKE_OPTIONS = subdir-objects +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = po runtime-po . + +# Files installed for use by Automake. +aclocaldir = @aclocaldir@ +aclocal_DATA = m4/bison-i18n.m4 + +EXTRA_DIST = .prev-version .version cfg.mk PACKAGING \ + ChangeLog-1998 ChangeLog-2012 ChangeLog + +dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO + +## Running the bison from this tarball. To generate our own parser, +## but also to run the tests. Of course, you ought to keep a sane +## version of Bison nearby... +BISON = $(top_builddir)/tests/bison +BISON_IN = $(top_srcdir)/tests/bison.in +YACC = $(BISON) -o y.tab.c +AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all + +# Initialization before completion by local.mk's. +AM_CFLAGS = $(WARN_CFLAGS) +# Find builddir/src/scan-code.c etc. For some reason "-I./lib" +# instead of "-Ilib" avoids infinite recursions on #include_next. +AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib +BUILT_SOURCES = +CLEANFILES = +DISTCLEANFILES = +EXTRA_DIST += $(dist_TESTS) +MOSTLYCLEANDIRS = +MOSTLYCLEANFILES = +SUFFIXES = +TESTS = $(dist_TESTS) +check_PROGRAMS = +dist_TESTS = +noinst_LIBRARIES = + +include build-aux/local.mk +include data/local.mk +include djgpp/local.mk +include doc/local.mk +include etc/local.mk +include examples/local.mk +include lib/local.mk +include src/local.mk +include tests/local.mk + +# See comments in build-aux/git-version-gen. However, we make .version depend +# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the +# working copy (for example, when you run autoreconf && make). Allowing these +# to fall out of sync appears to have little potential to improve Bison build +# efficiency (even if we were to replace VERSION/PACKAGE_VERSION with .version +# everywhere possible). On the other hand, it could be harmful. For example, +# a developer might naively reference .version in a test case while the bison +# executable still compiles with VERSION, and so the test case might fail or +# pass incorrectly. +BUILT_SOURCES += $(top_srcdir)/.version +$(top_srcdir)/.version: configure + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: gen-ChangeLog + echo $(VERSION) > $(distdir)/.tarball-version + +.PHONY: update-b4-copyright update-package-copyright-year +update-b4-copyright: + $(AM_V_GEN)find $(srcdir)/data -type f \ + | xargs $(srcdir)/build-aux/$@ + @echo 'warning: src/parse-gram.[hc] may need to be regenerated.' +update-package-copyright-year: + $(AM_V_GEN)$(srcdir)/build-aux/$@ $(srcdir)/configure.ac + +gen_start_date = 2012-01-16 +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ + cl=$(distdir)/ChangeLog && \ + rm -f $$cl.tmp && \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + --strip-tab \ + --strip-cherry-pick \ + --no-cluster \ + --amend=$(srcdir)/build-aux/git-log-fix \ + --srcdir=$(srcdir) \ + --since=$(gen_start_date) > $$cl.tmp && \ + mv -f $$cl.tmp $$cl; \ + fi diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..73f6b75 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,6910 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Copyright (C) 2001-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2000-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2005, 2008-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2005-2006, 2008-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2005-2006, 2008-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2005-2006, 2008-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2001-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This 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 file. If not, see . +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libbison --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl argmatch assert c-strcase calloc-posix close closeout config-h configmake dirname error extensions fdl fopen-safer fprintf-posix getopt-gnu gettext git-version-gen gitlog-to-changelog gpl-3.0 hash inttypes isnan javacomp-script javaexec-script ldexpl malloc-gnu mbswidth non-recursive-gnulib-prefix-hack obstack obstack-printf perror printf-posix progname quote quotearg readme-release realloc-posix snprintf-posix spawn-pipe sprintf-posix stdbool stpcpy strdup-posix strerror strverscmp unistd unistd-safer unlink unlocked-io unsetenv update-copyright verify vsnprintf-posix vsprintf-posix warnings xalloc xalloc-die xconcat-filename xmemdup0 xstrndup + +# Copyright (C) 2001-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2000-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +check_PROGRAMS = $(am__EXEEXT_1) examples/mfcalc/mfcalc$(EXEEXT) \ + examples/rpcalc/rpcalc$(EXEEXT) +@CROSS_COMPILING_FALSE@am__append_1 = $(top_srcdir)/doc/bison.help +@FLEX_CXX_WORKS_TRUE@am__append_2 = examples/calc++/calc++ +@FLEX_CXX_WORKS_TRUE@am__append_3 = examples/calc++/calc++.test +@FLEX_CXX_WORKS_FALSE@am__append_4 = examples/calc++/calc++.test +@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__append_5 = lib/uniwidth/width.c +bin_PROGRAMS = src/bison$(EXEEXT) +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/bison-i18n.m4 $(top_srcdir)/m4/c-working.m4 \ + $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/close-stream.m4 \ + $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/cxx.m4 \ + $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dmalloc.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \ + $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \ + $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ + $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 \ + $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/flex.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \ + $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ + $(top_srcdir)/m4/fseterr.m4 $(top_srcdir)/m4/fstat.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/include_next.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnan.m4 \ + $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \ + $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/javacomp.m4 \ + $(top_srcdir)/m4/javaexec.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libunistring-base.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/m4.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/math_h.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \ + $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mmap-anon.m4 \ + $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/non-recursive-gnulib-prefix-hack.m4 \ + $(top_srcdir)/m4/obstack-printf.m4 $(top_srcdir)/m4/obstack.m4 \ + $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open.m4 \ + $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perror.m4 \ + $(top_srcdir)/m4/pipe2.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix_spawn.m4 \ + $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/printf-frexpl.m4 \ + $(top_srcdir)/m4/printf-posix-rpl.m4 \ + $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/sched_h.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ + $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/snprintf-posix.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/spawn-pipe.m4 \ + $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/sprintf-posix.m4 \ + $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \ + $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \ + $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/time_h.m4 \ + $(top_srcdir)/m4/timevar.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/vfprintf-posix.m4 \ + $(top_srcdir)/m4/vsnprintf-posix.m4 \ + $(top_srcdir)/m4/vsnprintf.m4 \ + $(top_srcdir)/m4/vsprintf-posix.m4 \ + $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \ + $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ + $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(dist_noinst_SCRIPTS) \ + $(srcdir)/doc/version.texi $(srcdir)/doc/stamp-vti \ + $(dist_doc_DATA) $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) \ + $(dist_xslt_DATA) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/config.h +CONFIG_CLEAN_FILES = javacomp.sh javaexec.sh etc/bench.pl \ + tests/atlocal tests/bison doc/yacc.1 +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(aclocaldir)" \ + "$(DESTDIR)$(calcxxdir)" "$(DESTDIR)$(docdir)" \ + "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)" \ + "$(DESTDIR)$(xsltdir)" "$(DESTDIR)$(mfcalcdir)" \ + "$(DESTDIR)$(rpcalcdir)" +LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES) +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +lib_libbison_a_AR = $(AR) $(ARFLAGS) +am__DEPENDENCIES_1 = +am__lib_libbison_a_SOURCES_DIST = lib/argmatch.c lib/binary-io.h \ + lib/binary-io.c lib/bitrotate.h lib/bitrotate.c lib/c-ctype.h \ + lib/c-ctype.c lib/c-strcase.h lib/c-strcasecmp.c \ + lib/c-strncasecmp.c lib/cloexec.c lib/close-stream.c \ + lib/closeout.c lib/concat-filename.c lib/dirname.c \ + lib/basename.c lib/dirname-lgpl.c lib/basename-lgpl.c \ + lib/stripslash.c lib/exitfail.c lib/fatal-signal.h \ + lib/fatal-signal.c lib/fd-hook.c lib/fd-safer-flag.c \ + lib/dup-safer-flag.c lib/fopen-safer.c lib/gettext.h \ + lib/hash.c lib/localcharset.h lib/localcharset.c \ + lib/glthread/lock.h lib/glthread/lock.c lib/math.c \ + lib/mbswidth.h lib/mbswidth.c lib/pipe2.c lib/pipe2-safer.c \ + lib/printf-frexp.c lib/printf-frexpl.c lib/progname.h \ + lib/progname.c lib/quotearg.c lib/sig-handler.c lib/size_max.h \ + lib/spawn-pipe.h lib/spawn-pipe.c lib/w32spawn.h \ + lib/glthread/threadlib.c lib/unistd.c lib/dup-safer.c \ + lib/fd-safer.c lib/pipe-safer.c lib/uniwidth/width.c \ + lib/wait-process.h lib/wait-process.c lib/wctype-h.c \ + lib/xmalloc.c lib/xalloc-die.c lib/xconcat-filename.c \ + lib/xsize.h lib/xsize.c lib/xstrndup.h lib/xstrndup.c \ + lib/abitset.c lib/abitset.h lib/bbitset.h lib/bitset.c \ + lib/bitset.h lib/bitset_stats.c lib/bitset_stats.h \ + lib/bitsetv.c lib/bitsetv.h lib/ebitset.c lib/ebitset.h \ + lib/lbitset.c lib/lbitset.h lib/libiberty.h lib/vbitset.c \ + lib/vbitset.h lib/bitsetv-print.h lib/bitsetv-print.c \ + lib/timevar.h lib/timevar.c lib/timevar.def lib/get-errno.h \ + lib/get-errno.c +am__dirstamp = $(am__leading_dot)dirstamp +@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__objects_1 = lib/uniwidth/width.$(OBJEXT) +am_lib_libbison_a_OBJECTS = lib/argmatch.$(OBJEXT) \ + lib/binary-io.$(OBJEXT) lib/bitrotate.$(OBJEXT) \ + lib/c-ctype.$(OBJEXT) lib/c-strcasecmp.$(OBJEXT) \ + lib/c-strncasecmp.$(OBJEXT) lib/cloexec.$(OBJEXT) \ + lib/close-stream.$(OBJEXT) lib/closeout.$(OBJEXT) \ + lib/concat-filename.$(OBJEXT) lib/dirname.$(OBJEXT) \ + lib/basename.$(OBJEXT) lib/dirname-lgpl.$(OBJEXT) \ + lib/basename-lgpl.$(OBJEXT) lib/stripslash.$(OBJEXT) \ + lib/exitfail.$(OBJEXT) lib/fatal-signal.$(OBJEXT) \ + lib/fd-hook.$(OBJEXT) lib/fd-safer-flag.$(OBJEXT) \ + lib/dup-safer-flag.$(OBJEXT) lib/fopen-safer.$(OBJEXT) \ + lib/hash.$(OBJEXT) lib/localcharset.$(OBJEXT) \ + lib/glthread/lock.$(OBJEXT) lib/math.$(OBJEXT) \ + lib/mbswidth.$(OBJEXT) lib/pipe2.$(OBJEXT) \ + lib/pipe2-safer.$(OBJEXT) lib/printf-frexp.$(OBJEXT) \ + lib/printf-frexpl.$(OBJEXT) lib/progname.$(OBJEXT) \ + lib/quotearg.$(OBJEXT) lib/sig-handler.$(OBJEXT) \ + lib/spawn-pipe.$(OBJEXT) lib/glthread/threadlib.$(OBJEXT) \ + lib/unistd.$(OBJEXT) lib/dup-safer.$(OBJEXT) \ + lib/fd-safer.$(OBJEXT) lib/pipe-safer.$(OBJEXT) \ + $(am__objects_1) lib/wait-process.$(OBJEXT) \ + lib/wctype-h.$(OBJEXT) lib/xmalloc.$(OBJEXT) \ + lib/xalloc-die.$(OBJEXT) lib/xconcat-filename.$(OBJEXT) \ + lib/xsize.$(OBJEXT) lib/xstrndup.$(OBJEXT) \ + lib/abitset.$(OBJEXT) lib/bitset.$(OBJEXT) \ + lib/bitset_stats.$(OBJEXT) lib/bitsetv.$(OBJEXT) \ + lib/ebitset.$(OBJEXT) lib/lbitset.$(OBJEXT) \ + lib/vbitset.$(OBJEXT) lib/bitsetv-print.$(OBJEXT) \ + lib/timevar.$(OBJEXT) lib/get-errno.$(OBJEXT) +lib_libbison_a_OBJECTS = $(am_lib_libbison_a_OBJECTS) +lib_liby_a_AR = $(AR) $(ARFLAGS) +lib_liby_a_LIBADD = +am__lib_liby_a_SOURCES_DIST = lib/main.c lib/yyerror.c +@ENABLE_YACC_TRUE@am_lib_liby_a_OBJECTS = lib/main.$(OBJEXT) \ +@ENABLE_YACC_TRUE@ lib/yyerror.$(OBJEXT) +lib_liby_a_OBJECTS = $(am_lib_liby_a_OBJECTS) +@FLEX_CXX_WORKS_TRUE@am__EXEEXT_1 = examples/calc++/calc++$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) +am__objects_2 = examples/calc++/examples_calc___calc__-calc++-driver.$(OBJEXT) \ + examples/calc++/examples_calc___calc__-calc++-scanner.$(OBJEXT) \ + examples/calc++/examples_calc___calc__-calc++.$(OBJEXT) +am__objects_3 = examples/calc++/examples_calc___calc__-calc++-parser.$(OBJEXT) +am__objects_4 = $(am__objects_2) $(am__objects_3) +@FLEX_CXX_WORKS_TRUE@nodist_examples_calc___calc___OBJECTS = \ +@FLEX_CXX_WORKS_TRUE@ $(am__objects_4) +examples_calc___calc___OBJECTS = \ + $(nodist_examples_calc___calc___OBJECTS) +examples_calc___calc___LDADD = $(LDADD) +examples_calc___calc___DEPENDENCIES = lib/libbison.a \ + $(am__DEPENDENCIES_1) +examples_calc___calc___LINK = $(CXXLD) \ + $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__objects_5 = \ + examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.$(OBJEXT) +am__objects_6 = $(am__objects_5) +nodist_examples_mfcalc_mfcalc_OBJECTS = $(am__objects_6) +examples_mfcalc_mfcalc_OBJECTS = \ + $(nodist_examples_mfcalc_mfcalc_OBJECTS) +examples_mfcalc_mfcalc_DEPENDENCIES = +am__objects_7 = \ + examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.$(OBJEXT) +am__objects_8 = $(am__objects_7) +nodist_examples_rpcalc_rpcalc_OBJECTS = $(am__objects_8) +examples_rpcalc_rpcalc_OBJECTS = \ + $(nodist_examples_rpcalc_rpcalc_OBJECTS) +examples_rpcalc_rpcalc_DEPENDENCIES = +am_src_bison_OBJECTS = src/bison-AnnotationList.$(OBJEXT) \ + src/bison-InadequacyList.$(OBJEXT) src/bison-LR0.$(OBJEXT) \ + src/bison-Sbitset.$(OBJEXT) src/bison-assoc.$(OBJEXT) \ + src/bison-closure.$(OBJEXT) src/bison-complain.$(OBJEXT) \ + src/bison-conflicts.$(OBJEXT) src/bison-derives.$(OBJEXT) \ + src/bison-files.$(OBJEXT) src/bison-getargs.$(OBJEXT) \ + src/bison-gram.$(OBJEXT) src/bison-graphviz.$(OBJEXT) \ + src/bison-lalr.$(OBJEXT) src/bison-ielr.$(OBJEXT) \ + src/bison-location.$(OBJEXT) src/bison-main.$(OBJEXT) \ + src/bison-muscle-tab.$(OBJEXT) src/bison-named-ref.$(OBJEXT) \ + src/bison-nullable.$(OBJEXT) src/bison-output.$(OBJEXT) \ + src/bison-parse-gram.$(OBJEXT) src/bison-print-xml.$(OBJEXT) \ + src/bison-print.$(OBJEXT) src/bison-print_graph.$(OBJEXT) \ + src/bison-reader.$(OBJEXT) src/bison-reduce.$(OBJEXT) \ + src/bison-relation.$(OBJEXT) src/bison-scan-code-c.$(OBJEXT) \ + src/bison-scan-gram-c.$(OBJEXT) \ + src/bison-scan-skel-c.$(OBJEXT) src/bison-state.$(OBJEXT) \ + src/bison-symlist.$(OBJEXT) src/bison-symtab.$(OBJEXT) \ + src/bison-tables.$(OBJEXT) src/bison-uniqstr.$(OBJEXT) +src_bison_OBJECTS = $(am_src_bison_OBJECTS) +src_bison_LDADD = $(LDADD) +src_bison_DEPENDENCIES = lib/libbison.a $(am__DEPENDENCIES_1) +src_bison_LINK = $(CCLD) $(src_bison_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SCRIPTS = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS) \ + $(nodist_noinst_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) +AM_V_LEX = $(am__v_LEX_@AM_V@) +am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) +am__v_LEX_0 = @echo " LEX " $@; +am__v_LEX_1 = +YLWRAP = $(top_srcdir)/build-aux/ylwrap +am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ + -e s/c++$$/h++/ -e s/c$$/h/ +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_@AM_V@) +am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) +am__v_YACC_0 = @echo " YACC " $@; +am__v_YACC_1 = +SOURCES = $(lib_libbison_a_SOURCES) $(EXTRA_lib_libbison_a_SOURCES) \ + $(lib_liby_a_SOURCES) $(nodist_examples_calc___calc___SOURCES) \ + $(nodist_examples_mfcalc_mfcalc_SOURCES) \ + $(nodist_examples_rpcalc_rpcalc_SOURCES) $(src_bison_SOURCES) \ + $(EXTRA_src_bison_SOURCES) +DIST_SOURCES = $(am__lib_libbison_a_SOURCES_DIST) \ + $(EXTRA_lib_libbison_a_SOURCES) $(am__lib_liby_a_SOURCES_DIST) \ + $(src_bison_SOURCES) $(EXTRA_src_bison_SOURCES) +AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) +am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) +am__v_DVIPS_0 = @echo " DVIPS " $@; +am__v_DVIPS_1 = +AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) +am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) +am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; +am__v_MAKEINFO_1 = +AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) +am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) +am__v_INFOHTML_0 = @echo " INFOHTML" $@; +am__v_INFOHTML_1 = +AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) +am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) +am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; +am__v_TEXI2DVI_1 = +AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) +am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) +am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; +am__v_TEXI2PDF_1 = +AM_V_texinfo = $(am__v_texinfo_@AM_V@) +am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) +am__v_texinfo_0 = -q +am__v_texinfo_1 = +AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) +am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) +am__v_texidevnull_0 = > /dev/null +am__v_texidevnull_1 = +INFO_DEPS = $(srcdir)/doc/bison.info +TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux +DVIS = doc/bison.dvi +PDFS = doc/bison.pdf +PSS = doc/bison.ps +HTMLS = doc/bison.html +TEXINFOS = doc/bison.texi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(dist_man_MANS) $(nodist_man_MANS) +DATA = $(aclocal_DATA) $(calcxx_DATA) $(dist_doc_DATA) \ + $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) $(dist_xslt_DATA) \ + $(mfcalc_DATA) $(rpcalc_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope check recheck distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(dist_man_MANS) $(doc_bison_TEXINFOS) \ + $(srcdir)/Makefile.in $(srcdir)/build-aux/local.mk \ + $(srcdir)/data/local.mk $(srcdir)/djgpp/local.mk \ + $(srcdir)/doc/local.mk $(srcdir)/etc/local.mk \ + $(srcdir)/examples/calc++/local.mk $(srcdir)/examples/local.mk \ + $(srcdir)/examples/mfcalc/local.mk \ + $(srcdir)/examples/rpcalc/local.mk $(srcdir)/lib/gnulib.mk \ + $(srcdir)/lib/local.mk $(srcdir)/src/local.mk \ + $(srcdir)/tests/local.mk $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/javacomp.sh.in \ + $(top_srcdir)/build-aux/javaexec.sh.in \ + $(top_srcdir)/build-aux/mdate-sh \ + $(top_srcdir)/build-aux/missing \ + $(top_srcdir)/build-aux/test-driver \ + $(top_srcdir)/build-aux/texinfo.tex \ + $(top_srcdir)/build-aux/ylwrap $(top_srcdir)/doc/yacc.1.in \ + $(top_srcdir)/etc/bench.pl.in $(top_srcdir)/lib/config.in.h \ + $(top_srcdir)/tests/atlocal.in $(top_srcdir)/tests/bison.in \ + ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README \ + README-alpha THANKS TODO build-aux/compile \ + build-aux/config.guess build-aux/config.rpath \ + build-aux/config.sub build-aux/depcomp build-aux/install-sh \ + build-aux/mdate-sh build-aux/missing build-aux/texinfo.tex \ + build-aux/ylwrap src/parse-gram.c src/parse-gram.h \ + src/scan-code.c src/scan-gram.c src/scan-skel.c +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz +GZIP_ENV = --best +DIST_TARGETS = dist-xz dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +pkglibexecdir = @pkglibexecdir@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON_CXX_WORKS = @BISON_CXX_WORKS@ +BISON_C_WORKS = @BISON_C_WORKS@ +BISON_LOCALEDIR = @BISON_LOCALEDIR@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLASSPATH = @CLASSPATH@ +CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CONF_JAVA = @CONF_JAVA@ +CONF_JAVAC = @CONF_JAVAC@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXX_COMPILER_POSIXLY_CORRECT = @CXX_COMPILER_POSIXLY_CORRECT@ +CYGPATH_W = @CYGPATH_W@ +C_COMPILER_POSIXLY_CORRECT = @C_COMPILER_POSIXLY_CORRECT@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOT = @DOT@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +EXEEXT = @EXEEXT@ +FLEX_SCANNER_CXXFLAGS = @FLEX_SCANNER_CXXFLAGS@ +FLOAT_H = @FLOAT_H@ +GCC = @GCC@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACOSF = @GNULIB_ACOSF@ +GNULIB_ACOSL = @GNULIB_ACOSL@ +GNULIB_ASINF = @GNULIB_ASINF@ +GNULIB_ASINL = @GNULIB_ASINL@ +GNULIB_ATAN2F = @GNULIB_ATAN2F@ +GNULIB_ATANF = @GNULIB_ATANF@ +GNULIB_ATANL = @GNULIB_ATANL@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CBRT = @GNULIB_CBRT@ +GNULIB_CBRTF = @GNULIB_CBRTF@ +GNULIB_CBRTL = @GNULIB_CBRTL@ +GNULIB_CEIL = @GNULIB_CEIL@ +GNULIB_CEILF = @GNULIB_CEILF@ +GNULIB_CEILL = @GNULIB_CEILL@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_COPYSIGN = @GNULIB_COPYSIGN@ +GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@ +GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@ +GNULIB_COSF = @GNULIB_COSF@ +GNULIB_COSHF = @GNULIB_COSHF@ +GNULIB_COSL = @GNULIB_COSL@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_EXP2 = @GNULIB_EXP2@ +GNULIB_EXP2F = @GNULIB_EXP2F@ +GNULIB_EXP2L = @GNULIB_EXP2L@ +GNULIB_EXPF = @GNULIB_EXPF@ +GNULIB_EXPL = @GNULIB_EXPL@ +GNULIB_EXPM1 = @GNULIB_EXPM1@ +GNULIB_EXPM1F = @GNULIB_EXPM1F@ +GNULIB_EXPM1L = @GNULIB_EXPM1L@ +GNULIB_FABSF = @GNULIB_FABSF@ +GNULIB_FABSL = @GNULIB_FABSL@ +GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ +GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FDOPEN = @GNULIB_FDOPEN@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FLOOR = @GNULIB_FLOOR@ +GNULIB_FLOORF = @GNULIB_FLOORF@ +GNULIB_FLOORL = @GNULIB_FLOORL@ +GNULIB_FMA = @GNULIB_FMA@ +GNULIB_FMAF = @GNULIB_FMAF@ +GNULIB_FMAL = @GNULIB_FMAL@ +GNULIB_FMOD = @GNULIB_FMOD@ +GNULIB_FMODF = @GNULIB_FMODF@ +GNULIB_FMODL = @GNULIB_FMODL@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPURGE = @GNULIB_FPURGE@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FREXP = @GNULIB_FREXP@ +GNULIB_FREXPF = @GNULIB_FREXPF@ +GNULIB_FREXPL = @GNULIB_FREXPL@ +GNULIB_FSCANF = @GNULIB_FSCANF@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSTAT = @GNULIB_FSTAT@ +GNULIB_FSTATAT = @GNULIB_FSTATAT@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETC = @GNULIB_GETC@ +GNULIB_GETCHAR = @GNULIB_GETCHAR@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ +GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ +GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_HYPOT = @GNULIB_HYPOT@ +GNULIB_HYPOTF = @GNULIB_HYPOTF@ +GNULIB_HYPOTL = @GNULIB_HYPOTL@ +GNULIB_ILOGB = @GNULIB_ILOGB@ +GNULIB_ILOGBF = @GNULIB_ILOGBF@ +GNULIB_ILOGBL = @GNULIB_ILOGBL@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LDEXPF = @GNULIB_LDEXPF@ +GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOG = @GNULIB_LOG@ +GNULIB_LOG10 = @GNULIB_LOG10@ +GNULIB_LOG10F = @GNULIB_LOG10F@ +GNULIB_LOG10L = @GNULIB_LOG10L@ +GNULIB_LOG1P = @GNULIB_LOG1P@ +GNULIB_LOG1PF = @GNULIB_LOG1PF@ +GNULIB_LOG1PL = @GNULIB_LOG1PL@ +GNULIB_LOG2 = @GNULIB_LOG2@ +GNULIB_LOG2F = @GNULIB_LOG2F@ +GNULIB_LOG2L = @GNULIB_LOG2L@ +GNULIB_LOGB = @GNULIB_LOGB@ +GNULIB_LOGBF = @GNULIB_LOGBF@ +GNULIB_LOGBL = @GNULIB_LOGBL@ +GNULIB_LOGF = @GNULIB_LOGF@ +GNULIB_LOGL = @GNULIB_LOGL@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MEMCHR = @GNULIB_MEMCHR@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKFIFO = @GNULIB_MKFIFO@ +GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ +GNULIB_MKNOD = @GNULIB_MKNOD@ +GNULIB_MKNODAT = @GNULIB_MKNODAT@ +GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ +GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ +GNULIB_MKTIME = @GNULIB_MKTIME@ +GNULIB_MODF = @GNULIB_MODF@ +GNULIB_MODFF = @GNULIB_MODFF@ +GNULIB_MODFL = @GNULIB_MODFL@ +GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_PCLOSE = @GNULIB_PCLOSE@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PIPE = @GNULIB_PIPE@ +GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ +GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ +GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ +GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ +GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ +GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ +GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ +GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ +GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ +GNULIB_POWF = @GNULIB_POWF@ +GNULIB_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ +GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ +GNULIB_RAISE = @GNULIB_RAISE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_REMAINDER = @GNULIB_REMAINDER@ +GNULIB_REMAINDERF = @GNULIB_REMAINDERF@ +GNULIB_REMAINDERL = @GNULIB_REMAINDERL@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_RINT = @GNULIB_RINT@ +GNULIB_RINTF = @GNULIB_RINTF@ +GNULIB_RINTL = @GNULIB_RINTL@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_ROUND = @GNULIB_ROUND@ +GNULIB_ROUNDF = @GNULIB_ROUNDF@ +GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SINF = @GNULIB_SINF@ +GNULIB_SINHF = @GNULIB_SINHF@ +GNULIB_SINL = @GNULIB_SINL@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_SQRTF = @GNULIB_SQRTF@ +GNULIB_SQRTL = @GNULIB_SQRTL@ +GNULIB_STAT = @GNULIB_STAT@ +GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRNCAT = @GNULIB_STRNCAT@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRPTIME = @GNULIB_STRPTIME@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_SYMLINK = @GNULIB_SYMLINK@ +GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ +GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TANF = @GNULIB_TANF@ +GNULIB_TANHF = @GNULIB_TANHF@ +GNULIB_TANL = @GNULIB_TANL@ +GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNC = @GNULIB_TRUNC@ +GNULIB_TRUNCF = @GNULIB_TRUNCF@ +GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNLINK = @GNULIB_UNLINK@ +GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ +GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VFSCANF = @GNULIB_VFSCANF@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSCANF = @GNULIB_VSCANF@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ +GNULIB_WRITE = @GNULIB_WRITE@ +GNULIB__EXIT = @GNULIB__EXIT@ +GREP = @GREP@ +HAVE_ACOSF = @HAVE_ACOSF@ +HAVE_ACOSL = @HAVE_ACOSL@ +HAVE_ASINF = @HAVE_ASINF@ +HAVE_ASINL = @HAVE_ASINL@ +HAVE_ATAN2F = @HAVE_ATAN2F@ +HAVE_ATANF = @HAVE_ATANF@ +HAVE_ATANL = @HAVE_ATANL@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CBRT = @HAVE_CBRT@ +HAVE_CBRTF = @HAVE_CBRTF@ +HAVE_CBRTL = @HAVE_CBRTL@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_COPYSIGN = @HAVE_COPYSIGN@ +HAVE_COPYSIGNL = @HAVE_COPYSIGNL@ +HAVE_COSF = @HAVE_COSF@ +HAVE_COSHF = @HAVE_COSHF@ +HAVE_COSL = @HAVE_COSL@ +HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ +HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ +HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ +HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@ +HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@ +HAVE_DECL_CEILF = @HAVE_DECL_CEILF@ +HAVE_DECL_CEILL = @HAVE_DECL_CEILL@ +HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@ +HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@ +HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@ +HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@ +HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@ +HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@ +HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@ +HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@ +HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@ +HAVE_DECL_LOGB = @HAVE_DECL_LOGB@ +HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@ +HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@ +HAVE_DECL_RINTF = @HAVE_DECL_RINTF@ +HAVE_DECL_ROUND = @HAVE_DECL_ROUND@ +HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@ +HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SINL = @HAVE_DECL_SINL@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TANL = @HAVE_DECL_TANL@ +HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ +HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ +HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_EXPF = @HAVE_EXPF@ +HAVE_EXPL = @HAVE_EXPL@ +HAVE_EXPM1 = @HAVE_EXPM1@ +HAVE_EXPM1F = @HAVE_EXPM1F@ +HAVE_FABSF = @HAVE_FABSF@ +HAVE_FABSL = @HAVE_FABSL@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FMA = @HAVE_FMA@ +HAVE_FMAF = @HAVE_FMAF@ +HAVE_FMAL = @HAVE_FMAL@ +HAVE_FMODF = @HAVE_FMODF@ +HAVE_FMODL = @HAVE_FMODL@ +HAVE_FREXPF = @HAVE_FREXPF@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GCJ_C = @HAVE_GCJ_C@ +HAVE_GCJ_IN_PATH = @HAVE_GCJ_IN_PATH@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GIJ = @HAVE_GIJ@ +HAVE_GIJ_IN_PATH = @HAVE_GIJ_IN_PATH@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_HYPOTF = @HAVE_HYPOTF@ +HAVE_HYPOTL = @HAVE_HYPOTL@ +HAVE_ILOGB = @HAVE_ILOGB@ +HAVE_ILOGBF = @HAVE_ILOGBF@ +HAVE_ILOGBL = @HAVE_ILOGBL@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_JAVA = @HAVE_JAVA@ +HAVE_JAVAC = @HAVE_JAVAC@ +HAVE_JAVAC_ENVVAR = @HAVE_JAVAC_ENVVAR@ +HAVE_JAVAC_IN_PATH = @HAVE_JAVAC_IN_PATH@ +HAVE_JAVA_ENVVAR = @HAVE_JAVA_ENVVAR@ +HAVE_JAVA_IN_PATH = @HAVE_JAVA_IN_PATH@ +HAVE_JIKES = @HAVE_JIKES@ +HAVE_JIKES_IN_PATH = @HAVE_JIKES_IN_PATH@ +HAVE_JRE = @HAVE_JRE@ +HAVE_JRE_IN_PATH = @HAVE_JRE_IN_PATH@ +HAVE_JVIEW = @HAVE_JVIEW@ +HAVE_JVIEW_IN_PATH = @HAVE_JVIEW_IN_PATH@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LDEXPF = @HAVE_LDEXPF@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LOG10F = @HAVE_LOG10F@ +HAVE_LOG10L = @HAVE_LOG10L@ +HAVE_LOG1P = @HAVE_LOG1P@ +HAVE_LOG1PF = @HAVE_LOG1PF@ +HAVE_LOG1PL = @HAVE_LOG1PL@ +HAVE_LOGBF = @HAVE_LOGBF@ +HAVE_LOGBL = @HAVE_LOGBL@ +HAVE_LOGF = @HAVE_LOGF@ +HAVE_LOGL = @HAVE_LOGL@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MODFF = @HAVE_MODFF@ +HAVE_MODFL = @HAVE_MODFL@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ +HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@ +HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ +HAVE_POWF = @HAVE_POWF@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_RAISE = @HAVE_RAISE@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_REMAINDER = @HAVE_REMAINDER@ +HAVE_REMAINDERF = @HAVE_REMAINDERF@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RINT = @HAVE_RINT@ +HAVE_RINTL = @HAVE_RINTL@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@ +HAVE_SCHED_H = @HAVE_SCHED_H@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SINF = @HAVE_SINF@ +HAVE_SINHF = @HAVE_SINHF@ +HAVE_SINL = @HAVE_SINL@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SPAWN_H = @HAVE_SPAWN_H@ +HAVE_SQRTF = @HAVE_SQRTF@ +HAVE_SQRTL = @HAVE_SQRTL@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TANF = @HAVE_TANF@ +HAVE_TANHF = @HAVE_TANHF@ +HAVE_TANL = @HAVE_TANL@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +HELP2MAN = @HELP2MAN@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +ISNAND_LIBM = @ISNAND_LIBM@ +ISNANF_LIBM = @ISNANF_LIBM@ +ISNANL_LIBM = @ISNANL_LIBM@ +ISNAN_LIBM = @ISNAN_LIBM@ +LDEXPL_LIBM = @LDEXPL_LIBM@ +LDEXP_LIBM = @LDEXP_LIBM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_IS_FLEX = @LEX_IS_FLEX@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBBISON_LIBDEPS = @LIBBISON_LIBDEPS@ +LIBBISON_LTLIBDEPS = @LIBBISON_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMULTITHREAD = @LIBMULTITHREAD@ +LIBOBJS = @LIBOBJS@ +LIBPTH = @LIBPTH@ +LIBPTH_PREFIX = @LIBPTH_PREFIX@ +LIBS = @LIBS@ +LIBTHREAD = @LIBTHREAD@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBPTH = @LTLIBPTH@ +LTLIBTHREAD = @LTLIBTHREAD@ +M4 = @M4@ +M4_DEBUGFILE = @M4_DEBUGFILE@ +M4_GNU = @M4_GNU@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ +NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@ +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ +NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_SCHED_H = @NEXT_SCHED_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_SPAWN_H = @NEXT_SPAWN_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_COPYRIGHT_YEAR = @PACKAGE_COPYRIGHT_YEAR@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +POSUB = @POSUB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC = @REPLACE_CALLOC@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CBRTF = @REPLACE_CBRTF@ +REPLACE_CBRTL = @REPLACE_CBRTL@ +REPLACE_CEIL = @REPLACE_CEIL@ +REPLACE_CEILF = @REPLACE_CEILF@ +REPLACE_CEILL = @REPLACE_CEILL@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_EXP2 = @REPLACE_EXP2@ +REPLACE_EXP2L = @REPLACE_EXP2L@ +REPLACE_EXPM1 = @REPLACE_EXPM1@ +REPLACE_EXPM1F = @REPLACE_EXPM1F@ +REPLACE_FABSL = @REPLACE_FABSL@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FLOOR = @REPLACE_FLOOR@ +REPLACE_FLOORF = @REPLACE_FLOORF@ +REPLACE_FLOORL = @REPLACE_FLOORL@ +REPLACE_FMA = @REPLACE_FMA@ +REPLACE_FMAF = @REPLACE_FMAF@ +REPLACE_FMAL = @REPLACE_FMAL@ +REPLACE_FMOD = @REPLACE_FMOD@ +REPLACE_FMODF = @REPLACE_FMODF@ +REPLACE_FMODL = @REPLACE_FMODL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FREXP = @REPLACE_FREXP@ +REPLACE_FREXPF = @REPLACE_FREXPF@ +REPLACE_FREXPL = @REPLACE_FREXPL@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ +REPLACE_HYPOT = @REPLACE_HYPOT@ +REPLACE_HYPOTF = @REPLACE_HYPOTF@ +REPLACE_HYPOTL = @REPLACE_HYPOTL@ +REPLACE_ILOGB = @REPLACE_ILOGB@ +REPLACE_ILOGBF = @REPLACE_ILOGBF@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LOG = @REPLACE_LOG@ +REPLACE_LOG10 = @REPLACE_LOG10@ +REPLACE_LOG10F = @REPLACE_LOG10F@ +REPLACE_LOG10L = @REPLACE_LOG10L@ +REPLACE_LOG1P = @REPLACE_LOG1P@ +REPLACE_LOG1PF = @REPLACE_LOG1PF@ +REPLACE_LOG1PL = @REPLACE_LOG1PL@ +REPLACE_LOG2 = @REPLACE_LOG2@ +REPLACE_LOG2F = @REPLACE_LOG2F@ +REPLACE_LOG2L = @REPLACE_LOG2L@ +REPLACE_LOGB = @REPLACE_LOGB@ +REPLACE_LOGBF = @REPLACE_LOGBF@ +REPLACE_LOGBL = @REPLACE_LOGBL@ +REPLACE_LOGF = @REPLACE_LOGF@ +REPLACE_LOGL = @REPLACE_LOGL@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_MODF = @REPLACE_MODF@ +REPLACE_MODFF = @REPLACE_MODFF@ +REPLACE_MODFL = @REPLACE_MODFL@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ +REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOC = @REPLACE_REALLOC@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMAINDER = @REPLACE_REMAINDER@ +REPLACE_REMAINDERF = @REPLACE_REMAINDERF@ +REPLACE_REMAINDERL = @REPLACE_REMAINDERL@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_ROUND = @REPLACE_ROUND@ +REPLACE_ROUNDF = @REPLACE_ROUNDF@ +REPLACE_ROUNDL = @REPLACE_ROUNDL@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ +REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_SQRTL = @REPLACE_SQRTL@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNC = @REPLACE_TRUNC@ +REPLACE_TRUNCF = @REPLACE_TRUNCF@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SCHED_H = @SCHED_H@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +USE_NLS = @USE_NLS@ +VALGRIND = @VALGRIND@ +VALGRIND_PREBISON = @VALGRIND_PREBISON@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS_TEST = @WARN_CFLAGS_TEST@ +WARN_CXXFLAGS = @WARN_CXXFLAGS@ +WARN_CXXFLAGS_TEST = @WARN_CXXFLAGS_TEST@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WERROR_CXXFLAGS = @WERROR_CXXFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XSLTPROC = @XSLTPROC@ +YACC = $(BISON) -o y.tab.c +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ + +# Files installed for use by Automake. +aclocaldir = @aclocaldir@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = subdir-objects +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = po runtime-po . +aclocal_DATA = m4/bison-i18n.m4 + +# Some of our targets (cross-option.texi, bison.1) use "bison --help". +# Since we want to ship the generated file to avoid additional +# requirements over the user environment, we used not depend on +# src/bison itself, but on src/getargs.c and other files. Yet, we +# need "bison --help" to work to make help2man happy, so we used to +# include "make src/bison" in the commands. Then we may have a +# problem with concurrent builds, since one make might be aiming one +# of its jobs at compiling src/bison, and another job at generating +# the man page. If the latter is faster than the former, then we have +# two makes that concurrently try to compile src/bison. Doomed to +# failure. +# +# As a simple scheme to get our way out, make a stamp file, +# bison.help, which contains --version then --help. This file can +# depend on bison, which ensures its correctness. But update it +# *only* if needed (content changes). This way, we avoid useless +# compilations of cross-option.texi and bison.1. At the cost of +# repeated builds of bison.help. + +# If your project uses "gettextize --intl" to put a source-code +# copy of libintl into the package, every Makefile.am needs +# -I$(top_builddir)/intl, so that can be found in this directory. +# Here's one way to do this: +#AM_CPPFLAGS += -I$(top_builddir)/intl +# This option has no effect when the user disables NLS (because then +# the intl directory contains no libintl.h file). This option is not +# enabled by default because the intl directory might not exist if +# your project does not use "gettext --intl", and some compilers +# complain about -I options applied to nonexistent directories. +EXTRA_DIST = .prev-version .version cfg.mk PACKAGING ChangeLog-1998 \ + ChangeLog-2012 ChangeLog $(dist_TESTS) \ + build-aux/cross-options.pl build-aux/darwin11.4.0.valgrind \ + build-aux/linux-gnu.valgrind build-aux/move-if-change \ + build-aux/prev-version.txt build-aux/update-b4-copyright \ + djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \ + djgpp/config.sed djgpp/config.site djgpp/config_h.sed \ + djgpp/djunpack.bat djgpp/fnchange.lst djgpp/subpipe.c \ + djgpp/subpipe.h djgpp/testsuite.sed doc/refcard.tex \ + $(top_srcdir)/doc/bison.help $(dist_man_MANS:.1=.x) $(FIGS_GV) \ + $(FIGS_GV:.gv=.txt) $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) \ + $(FIGS_GV:.gv=.png) doc/Doxyfile.in $(am__append_4) \ + lib/alignof.h lib/alloca.in.h \ + $(top_srcdir)/build-aux/announce-gen lib/argmatch.h \ + lib/c-strcaseeq.h lib/calloc.c lib/cloexec.h lib/close.c \ + lib/close-stream.h lib/closeout.h lib/concat-filename.h \ + lib/stripslash.c lib/dirname.h \ + $(top_srcdir)/build-aux/do-release-commit-and-tag \ + lib/dosname.h lib/dup2.c lib/errno.in.h lib/error.c \ + lib/error.h lib/exitfail.h lib/fcntl.c lib/fcntl.in.h \ + lib/fd-hook.h lib/filename.h lib/float.c lib/float.in.h \ + lib/itold.c lib/fopen.c lib/stdio--.h lib/stdio-safer.h \ + lib/fpending.c lib/fpending.h lib/fprintf.c lib/fpucw.h \ + lib/frexp.c lib/frexp.c lib/frexpl.c lib/fseterr.c \ + lib/fseterr.h lib/stdio-impl.h lib/fstat.c \ + $(top_srcdir)/build-aux/gendocs.sh lib/getdtablesize.c \ + lib/getopt.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h \ + $(top_srcdir)/build-aux/config.rpath lib/gettimeofday.c \ + $(top_srcdir)/build-aux/git-version-gen \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + $(top_srcdir)/build-aux/gnu-web-doc-update \ + $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \ + lib/hash.h $(top_srcdir)/build-aux/config.rpath lib/intprops.h \ + lib/inttypes.in.h lib/float+.h lib/isnan.c lib/isnand.c \ + lib/float+.h lib/isnan.c lib/isnand-nolibm.h lib/isnand.c \ + lib/float+.h lib/isnan.c lib/isnanf.c lib/float+.h lib/isnan.c \ + lib/isnanf-nolibm.h lib/isnanf.c lib/float+.h lib/isnan.c \ + lib/isnanl.c lib/float+.h lib/isnan.c lib/isnanl-nolibm.h \ + lib/isnanl.c $(top_srcdir)/build-aux/javacomp.sh.in \ + $(top_srcdir)/build-aux/javaexec.sh.in lib/ldexpl.c \ + lib/config.charset lib/ref-add.sin lib/ref-del.sin lib/lstat.c \ + $(top_srcdir)/maint.mk lib/malloc.c lib/malloc.c lib/math.in.h \ + lib/mbrtowc.c lib/mbsinit.c lib/memchr.c lib/memchr.valgrind \ + lib/msvc-inval.c lib/msvc-inval.h lib/msvc-nothrow.c \ + lib/msvc-nothrow.h $(top_srcdir)/build-aux/prefix-gnulib-mk \ + lib/obstack.c lib/obstack.h lib/obstack_printf.c lib/open.c \ + lib/pathmax.h lib/perror.c lib/spawn_int.h lib/spawni.c \ + lib/spawn_faction_addclose.c lib/spawn_int.h \ + lib/spawn_faction_adddup2.c lib/spawn_int.h \ + lib/spawn_faction_addopen.c lib/spawn_int.h \ + lib/spawn_faction_destroy.c lib/spawn_faction_init.c \ + lib/spawn_int.h lib/spawnattr_destroy.c lib/spawnattr_init.c \ + lib/spawnattr_setflags.c lib/spawnattr_setsigmask.c \ + lib/spawnp.c lib/printf-frexp.h lib/printf-frexp.c \ + lib/printf-frexpl.h lib/printf.c lib/quote.h lib/quote.h \ + lib/quotearg.h lib/raise.c lib/rawmemchr.c \ + lib/rawmemchr.valgrind $(top_srcdir)/README-release \ + lib/realloc.c lib/sched.in.h lib/sig-handler.h lib/sigaction.c \ + lib/signal.in.h lib/float+.h lib/signbitd.c lib/signbitf.c \ + lib/signbitl.c lib/sigprocmask.c \ + $(top_srcdir)/build-aux/snippet/_Noreturn.h \ + $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ + $(top_srcdir)/build-aux/snippet/c++defs.h \ + $(top_srcdir)/build-aux/snippet/warn-on-use.h lib/snprintf.c \ + lib/spawn.in.h lib/sprintf.c lib/stat.c lib/stdbool.in.h \ + lib/stddef.in.h lib/stdint.in.h lib/stdio.in.h lib/stdlib.in.h \ + lib/stpcpy.c lib/strchrnul.c lib/strchrnul.valgrind \ + lib/strdup.c lib/streq.h lib/strerror.c \ + lib/strerror-override.c lib/strerror-override.h \ + lib/strerror_r.c lib/string.in.h lib/strndup.c lib/strnlen.c \ + lib/strverscmp.c lib/sys_stat.in.h lib/sys_time.in.h \ + lib/sys_types.in.h lib/sys_wait.in.h \ + $(top_srcdir)/build-aux/config.rpath lib/time.in.h \ + lib/unistd.in.h lib/unistd--.h lib/unistd-safer.h \ + lib/unitypes.in.h lib/localcharset.h lib/uniwidth.in.h \ + lib/uniwidth/cjk.h lib/unlink.c lib/unlocked-io.h \ + lib/unsetenv.c $(top_srcdir)/build-aux/update-copyright \ + $(top_srcdir)/build-aux/useless-if-before-free lib/asnprintf.c \ + lib/float+.h lib/printf-args.c lib/printf-args.h \ + lib/printf-parse.c lib/printf-parse.h lib/vasnprintf.c \ + lib/vasnprintf.h $(top_srcdir)/build-aux/vc-list-files \ + lib/verify.h lib/vfprintf.c lib/vsnprintf.c lib/vsprintf.c \ + lib/waitpid.c lib/wchar.in.h lib/wctype.in.h lib/wcwidth.c \ + lib/xalloc.h lib/xalloc-oversized.h lib/concat-filename.h \ + lib/xmemdup0.c lib/xmemdup0.h $(TESTSUITE_AT) tests/testsuite +dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO +BISON = $(top_builddir)/tests/bison +BISON_IN = $(top_srcdir)/tests/bison.in +AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all + +# Initialization before completion by local.mk's. +AM_CFLAGS = $(WARN_CFLAGS) +# Find builddir/src/scan-code.c etc. For some reason "-I./lib" +# instead of "-Ilib" avoids infinite recursions on #include_next. +AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib + +# The BUILT_SOURCES created by this Makefile snippet are not used via #include +# statements but through direct file reference. Therefore this snippet must be +# present in all Makefile.am that need it. This is ensured by the applicability +# 'all' defined above. + +# The BUILT_SOURCES created by this Makefile snippet are not used via #include +# statements but through direct file reference. Therefore this snippet must be +# present in all Makefile.am that need it. This is ensured by the applicability +# 'all' defined above. + +# See comments in build-aux/git-version-gen. However, we make .version depend +# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the +# working copy (for example, when you run autoreconf && make). Allowing these +# to fall out of sync appears to have little potential to improve Bison build +# efficiency (even if we were to replace VERSION/PACKAGE_VERSION with .version +# everywhere possible). On the other hand, it could be harmful. For example, +# a developer might naively reference .version in a test case while the bison +# executable still compiles with VERSION, and so the test case might fail or +# pass incorrectly. +BUILT_SOURCES = $(mfcalc_sources) $(rpcalc_sources) $(ALLOCA_H) \ + lib/configmake.h $(ERRNO_H) lib/fcntl.h $(FLOAT_H) $(GETOPT_H) \ + lib/inttypes.h lib/math.h $(SCHED_H) lib/signal.h \ + lib/arg-nonnull.h lib/c++defs.h lib/warn-on-use.h lib/spawn.h \ + $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) lib/stdio.h lib/stdlib.h \ + lib/string.h lib/sys/stat.h lib/sys/time.h lib/sys/types.h \ + lib/sys/wait.h lib/time.h lib/unistd.h \ + $(LIBUNISTRING_UNITYPES_H) $(LIBUNISTRING_UNIWIDTH_H) \ + lib/wchar.h lib/wctype.h src/parse-gram.c src/parse-gram.h \ + src/scan-code.c src/scan-gram.c src/scan-skel.c \ + $(top_srcdir)/.version +CLEANFILES = doc/refcard.pdf $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) \ + $(FIGS_GV:.gv=.png) doc/Doxyfile $(extracted) \ + examples/extracted.stamp $(calcxx_sources_generated) \ + examples/calc++/calc++-parser.output \ + examples/calc++/calc++-parser.stamp \ + examples/calc++/calc++-scanner.cc examples/mfcalc/mfcalc.[ch] \ + examples/mfcalc/mfcalc.output examples/rpcalc/rpcalc.[ch] \ + examples/rpcalc/rpcalc.output lib/configmake.h \ + lib/configmake.h-t lib/charset.alias lib/ref-add.sed \ + lib/ref-del.sed +DISTCLEANFILES = tests/atconfig $(check_SCRIPTS) +MOSTLYCLEANDIRS = lib/sys lib/sys +MOSTLYCLEANFILES = $(top_srcdir)/doc/*.t lib/core lib/*.stackdump \ + lib/alloca.h lib/alloca.h-t lib/errno.h lib/errno.h-t \ + lib/fcntl.h lib/fcntl.h-t lib/float.h lib/float.h-t \ + lib/getopt.h lib/getopt.h-t lib/inttypes.h lib/inttypes.h-t \ + lib/math.h lib/math.h-t lib/sched.h lib/sched.h-t lib/signal.h \ + lib/signal.h-t lib/arg-nonnull.h lib/arg-nonnull.h-t \ + lib/c++defs.h lib/c++defs.h-t lib/warn-on-use.h \ + lib/warn-on-use.h-t lib/spawn.h lib/spawn.h-t lib/stdbool.h \ + lib/stdbool.h-t lib/stddef.h lib/stddef.h-t lib/stdint.h \ + lib/stdint.h-t lib/stdio.h lib/stdio.h-t lib/stdlib.h \ + lib/stdlib.h-t lib/string.h lib/string.h-t lib/sys/stat.h \ + lib/sys/stat.h-t lib/sys/time.h lib/sys/time.h-t \ + lib/sys/types.h lib/sys/types.h-t lib/sys/wait.h \ + lib/sys/wait.h-t lib/time.h lib/time.h-t lib/unistd.h \ + lib/unistd.h-t lib/unitypes.h lib/unitypes.h-t lib/uniwidth.h \ + lib/uniwidth.h-t lib/wchar.h lib/wchar.h-t lib/wctype.h \ + lib/wctype.h-t src/yacc +SUFFIXES = .gv .eps .pdf .png .yy .stamp +TESTS = $(dist_TESTS) +dist_TESTS = $(am__append_3) examples/mfcalc/mfcalc.test \ + examples/rpcalc/rpcalc.test +noinst_LIBRARIES = lib/libbison.a +dist_pkgdata_DATA = \ + data/README \ + data/bison.m4 \ + data/c++-skel.m4 \ + data/c++.m4 \ + data/c-like.m4 \ + data/c-skel.m4 \ + data/c.m4 \ + data/glr.c \ + data/glr.cc \ + data/java-skel.m4 \ + data/java.m4 \ + data/lalr1.cc \ + data/lalr1.java \ + data/location.cc \ + data/stack.hh \ + data/variant.hh \ + data/yacc.c + +m4sugardir = $(pkgdatadir)/m4sugar +dist_m4sugar_DATA = \ + data/m4sugar/foreach.m4 \ + data/m4sugar/m4sugar.m4 + +xsltdir = $(pkgdatadir)/xslt +dist_xslt_DATA = \ + data/xslt/bison.xsl \ + data/xslt/xml2dot.xsl \ + data/xslt/xml2text.xsl \ + data/xslt/xml2xhtml.xsl + +AM_MAKEINFOFLAGS = --no-split +info_TEXINFOS = doc/bison.texi +doc_bison_TEXINFOS = \ + $(CROSS_OPTIONS_TEXI) \ + doc/fdl.texi \ + doc/gpl-3.0.texi + + +# Cannot express dependencies directly on file names because of Automake. +# Obfuscate with a variable. +doc_bison = doc/bison +TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc +CLEANDIRS = doc/bison.t2d doc/html +CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl +CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi +MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI) $(am__append_1) \ + $(dist_man_MANS) $(TESTSUITE) +dist_man_MANS = $(top_srcdir)/doc/bison.1 + +# Differences to ignore when comparing the man page (the date). +remove_time_stamp = \ + sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/' + + +# Depend on configure to get version number changes. +@CROSS_COMPILING_FALSE@MAN_DEPS = doc/bison.help doc/bison.x $(top_srcdir)/configure +@ENABLE_YACC_TRUE@nodist_man_MANS = doc/yacc.1 +FIGS_GV = \ + doc/figs/example.gv \ + doc/figs/example-reduce.gv doc/figs/example-shift.gv + +DOXYGEN = doxygen +edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ + -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ + -e 's,@PERL\@,$(PERL),g' \ + -e 's,@top_builddir\@,$(top_builddir),g' \ + -e 's,@top_srcdir\@,$(top_srcdir),g' + +nodist_noinst_SCRIPTS = etc/bench.pl +dist_noinst_SCRIPTS = examples/extexi examples/test +TEST_LOG_COMPILER = $(top_srcdir)/examples/test +AM_CXXFLAGS = \ + $(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS) + +doc = $(top_srcdir)/doc/bison.texi +extexi = $(top_srcdir)/examples/extexi +@ENABLE_GCC_WARNINGS_TRUE@extexiFLAGS = --synclines +extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(extexiFLAGS) $(doc) -- +extracted = $(calcxx_extracted) $(mfcalc_extracted) \ + $(rpcalc_extracted) +calcxx_sources_extracted = \ + examples/calc++/calc++-driver.cc \ + examples/calc++/calc++-driver.hh \ + examples/calc++/calc++-scanner.ll \ + examples/calc++/calc++.cc + +calcxx_extracted = \ + $(calcxx_sources_extracted) \ + examples/calc++/calc++-parser.yy + +calcxx_sources_generated = \ + examples/calc++/calc++-parser.cc \ + examples/calc++/calc++-parser.hh \ + examples/calc++/location.hh \ + examples/calc++/position.hh \ + examples/calc++/stack.hh + +calcxx_sources = \ + $(calcxx_sources_extracted) \ + $(calcxx_sources_generated) + +@FLEX_CXX_WORKS_TRUE@nodist_examples_calc___calc___SOURCES = \ +@FLEX_CXX_WORKS_TRUE@ $(calcxx_sources) + +@FLEX_CXX_WORKS_TRUE@examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++ +@FLEX_CXX_WORKS_TRUE@examples_calc___calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS) +calcxxdir = $(docdir)/examples/calc++ +calcxx_DATA = $(calcxx_extracted) +mfcalc_extracted = examples/mfcalc/calc.h examples/mfcalc/mfcalc.y +mfcalc_sources = $(mfcalc_extracted) +examples_mfcalc_mfcalc_LDADD = -lm +nodist_examples_mfcalc_mfcalc_SOURCES = $(mfcalc_sources) +examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc +mfcalcdir = $(docdir)/examples/mfcalc +mfcalc_DATA = $(mfcalc_extracted) +rpcalc_extracted = examples/rpcalc/rpcalc.y +rpcalc_sources = $(rpcalc_extracted) +examples_rpcalc_rpcalc_LDADD = -lm +nodist_examples_rpcalc_rpcalc_SOURCES = $(rpcalc_sources) +examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc +rpcalcdir = $(docdir)/examples/rpcalc +rpcalc_DATA = $(rpcalc_extracted) + +# Implementation of bitsets. + +# Additional bitset operations. + +# timevars, stolen from GCC. + +# Non-gnulib sources in Bison's internal library. +lib_libbison_a_SOURCES = lib/argmatch.c lib/binary-io.h \ + lib/binary-io.c lib/bitrotate.h lib/bitrotate.c lib/c-ctype.h \ + lib/c-ctype.c lib/c-strcase.h lib/c-strcasecmp.c \ + lib/c-strncasecmp.c lib/cloexec.c lib/close-stream.c \ + lib/closeout.c lib/concat-filename.c lib/dirname.c \ + lib/basename.c lib/dirname-lgpl.c lib/basename-lgpl.c \ + lib/stripslash.c lib/exitfail.c lib/fatal-signal.h \ + lib/fatal-signal.c lib/fd-hook.c lib/fd-safer-flag.c \ + lib/dup-safer-flag.c lib/fopen-safer.c lib/gettext.h \ + lib/hash.c lib/localcharset.h lib/localcharset.c \ + lib/glthread/lock.h lib/glthread/lock.c lib/math.c \ + lib/mbswidth.h lib/mbswidth.c lib/pipe2.c lib/pipe2-safer.c \ + lib/printf-frexp.c lib/printf-frexpl.c lib/progname.h \ + lib/progname.c lib/quotearg.c lib/sig-handler.c lib/size_max.h \ + lib/spawn-pipe.h lib/spawn-pipe.c lib/w32spawn.h \ + lib/glthread/threadlib.c lib/unistd.c lib/dup-safer.c \ + lib/fd-safer.c lib/pipe-safer.c $(am__append_5) \ + lib/wait-process.h lib/wait-process.c lib/wctype-h.c \ + lib/xmalloc.c lib/xalloc-die.c lib/xconcat-filename.c \ + lib/xsize.h lib/xsize.c lib/xstrndup.h lib/xstrndup.c \ + lib/abitset.c lib/abitset.h lib/bbitset.h lib/bitset.c \ + lib/bitset.h lib/bitset_stats.c lib/bitset_stats.h \ + lib/bitsetv.c lib/bitsetv.h lib/ebitset.c lib/ebitset.h \ + lib/lbitset.c lib/lbitset.h lib/libiberty.h lib/vbitset.c \ + lib/vbitset.h lib/bitsetv-print.h lib/bitsetv-print.c \ + lib/timevar.h lib/timevar.c lib/timevar.def lib/get-errno.h \ + lib/get-errno.c +lib_libbison_a_LIBADD = $(gl_LIBOBJS) +lib_libbison_a_DEPENDENCIES = $(gl_LIBOBJS) +EXTRA_lib_libbison_a_SOURCES = lib/calloc.c lib/close.c \ + lib/stripslash.c lib/dup2.c lib/error.c lib/fcntl.c \ + lib/float.c lib/itold.c lib/fopen.c lib/fpending.c \ + lib/fprintf.c lib/frexp.c lib/frexp.c lib/frexpl.c \ + lib/fseterr.c lib/fstat.c lib/getdtablesize.c lib/getopt.c \ + lib/getopt1.c lib/gettimeofday.c lib/isnan.c lib/isnand.c \ + lib/isnan.c lib/isnand.c lib/isnan.c lib/isnanf.c lib/isnan.c \ + lib/isnanf.c lib/isnan.c lib/isnanl.c lib/isnan.c lib/isnanl.c \ + lib/ldexpl.c lib/lstat.c lib/malloc.c lib/malloc.c \ + lib/mbrtowc.c lib/mbsinit.c lib/memchr.c lib/msvc-inval.c \ + lib/msvc-nothrow.c lib/obstack.c lib/obstack_printf.c \ + lib/open.c lib/perror.c lib/spawni.c \ + lib/spawn_faction_addclose.c lib/spawn_faction_adddup2.c \ + lib/spawn_faction_addopen.c lib/spawn_faction_destroy.c \ + lib/spawn_faction_init.c lib/spawnattr_destroy.c \ + lib/spawnattr_init.c lib/spawnattr_setflags.c \ + lib/spawnattr_setsigmask.c lib/spawnp.c lib/printf-frexp.c \ + lib/printf.c lib/raise.c lib/rawmemchr.c lib/realloc.c \ + lib/sigaction.c lib/signbitd.c lib/signbitf.c lib/signbitl.c \ + lib/sigprocmask.c lib/snprintf.c lib/sprintf.c lib/stat.c \ + lib/stpcpy.c lib/strchrnul.c lib/strdup.c lib/strerror.c \ + lib/strerror-override.c lib/strerror_r.c lib/strndup.c \ + lib/strnlen.c lib/strverscmp.c lib/unlink.c lib/unsetenv.c \ + lib/asnprintf.c lib/printf-args.c lib/printf-parse.c \ + lib/vasnprintf.c lib/vfprintf.c lib/vsnprintf.c lib/vsprintf.c \ + lib/waitpid.c lib/wcwidth.c lib/xmemdup0.c + +# Use this preprocessor expression to decide whether #include_next works. +# Do not rely on a 'configure'-time test for this, since the expression +# might appear in an installed header, which is used by some other compiler. +HAVE_INCLUDE_NEXT = lib/(__GNUC__ lib/|| lib/60000000 lib/<= lib/__DECC_VER) +charset_alias = $(DESTDIR)$(libdir)/charset.alias +charset_tmp = $(DESTDIR)$(libdir)/charset.tmp + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all Makefile.am that +# need it. This is ensured by the applicability 'all' defined above. +_NORETURN_H = $(top_srcdir)/build-aux/snippet/_Noreturn.h +ARG_NONNULL_H = lib/arg-nonnull.h +CXXDEFS_H = lib/c++defs.h +WARN_ON_USE_H = lib/warn-on-use.h + +# The Yacc compatibility library. +@ENABLE_YACC_TRUE@lib_LIBRARIES = lib/liby.a +@ENABLE_YACC_TRUE@EXTRA_LIBRARIES = lib/liby.a +@ENABLE_YACC_TRUE@lib_liby_a_SOURCES = lib/main.c lib/yyerror.c +LDADD = lib/libbison.a $(LIBINTL) +# Prettify Automake-computed names of compiled objects. +src_bison_SHORTNAME = bison +src_bison_CFLAGS = $(AM_CFLAGS) $(WERROR_CFLAGS) +src_bison_SOURCES = \ + src/AnnotationList.c \ + src/AnnotationList.h \ + src/InadequacyList.c \ + src/InadequacyList.h \ + src/LR0.c \ + src/LR0.h \ + src/Sbitset.c \ + src/Sbitset.h \ + src/assoc.c \ + src/assoc.h \ + src/closure.c \ + src/closure.h \ + src/complain.c \ + src/complain.h \ + src/conflicts.c \ + src/conflicts.h \ + src/derives.c \ + src/derives.h \ + src/files.c \ + src/files.h \ + src/flex-scanner.h \ + src/getargs.c \ + src/getargs.h \ + src/gram.c \ + src/gram.h \ + src/graphviz.c \ + src/graphviz.h \ + src/lalr.c \ + src/lalr.h \ + src/ielr.c \ + src/ielr.h \ + src/location.c \ + src/location.h \ + src/main.c \ + src/muscle-tab.c \ + src/muscle-tab.h \ + src/named-ref.c \ + src/named-ref.h \ + src/nullable.c \ + src/nullable.h \ + src/output.c \ + src/output.h \ + src/parse-gram.y \ + src/print-xml.c \ + src/print-xml.h \ + src/print.c \ + src/print.h \ + src/print_graph.c \ + src/print_graph.h \ + src/reader.c \ + src/reader.h \ + src/reduce.c \ + src/reduce.h \ + src/relation.c \ + src/relation.h \ + src/scan-code-c.c \ + src/scan-code.h \ + src/scan-gram-c.c \ + src/scan-gram.h \ + src/scan-skel-c.c \ + src/scan-skel.h \ + src/state.c \ + src/state.h \ + src/symlist.c \ + src/symlist.h \ + src/symtab.c \ + src/symtab.h \ + src/system.h \ + src/tables.c \ + src/tables.h \ + src/uniqstr.c \ + src/uniqstr.h + +EXTRA_src_bison_SOURCES = \ + src/scan-code.l \ + src/scan-gram.l \ + src/scan-skel.l + +@ENABLE_YACC_TRUE@bin_SCRIPTS = src/yacc +EXTRA_SCRIPTS = src/yacc +TESTSUITE_AT = \ + tests/testsuite.at \ + \ + tests/actions.at \ + tests/c++.at \ + tests/calc.at \ + tests/conflicts.at \ + tests/cxx-type.at \ + tests/existing.at \ + tests/glr-regression.at \ + tests/headers.at \ + tests/input.at \ + tests/java.at \ + tests/javapush.at \ + tests/local.at \ + tests/named-refs.at \ + tests/output.at \ + tests/package.m4 \ + tests/push.at \ + tests/reduce.at \ + tests/regression.at \ + tests/sets.at \ + tests/skeletons.at \ + tests/synclines.at \ + tests/torture.at \ + tests/types.at + +TESTSUITE = $(top_srcdir)/tests/testsuite +AUTOTEST = $(AUTOM4TE) --language=autotest +AUTOTESTFLAGS = -I $(top_srcdir)/tests + +# Move into tests/ so that testsuite.dir etc. be created there. +RUN_TESTSUITE = $(TESTSUITE) -C tests $(TESTSUITEFLAGS) +check_SCRIPTS = $(BISON) tests/atconfig tests/atlocal +RUN_TESTSUITE_deps = all $(TESTSUITE) $(check_SCRIPTS) +gen_start_date = 2012-01-16 +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .gv .eps .pdf .png .yy .stamp .c .cc .dvi .l .ll .log .o .obj .ps .sed .sin .test .test$(EXEEXT) .trs .y +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/build-aux/local.mk $(srcdir)/data/local.mk $(srcdir)/djgpp/local.mk $(srcdir)/doc/local.mk $(srcdir)/etc/local.mk $(srcdir)/examples/local.mk $(srcdir)/examples/calc++/local.mk $(srcdir)/examples/mfcalc/local.mk $(srcdir)/examples/rpcalc/local.mk $(srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(srcdir)/src/local.mk $(srcdir)/tests/local.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnits'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnits \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; +$(srcdir)/build-aux/local.mk $(srcdir)/data/local.mk $(srcdir)/djgpp/local.mk $(srcdir)/doc/local.mk $(srcdir)/etc/local.mk $(srcdir)/examples/local.mk $(srcdir)/examples/calc++/local.mk $(srcdir)/examples/mfcalc/local.mk $(srcdir)/examples/rpcalc/local.mk $(srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(srcdir)/src/local.mk $(srcdir)/tests/local.mk $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +lib/config.h: lib/stamp-h1 + @test -f $@ || rm -f lib/stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) lib/stamp-h1 + +lib/stamp-h1: $(top_srcdir)/lib/config.in.h $(top_builddir)/config.status + @rm -f lib/stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status lib/config.h +$(top_srcdir)/lib/config.in.h: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f lib/stamp-h1 + touch $@ + +distclean-hdr: + -rm -f lib/config.h lib/stamp-h1 +javacomp.sh: $(top_builddir)/config.status $(top_srcdir)/build-aux/javacomp.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +javaexec.sh: $(top_builddir)/config.status $(top_srcdir)/build-aux/javaexec.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +etc/bench.pl: $(top_builddir)/config.status $(top_srcdir)/etc/bench.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +tests/atlocal: $(top_builddir)/config.status $(top_srcdir)/tests/atlocal.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +tests/bison: $(top_builddir)/config.status $(top_srcdir)/tests/bison.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +doc/yacc.1: $(top_builddir)/config.status $(top_srcdir)/doc/yacc.1.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +install-libLIBRARIES: $(lib_LIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; } + @$(POST_INSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + if test -f $$p; then \ + $(am__strip_dir) \ + echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \ + ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \ + else :; fi; \ + done + +uninstall-libLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir) + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +lib/$(am__dirstamp): + @$(MKDIR_P) lib + @: > lib/$(am__dirstamp) +lib/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/$(DEPDIR) + @: > lib/$(DEPDIR)/$(am__dirstamp) +lib/argmatch.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/binary-io.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitrotate.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/c-ctype.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/c-strcasecmp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/c-strncasecmp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/cloexec.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/close-stream.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/closeout.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/concat-filename.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/dirname.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/basename.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/dirname-lgpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/basename-lgpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/stripslash.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/exitfail.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fatal-signal.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fd-hook.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fd-safer-flag.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/dup-safer-flag.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fopen-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/hash.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/localcharset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/glthread/$(am__dirstamp): + @$(MKDIR_P) lib/glthread + @: > lib/glthread/$(am__dirstamp) +lib/glthread/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/glthread/$(DEPDIR) + @: > lib/glthread/$(DEPDIR)/$(am__dirstamp) +lib/glthread/lock.$(OBJEXT): lib/glthread/$(am__dirstamp) \ + lib/glthread/$(DEPDIR)/$(am__dirstamp) +lib/math.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/mbswidth.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/pipe2.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/pipe2-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-frexp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-frexpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/progname.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/quotearg.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/sig-handler.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn-pipe.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/glthread/threadlib.$(OBJEXT): lib/glthread/$(am__dirstamp) \ + lib/glthread/$(DEPDIR)/$(am__dirstamp) +lib/unistd.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/dup-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fd-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/pipe-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/uniwidth/$(am__dirstamp): + @$(MKDIR_P) lib/uniwidth + @: > lib/uniwidth/$(am__dirstamp) +lib/uniwidth/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/uniwidth/$(DEPDIR) + @: > lib/uniwidth/$(DEPDIR)/$(am__dirstamp) +lib/uniwidth/width.$(OBJEXT): lib/uniwidth/$(am__dirstamp) \ + lib/uniwidth/$(DEPDIR)/$(am__dirstamp) +lib/wait-process.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/wctype-h.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xmalloc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xalloc-die.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xconcat-filename.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xsize.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/xstrndup.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/abitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitset_stats.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitsetv.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/ebitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/lbitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vbitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitsetv-print.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/timevar.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/get-errno.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/calloc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/close.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/dup2.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/error.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/fcntl.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/float.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/itold.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/fopen.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/fpending.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/frexp.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/frexpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fseterr.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fstat.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/getdtablesize.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/getopt.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/getopt1.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/gettimeofday.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/isnan.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/isnand.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/isnanf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/isnanl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/ldexpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/lstat.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/malloc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/mbrtowc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/mbsinit.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/memchr.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/msvc-inval.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/msvc-nothrow.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/obstack.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/obstack_printf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/open.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/perror.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawni.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_addclose.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_adddup2.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_addopen.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_destroy.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_init.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnattr_destroy.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnattr_init.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnattr_setflags.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnattr_setsigmask.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/raise.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/rawmemchr.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/realloc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/sigaction.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/signbitd.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/signbitf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/signbitl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/sigprocmask.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/snprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/sprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/stat.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/stpcpy.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strchrnul.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strdup.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strerror.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strerror-override.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strerror_r.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strndup.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strnlen.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strverscmp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/unlink.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/unsetenv.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/asnprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-args.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-parse.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vasnprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vfprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vsnprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vsprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/waitpid.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/wcwidth.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xmemdup0.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) + +lib/libbison.a: $(lib_libbison_a_OBJECTS) $(lib_libbison_a_DEPENDENCIES) $(EXTRA_lib_libbison_a_DEPENDENCIES) lib/$(am__dirstamp) + $(AM_V_at)-rm -f lib/libbison.a + $(AM_V_AR)$(lib_libbison_a_AR) lib/libbison.a $(lib_libbison_a_OBJECTS) $(lib_libbison_a_LIBADD) + $(AM_V_at)$(RANLIB) lib/libbison.a +lib/main.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/yyerror.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) + +lib/liby.a: $(lib_liby_a_OBJECTS) $(lib_liby_a_DEPENDENCIES) $(EXTRA_lib_liby_a_DEPENDENCIES) lib/$(am__dirstamp) + $(AM_V_at)-rm -f lib/liby.a + $(AM_V_AR)$(lib_liby_a_AR) lib/liby.a $(lib_liby_a_OBJECTS) $(lib_liby_a_LIBADD) + $(AM_V_at)$(RANLIB) lib/liby.a +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +installcheck-binPROGRAMS: $(bin_PROGRAMS) + bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | \ + sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +examples/calc++/$(am__dirstamp): + @$(MKDIR_P) examples/calc++ + @: > examples/calc++/$(am__dirstamp) +examples/calc++/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) examples/calc++/$(DEPDIR) + @: > examples/calc++/$(DEPDIR)/$(am__dirstamp) +examples/calc++/examples_calc___calc__-calc++-driver.$(OBJEXT): \ + examples/calc++/$(am__dirstamp) \ + examples/calc++/$(DEPDIR)/$(am__dirstamp) +examples/calc++/examples_calc___calc__-calc++-scanner.$(OBJEXT): \ + examples/calc++/$(am__dirstamp) \ + examples/calc++/$(DEPDIR)/$(am__dirstamp) +examples/calc++/examples_calc___calc__-calc++.$(OBJEXT): \ + examples/calc++/$(am__dirstamp) \ + examples/calc++/$(DEPDIR)/$(am__dirstamp) +examples/calc++/examples_calc___calc__-calc++-parser.$(OBJEXT): \ + examples/calc++/$(am__dirstamp) \ + examples/calc++/$(DEPDIR)/$(am__dirstamp) + +examples/calc++/calc++$(EXEEXT): $(examples_calc___calc___OBJECTS) $(examples_calc___calc___DEPENDENCIES) $(EXTRA_examples_calc___calc___DEPENDENCIES) examples/calc++/$(am__dirstamp) + @rm -f examples/calc++/calc++$(EXEEXT) + $(AM_V_CXXLD)$(examples_calc___calc___LINK) $(examples_calc___calc___OBJECTS) $(examples_calc___calc___LDADD) $(LIBS) +examples/mfcalc/mfcalc.h: examples/mfcalc/mfcalc.c + @if test ! -f $@; then rm -f examples/mfcalc/mfcalc.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) examples/mfcalc/mfcalc.c; else :; fi +examples/mfcalc/$(am__dirstamp): + @$(MKDIR_P) examples/mfcalc + @: > examples/mfcalc/$(am__dirstamp) +examples/mfcalc/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) examples/mfcalc/$(DEPDIR) + @: > examples/mfcalc/$(DEPDIR)/$(am__dirstamp) +examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.$(OBJEXT): \ + examples/mfcalc/$(am__dirstamp) \ + examples/mfcalc/$(DEPDIR)/$(am__dirstamp) + +examples/mfcalc/mfcalc$(EXEEXT): $(examples_mfcalc_mfcalc_OBJECTS) $(examples_mfcalc_mfcalc_DEPENDENCIES) $(EXTRA_examples_mfcalc_mfcalc_DEPENDENCIES) examples/mfcalc/$(am__dirstamp) + @rm -f examples/mfcalc/mfcalc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(examples_mfcalc_mfcalc_OBJECTS) $(examples_mfcalc_mfcalc_LDADD) $(LIBS) +examples/rpcalc/rpcalc.h: examples/rpcalc/rpcalc.c + @if test ! -f $@; then rm -f examples/rpcalc/rpcalc.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) examples/rpcalc/rpcalc.c; else :; fi +examples/rpcalc/$(am__dirstamp): + @$(MKDIR_P) examples/rpcalc + @: > examples/rpcalc/$(am__dirstamp) +examples/rpcalc/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) examples/rpcalc/$(DEPDIR) + @: > examples/rpcalc/$(DEPDIR)/$(am__dirstamp) +examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.$(OBJEXT): \ + examples/rpcalc/$(am__dirstamp) \ + examples/rpcalc/$(DEPDIR)/$(am__dirstamp) + +examples/rpcalc/rpcalc$(EXEEXT): $(examples_rpcalc_rpcalc_OBJECTS) $(examples_rpcalc_rpcalc_DEPENDENCIES) $(EXTRA_examples_rpcalc_rpcalc_DEPENDENCIES) examples/rpcalc/$(am__dirstamp) + @rm -f examples/rpcalc/rpcalc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(examples_rpcalc_rpcalc_OBJECTS) $(examples_rpcalc_rpcalc_LDADD) $(LIBS) +src/$(am__dirstamp): + @$(MKDIR_P) src + @: > src/$(am__dirstamp) +src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/$(DEPDIR) + @: > src/$(DEPDIR)/$(am__dirstamp) +src/bison-AnnotationList.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-InadequacyList.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-LR0.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-Sbitset.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-assoc.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-closure.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-complain.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-conflicts.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-derives.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-files.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-getargs.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-graphviz.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-lalr.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-ielr.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-location.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-main.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-muscle-tab.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-named-ref.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-nullable.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-output.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/parse-gram.h: src/parse-gram.c + @if test ! -f $@; then rm -f src/parse-gram.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/parse-gram.c; else :; fi +src/bison-parse-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-print-xml.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-print.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-print_graph.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-reader.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-reduce.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-relation.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-code-c.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-gram-c.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-skel-c.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-state.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-symlist.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-symtab.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-tables.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-uniqstr.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-code.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-skel.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/bison$(EXEEXT): $(src_bison_OBJECTS) $(src_bison_DEPENDENCIES) $(EXTRA_src_bison_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/bison$(EXEEXT) + $(AM_V_CCLD)$(src_bison_LINK) $(src_bison_OBJECTS) $(src_bison_LDADD) $(LIBS) +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) + +installcheck-binSCRIPTS: $(bin_SCRIPTS) + bad=0; pid=$$$$; list="$(bin_SCRIPTS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f examples/calc++/*.$(OBJEXT) + -rm -f examples/mfcalc/*.$(OBJEXT) + -rm -f examples/rpcalc/*.$(OBJEXT) + -rm -f lib/*.$(OBJEXT) + -rm -f lib/glthread/*.$(OBJEXT) + -rm -f lib/uniwidth/*.$(OBJEXT) + -rm -f src/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-driver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-parser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-scanner.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@examples/mfcalc/$(DEPDIR)/examples_mfcalc_mfcalc-mfcalc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@examples/rpcalc/$(DEPDIR)/examples_rpcalc_rpcalc-rpcalc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/abitset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/argmatch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/asnprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/basename-lgpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/basename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/binary-io.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitrotate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitset_stats.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitsetv-print.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitsetv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/c-ctype.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/c-strcasecmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/c-strncasecmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/calloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/cloexec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/close-stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/close.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/closeout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/concat-filename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirname-lgpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dup-safer-flag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dup-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dup2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ebitset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/exitfail.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fatal-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fcntl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fd-hook.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fd-safer-flag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fd-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/float.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fopen-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fpending.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/frexp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/frexpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fseterr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/get-errno.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getdtablesize.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/gettimeofday.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnand.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnanf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnanl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/itold.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lbitset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ldexpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/localcharset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/malloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/math.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbrtowc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbsinit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbswidth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/memchr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/msvc-inval.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/msvc-nothrow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/obstack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/obstack_printf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/perror.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/pipe-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/pipe2-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/pipe2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-args.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-frexp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-frexpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/progname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/quotearg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/raise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/rawmemchr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/realloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sig-handler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sigaction.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sigprocmask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/snprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn-pipe.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_addclose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_adddup2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_addopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_destroy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnattr_destroy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnattr_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnattr_setflags.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnattr_setsigmask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawni.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stpcpy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strchrnul.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strdup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror-override.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror_r.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stripslash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strndup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strnlen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strverscmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/timevar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unistd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unsetenv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vasnprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vbitset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vfprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vsnprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vsprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/wait-process.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/waitpid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/wctype-h.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/wcwidth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xalloc-die.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xconcat-filename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xmalloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xmemdup0.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xsize.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xstrndup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/yyerror.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/glthread/$(DEPDIR)/lock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/glthread/$(DEPDIR)/threadlib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/uniwidth/$(DEPDIR)/width.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-AnnotationList.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-InadequacyList.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-LR0.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-Sbitset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-assoc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-closure.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-complain.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-conflicts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-derives.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-files.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-getargs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-gram.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-graphviz.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-ielr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-lalr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-location.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-muscle-tab.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-named-ref.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-nullable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-output.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-parse-gram.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print-xml.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print_graph.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-reader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-reduce.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-relation.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-code-c.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-code.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-gram-c.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-gram.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-skel-c.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-skel.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-state.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-symlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-symtab.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-tables.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-uniqstr.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o: examples/mfcalc/mfcalc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_mfcalc_mfcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o -MD -MP -MF examples/mfcalc/$(DEPDIR)/examples_mfcalc_mfcalc-mfcalc.Tpo -c -o examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o `test -f 'examples/mfcalc/mfcalc.c' || echo '$(srcdir)/'`examples/mfcalc/mfcalc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/mfcalc/$(DEPDIR)/examples_mfcalc_mfcalc-mfcalc.Tpo examples/mfcalc/$(DEPDIR)/examples_mfcalc_mfcalc-mfcalc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/mfcalc/mfcalc.c' object='examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_mfcalc_mfcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o `test -f 'examples/mfcalc/mfcalc.c' || echo '$(srcdir)/'`examples/mfcalc/mfcalc.c + +examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.obj: examples/mfcalc/mfcalc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_mfcalc_mfcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.obj -MD -MP -MF examples/mfcalc/$(DEPDIR)/examples_mfcalc_mfcalc-mfcalc.Tpo -c -o examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.obj `if test -f 'examples/mfcalc/mfcalc.c'; then $(CYGPATH_W) 'examples/mfcalc/mfcalc.c'; else $(CYGPATH_W) '$(srcdir)/examples/mfcalc/mfcalc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/mfcalc/$(DEPDIR)/examples_mfcalc_mfcalc-mfcalc.Tpo examples/mfcalc/$(DEPDIR)/examples_mfcalc_mfcalc-mfcalc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/mfcalc/mfcalc.c' object='examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_mfcalc_mfcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.obj `if test -f 'examples/mfcalc/mfcalc.c'; then $(CYGPATH_W) 'examples/mfcalc/mfcalc.c'; else $(CYGPATH_W) '$(srcdir)/examples/mfcalc/mfcalc.c'; fi` + +examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.o: examples/rpcalc/rpcalc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_rpcalc_rpcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.o -MD -MP -MF examples/rpcalc/$(DEPDIR)/examples_rpcalc_rpcalc-rpcalc.Tpo -c -o examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.o `test -f 'examples/rpcalc/rpcalc.c' || echo '$(srcdir)/'`examples/rpcalc/rpcalc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/rpcalc/$(DEPDIR)/examples_rpcalc_rpcalc-rpcalc.Tpo examples/rpcalc/$(DEPDIR)/examples_rpcalc_rpcalc-rpcalc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/rpcalc/rpcalc.c' object='examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_rpcalc_rpcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.o `test -f 'examples/rpcalc/rpcalc.c' || echo '$(srcdir)/'`examples/rpcalc/rpcalc.c + +examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.obj: examples/rpcalc/rpcalc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_rpcalc_rpcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.obj -MD -MP -MF examples/rpcalc/$(DEPDIR)/examples_rpcalc_rpcalc-rpcalc.Tpo -c -o examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.obj `if test -f 'examples/rpcalc/rpcalc.c'; then $(CYGPATH_W) 'examples/rpcalc/rpcalc.c'; else $(CYGPATH_W) '$(srcdir)/examples/rpcalc/rpcalc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/rpcalc/$(DEPDIR)/examples_rpcalc_rpcalc-rpcalc.Tpo examples/rpcalc/$(DEPDIR)/examples_rpcalc_rpcalc-rpcalc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/rpcalc/rpcalc.c' object='examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_rpcalc_rpcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.obj `if test -f 'examples/rpcalc/rpcalc.c'; then $(CYGPATH_W) 'examples/rpcalc/rpcalc.c'; else $(CYGPATH_W) '$(srcdir)/examples/rpcalc/rpcalc.c'; fi` + +src/bison-AnnotationList.o: src/AnnotationList.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-AnnotationList.o -MD -MP -MF src/$(DEPDIR)/bison-AnnotationList.Tpo -c -o src/bison-AnnotationList.o `test -f 'src/AnnotationList.c' || echo '$(srcdir)/'`src/AnnotationList.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-AnnotationList.Tpo src/$(DEPDIR)/bison-AnnotationList.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/AnnotationList.c' object='src/bison-AnnotationList.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-AnnotationList.o `test -f 'src/AnnotationList.c' || echo '$(srcdir)/'`src/AnnotationList.c + +src/bison-AnnotationList.obj: src/AnnotationList.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-AnnotationList.obj -MD -MP -MF src/$(DEPDIR)/bison-AnnotationList.Tpo -c -o src/bison-AnnotationList.obj `if test -f 'src/AnnotationList.c'; then $(CYGPATH_W) 'src/AnnotationList.c'; else $(CYGPATH_W) '$(srcdir)/src/AnnotationList.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-AnnotationList.Tpo src/$(DEPDIR)/bison-AnnotationList.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/AnnotationList.c' object='src/bison-AnnotationList.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-AnnotationList.obj `if test -f 'src/AnnotationList.c'; then $(CYGPATH_W) 'src/AnnotationList.c'; else $(CYGPATH_W) '$(srcdir)/src/AnnotationList.c'; fi` + +src/bison-InadequacyList.o: src/InadequacyList.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-InadequacyList.o -MD -MP -MF src/$(DEPDIR)/bison-InadequacyList.Tpo -c -o src/bison-InadequacyList.o `test -f 'src/InadequacyList.c' || echo '$(srcdir)/'`src/InadequacyList.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-InadequacyList.Tpo src/$(DEPDIR)/bison-InadequacyList.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/InadequacyList.c' object='src/bison-InadequacyList.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-InadequacyList.o `test -f 'src/InadequacyList.c' || echo '$(srcdir)/'`src/InadequacyList.c + +src/bison-InadequacyList.obj: src/InadequacyList.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-InadequacyList.obj -MD -MP -MF src/$(DEPDIR)/bison-InadequacyList.Tpo -c -o src/bison-InadequacyList.obj `if test -f 'src/InadequacyList.c'; then $(CYGPATH_W) 'src/InadequacyList.c'; else $(CYGPATH_W) '$(srcdir)/src/InadequacyList.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-InadequacyList.Tpo src/$(DEPDIR)/bison-InadequacyList.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/InadequacyList.c' object='src/bison-InadequacyList.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-InadequacyList.obj `if test -f 'src/InadequacyList.c'; then $(CYGPATH_W) 'src/InadequacyList.c'; else $(CYGPATH_W) '$(srcdir)/src/InadequacyList.c'; fi` + +src/bison-LR0.o: src/LR0.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-LR0.o -MD -MP -MF src/$(DEPDIR)/bison-LR0.Tpo -c -o src/bison-LR0.o `test -f 'src/LR0.c' || echo '$(srcdir)/'`src/LR0.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-LR0.Tpo src/$(DEPDIR)/bison-LR0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/LR0.c' object='src/bison-LR0.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-LR0.o `test -f 'src/LR0.c' || echo '$(srcdir)/'`src/LR0.c + +src/bison-LR0.obj: src/LR0.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-LR0.obj -MD -MP -MF src/$(DEPDIR)/bison-LR0.Tpo -c -o src/bison-LR0.obj `if test -f 'src/LR0.c'; then $(CYGPATH_W) 'src/LR0.c'; else $(CYGPATH_W) '$(srcdir)/src/LR0.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-LR0.Tpo src/$(DEPDIR)/bison-LR0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/LR0.c' object='src/bison-LR0.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-LR0.obj `if test -f 'src/LR0.c'; then $(CYGPATH_W) 'src/LR0.c'; else $(CYGPATH_W) '$(srcdir)/src/LR0.c'; fi` + +src/bison-Sbitset.o: src/Sbitset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-Sbitset.o -MD -MP -MF src/$(DEPDIR)/bison-Sbitset.Tpo -c -o src/bison-Sbitset.o `test -f 'src/Sbitset.c' || echo '$(srcdir)/'`src/Sbitset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-Sbitset.Tpo src/$(DEPDIR)/bison-Sbitset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/Sbitset.c' object='src/bison-Sbitset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-Sbitset.o `test -f 'src/Sbitset.c' || echo '$(srcdir)/'`src/Sbitset.c + +src/bison-Sbitset.obj: src/Sbitset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-Sbitset.obj -MD -MP -MF src/$(DEPDIR)/bison-Sbitset.Tpo -c -o src/bison-Sbitset.obj `if test -f 'src/Sbitset.c'; then $(CYGPATH_W) 'src/Sbitset.c'; else $(CYGPATH_W) '$(srcdir)/src/Sbitset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-Sbitset.Tpo src/$(DEPDIR)/bison-Sbitset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/Sbitset.c' object='src/bison-Sbitset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-Sbitset.obj `if test -f 'src/Sbitset.c'; then $(CYGPATH_W) 'src/Sbitset.c'; else $(CYGPATH_W) '$(srcdir)/src/Sbitset.c'; fi` + +src/bison-assoc.o: src/assoc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-assoc.o -MD -MP -MF src/$(DEPDIR)/bison-assoc.Tpo -c -o src/bison-assoc.o `test -f 'src/assoc.c' || echo '$(srcdir)/'`src/assoc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-assoc.Tpo src/$(DEPDIR)/bison-assoc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/assoc.c' object='src/bison-assoc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-assoc.o `test -f 'src/assoc.c' || echo '$(srcdir)/'`src/assoc.c + +src/bison-assoc.obj: src/assoc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-assoc.obj -MD -MP -MF src/$(DEPDIR)/bison-assoc.Tpo -c -o src/bison-assoc.obj `if test -f 'src/assoc.c'; then $(CYGPATH_W) 'src/assoc.c'; else $(CYGPATH_W) '$(srcdir)/src/assoc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-assoc.Tpo src/$(DEPDIR)/bison-assoc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/assoc.c' object='src/bison-assoc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-assoc.obj `if test -f 'src/assoc.c'; then $(CYGPATH_W) 'src/assoc.c'; else $(CYGPATH_W) '$(srcdir)/src/assoc.c'; fi` + +src/bison-closure.o: src/closure.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-closure.o -MD -MP -MF src/$(DEPDIR)/bison-closure.Tpo -c -o src/bison-closure.o `test -f 'src/closure.c' || echo '$(srcdir)/'`src/closure.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-closure.Tpo src/$(DEPDIR)/bison-closure.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/closure.c' object='src/bison-closure.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-closure.o `test -f 'src/closure.c' || echo '$(srcdir)/'`src/closure.c + +src/bison-closure.obj: src/closure.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-closure.obj -MD -MP -MF src/$(DEPDIR)/bison-closure.Tpo -c -o src/bison-closure.obj `if test -f 'src/closure.c'; then $(CYGPATH_W) 'src/closure.c'; else $(CYGPATH_W) '$(srcdir)/src/closure.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-closure.Tpo src/$(DEPDIR)/bison-closure.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/closure.c' object='src/bison-closure.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-closure.obj `if test -f 'src/closure.c'; then $(CYGPATH_W) 'src/closure.c'; else $(CYGPATH_W) '$(srcdir)/src/closure.c'; fi` + +src/bison-complain.o: src/complain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-complain.o -MD -MP -MF src/$(DEPDIR)/bison-complain.Tpo -c -o src/bison-complain.o `test -f 'src/complain.c' || echo '$(srcdir)/'`src/complain.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-complain.Tpo src/$(DEPDIR)/bison-complain.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/complain.c' object='src/bison-complain.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-complain.o `test -f 'src/complain.c' || echo '$(srcdir)/'`src/complain.c + +src/bison-complain.obj: src/complain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-complain.obj -MD -MP -MF src/$(DEPDIR)/bison-complain.Tpo -c -o src/bison-complain.obj `if test -f 'src/complain.c'; then $(CYGPATH_W) 'src/complain.c'; else $(CYGPATH_W) '$(srcdir)/src/complain.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-complain.Tpo src/$(DEPDIR)/bison-complain.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/complain.c' object='src/bison-complain.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-complain.obj `if test -f 'src/complain.c'; then $(CYGPATH_W) 'src/complain.c'; else $(CYGPATH_W) '$(srcdir)/src/complain.c'; fi` + +src/bison-conflicts.o: src/conflicts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-conflicts.o -MD -MP -MF src/$(DEPDIR)/bison-conflicts.Tpo -c -o src/bison-conflicts.o `test -f 'src/conflicts.c' || echo '$(srcdir)/'`src/conflicts.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-conflicts.Tpo src/$(DEPDIR)/bison-conflicts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/conflicts.c' object='src/bison-conflicts.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-conflicts.o `test -f 'src/conflicts.c' || echo '$(srcdir)/'`src/conflicts.c + +src/bison-conflicts.obj: src/conflicts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-conflicts.obj -MD -MP -MF src/$(DEPDIR)/bison-conflicts.Tpo -c -o src/bison-conflicts.obj `if test -f 'src/conflicts.c'; then $(CYGPATH_W) 'src/conflicts.c'; else $(CYGPATH_W) '$(srcdir)/src/conflicts.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-conflicts.Tpo src/$(DEPDIR)/bison-conflicts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/conflicts.c' object='src/bison-conflicts.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-conflicts.obj `if test -f 'src/conflicts.c'; then $(CYGPATH_W) 'src/conflicts.c'; else $(CYGPATH_W) '$(srcdir)/src/conflicts.c'; fi` + +src/bison-derives.o: src/derives.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-derives.o -MD -MP -MF src/$(DEPDIR)/bison-derives.Tpo -c -o src/bison-derives.o `test -f 'src/derives.c' || echo '$(srcdir)/'`src/derives.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-derives.Tpo src/$(DEPDIR)/bison-derives.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/derives.c' object='src/bison-derives.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-derives.o `test -f 'src/derives.c' || echo '$(srcdir)/'`src/derives.c + +src/bison-derives.obj: src/derives.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-derives.obj -MD -MP -MF src/$(DEPDIR)/bison-derives.Tpo -c -o src/bison-derives.obj `if test -f 'src/derives.c'; then $(CYGPATH_W) 'src/derives.c'; else $(CYGPATH_W) '$(srcdir)/src/derives.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-derives.Tpo src/$(DEPDIR)/bison-derives.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/derives.c' object='src/bison-derives.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-derives.obj `if test -f 'src/derives.c'; then $(CYGPATH_W) 'src/derives.c'; else $(CYGPATH_W) '$(srcdir)/src/derives.c'; fi` + +src/bison-files.o: src/files.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-files.o -MD -MP -MF src/$(DEPDIR)/bison-files.Tpo -c -o src/bison-files.o `test -f 'src/files.c' || echo '$(srcdir)/'`src/files.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-files.Tpo src/$(DEPDIR)/bison-files.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/files.c' object='src/bison-files.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-files.o `test -f 'src/files.c' || echo '$(srcdir)/'`src/files.c + +src/bison-files.obj: src/files.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-files.obj -MD -MP -MF src/$(DEPDIR)/bison-files.Tpo -c -o src/bison-files.obj `if test -f 'src/files.c'; then $(CYGPATH_W) 'src/files.c'; else $(CYGPATH_W) '$(srcdir)/src/files.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-files.Tpo src/$(DEPDIR)/bison-files.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/files.c' object='src/bison-files.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-files.obj `if test -f 'src/files.c'; then $(CYGPATH_W) 'src/files.c'; else $(CYGPATH_W) '$(srcdir)/src/files.c'; fi` + +src/bison-getargs.o: src/getargs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-getargs.o -MD -MP -MF src/$(DEPDIR)/bison-getargs.Tpo -c -o src/bison-getargs.o `test -f 'src/getargs.c' || echo '$(srcdir)/'`src/getargs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-getargs.Tpo src/$(DEPDIR)/bison-getargs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/getargs.c' object='src/bison-getargs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-getargs.o `test -f 'src/getargs.c' || echo '$(srcdir)/'`src/getargs.c + +src/bison-getargs.obj: src/getargs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-getargs.obj -MD -MP -MF src/$(DEPDIR)/bison-getargs.Tpo -c -o src/bison-getargs.obj `if test -f 'src/getargs.c'; then $(CYGPATH_W) 'src/getargs.c'; else $(CYGPATH_W) '$(srcdir)/src/getargs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-getargs.Tpo src/$(DEPDIR)/bison-getargs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/getargs.c' object='src/bison-getargs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-getargs.obj `if test -f 'src/getargs.c'; then $(CYGPATH_W) 'src/getargs.c'; else $(CYGPATH_W) '$(srcdir)/src/getargs.c'; fi` + +src/bison-gram.o: src/gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-gram.o -MD -MP -MF src/$(DEPDIR)/bison-gram.Tpo -c -o src/bison-gram.o `test -f 'src/gram.c' || echo '$(srcdir)/'`src/gram.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-gram.Tpo src/$(DEPDIR)/bison-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gram.c' object='src/bison-gram.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-gram.o `test -f 'src/gram.c' || echo '$(srcdir)/'`src/gram.c + +src/bison-gram.obj: src/gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-gram.obj -MD -MP -MF src/$(DEPDIR)/bison-gram.Tpo -c -o src/bison-gram.obj `if test -f 'src/gram.c'; then $(CYGPATH_W) 'src/gram.c'; else $(CYGPATH_W) '$(srcdir)/src/gram.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-gram.Tpo src/$(DEPDIR)/bison-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gram.c' object='src/bison-gram.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-gram.obj `if test -f 'src/gram.c'; then $(CYGPATH_W) 'src/gram.c'; else $(CYGPATH_W) '$(srcdir)/src/gram.c'; fi` + +src/bison-graphviz.o: src/graphviz.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-graphviz.o -MD -MP -MF src/$(DEPDIR)/bison-graphviz.Tpo -c -o src/bison-graphviz.o `test -f 'src/graphviz.c' || echo '$(srcdir)/'`src/graphviz.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-graphviz.Tpo src/$(DEPDIR)/bison-graphviz.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/graphviz.c' object='src/bison-graphviz.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-graphviz.o `test -f 'src/graphviz.c' || echo '$(srcdir)/'`src/graphviz.c + +src/bison-graphviz.obj: src/graphviz.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-graphviz.obj -MD -MP -MF src/$(DEPDIR)/bison-graphviz.Tpo -c -o src/bison-graphviz.obj `if test -f 'src/graphviz.c'; then $(CYGPATH_W) 'src/graphviz.c'; else $(CYGPATH_W) '$(srcdir)/src/graphviz.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-graphviz.Tpo src/$(DEPDIR)/bison-graphviz.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/graphviz.c' object='src/bison-graphviz.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-graphviz.obj `if test -f 'src/graphviz.c'; then $(CYGPATH_W) 'src/graphviz.c'; else $(CYGPATH_W) '$(srcdir)/src/graphviz.c'; fi` + +src/bison-lalr.o: src/lalr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-lalr.o -MD -MP -MF src/$(DEPDIR)/bison-lalr.Tpo -c -o src/bison-lalr.o `test -f 'src/lalr.c' || echo '$(srcdir)/'`src/lalr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-lalr.Tpo src/$(DEPDIR)/bison-lalr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/lalr.c' object='src/bison-lalr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-lalr.o `test -f 'src/lalr.c' || echo '$(srcdir)/'`src/lalr.c + +src/bison-lalr.obj: src/lalr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-lalr.obj -MD -MP -MF src/$(DEPDIR)/bison-lalr.Tpo -c -o src/bison-lalr.obj `if test -f 'src/lalr.c'; then $(CYGPATH_W) 'src/lalr.c'; else $(CYGPATH_W) '$(srcdir)/src/lalr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-lalr.Tpo src/$(DEPDIR)/bison-lalr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/lalr.c' object='src/bison-lalr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-lalr.obj `if test -f 'src/lalr.c'; then $(CYGPATH_W) 'src/lalr.c'; else $(CYGPATH_W) '$(srcdir)/src/lalr.c'; fi` + +src/bison-ielr.o: src/ielr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-ielr.o -MD -MP -MF src/$(DEPDIR)/bison-ielr.Tpo -c -o src/bison-ielr.o `test -f 'src/ielr.c' || echo '$(srcdir)/'`src/ielr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-ielr.Tpo src/$(DEPDIR)/bison-ielr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ielr.c' object='src/bison-ielr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-ielr.o `test -f 'src/ielr.c' || echo '$(srcdir)/'`src/ielr.c + +src/bison-ielr.obj: src/ielr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-ielr.obj -MD -MP -MF src/$(DEPDIR)/bison-ielr.Tpo -c -o src/bison-ielr.obj `if test -f 'src/ielr.c'; then $(CYGPATH_W) 'src/ielr.c'; else $(CYGPATH_W) '$(srcdir)/src/ielr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-ielr.Tpo src/$(DEPDIR)/bison-ielr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ielr.c' object='src/bison-ielr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-ielr.obj `if test -f 'src/ielr.c'; then $(CYGPATH_W) 'src/ielr.c'; else $(CYGPATH_W) '$(srcdir)/src/ielr.c'; fi` + +src/bison-location.o: src/location.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-location.o -MD -MP -MF src/$(DEPDIR)/bison-location.Tpo -c -o src/bison-location.o `test -f 'src/location.c' || echo '$(srcdir)/'`src/location.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-location.Tpo src/$(DEPDIR)/bison-location.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/location.c' object='src/bison-location.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-location.o `test -f 'src/location.c' || echo '$(srcdir)/'`src/location.c + +src/bison-location.obj: src/location.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-location.obj -MD -MP -MF src/$(DEPDIR)/bison-location.Tpo -c -o src/bison-location.obj `if test -f 'src/location.c'; then $(CYGPATH_W) 'src/location.c'; else $(CYGPATH_W) '$(srcdir)/src/location.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-location.Tpo src/$(DEPDIR)/bison-location.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/location.c' object='src/bison-location.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-location.obj `if test -f 'src/location.c'; then $(CYGPATH_W) 'src/location.c'; else $(CYGPATH_W) '$(srcdir)/src/location.c'; fi` + +src/bison-main.o: src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-main.o -MD -MP -MF src/$(DEPDIR)/bison-main.Tpo -c -o src/bison-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-main.Tpo src/$(DEPDIR)/bison-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/bison-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c + +src/bison-main.obj: src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-main.obj -MD -MP -MF src/$(DEPDIR)/bison-main.Tpo -c -o src/bison-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-main.Tpo src/$(DEPDIR)/bison-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/bison-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` + +src/bison-muscle-tab.o: src/muscle-tab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-muscle-tab.o -MD -MP -MF src/$(DEPDIR)/bison-muscle-tab.Tpo -c -o src/bison-muscle-tab.o `test -f 'src/muscle-tab.c' || echo '$(srcdir)/'`src/muscle-tab.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-muscle-tab.Tpo src/$(DEPDIR)/bison-muscle-tab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/muscle-tab.c' object='src/bison-muscle-tab.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-muscle-tab.o `test -f 'src/muscle-tab.c' || echo '$(srcdir)/'`src/muscle-tab.c + +src/bison-muscle-tab.obj: src/muscle-tab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-muscle-tab.obj -MD -MP -MF src/$(DEPDIR)/bison-muscle-tab.Tpo -c -o src/bison-muscle-tab.obj `if test -f 'src/muscle-tab.c'; then $(CYGPATH_W) 'src/muscle-tab.c'; else $(CYGPATH_W) '$(srcdir)/src/muscle-tab.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-muscle-tab.Tpo src/$(DEPDIR)/bison-muscle-tab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/muscle-tab.c' object='src/bison-muscle-tab.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-muscle-tab.obj `if test -f 'src/muscle-tab.c'; then $(CYGPATH_W) 'src/muscle-tab.c'; else $(CYGPATH_W) '$(srcdir)/src/muscle-tab.c'; fi` + +src/bison-named-ref.o: src/named-ref.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-named-ref.o -MD -MP -MF src/$(DEPDIR)/bison-named-ref.Tpo -c -o src/bison-named-ref.o `test -f 'src/named-ref.c' || echo '$(srcdir)/'`src/named-ref.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-named-ref.Tpo src/$(DEPDIR)/bison-named-ref.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/named-ref.c' object='src/bison-named-ref.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-named-ref.o `test -f 'src/named-ref.c' || echo '$(srcdir)/'`src/named-ref.c + +src/bison-named-ref.obj: src/named-ref.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-named-ref.obj -MD -MP -MF src/$(DEPDIR)/bison-named-ref.Tpo -c -o src/bison-named-ref.obj `if test -f 'src/named-ref.c'; then $(CYGPATH_W) 'src/named-ref.c'; else $(CYGPATH_W) '$(srcdir)/src/named-ref.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-named-ref.Tpo src/$(DEPDIR)/bison-named-ref.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/named-ref.c' object='src/bison-named-ref.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-named-ref.obj `if test -f 'src/named-ref.c'; then $(CYGPATH_W) 'src/named-ref.c'; else $(CYGPATH_W) '$(srcdir)/src/named-ref.c'; fi` + +src/bison-nullable.o: src/nullable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-nullable.o -MD -MP -MF src/$(DEPDIR)/bison-nullable.Tpo -c -o src/bison-nullable.o `test -f 'src/nullable.c' || echo '$(srcdir)/'`src/nullable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-nullable.Tpo src/$(DEPDIR)/bison-nullable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/nullable.c' object='src/bison-nullable.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-nullable.o `test -f 'src/nullable.c' || echo '$(srcdir)/'`src/nullable.c + +src/bison-nullable.obj: src/nullable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-nullable.obj -MD -MP -MF src/$(DEPDIR)/bison-nullable.Tpo -c -o src/bison-nullable.obj `if test -f 'src/nullable.c'; then $(CYGPATH_W) 'src/nullable.c'; else $(CYGPATH_W) '$(srcdir)/src/nullable.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-nullable.Tpo src/$(DEPDIR)/bison-nullable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/nullable.c' object='src/bison-nullable.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-nullable.obj `if test -f 'src/nullable.c'; then $(CYGPATH_W) 'src/nullable.c'; else $(CYGPATH_W) '$(srcdir)/src/nullable.c'; fi` + +src/bison-output.o: src/output.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-output.o -MD -MP -MF src/$(DEPDIR)/bison-output.Tpo -c -o src/bison-output.o `test -f 'src/output.c' || echo '$(srcdir)/'`src/output.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-output.Tpo src/$(DEPDIR)/bison-output.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/output.c' object='src/bison-output.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-output.o `test -f 'src/output.c' || echo '$(srcdir)/'`src/output.c + +src/bison-output.obj: src/output.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-output.obj -MD -MP -MF src/$(DEPDIR)/bison-output.Tpo -c -o src/bison-output.obj `if test -f 'src/output.c'; then $(CYGPATH_W) 'src/output.c'; else $(CYGPATH_W) '$(srcdir)/src/output.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-output.Tpo src/$(DEPDIR)/bison-output.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/output.c' object='src/bison-output.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-output.obj `if test -f 'src/output.c'; then $(CYGPATH_W) 'src/output.c'; else $(CYGPATH_W) '$(srcdir)/src/output.c'; fi` + +src/bison-parse-gram.o: src/parse-gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-parse-gram.o -MD -MP -MF src/$(DEPDIR)/bison-parse-gram.Tpo -c -o src/bison-parse-gram.o `test -f 'src/parse-gram.c' || echo '$(srcdir)/'`src/parse-gram.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-parse-gram.Tpo src/$(DEPDIR)/bison-parse-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/parse-gram.c' object='src/bison-parse-gram.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-parse-gram.o `test -f 'src/parse-gram.c' || echo '$(srcdir)/'`src/parse-gram.c + +src/bison-parse-gram.obj: src/parse-gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-parse-gram.obj -MD -MP -MF src/$(DEPDIR)/bison-parse-gram.Tpo -c -o src/bison-parse-gram.obj `if test -f 'src/parse-gram.c'; then $(CYGPATH_W) 'src/parse-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/parse-gram.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-parse-gram.Tpo src/$(DEPDIR)/bison-parse-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/parse-gram.c' object='src/bison-parse-gram.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-parse-gram.obj `if test -f 'src/parse-gram.c'; then $(CYGPATH_W) 'src/parse-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/parse-gram.c'; fi` + +src/bison-print-xml.o: src/print-xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print-xml.o -MD -MP -MF src/$(DEPDIR)/bison-print-xml.Tpo -c -o src/bison-print-xml.o `test -f 'src/print-xml.c' || echo '$(srcdir)/'`src/print-xml.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print-xml.Tpo src/$(DEPDIR)/bison-print-xml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print-xml.c' object='src/bison-print-xml.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print-xml.o `test -f 'src/print-xml.c' || echo '$(srcdir)/'`src/print-xml.c + +src/bison-print-xml.obj: src/print-xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print-xml.obj -MD -MP -MF src/$(DEPDIR)/bison-print-xml.Tpo -c -o src/bison-print-xml.obj `if test -f 'src/print-xml.c'; then $(CYGPATH_W) 'src/print-xml.c'; else $(CYGPATH_W) '$(srcdir)/src/print-xml.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print-xml.Tpo src/$(DEPDIR)/bison-print-xml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print-xml.c' object='src/bison-print-xml.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print-xml.obj `if test -f 'src/print-xml.c'; then $(CYGPATH_W) 'src/print-xml.c'; else $(CYGPATH_W) '$(srcdir)/src/print-xml.c'; fi` + +src/bison-print.o: src/print.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print.o -MD -MP -MF src/$(DEPDIR)/bison-print.Tpo -c -o src/bison-print.o `test -f 'src/print.c' || echo '$(srcdir)/'`src/print.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print.Tpo src/$(DEPDIR)/bison-print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print.c' object='src/bison-print.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print.o `test -f 'src/print.c' || echo '$(srcdir)/'`src/print.c + +src/bison-print.obj: src/print.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print.obj -MD -MP -MF src/$(DEPDIR)/bison-print.Tpo -c -o src/bison-print.obj `if test -f 'src/print.c'; then $(CYGPATH_W) 'src/print.c'; else $(CYGPATH_W) '$(srcdir)/src/print.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print.Tpo src/$(DEPDIR)/bison-print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print.c' object='src/bison-print.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print.obj `if test -f 'src/print.c'; then $(CYGPATH_W) 'src/print.c'; else $(CYGPATH_W) '$(srcdir)/src/print.c'; fi` + +src/bison-print_graph.o: src/print_graph.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print_graph.o -MD -MP -MF src/$(DEPDIR)/bison-print_graph.Tpo -c -o src/bison-print_graph.o `test -f 'src/print_graph.c' || echo '$(srcdir)/'`src/print_graph.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print_graph.Tpo src/$(DEPDIR)/bison-print_graph.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print_graph.c' object='src/bison-print_graph.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print_graph.o `test -f 'src/print_graph.c' || echo '$(srcdir)/'`src/print_graph.c + +src/bison-print_graph.obj: src/print_graph.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print_graph.obj -MD -MP -MF src/$(DEPDIR)/bison-print_graph.Tpo -c -o src/bison-print_graph.obj `if test -f 'src/print_graph.c'; then $(CYGPATH_W) 'src/print_graph.c'; else $(CYGPATH_W) '$(srcdir)/src/print_graph.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print_graph.Tpo src/$(DEPDIR)/bison-print_graph.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print_graph.c' object='src/bison-print_graph.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print_graph.obj `if test -f 'src/print_graph.c'; then $(CYGPATH_W) 'src/print_graph.c'; else $(CYGPATH_W) '$(srcdir)/src/print_graph.c'; fi` + +src/bison-reader.o: src/reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-reader.o -MD -MP -MF src/$(DEPDIR)/bison-reader.Tpo -c -o src/bison-reader.o `test -f 'src/reader.c' || echo '$(srcdir)/'`src/reader.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-reader.Tpo src/$(DEPDIR)/bison-reader.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/reader.c' object='src/bison-reader.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-reader.o `test -f 'src/reader.c' || echo '$(srcdir)/'`src/reader.c + +src/bison-reader.obj: src/reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-reader.obj -MD -MP -MF src/$(DEPDIR)/bison-reader.Tpo -c -o src/bison-reader.obj `if test -f 'src/reader.c'; then $(CYGPATH_W) 'src/reader.c'; else $(CYGPATH_W) '$(srcdir)/src/reader.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-reader.Tpo src/$(DEPDIR)/bison-reader.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/reader.c' object='src/bison-reader.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-reader.obj `if test -f 'src/reader.c'; then $(CYGPATH_W) 'src/reader.c'; else $(CYGPATH_W) '$(srcdir)/src/reader.c'; fi` + +src/bison-reduce.o: src/reduce.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-reduce.o -MD -MP -MF src/$(DEPDIR)/bison-reduce.Tpo -c -o src/bison-reduce.o `test -f 'src/reduce.c' || echo '$(srcdir)/'`src/reduce.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-reduce.Tpo src/$(DEPDIR)/bison-reduce.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/reduce.c' object='src/bison-reduce.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-reduce.o `test -f 'src/reduce.c' || echo '$(srcdir)/'`src/reduce.c + +src/bison-reduce.obj: src/reduce.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-reduce.obj -MD -MP -MF src/$(DEPDIR)/bison-reduce.Tpo -c -o src/bison-reduce.obj `if test -f 'src/reduce.c'; then $(CYGPATH_W) 'src/reduce.c'; else $(CYGPATH_W) '$(srcdir)/src/reduce.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-reduce.Tpo src/$(DEPDIR)/bison-reduce.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/reduce.c' object='src/bison-reduce.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-reduce.obj `if test -f 'src/reduce.c'; then $(CYGPATH_W) 'src/reduce.c'; else $(CYGPATH_W) '$(srcdir)/src/reduce.c'; fi` + +src/bison-relation.o: src/relation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-relation.o -MD -MP -MF src/$(DEPDIR)/bison-relation.Tpo -c -o src/bison-relation.o `test -f 'src/relation.c' || echo '$(srcdir)/'`src/relation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-relation.Tpo src/$(DEPDIR)/bison-relation.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/relation.c' object='src/bison-relation.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-relation.o `test -f 'src/relation.c' || echo '$(srcdir)/'`src/relation.c + +src/bison-relation.obj: src/relation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-relation.obj -MD -MP -MF src/$(DEPDIR)/bison-relation.Tpo -c -o src/bison-relation.obj `if test -f 'src/relation.c'; then $(CYGPATH_W) 'src/relation.c'; else $(CYGPATH_W) '$(srcdir)/src/relation.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-relation.Tpo src/$(DEPDIR)/bison-relation.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/relation.c' object='src/bison-relation.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-relation.obj `if test -f 'src/relation.c'; then $(CYGPATH_W) 'src/relation.c'; else $(CYGPATH_W) '$(srcdir)/src/relation.c'; fi` + +src/bison-scan-code-c.o: src/scan-code-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-code-c.o -MD -MP -MF src/$(DEPDIR)/bison-scan-code-c.Tpo -c -o src/bison-scan-code-c.o `test -f 'src/scan-code-c.c' || echo '$(srcdir)/'`src/scan-code-c.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-code-c.Tpo src/$(DEPDIR)/bison-scan-code-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-code-c.c' object='src/bison-scan-code-c.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-code-c.o `test -f 'src/scan-code-c.c' || echo '$(srcdir)/'`src/scan-code-c.c + +src/bison-scan-code-c.obj: src/scan-code-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-code-c.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-code-c.Tpo -c -o src/bison-scan-code-c.obj `if test -f 'src/scan-code-c.c'; then $(CYGPATH_W) 'src/scan-code-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-code-c.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-code-c.Tpo src/$(DEPDIR)/bison-scan-code-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-code-c.c' object='src/bison-scan-code-c.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-code-c.obj `if test -f 'src/scan-code-c.c'; then $(CYGPATH_W) 'src/scan-code-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-code-c.c'; fi` + +src/bison-scan-gram-c.o: src/scan-gram-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-gram-c.o -MD -MP -MF src/$(DEPDIR)/bison-scan-gram-c.Tpo -c -o src/bison-scan-gram-c.o `test -f 'src/scan-gram-c.c' || echo '$(srcdir)/'`src/scan-gram-c.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-gram-c.Tpo src/$(DEPDIR)/bison-scan-gram-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-gram-c.c' object='src/bison-scan-gram-c.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-gram-c.o `test -f 'src/scan-gram-c.c' || echo '$(srcdir)/'`src/scan-gram-c.c + +src/bison-scan-gram-c.obj: src/scan-gram-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-gram-c.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-gram-c.Tpo -c -o src/bison-scan-gram-c.obj `if test -f 'src/scan-gram-c.c'; then $(CYGPATH_W) 'src/scan-gram-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-gram-c.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-gram-c.Tpo src/$(DEPDIR)/bison-scan-gram-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-gram-c.c' object='src/bison-scan-gram-c.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-gram-c.obj `if test -f 'src/scan-gram-c.c'; then $(CYGPATH_W) 'src/scan-gram-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-gram-c.c'; fi` + +src/bison-scan-skel-c.o: src/scan-skel-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-skel-c.o -MD -MP -MF src/$(DEPDIR)/bison-scan-skel-c.Tpo -c -o src/bison-scan-skel-c.o `test -f 'src/scan-skel-c.c' || echo '$(srcdir)/'`src/scan-skel-c.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-skel-c.Tpo src/$(DEPDIR)/bison-scan-skel-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-skel-c.c' object='src/bison-scan-skel-c.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-skel-c.o `test -f 'src/scan-skel-c.c' || echo '$(srcdir)/'`src/scan-skel-c.c + +src/bison-scan-skel-c.obj: src/scan-skel-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-skel-c.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-skel-c.Tpo -c -o src/bison-scan-skel-c.obj `if test -f 'src/scan-skel-c.c'; then $(CYGPATH_W) 'src/scan-skel-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-skel-c.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-skel-c.Tpo src/$(DEPDIR)/bison-scan-skel-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-skel-c.c' object='src/bison-scan-skel-c.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-skel-c.obj `if test -f 'src/scan-skel-c.c'; then $(CYGPATH_W) 'src/scan-skel-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-skel-c.c'; fi` + +src/bison-state.o: src/state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-state.o -MD -MP -MF src/$(DEPDIR)/bison-state.Tpo -c -o src/bison-state.o `test -f 'src/state.c' || echo '$(srcdir)/'`src/state.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-state.Tpo src/$(DEPDIR)/bison-state.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/state.c' object='src/bison-state.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-state.o `test -f 'src/state.c' || echo '$(srcdir)/'`src/state.c + +src/bison-state.obj: src/state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-state.obj -MD -MP -MF src/$(DEPDIR)/bison-state.Tpo -c -o src/bison-state.obj `if test -f 'src/state.c'; then $(CYGPATH_W) 'src/state.c'; else $(CYGPATH_W) '$(srcdir)/src/state.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-state.Tpo src/$(DEPDIR)/bison-state.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/state.c' object='src/bison-state.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-state.obj `if test -f 'src/state.c'; then $(CYGPATH_W) 'src/state.c'; else $(CYGPATH_W) '$(srcdir)/src/state.c'; fi` + +src/bison-symlist.o: src/symlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-symlist.o -MD -MP -MF src/$(DEPDIR)/bison-symlist.Tpo -c -o src/bison-symlist.o `test -f 'src/symlist.c' || echo '$(srcdir)/'`src/symlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-symlist.Tpo src/$(DEPDIR)/bison-symlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/symlist.c' object='src/bison-symlist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-symlist.o `test -f 'src/symlist.c' || echo '$(srcdir)/'`src/symlist.c + +src/bison-symlist.obj: src/symlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-symlist.obj -MD -MP -MF src/$(DEPDIR)/bison-symlist.Tpo -c -o src/bison-symlist.obj `if test -f 'src/symlist.c'; then $(CYGPATH_W) 'src/symlist.c'; else $(CYGPATH_W) '$(srcdir)/src/symlist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-symlist.Tpo src/$(DEPDIR)/bison-symlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/symlist.c' object='src/bison-symlist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-symlist.obj `if test -f 'src/symlist.c'; then $(CYGPATH_W) 'src/symlist.c'; else $(CYGPATH_W) '$(srcdir)/src/symlist.c'; fi` + +src/bison-symtab.o: src/symtab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-symtab.o -MD -MP -MF src/$(DEPDIR)/bison-symtab.Tpo -c -o src/bison-symtab.o `test -f 'src/symtab.c' || echo '$(srcdir)/'`src/symtab.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-symtab.Tpo src/$(DEPDIR)/bison-symtab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/symtab.c' object='src/bison-symtab.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-symtab.o `test -f 'src/symtab.c' || echo '$(srcdir)/'`src/symtab.c + +src/bison-symtab.obj: src/symtab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-symtab.obj -MD -MP -MF src/$(DEPDIR)/bison-symtab.Tpo -c -o src/bison-symtab.obj `if test -f 'src/symtab.c'; then $(CYGPATH_W) 'src/symtab.c'; else $(CYGPATH_W) '$(srcdir)/src/symtab.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-symtab.Tpo src/$(DEPDIR)/bison-symtab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/symtab.c' object='src/bison-symtab.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-symtab.obj `if test -f 'src/symtab.c'; then $(CYGPATH_W) 'src/symtab.c'; else $(CYGPATH_W) '$(srcdir)/src/symtab.c'; fi` + +src/bison-tables.o: src/tables.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-tables.o -MD -MP -MF src/$(DEPDIR)/bison-tables.Tpo -c -o src/bison-tables.o `test -f 'src/tables.c' || echo '$(srcdir)/'`src/tables.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-tables.Tpo src/$(DEPDIR)/bison-tables.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/tables.c' object='src/bison-tables.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-tables.o `test -f 'src/tables.c' || echo '$(srcdir)/'`src/tables.c + +src/bison-tables.obj: src/tables.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-tables.obj -MD -MP -MF src/$(DEPDIR)/bison-tables.Tpo -c -o src/bison-tables.obj `if test -f 'src/tables.c'; then $(CYGPATH_W) 'src/tables.c'; else $(CYGPATH_W) '$(srcdir)/src/tables.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-tables.Tpo src/$(DEPDIR)/bison-tables.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/tables.c' object='src/bison-tables.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-tables.obj `if test -f 'src/tables.c'; then $(CYGPATH_W) 'src/tables.c'; else $(CYGPATH_W) '$(srcdir)/src/tables.c'; fi` + +src/bison-uniqstr.o: src/uniqstr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-uniqstr.o -MD -MP -MF src/$(DEPDIR)/bison-uniqstr.Tpo -c -o src/bison-uniqstr.o `test -f 'src/uniqstr.c' || echo '$(srcdir)/'`src/uniqstr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-uniqstr.Tpo src/$(DEPDIR)/bison-uniqstr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/uniqstr.c' object='src/bison-uniqstr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-uniqstr.o `test -f 'src/uniqstr.c' || echo '$(srcdir)/'`src/uniqstr.c + +src/bison-uniqstr.obj: src/uniqstr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-uniqstr.obj -MD -MP -MF src/$(DEPDIR)/bison-uniqstr.Tpo -c -o src/bison-uniqstr.obj `if test -f 'src/uniqstr.c'; then $(CYGPATH_W) 'src/uniqstr.c'; else $(CYGPATH_W) '$(srcdir)/src/uniqstr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-uniqstr.Tpo src/$(DEPDIR)/bison-uniqstr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/uniqstr.c' object='src/bison-uniqstr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-uniqstr.obj `if test -f 'src/uniqstr.c'; then $(CYGPATH_W) 'src/uniqstr.c'; else $(CYGPATH_W) '$(srcdir)/src/uniqstr.c'; fi` + +src/bison-scan-code.o: src/scan-code.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-code.o -MD -MP -MF src/$(DEPDIR)/bison-scan-code.Tpo -c -o src/bison-scan-code.o `test -f 'src/scan-code.c' || echo '$(srcdir)/'`src/scan-code.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-code.Tpo src/$(DEPDIR)/bison-scan-code.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-code.c' object='src/bison-scan-code.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-code.o `test -f 'src/scan-code.c' || echo '$(srcdir)/'`src/scan-code.c + +src/bison-scan-code.obj: src/scan-code.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-code.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-code.Tpo -c -o src/bison-scan-code.obj `if test -f 'src/scan-code.c'; then $(CYGPATH_W) 'src/scan-code.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-code.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-code.Tpo src/$(DEPDIR)/bison-scan-code.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-code.c' object='src/bison-scan-code.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-code.obj `if test -f 'src/scan-code.c'; then $(CYGPATH_W) 'src/scan-code.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-code.c'; fi` + +src/bison-scan-gram.o: src/scan-gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-gram.o -MD -MP -MF src/$(DEPDIR)/bison-scan-gram.Tpo -c -o src/bison-scan-gram.o `test -f 'src/scan-gram.c' || echo '$(srcdir)/'`src/scan-gram.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-gram.Tpo src/$(DEPDIR)/bison-scan-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-gram.c' object='src/bison-scan-gram.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-gram.o `test -f 'src/scan-gram.c' || echo '$(srcdir)/'`src/scan-gram.c + +src/bison-scan-gram.obj: src/scan-gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-gram.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-gram.Tpo -c -o src/bison-scan-gram.obj `if test -f 'src/scan-gram.c'; then $(CYGPATH_W) 'src/scan-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-gram.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-gram.Tpo src/$(DEPDIR)/bison-scan-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-gram.c' object='src/bison-scan-gram.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-gram.obj `if test -f 'src/scan-gram.c'; then $(CYGPATH_W) 'src/scan-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-gram.c'; fi` + +src/bison-scan-skel.o: src/scan-skel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-skel.o -MD -MP -MF src/$(DEPDIR)/bison-scan-skel.Tpo -c -o src/bison-scan-skel.o `test -f 'src/scan-skel.c' || echo '$(srcdir)/'`src/scan-skel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-skel.Tpo src/$(DEPDIR)/bison-scan-skel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-skel.c' object='src/bison-scan-skel.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-skel.o `test -f 'src/scan-skel.c' || echo '$(srcdir)/'`src/scan-skel.c + +src/bison-scan-skel.obj: src/scan-skel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-skel.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-skel.Tpo -c -o src/bison-scan-skel.obj `if test -f 'src/scan-skel.c'; then $(CYGPATH_W) 'src/scan-skel.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-skel.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-skel.Tpo src/$(DEPDIR)/bison-scan-skel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-skel.c' object='src/bison-scan-skel.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-skel.obj `if test -f 'src/scan-skel.c'; then $(CYGPATH_W) 'src/scan-skel.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-skel.c'; fi` + +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +examples/calc++/examples_calc___calc__-calc++-driver.o: examples/calc++/calc++-driver.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/examples_calc___calc__-calc++-driver.o -MD -MP -MF examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-driver.Tpo -c -o examples/calc++/examples_calc___calc__-calc++-driver.o `test -f 'examples/calc++/calc++-driver.cc' || echo '$(srcdir)/'`examples/calc++/calc++-driver.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-driver.Tpo examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-driver.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-driver.cc' object='examples/calc++/examples_calc___calc__-calc++-driver.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/examples_calc___calc__-calc++-driver.o `test -f 'examples/calc++/calc++-driver.cc' || echo '$(srcdir)/'`examples/calc++/calc++-driver.cc + +examples/calc++/examples_calc___calc__-calc++-driver.obj: examples/calc++/calc++-driver.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/examples_calc___calc__-calc++-driver.obj -MD -MP -MF examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-driver.Tpo -c -o examples/calc++/examples_calc___calc__-calc++-driver.obj `if test -f 'examples/calc++/calc++-driver.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-driver.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-driver.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-driver.Tpo examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-driver.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-driver.cc' object='examples/calc++/examples_calc___calc__-calc++-driver.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/examples_calc___calc__-calc++-driver.obj `if test -f 'examples/calc++/calc++-driver.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-driver.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-driver.cc'; fi` + +examples/calc++/examples_calc___calc__-calc++-scanner.o: examples/calc++/calc++-scanner.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/examples_calc___calc__-calc++-scanner.o -MD -MP -MF examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-scanner.Tpo -c -o examples/calc++/examples_calc___calc__-calc++-scanner.o `test -f 'examples/calc++/calc++-scanner.cc' || echo '$(srcdir)/'`examples/calc++/calc++-scanner.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-scanner.Tpo examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-scanner.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-scanner.cc' object='examples/calc++/examples_calc___calc__-calc++-scanner.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/examples_calc___calc__-calc++-scanner.o `test -f 'examples/calc++/calc++-scanner.cc' || echo '$(srcdir)/'`examples/calc++/calc++-scanner.cc + +examples/calc++/examples_calc___calc__-calc++-scanner.obj: examples/calc++/calc++-scanner.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/examples_calc___calc__-calc++-scanner.obj -MD -MP -MF examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-scanner.Tpo -c -o examples/calc++/examples_calc___calc__-calc++-scanner.obj `if test -f 'examples/calc++/calc++-scanner.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-scanner.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-scanner.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-scanner.Tpo examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-scanner.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-scanner.cc' object='examples/calc++/examples_calc___calc__-calc++-scanner.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/examples_calc___calc__-calc++-scanner.obj `if test -f 'examples/calc++/calc++-scanner.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-scanner.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-scanner.cc'; fi` + +examples/calc++/examples_calc___calc__-calc++.o: examples/calc++/calc++.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/examples_calc___calc__-calc++.o -MD -MP -MF examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++.Tpo -c -o examples/calc++/examples_calc___calc__-calc++.o `test -f 'examples/calc++/calc++.cc' || echo '$(srcdir)/'`examples/calc++/calc++.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++.Tpo examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++.cc' object='examples/calc++/examples_calc___calc__-calc++.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/examples_calc___calc__-calc++.o `test -f 'examples/calc++/calc++.cc' || echo '$(srcdir)/'`examples/calc++/calc++.cc + +examples/calc++/examples_calc___calc__-calc++.obj: examples/calc++/calc++.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/examples_calc___calc__-calc++.obj -MD -MP -MF examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++.Tpo -c -o examples/calc++/examples_calc___calc__-calc++.obj `if test -f 'examples/calc++/calc++.cc'; then $(CYGPATH_W) 'examples/calc++/calc++.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++.Tpo examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++.cc' object='examples/calc++/examples_calc___calc__-calc++.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/examples_calc___calc__-calc++.obj `if test -f 'examples/calc++/calc++.cc'; then $(CYGPATH_W) 'examples/calc++/calc++.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++.cc'; fi` + +examples/calc++/examples_calc___calc__-calc++-parser.o: examples/calc++/calc++-parser.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/examples_calc___calc__-calc++-parser.o -MD -MP -MF examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-parser.Tpo -c -o examples/calc++/examples_calc___calc__-calc++-parser.o `test -f 'examples/calc++/calc++-parser.cc' || echo '$(srcdir)/'`examples/calc++/calc++-parser.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-parser.Tpo examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-parser.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-parser.cc' object='examples/calc++/examples_calc___calc__-calc++-parser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/examples_calc___calc__-calc++-parser.o `test -f 'examples/calc++/calc++-parser.cc' || echo '$(srcdir)/'`examples/calc++/calc++-parser.cc + +examples/calc++/examples_calc___calc__-calc++-parser.obj: examples/calc++/calc++-parser.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/examples_calc___calc__-calc++-parser.obj -MD -MP -MF examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-parser.Tpo -c -o examples/calc++/examples_calc___calc__-calc++-parser.obj `if test -f 'examples/calc++/calc++-parser.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-parser.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-parser.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-parser.Tpo examples/calc++/$(DEPDIR)/examples_calc___calc__-calc++-parser.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-parser.cc' object='examples/calc++/examples_calc___calc__-calc++-parser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/examples_calc___calc__-calc++-parser.obj `if test -f 'examples/calc++/calc++-parser.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-parser.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-parser.cc'; fi` + +.l.c: + $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) + +.ll.cc: + $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) + +examples/calc++/calc++-scanner.cc: examples/calc++/calc++-scanner.ll + $(AM_V_LEX) \ + $(SHELL) $(YLWRAP) `test -f 'examples/calc++/calc++-scanner.ll' || echo '$(srcdir)/'`examples/calc++/calc++-scanner.ll $(LEX_OUTPUT_ROOT).c examples/calc++/calc++-scanner.cc -- $(LEX) $(AM_LFLAGS) $(LFLAGS) + +.y.c: + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) + +examples/mfcalc/mfcalc.c: examples/mfcalc/mfcalc.y + $(AM_V_YACC) \ + $(SHELL) $(YLWRAP) `test -f 'examples/mfcalc/mfcalc.y' || echo '$(srcdir)/'`examples/mfcalc/mfcalc.y y.tab.c examples/mfcalc/mfcalc.c y.tab.h `echo examples/mfcalc/mfcalc.c | $(am__yacc_c2h)` y.output examples/mfcalc/mfcalc.output -- $(YACC) $(AM_YFLAGS) $(YFLAGS) + +examples/rpcalc/rpcalc.c: examples/rpcalc/rpcalc.y + $(AM_V_YACC) \ + $(SHELL) $(YLWRAP) `test -f 'examples/rpcalc/rpcalc.y' || echo '$(srcdir)/'`examples/rpcalc/rpcalc.y y.tab.c examples/rpcalc/rpcalc.c y.tab.h `echo examples/rpcalc/rpcalc.c | $(am__yacc_c2h)` y.output examples/rpcalc/rpcalc.output -- $(YACC) $(AM_YFLAGS) $(YFLAGS) +doc/$(am__dirstamp): + @$(MKDIR_P) doc + @: > doc/$(am__dirstamp) + +$(srcdir)/doc/bison.info: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \ + -o $@ $(srcdir)/doc/bison.texi; \ + then \ + rc=0; \ + $(am__cd) $(srcdir); \ + else \ + rc=$$?; \ + $(am__cd) $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +doc/bison.dvi: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp) + $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \ + $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ + `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi + +doc/bison.pdf: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp) + $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \ + $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ + `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi + +doc/bison.html: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp) + $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) + $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \ + -o $(@:.html=.htp) `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi; \ + then \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ + else \ + rm -rf $(@:.html=.htp); exit 1; \ + fi +$(srcdir)/doc/version.texi: $(srcdir)/doc/stamp-vti +$(srcdir)/doc/stamp-vti: doc/bison.texi $(top_srcdir)/configure + @test -f doc/$(am__dirstamp) || $(MAKE) $(AM_MAKEFLAGS) doc/$(am__dirstamp) + @(dir=.; test -f ./doc/bison.texi || dir=$(srcdir); \ + set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/doc/bison.texi`; \ + echo "@set UPDATED $$1 $$2 $$3"; \ + echo "@set UPDATED-MONTH $$2 $$3"; \ + echo "@set EDITION $(VERSION)"; \ + echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \ + (cmp -s vti.tmp$$$$ $(srcdir)/doc/version.texi \ + || (echo "Updating $(srcdir)/doc/version.texi" && \ + cp vti.tmp$$$$ $(srcdir)/doc/version.texi.tmp$$$$ && \ + mv $(srcdir)/doc/version.texi.tmp$$$$ $(srcdir)/doc/version.texi)) && \ + rm -f vti.tmp$$$$ $(srcdir)/doc/version.texi.$$$$ + @cp $(srcdir)/doc/version.texi $@ + +mostlyclean-vti: + -rm -f vti.tmp* $(srcdir)/doc/version.texi.tmp* + +maintainer-clean-vti: + -rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi +.dvi.ps: + $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + $(DVIPS) $(AM_V_texinfo) -o $@ $< + +uninstall-dvi-am: + @$(NORMAL_UNINSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ + rm -f "$(DESTDIR)$(dvidir)/$$f"; \ + done + +uninstall-html-am: + @$(NORMAL_UNINSTALL) + @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ + rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ + done + +uninstall-info-am: + @$(PRE_UNINSTALL) + @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ + done + +uninstall-pdf-am: + @$(NORMAL_UNINSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ + done + +uninstall-ps-am: + @$(NORMAL_UNINSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ + rm -f "$(DESTDIR)$(psdir)/$$f"; \ + done + +dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ + for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ + if test -f $$file; then \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f "$(distdir)/$$relfile" || \ + cp -p $$file "$(distdir)/$$relfile"; \ + else :; fi; \ + done; \ + done + +mostlyclean-aminfo: + -rm -rf doc/bison.t2d doc/bison.t2p + +clean-aminfo: + -test -z "doc/bison.dvi doc/bison.pdf doc/bison.ps doc/bison.html" \ + || rm -rf doc/bison.dvi doc/bison.pdf doc/bison.ps doc/bison.html + +maintainer-clean-aminfo: + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ + done +install-man1: $(dist_man_MANS) $(nodist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS) $(nodist_man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS) $(nodist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-aclocalDATA: $(aclocal_DATA) + @$(NORMAL_INSTALL) + @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(aclocaldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(aclocaldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(aclocaldir)" || exit $$?; \ + done + +uninstall-aclocalDATA: + @$(NORMAL_UNINSTALL) + @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(aclocaldir)'; $(am__uninstall_files_from_dir) +install-calcxxDATA: $(calcxx_DATA) + @$(NORMAL_INSTALL) + @list='$(calcxx_DATA)'; test -n "$(calcxxdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(calcxxdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(calcxxdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(calcxxdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(calcxxdir)" || exit $$?; \ + done + +uninstall-calcxxDATA: + @$(NORMAL_UNINSTALL) + @list='$(calcxx_DATA)'; test -n "$(calcxxdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(calcxxdir)'; $(am__uninstall_files_from_dir) +install-dist_docDATA: $(dist_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + done + +uninstall-dist_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) +install-dist_m4sugarDATA: $(dist_m4sugar_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_m4sugar_DATA)'; test -n "$(m4sugardir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(m4sugardir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(m4sugardir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4sugardir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(m4sugardir)" || exit $$?; \ + done + +uninstall-dist_m4sugarDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_m4sugar_DATA)'; test -n "$(m4sugardir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(m4sugardir)'; $(am__uninstall_files_from_dir) +install-dist_pkgdataDATA: $(dist_pkgdata_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ + done + +uninstall-dist_pkgdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) +install-dist_xsltDATA: $(dist_xslt_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_xslt_DATA)'; test -n "$(xsltdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(xsltdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(xsltdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xsltdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(xsltdir)" || exit $$?; \ + done + +uninstall-dist_xsltDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_xslt_DATA)'; test -n "$(xsltdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(xsltdir)'; $(am__uninstall_files_from_dir) +install-mfcalcDATA: $(mfcalc_DATA) + @$(NORMAL_INSTALL) + @list='$(mfcalc_DATA)'; test -n "$(mfcalcdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(mfcalcdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(mfcalcdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(mfcalcdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(mfcalcdir)" || exit $$?; \ + done + +uninstall-mfcalcDATA: + @$(NORMAL_UNINSTALL) + @list='$(mfcalc_DATA)'; test -n "$(mfcalcdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(mfcalcdir)'; $(am__uninstall_files_from_dir) +install-rpcalcDATA: $(rpcalc_DATA) + @$(NORMAL_INSTALL) + @list='$(rpcalc_DATA)'; test -n "$(rpcalcdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(rpcalcdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(rpcalcdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rpcalcdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(rpcalcdir)" || exit $$?; \ + done + +uninstall-rpcalcDATA: + @$(NORMAL_UNINSTALL) + @list='$(rpcalc_DATA)'; test -n "$(rpcalcdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(rpcalcdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) $(check_SCRIPTS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @case `sed 15q $(srcdir)/NEWS` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "NEWS not updated; not releasing" 1>&2; \ + exit 1;; \ + esac + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-info dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --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) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(INFO_DEPS) $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) \ + $(MANS) $(DATA) all-local +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(aclocaldir)" "$(DESTDIR)$(calcxxdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(xsltdir)" "$(DESTDIR)$(mfcalcdir)" "$(DESTDIR)$(rpcalcdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -rm -f examples/calc++/calc++-scanner.cc + -rm -f examples/mfcalc/mfcalc.c + -rm -f examples/mfcalc/mfcalc.h + -rm -f examples/rpcalc/rpcalc.c + -rm -f examples/rpcalc/rpcalc.h + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f doc/$(am__dirstamp) + -rm -f examples/calc++/$(DEPDIR)/$(am__dirstamp) + -rm -f examples/calc++/$(am__dirstamp) + -rm -f examples/mfcalc/$(DEPDIR)/$(am__dirstamp) + -rm -f examples/mfcalc/$(am__dirstamp) + -rm -f examples/rpcalc/$(DEPDIR)/$(am__dirstamp) + -rm -f examples/rpcalc/$(am__dirstamp) + -rm -f lib/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/$(am__dirstamp) + -rm -f lib/glthread/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/glthread/$(am__dirstamp) + -rm -f lib/uniwidth/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/uniwidth/$(am__dirstamp) + -rm -f src/$(DEPDIR)/$(am__dirstamp) + -rm -f src/$(am__dirstamp) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -rm -f src/parse-gram.c + -rm -f src/parse-gram.h + -rm -f src/scan-code.c + -rm -f src/scan-gram.c + -rm -f src/scan-skel.c + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-aminfo clean-binPROGRAMS clean-checkPROGRAMS \ + clean-generic clean-libLIBRARIES clean-local \ + clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf examples/calc++/$(DEPDIR) examples/mfcalc/$(DEPDIR) examples/rpcalc/$(DEPDIR) lib/$(DEPDIR) lib/glthread/$(DEPDIR) lib/uniwidth/$(DEPDIR) src/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-local distclean-tags + +dvi: dvi-recursive + +dvi-am: $(DVIS) + +html: html-recursive + +html-am: $(HTMLS) html-local + +info: info-recursive + +info-am: $(INFO_DEPS) + +install-data-am: install-aclocalDATA install-calcxxDATA \ + install-dist_docDATA install-dist_m4sugarDATA \ + install-dist_pkgdataDATA install-dist_xsltDATA install-info-am \ + install-man install-mfcalcDATA install-rpcalcDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: $(DVIS) + @$(NORMAL_INSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ + done +install-exec-am: install-binPROGRAMS install-binSCRIPTS \ + install-exec-local install-libLIBRARIES + +install-html: install-html-recursive + +install-html-am: $(HTMLS) + @$(NORMAL_INSTALL) + @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ + $(am__strip_dir) \ + d2=$$d$$p; \ + if test -d "$$d2"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ + echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ + else \ + list2="$$list2 $$d2"; \ + fi; \ + done; \ + test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done; } +install-info: install-info-recursive + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ + fi; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + echo "$$ifile"; \ + else : ; fi; \ + done; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done + @$(POST_INSTALL) + @if $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: install-man1 + +install-pdf: install-pdf-recursive + +install-pdf-am: $(PDFS) + @$(NORMAL_INSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done +install-ps: install-ps-recursive + +install-ps-am: $(PSS) + @$(NORMAL_INSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done +installcheck-am: installcheck-binPROGRAMS installcheck-binSCRIPTS \ + installcheck-local + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf examples/calc++/$(DEPDIR) examples/mfcalc/$(DEPDIR) examples/rpcalc/$(DEPDIR) lib/$(DEPDIR) lib/glthread/$(DEPDIR) lib/uniwidth/$(DEPDIR) src/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \ + mostlyclean-generic mostlyclean-local mostlyclean-vti + +pdf: pdf-recursive + +pdf-am: $(PDFS) + +ps: ps-recursive + +ps-am: $(PSS) + +uninstall-am: uninstall-aclocalDATA uninstall-binPROGRAMS \ + uninstall-binSCRIPTS uninstall-calcxxDATA \ + uninstall-dist_docDATA uninstall-dist_m4sugarDATA \ + uninstall-dist_pkgdataDATA uninstall-dist_xsltDATA \ + uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-libLIBRARIES uninstall-local uninstall-man \ + uninstall-mfcalcDATA uninstall-pdf-am uninstall-ps-am \ + uninstall-rpcalcDATA + +uninstall-man: uninstall-man1 + +.MAKE: $(am__recursive_targets) all check check-am install install-am \ + install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ + am--refresh check check-TESTS check-am check-local clean \ + clean-aminfo clean-binPROGRAMS clean-checkPROGRAMS \ + clean-cscope clean-generic clean-libLIBRARIES clean-local \ + clean-noinstLIBRARIES cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-hook dist-info dist-lzip \ + dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-local distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am html-local info \ + info-am install install-aclocalDATA install-am \ + install-binPROGRAMS install-binSCRIPTS install-calcxxDATA \ + install-data install-data-am install-dist_docDATA \ + install-dist_m4sugarDATA install-dist_pkgdataDATA \ + install-dist_xsltDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-local install-html \ + install-html-am install-info install-info-am \ + install-libLIBRARIES install-man install-man1 \ + install-mfcalcDATA install-pdf install-pdf-am install-ps \ + install-ps-am install-rpcalcDATA install-strip installcheck \ + installcheck-am installcheck-binPROGRAMS \ + installcheck-binSCRIPTS installcheck-local installdirs \ + installdirs-am maintainer-clean maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti mostlyclean \ + mostlyclean-aminfo mostlyclean-compile mostlyclean-generic \ + mostlyclean-local mostlyclean-vti pdf pdf-am ps ps-am recheck \ + tags tags-am uninstall uninstall-aclocalDATA uninstall-am \ + uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-calcxxDATA uninstall-dist_docDATA \ + uninstall-dist_m4sugarDATA uninstall-dist_pkgdataDATA \ + uninstall-dist_xsltDATA uninstall-dvi-am uninstall-html-am \ + uninstall-info-am uninstall-libLIBRARIES uninstall-local \ + uninstall-man uninstall-man1 uninstall-mfcalcDATA \ + uninstall-pdf-am uninstall-ps-am uninstall-rpcalcDATA + +.PRECIOUS: Makefile + +$(doc_bison).dvi: $(FIGS_GV:.gv=.eps) +$(doc_bison).info: $(FIGS_GV:.gv=.txt) +$(doc_bison).pdf: $(FIGS_GV:.gv=.pdf) +$(doc_bison).html: $(FIGS_GV:.gv=.png) +clean-local: + rm -rf $(CLEANDIRS) +$(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL) +# Create $@~ which is the previous contents. Don't use 'mv' here so +# that even if we are interrupted, the file is still available for +# diff in the next run. Note that $@ might not exist yet. + $(AM_V_GEN){ test ! -f $@ || cat $@; } >$@~ + $(AM_V_at)test ! -f $@.tmp || rm -f $@.tmp + $(AM_V_at)src/bison$(EXEEXT) --help | \ + $(PERL) $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp + $(AM_V_at)diff -u $@~ $@.tmp || true + $(AM_V_at)mv $@.tmp $@ + +doc/refcard.pdf: doc/refcard.tex + $(AM_V_GEN) cd doc && pdftex $(abs_top_srcdir)/doc/refcard.tex +@CROSS_COMPILING_FALSE@$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT) +@CROSS_COMPILING_FALSE@ $(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp +@CROSS_COMPILING_FALSE@ $(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp +@CROSS_COMPILING_FALSE@ $(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@ + +$(top_srcdir)/doc/bison.1: $(MAN_DEPS) + $(AM_V_GEN)$(HELP2MAN) \ + --include=$(top_srcdir)/doc/bison.x \ + --output=$@.t src/bison$(EXEEXT) + $(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \ + $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \ + touch $@; \ + else \ + mv $@.t $@; \ + fi + $(AM_V_at)rm -f $@*.t + +.gv.eps: + $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` + $(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp + $(AM_V_at) mv $@.tmp $@ + +.gv.pdf: + $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` + $(AM_V_at) $(DOT) -Gmargin=0 -Tpdf $< >$@.tmp + $(AM_V_at) mv $@.tmp $@ + +.gv.png: + $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` + $(AM_V_at) $(DOT) -Gmargin=0 -Tpng $< >$@.tmp + $(AM_V_at) mv $@.tmp $@ + +.PHONY: doc html + +doc: html + +html-local: doc/Doxyfile + $(AM_V_GEN) $(DOXYGEN) doc/Doxyfile +# Sed is used to generate Doxyfile from Doxyfile.in instead of +# configure, because the former is way faster than the latter. +doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in + $(AM_V_GEN) $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile +examples/extracted.stamp: $(doc) $(extexi) + $(AM_V_GEN)rm -f $@ $@.tmp + $(AM_V_at)touch $@.tmp + $(AM_V_at)$(extract) $(extracted) + $(AM_V_at)mv $@.tmp $@ + +$(extracted): examples/extracted.stamp + @test -f $@ || rm -f examples/extracted.stamp + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp + +# Don't depend on $(BISON) otherwise we would rebuild these files +# in srcdir, including during distcheck, which is forbidden. +examples/calc++/calc++-parser.stamp: $(BISON_IN) +.yy.stamp: + $(AM_V_YACC)rm -f $@ + $(AM_V_at)touch $@.tmp + $(AM_V_at)$(YACCCOMPILE) -o $*.cc $< + $(AM_V_at)mv -f $@.tmp $@ + +$(calcxx_sources_generated): examples/calc++/calc++-parser.stamp + @test -f $@ || rm -f examples/calc++/calc++-parser.stamp + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp + +# Avoid using BUILT_SOURCES which is too global. +$(examples_calc___calc___OBJECTS): $(calcxx_sources_generated) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_ALLOCA_H_TRUE@lib/alloca.h: lib/alloca.in.h $(top_builddir)/config.status +@GL_GENERATE_ALLOCA_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_ALLOCA_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_ALLOCA_H_TRUE@ cat $(top_srcdir)/lib/alloca.in.h; \ +@GL_GENERATE_ALLOCA_H_TRUE@ } > $@-t && \ +@GL_GENERATE_ALLOCA_H_TRUE@ mv -f $@-t $@ +@GL_GENERATE_ALLOCA_H_FALSE@lib/alloca.h: $(top_builddir)/config.status +@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@ + +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+ or 2.70. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +lib/configmake.h: Makefile + $(AM_V_GEN)rm -f $@-t && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define RUNSTATEDIR "$(runstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t && \ + mv -f $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that is POSIX compliant. +@GL_GENERATE_ERRNO_H_TRUE@lib/errno.h: lib/errno.in.h $(top_builddir)/config.status +@GL_GENERATE_ERRNO_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_ERRNO_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_ERRNO_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ < $(top_srcdir)/lib/errno.in.h; \ +@GL_GENERATE_ERRNO_H_TRUE@ } > $@-t && \ +@GL_GENERATE_ERRNO_H_TRUE@ mv $@-t $@ +@GL_GENERATE_ERRNO_H_FALSE@lib/errno.h: $(top_builddir)/config.status +@GL_GENERATE_ERRNO_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/fcntl.h: lib/fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_FLOAT_H_TRUE@lib/float.h: lib/float.in.h $(top_builddir)/config.status +@GL_GENERATE_FLOAT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_FLOAT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_FLOAT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ < $(top_srcdir)/lib/float.in.h; \ +@GL_GENERATE_FLOAT_H_TRUE@ } > $@-t && \ +@GL_GENERATE_FLOAT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_FLOAT_H_FALSE@lib/float.h: $(top_builddir)/config.status +@GL_GENERATE_FLOAT_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/getopt.h: lib/getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + < $(top_srcdir)/lib/getopt.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +distclean-local: clean-GNUmakefile +clean-GNUmakefile: + test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/inttypes.h: lib/inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ + -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ + -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ + -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ + -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ + -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ + -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ + -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ + -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ + -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ + -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ + -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ + -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ + -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ + -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/inttypes.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to install a simple file in $(libdir) +# which is shared with other installed packages. We use a list of referencing +# packages so that "make uninstall" will remove the file if and only if it +# is not used by another installed package. +# On systems with glibc-2.1 or newer, the file is redundant, therefore we +# avoid installing it. + +all-local: lib/charset.alias lib/ref-add.sed lib/ref-del.sed +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ + if test -f $(charset_alias); then \ + sed -f lib/ref-add.sed $(charset_alias) > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + else \ + if $$need_charset_alias; then \ + sed -f lib/ref-add.sed lib/charset.alias > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + fi ; \ + fi + +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local + if test -f $(charset_alias); then \ + sed -f lib/ref-del.sed $(charset_alias) > $(charset_tmp); \ + if grep '^# Packages using this file: $$' $(charset_tmp) \ + > /dev/null; then \ + rm -f $(charset_alias); \ + else \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ + fi; \ + rm -f $(charset_tmp); \ + fi + +lib/charset.alias: lib/config.charset + $(AM_V_GEN)rm -f $@-t $@ && \ + $(SHELL) $(top_srcdir)/lib/config.charset '$(host)' > $@-t && \ + mv $@-t $@ + +# SUFFIXES += .sed .sin +.sin.sed: + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/math.h: lib/math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \ + -e 's/@''GNULIB_ACOSF''@/$(GNULIB_ACOSF)/g' \ + -e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \ + -e 's/@''GNULIB_ASINF''@/$(GNULIB_ASINF)/g' \ + -e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \ + -e 's/@''GNULIB_ATANF''@/$(GNULIB_ATANF)/g' \ + -e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \ + -e 's/@''GNULIB_ATAN2F''@/$(GNULIB_ATAN2F)/g' \ + -e 's/@''GNULIB_CBRT''@/$(GNULIB_CBRT)/g' \ + -e 's/@''GNULIB_CBRTF''@/$(GNULIB_CBRTF)/g' \ + -e 's/@''GNULIB_CBRTL''@/$(GNULIB_CBRTL)/g' \ + -e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \ + -e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \ + -e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \ + -e 's/@''GNULIB_COPYSIGN''@/$(GNULIB_COPYSIGN)/g' \ + -e 's/@''GNULIB_COPYSIGNF''@/$(GNULIB_COPYSIGNF)/g' \ + -e 's/@''GNULIB_COPYSIGNL''@/$(GNULIB_COPYSIGNL)/g' \ + -e 's/@''GNULIB_COSF''@/$(GNULIB_COSF)/g' \ + -e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \ + -e 's/@''GNULIB_COSHF''@/$(GNULIB_COSHF)/g' \ + -e 's/@''GNULIB_EXPF''@/$(GNULIB_EXPF)/g' \ + -e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \ + -e 's/@''GNULIB_EXP2''@/$(GNULIB_EXP2)/g' \ + -e 's/@''GNULIB_EXP2F''@/$(GNULIB_EXP2F)/g' \ + -e 's/@''GNULIB_EXP2L''@/$(GNULIB_EXP2L)/g' \ + -e 's/@''GNULIB_EXPM1''@/$(GNULIB_EXPM1)/g' \ + -e 's/@''GNULIB_EXPM1F''@/$(GNULIB_EXPM1F)/g' \ + -e 's/@''GNULIB_EXPM1L''@/$(GNULIB_EXPM1L)/g' \ + -e 's/@''GNULIB_FABSF''@/$(GNULIB_FABSF)/g' \ + -e 's/@''GNULIB_FABSL''@/$(GNULIB_FABSL)/g' \ + -e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \ + -e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \ + -e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \ + -e 's/@''GNULIB_FMA''@/$(GNULIB_FMA)/g' \ + -e 's/@''GNULIB_FMAF''@/$(GNULIB_FMAF)/g' \ + -e 's/@''GNULIB_FMAL''@/$(GNULIB_FMAL)/g' \ + -e 's/@''GNULIB_FMOD''@/$(GNULIB_FMOD)/g' \ + -e 's/@''GNULIB_FMODF''@/$(GNULIB_FMODF)/g' \ + -e 's/@''GNULIB_FMODL''@/$(GNULIB_FMODL)/g' \ + -e 's/@''GNULIB_FREXPF''@/$(GNULIB_FREXPF)/g' \ + -e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \ + -e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \ + -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \ + -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \ + -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \ + < $(top_srcdir)/lib/math.in.h | \ + sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \ + -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \ + -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \ + -e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \ + -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \ + -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \ + -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \ + -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \ + -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \ + -e 's/@''GNULIB_LDEXPF''@/$(GNULIB_LDEXPF)/g' \ + -e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \ + -e 's/@''GNULIB_LOG''@/$(GNULIB_LOG)/g' \ + -e 's/@''GNULIB_LOGF''@/$(GNULIB_LOGF)/g' \ + -e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \ + -e 's/@''GNULIB_LOG10''@/$(GNULIB_LOG10)/g' \ + -e 's/@''GNULIB_LOG10F''@/$(GNULIB_LOG10F)/g' \ + -e 's/@''GNULIB_LOG10L''@/$(GNULIB_LOG10L)/g' \ + -e 's/@''GNULIB_LOG1P''@/$(GNULIB_LOG1P)/g' \ + -e 's/@''GNULIB_LOG1PF''@/$(GNULIB_LOG1PF)/g' \ + -e 's/@''GNULIB_LOG1PL''@/$(GNULIB_LOG1PL)/g' \ + -e 's/@''GNULIB_LOG2''@/$(GNULIB_LOG2)/g' \ + -e 's/@''GNULIB_LOG2F''@/$(GNULIB_LOG2F)/g' \ + -e 's/@''GNULIB_LOG2L''@/$(GNULIB_LOG2L)/g' \ + -e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \ + -e 's/@''GNULIB_LOGBF''@/$(GNULIB_LOGBF)/g' \ + -e 's/@''GNULIB_LOGBL''@/$(GNULIB_LOGBL)/g' \ + -e 's/@''GNULIB_MODF''@/$(GNULIB_MODF)/g' \ + -e 's/@''GNULIB_MODFF''@/$(GNULIB_MODFF)/g' \ + -e 's/@''GNULIB_MODFL''@/$(GNULIB_MODFL)/g' \ + -e 's/@''GNULIB_POWF''@/$(GNULIB_POWF)/g' \ + -e 's/@''GNULIB_REMAINDER''@/$(GNULIB_REMAINDER)/g' \ + -e 's/@''GNULIB_REMAINDERF''@/$(GNULIB_REMAINDERF)/g' \ + -e 's/@''GNULIB_REMAINDERL''@/$(GNULIB_REMAINDERL)/g' \ + -e 's/@''GNULIB_RINT''@/$(GNULIB_RINT)/g' \ + -e 's/@''GNULIB_RINTF''@/$(GNULIB_RINTF)/g' \ + -e 's/@''GNULIB_RINTL''@/$(GNULIB_RINTL)/g' \ + -e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \ + -e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \ + -e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \ + -e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \ + -e 's/@''GNULIB_SINF''@/$(GNULIB_SINF)/g' \ + -e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \ + -e 's/@''GNULIB_SINHF''@/$(GNULIB_SINHF)/g' \ + -e 's/@''GNULIB_SQRTF''@/$(GNULIB_SQRTF)/g' \ + -e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \ + -e 's/@''GNULIB_TANF''@/$(GNULIB_TANF)/g' \ + -e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \ + -e 's/@''GNULIB_TANHF''@/$(GNULIB_TANHF)/g' \ + -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \ + -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \ + -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \ + | \ + sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \ + -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \ + -e 's|@''HAVE_ASINF''@|$(HAVE_ASINF)|g' \ + -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \ + -e 's|@''HAVE_ATANF''@|$(HAVE_ATANF)|g' \ + -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \ + -e 's|@''HAVE_ATAN2F''@|$(HAVE_ATAN2F)|g' \ + -e 's|@''HAVE_CBRT''@|$(HAVE_CBRT)|g' \ + -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \ + -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \ + -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \ + -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \ + -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \ + -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \ + -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \ + -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \ + -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \ + -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \ + -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \ + -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \ + -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \ + -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \ + -e 's|@''HAVE_FMAF''@|$(HAVE_FMAF)|g' \ + -e 's|@''HAVE_FMAL''@|$(HAVE_FMAL)|g' \ + -e 's|@''HAVE_FMODF''@|$(HAVE_FMODF)|g' \ + -e 's|@''HAVE_FMODL''@|$(HAVE_FMODL)|g' \ + -e 's|@''HAVE_FREXPF''@|$(HAVE_FREXPF)|g' \ + -e 's|@''HAVE_HYPOTF''@|$(HAVE_HYPOTF)|g' \ + -e 's|@''HAVE_HYPOTL''@|$(HAVE_HYPOTL)|g' \ + -e 's|@''HAVE_ILOGB''@|$(HAVE_ILOGB)|g' \ + -e 's|@''HAVE_ILOGBF''@|$(HAVE_ILOGBF)|g' \ + -e 's|@''HAVE_ILOGBL''@|$(HAVE_ILOGBL)|g' \ + -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \ + -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \ + -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \ + -e 's|@''HAVE_LDEXPF''@|$(HAVE_LDEXPF)|g' \ + -e 's|@''HAVE_LOGF''@|$(HAVE_LOGF)|g' \ + -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \ + -e 's|@''HAVE_LOG10F''@|$(HAVE_LOG10F)|g' \ + -e 's|@''HAVE_LOG10L''@|$(HAVE_LOG10L)|g' \ + -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \ + -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \ + -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \ + -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \ + -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \ + -e 's|@''HAVE_MODFF''@|$(HAVE_MODFF)|g' \ + -e 's|@''HAVE_MODFL''@|$(HAVE_MODFL)|g' \ + -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \ + -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \ + -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \ + -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \ + -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \ + -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \ + -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \ + -e 's|@''HAVE_SINHF''@|$(HAVE_SINHF)|g' \ + -e 's|@''HAVE_SQRTF''@|$(HAVE_SQRTF)|g' \ + -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \ + -e 's|@''HAVE_TANF''@|$(HAVE_TANF)|g' \ + -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \ + -e 's|@''HAVE_TANHF''@|$(HAVE_TANHF)|g' \ + -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ + -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ + -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ + -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \ + -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \ + -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \ + -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \ + -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \ + -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \ + -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \ + -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \ + -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \ + -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \ + -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \ + -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \ + -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \ + -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \ + -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \ + -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \ + -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \ + -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \ + -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \ + -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \ + -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \ + -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \ + -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \ + -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \ + -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \ + -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \ + -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \ + -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \ + -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \ + -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \ + -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \ + -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \ + -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \ + | \ + sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \ + -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \ + -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \ + -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ + -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ + -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \ + -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \ + -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \ + -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \ + -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \ + -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \ + -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \ + -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \ + -e 's|@''REPLACE_FMA''@|$(REPLACE_FMA)|g' \ + -e 's|@''REPLACE_FMAF''@|$(REPLACE_FMAF)|g' \ + -e 's|@''REPLACE_FMAL''@|$(REPLACE_FMAL)|g' \ + -e 's|@''REPLACE_FMOD''@|$(REPLACE_FMOD)|g' \ + -e 's|@''REPLACE_FMODF''@|$(REPLACE_FMODF)|g' \ + -e 's|@''REPLACE_FMODL''@|$(REPLACE_FMODL)|g' \ + -e 's|@''REPLACE_FREXPF''@|$(REPLACE_FREXPF)|g' \ + -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \ + -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \ + -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \ + -e 's|@''REPLACE_HYPOT''@|$(REPLACE_HYPOT)|g' \ + -e 's|@''REPLACE_HYPOTF''@|$(REPLACE_HYPOTF)|g' \ + -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \ + -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \ + -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \ + -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \ + -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \ + -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \ + -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \ + -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \ + -e 's|@''REPLACE_LOG''@|$(REPLACE_LOG)|g' \ + -e 's|@''REPLACE_LOGF''@|$(REPLACE_LOGF)|g' \ + -e 's|@''REPLACE_LOGL''@|$(REPLACE_LOGL)|g' \ + -e 's|@''REPLACE_LOG10''@|$(REPLACE_LOG10)|g' \ + -e 's|@''REPLACE_LOG10F''@|$(REPLACE_LOG10F)|g' \ + -e 's|@''REPLACE_LOG10L''@|$(REPLACE_LOG10L)|g' \ + -e 's|@''REPLACE_LOG1P''@|$(REPLACE_LOG1P)|g' \ + -e 's|@''REPLACE_LOG1PF''@|$(REPLACE_LOG1PF)|g' \ + -e 's|@''REPLACE_LOG1PL''@|$(REPLACE_LOG1PL)|g' \ + -e 's|@''REPLACE_LOG2''@|$(REPLACE_LOG2)|g' \ + -e 's|@''REPLACE_LOG2F''@|$(REPLACE_LOG2F)|g' \ + -e 's|@''REPLACE_LOG2L''@|$(REPLACE_LOG2L)|g' \ + -e 's|@''REPLACE_LOGB''@|$(REPLACE_LOGB)|g' \ + -e 's|@''REPLACE_LOGBF''@|$(REPLACE_LOGBF)|g' \ + -e 's|@''REPLACE_LOGBL''@|$(REPLACE_LOGBL)|g' \ + -e 's|@''REPLACE_MODF''@|$(REPLACE_MODF)|g' \ + -e 's|@''REPLACE_MODFF''@|$(REPLACE_MODFF)|g' \ + -e 's|@''REPLACE_MODFL''@|$(REPLACE_MODFL)|g' \ + -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \ + -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \ + -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \ + -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \ + -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \ + -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ + -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ + -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ + -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \ + -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \ + -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \ + -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create a replacement for when +# the system doesn't have one. +@GL_GENERATE_SCHED_H_TRUE@lib/sched.h: lib/sched.in.h $(top_builddir)/config.status +@GL_GENERATE_SCHED_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_SCHED_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_SCHED_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ < $(top_srcdir)/lib/sched.in.h; \ +@GL_GENERATE_SCHED_H_TRUE@ } > $@-t && \ +@GL_GENERATE_SCHED_H_TRUE@ mv $@-t $@ +@GL_GENERATE_SCHED_H_FALSE@lib/sched.h: $(top_builddir)/config.status +@GL_GENERATE_SCHED_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have a complete one. +lib/signal.h: lib/signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ + -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \ + -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \ + -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \ + -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \ + -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \ + -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \ + -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \ + -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ + -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ + -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ + -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ + -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \ + -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \ + -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/signal.in.h; \ + } > $@-t && \ + mv $@-t $@ +# The arg-nonnull.h that gets inserted into generated .h files is the same as +# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut +# off. +lib/arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/GL_ARG_NONNULL/,$$p' \ + < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ + > $@-t && \ + mv $@-t $@ +# The c++defs.h that gets inserted into generated .h files is the same as +# build-aux/snippet/c++defs.h, except that it has the copyright header cut off. +lib/c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/_GL_CXXDEFS/,$$p' \ + < $(top_srcdir)/build-aux/snippet/c++defs.h \ + > $@-t && \ + mv $@-t $@ +# The warn-on-use.h that gets inserted into generated .h files is the same as +# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut +# off. +lib/warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/^.ifndef/,$$p' \ + < $(top_srcdir)/build-aux/snippet/warn-on-use.h \ + > $@-t && \ + mv $@-t $@ + +# We need the following in order to create a replacement for when +# the system doesn't have one. +lib/spawn.h: lib/spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_SPAWN_H''@|$(HAVE_SPAWN_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SPAWN_H''@|$(NEXT_SPAWN_H)|g' \ + -e 's/@''GNULIB_POSIX_SPAWN''@/$(GNULIB_POSIX_SPAWN)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNP''@/$(GNULIB_POSIX_SPAWNP)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_INIT''@/$(GNULIB_POSIX_SPAWNATTR_INIT)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_GETFLAGS)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_SETFLAGS)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_GETPGROUP)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_SETPGROUP)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGMASK)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGMASK)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_DESTROY''@/$(GNULIB_POSIX_SPAWNATTR_DESTROY)/g' \ + -e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \ + -e 's|@''HAVE_POSIX_SPAWNATTR_T''@|$(HAVE_POSIX_SPAWNATTR_T)|g' \ + -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_T''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_T)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/spawn.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works. +@GL_GENERATE_STDBOOL_H_TRUE@lib/stdbool.h: lib/stdbool.in.h $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDBOOL_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDBOOL_H_TRUE@ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(top_srcdir)/lib/stdbool.in.h; \ +@GL_GENERATE_STDBOOL_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDBOOL_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDBOOL_H_FALSE@lib/stdbool.h: $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDDEF_H_TRUE@lib/stddef.h: lib/stddef.in.h $(top_builddir)/config.status +@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDDEF_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_STDDEF_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ < $(top_srcdir)/lib/stddef.in.h; \ +@GL_GENERATE_STDDEF_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDDEF_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDDEF_H_FALSE@lib/stddef.h: $(top_builddir)/config.status +@GL_GENERATE_STDDEF_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDINT_H_TRUE@lib/stdint.h: lib/stdint.in.h $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDINT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDINT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ < $(top_srcdir)/lib/stdint.in.h; \ +@GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDINT_H_FALSE@lib/stdint.h: $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/stdio.h: lib/stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \ + -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \ + -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \ + -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \ + -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \ + -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \ + -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \ + -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \ + -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \ + -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \ + -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \ + -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \ + -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \ + -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \ + -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \ + -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \ + -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \ + -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \ + -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \ + -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \ + -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ + -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ + -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ + -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \ + -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \ + -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \ + -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \ + -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \ + -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \ + -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \ + -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \ + -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \ + -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \ + -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \ + -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \ + -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \ + -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \ + -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \ + -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \ + -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ + -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + < $(top_srcdir)/lib/stdio.in.h | \ + sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ + -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \ + -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \ + -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \ + -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \ + -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \ + -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \ + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ + -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \ + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ + -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ + -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \ + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ + -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \ + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ + -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \ + -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \ + -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \ + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ + -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ + -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ + -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ + -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/stdlib.h: lib/stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + < $(top_srcdir)/lib/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ + -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ + -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ + -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \ + -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ + -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ + -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ + -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ + -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ + -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/string.h: lib/string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ + -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ + -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ + -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ + -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ + -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ + -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ + -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ + -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ + -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ + -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ + -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ + -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ + -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ + -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ + -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ + -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ + -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ + -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ + -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ + -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ + -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ + -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ + -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ + -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ + -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ + -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ + -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ + -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ + -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ + -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ + -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ + -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ + -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ + -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ + -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ + -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + < $(top_srcdir)/lib/string.in.h | \ + sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ + -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ + -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ + -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ + -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ + -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ + -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ + -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ + -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ + -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ + -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ + -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ + -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ + -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ + -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ + -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ + -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ + -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ + -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \ + -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \ + -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ + -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ + -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + < $(top_srcdir)/lib/string.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# has one that is incomplete. +lib/sys/stat.h: lib/sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) lib/sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ + -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ + -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ + -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ + -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ + -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ + -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ + -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ + -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ + -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ + -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ + -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ + -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ + -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ + -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ + -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ + -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ + -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ + -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ + -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ + -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ + -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ + -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ + -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ + -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/sys_stat.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/sys/time.h: lib/sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) lib/sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/sys_time.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/sys/types.h: lib/sys_types.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) lib/sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + < $(top_srcdir)/lib/sys_types.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# has one that is incomplete. +lib/sys/wait.h: lib/sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) lib/sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ + -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/sys_wait.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/time.h: lib/time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ + -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ + -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ + -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ + -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ + -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ + -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ + -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ + -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ + -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/time.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create an empty placeholder for +# when the system doesn't have one. +lib/unistd.h: lib/unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + < $(top_srcdir)/lib/unistd.in.h | \ + sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ + -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ + -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ + -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ + -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ + -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \ + -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ + -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \ + -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ + -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ + -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ + -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ + -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ + -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ + | \ + sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ + -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ + -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ + -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \ + -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ + -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ + -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ + -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ + -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ + -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ + -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ + -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ + -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ + -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ + -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +lib/unitypes.h: lib/unitypes.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(top_srcdir)/lib/unitypes.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +lib/uniwidth.h: lib/uniwidth.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(top_srcdir)/lib/uniwidth.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +# We need the following in order to create when the system +# version does not work standalone. +lib/wchar.h: lib/wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ + -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ + -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ + -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \ + -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \ + -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \ + -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \ + -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \ + -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \ + -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \ + -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \ + -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \ + -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ + -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ + -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ + -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ + -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ + -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \ + -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \ + -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \ + -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \ + -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \ + -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \ + -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \ + -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \ + -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \ + -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \ + -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \ + -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \ + -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \ + -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \ + -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \ + -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \ + -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \ + -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \ + -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \ + -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ + -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ + < $(top_srcdir)/lib/wchar.in.h | \ + sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \ + -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ + -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ + -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ + -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ + -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ + -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \ + -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \ + -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \ + -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \ + -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \ + -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \ + -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \ + -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \ + -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \ + -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \ + -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \ + -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \ + -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \ + -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \ + -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \ + -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \ + -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \ + -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \ + -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \ + -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \ + -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + | \ + sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ + -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/wctype.h: lib/wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ + -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ + -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ + -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \ + -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \ + -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \ + -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/wctype.in.h; \ + } > $@-t && \ + mv $@-t $@ + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done; \ + : + +src/yacc: + $(AM_V_GEN)rm -f $@ $@.tmp + $(AM_V_at)echo '#! /bin/sh' >$@.tmp + $(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@.tmp + $(AM_V_at)chmod a+x $@.tmp + $(AM_V_at)mv $@.tmp $@ + +$(top_srcdir)/tests/package.m4: $(top_srcdir)/configure + $(AM_V_GEN)rm -f $@ $@.tmp + $(AM_V_at){ \ + echo '# Signature of the current package.'; \ + echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \ + echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \ + echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \ + echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \ + echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \ + } >$@.tmp + $(AM_V_at)mv $@.tmp $@ +$(TESTSUITE): $(TESTSUITE_AT) + $(AM_V_GEN) \ + $(AUTOTEST) $(AUTOTESTFLAGS) $(srcdir)/tests/testsuite.at -o $@.tmp + $(AM_V_at)$(PERL) -pi -e 's/\@tb\@/\t/g' $@.tmp + $(AM_V_at)mv $@.tmp $@ + +clean-local: clean-local-tests +clean-local-tests: + test ! -f $(TESTSUITE) || $(TESTSUITE) -C tests --clean + +check-local: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) + +# Run the test suite on the *installed* tree. +installcheck-local: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) AUTOTEST_PATH='$(bindir)' + +# Be real mean with it. +.PHONY: maintainer-check-g++ +maintainer-check-g++: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) --compile-c-with-cxx + +.PHONY: maintainer-check-posix +maintainer-check-posix: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) POSIXLY_CORRECT=1 _POSIX2_VERSION=200112 + +.PHONY: maintainer-check-valgrind +maintainer-check-valgrind: $(RUN_TESTSUITE_deps) + test -z '$(VALGRIND)' || \ + $(RUN_TESTSUITE) \ + PREBISON='$(VALGRIND_PREBISON)' PREPARSER='$(VALGRIND) -q' \ + VALGRIND_OPTS='--leak-check=full --show-reachable=yes' + +.PHONY: maintainer-check +maintainer-check: maintainer-check-posix maintainer-check-valgrind maintainer-check-g++ + +.PHONY: maintainer-push-check +maintainer-push-check: + $(MAKE) $(AM_MAKEFLAGS) maintainer-check \ + TESTSUITEFLAGS='BISON_USE_PUSH_FOR_PULL=1 $(TESTSUITEFLAGS)' + +.PHONY: maintainer-xml-check +maintainer-xml-check: + $(MAKE) $(AM_MAKEFLAGS) maintainer-check \ + TESTSUITEFLAGS='BISON_TEST_XML=1 $(TESTSUITEFLAGS)' + +.PHONY: maintainer-release-check +maintainer-release-check: maintainer-check maintainer-push-check maintainer-xml-check +$(top_srcdir)/.version: configure + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: gen-ChangeLog + echo $(VERSION) > $(distdir)/.tarball-version + +.PHONY: update-b4-copyright update-package-copyright-year +update-b4-copyright: + $(AM_V_GEN)find $(srcdir)/data -type f \ + | xargs $(srcdir)/build-aux/$@ + @echo 'warning: src/parse-gram.[hc] may need to be regenerated.' +update-package-copyright-year: + $(AM_V_GEN)$(srcdir)/build-aux/$@ $(srcdir)/configure.ac +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ + cl=$(distdir)/ChangeLog && \ + rm -f $$cl.tmp && \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + --strip-tab \ + --strip-cherry-pick \ + --no-cluster \ + --amend=$(srcdir)/build-aux/git-log-fix \ + --srcdir=$(srcdir) \ + --since=$(gen_start_date) > $$cl.tmp && \ + mv -f $$cl.tmp $$cl; \ + fi + +# 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..732da6f --- /dev/null +++ b/NEWS @@ -0,0 +1,2796 @@ +GNU Bison NEWS + +* Noteworthy changes in release 3.0.4 (2015-01-23) [stable] + +** Bug fixes + +*** C++ with Variants (lalr1.cc) + + Fix a compiler warning when no %destructor use $$. + +*** Test suites + + Several portability issues in tests were fixed. + +* Noteworthy changes in release 3.0.3 (2015-01-15) [stable] + +** Bug fixes + +*** C++ with Variants (lalr1.cc) + + Problems with %destructor and '%define parse.assert' have been fixed. + +*** Named %union support (yacc.c, glr.c) + + Bison 3.0 introduced a regression on named %union such as + + %union foo { int ival; }; + + The possibility to use a name was introduced "for Yacc compatibility". + It is however not required by POSIX Yacc, and its usefulness is not clear. + +*** %define api.value.type union with %defines (yacc.c, glr.c) + + The C parsers were broken when %defines was used together with "%define + api.value.type union". + +*** Redeclarations are reported in proper order + + On + + %token FOO "foo" + %printer {} "foo" + %printer {} FOO + + bison used to report: + + /tmp/foo.yy:2.10-11: error: %printer redeclaration for FOO + %printer {} "foo" + ^^ + /tmp/foo.yy:3.10-11: previous declaration + %printer {} FOO + ^^ + + Now, the "previous" declaration is always the first one. + + +** Documentation + + Bison now installs various files in its docdir (which defaults to + '/usr/local/share/doc/bison'), including the three fully blown examples + extracted from the documentation: + + - rpcalc + Reverse polish calculator, a simple introductory example. + - mfcalc + Multi-function Calc, a calculator with memory and functions and located + error messages. + - calc++ + a calculator in C++ using variant support and token constructors. + +* Noteworthy changes in release 3.0.2 (2013-12-05) [stable] + +** Bug fixes + +*** Generated source files when errors are reported + + When warnings are issued and -Werror is set, bison would still generate + the source files (*.c, *.h...). As a consequence, some runs of "make" + could fail the first time, but not the second (as the files were generated + anyway). + + This is fixed: bison no longer generates this source files, but, of + course, still produces the various reports (*.output, *.xml, etc.). + +*** %empty is used in reports + + Empty right-hand sides are denoted by '%empty' in all the reports (text, + dot, XML and formats derived from it). + +*** YYERROR and variants + + When C++ variant support is enabled, an error triggered via YYERROR, but + not caught via error recovery, resulted in a double deletion. + +* Noteworthy changes in release 3.0.1 (2013-11-12) [stable] + +** Bug fixes + +*** Errors in caret diagnostics + + On some platforms, some errors could result in endless diagnostics. + +*** Fixes of the -Werror option + + Options such as "-Werror -Wno-error=foo" were still turning "foo" + diagnostics into errors instead of warnings. This is fixed. + + Actually, for consistency with GCC, "-Wno-error=foo -Werror" now also + leaves "foo" diagnostics as warnings. Similarly, with "-Werror=foo + -Wno-error", "foo" diagnostics are now errors. + +*** GLR Predicates + + As demonstrated in the documentation, one can now leave spaces between + "%?" and its "{". + +*** Installation + + The yacc.1 man page is no longer installed if --disable-yacc was + specified. + +*** Fixes in the test suite + + Bugs and portability issues. + +* Noteworthy changes in release 3.0 (2013-07-25) [stable] + +** WARNING: Future backward-incompatibilities! + + Like other GNU packages, Bison will start using some of the C99 features + for its own code, especially the definition of variables after statements. + The generated C parsers still aim at C90. + +** Backward incompatible changes + +*** Obsolete features + + Support for YYFAIL is removed (deprecated in Bison 2.4.2): use YYERROR. + + Support for yystype and yyltype is removed (deprecated in Bison 1.875): + use YYSTYPE and YYLTYPE. + + Support for YYLEX_PARAM and YYPARSE_PARAM is removed (deprecated in Bison + 1.875): use %lex-param, %parse-param, or %param. + + Missing semicolons at the end of actions are no longer added (as announced + in the release 2.5). + +*** Use of YACC='bison -y' + + TL;DR: With Autoconf <= 2.69, pass -Wno-yacc to (AM_)YFLAGS if you use + Bison extensions. + + Traditional Yacc generates 'y.tab.c' whatever the name of the input file. + Therefore Makefiles written for Yacc expect 'y.tab.c' (and possibly + 'y.tab.h' and 'y.outout') to be generated from 'foo.y'. + + To this end, for ages, AC_PROG_YACC, Autoconf's macro to look for an + implementation of Yacc, was using Bison as 'bison -y'. While it does + ensure compatible output file names, it also enables warnings for + incompatibilities with POSIX Yacc. In other words, 'bison -y' triggers + warnings for Bison extensions. + + Autoconf 2.70+ fixes this incompatibility by using YACC='bison -o y.tab.c' + (which also generates 'y.tab.h' and 'y.output' when needed). + Alternatively, disable Yacc warnings by passing '-Wno-yacc' to your Yacc + flags (YFLAGS, or AM_YFLAGS with Automake). + +** Bug fixes + +*** The epilogue is no longer affected by internal #defines (glr.c) + + The glr.c skeleton uses defines such as #define yylval (yystackp->yyval) in + generated code. These weren't properly undefined before the inclusion of + the user epilogue, so functions such as the following were butchered by the + preprocessor expansion: + + int yylex (YYSTYPE *yylval); + + This is fixed: yylval, yynerrs, yychar, and yylloc are now valid + identifiers for user-provided variables. + +*** stdio.h is no longer needed when locations are enabled (yacc.c) + + Changes in Bison 2.7 introduced a dependency on FILE and fprintf when + locations are enabled. This is fixed. + +*** Warnings about useless %pure-parser/%define api.pure are restored + +** Diagnostics reported by Bison + + Most of these features were contributed by Théophile Ranquet and Victor + Santet. + +*** Carets + + Version 2.7 introduced caret errors, for a prettier output. These are now + activated by default. The old format can still be used by invoking Bison + with -fno-caret (or -fnone). + + Some error messages that reproduced excerpts of the grammar are now using + the caret information only. For instance on: + + %% + exp: 'a' | 'a'; + + Bison 2.7 reports: + + in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] + in.y:2.12-14: warning: rule useless in parser due to conflicts: exp: 'a' [-Wother] + + Now bison reports: + + in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] + in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother] + exp: 'a' | 'a'; + ^^^ + + and "bison -fno-caret" reports: + + in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] + in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother] + +*** Enhancements of the -Werror option + + The -Werror=CATEGORY option is now recognized, and will treat specified + warnings as errors. The warnings need not have been explicitly activated + using the -W option, this is similar to what GCC 4.7 does. + + For example, given the following command line, Bison will treat both + warnings related to POSIX Yacc incompatibilities and S/R conflicts as + errors (and only those): + + $ bison -Werror=yacc,error=conflicts-sr input.y + + If no categories are specified, -Werror will make all active warnings into + errors. For example, the following line does the same the previous example: + + $ bison -Werror -Wnone -Wyacc -Wconflicts-sr input.y + + (By default -Wconflicts-sr,conflicts-rr,deprecated,other is enabled.) + + Note that the categories in this -Werror option may not be prefixed with + "no-". However, -Wno-error[=CATEGORY] is valid. + + Note that -y enables -Werror=yacc. Therefore it is now possible to require + Yacc-like behavior (e.g., always generate y.tab.c), but to report + incompatibilities as warnings: "-y -Wno-error=yacc". + +*** The display of warnings is now richer + + The option that controls a given warning is now displayed: + + foo.y:4.6: warning: type clash on default action: != [-Wother] + + In the case of warnings treated as errors, the prefix is changed from + "warning: " to "error: ", and the suffix is displayed, in a manner similar + to GCC, as [-Werror=CATEGORY]. + + For instance, where the previous version of Bison would report (and exit + with failure): + + bison: warnings being treated as errors + input.y:1.1: warning: stray ',' treated as white space + + it now reports: + + input.y:1.1: error: stray ',' treated as white space [-Werror=other] + +*** Deprecated constructs + + The new 'deprecated' warning category flags obsolete constructs whose + support will be discontinued. It is enabled by default. These warnings + used to be reported as 'other' warnings. + +*** Useless semantic types + + Bison now warns about useless (uninhabited) semantic types. Since + semantic types are not declared to Bison (they are defined in the opaque + %union structure), it is %printer/%destructor directives about useless + types that trigger the warning: + + %token term + %type nterm + %printer {} + %destructor {} + %% + nterm: term { $$ = $1; }; + + 3.28-34: warning: type is used, but is not associated to any symbol + 4.28-34: warning: type is used, but is not associated to any symbol + +*** Undefined but unused symbols + + Bison used to raise an error for undefined symbols that are not used in + the grammar. This is now only a warning. + + %printer {} symbol1 + %destructor {} symbol2 + %type symbol3 + %% + exp: "a"; + +*** Useless destructors or printers + + Bison now warns about useless destructors or printers. In the following + example, the printer for , and the destructor for are + useless: all symbols of (token1) already have a printer, and all + symbols of type (token2) already have a destructor. + + %token token1 + token2 + token3 + token4 + %printer {} token1 + %destructor {} token2 + +*** Conflicts + + The warnings and error messages about shift/reduce and reduce/reduce + conflicts have been normalized. For instance on the following foo.y file: + + %glr-parser + %% + exp: exp '+' exp | '0' | '0'; + + compare the previous version of bison: + + $ bison foo.y + foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce + $ bison -Werror foo.y + bison: warnings being treated as errors + foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce + + with the new behavior: + + $ bison foo.y + foo.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] + foo.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] + $ bison -Werror foo.y + foo.y: error: 1 shift/reduce conflict [-Werror=conflicts-sr] + foo.y: error: 2 reduce/reduce conflicts [-Werror=conflicts-rr] + + When %expect or %expect-rr is used, such as with bar.y: + + %expect 0 + %glr-parser + %% + exp: exp '+' exp | '0' | '0'; + + Former behavior: + + $ bison bar.y + bar.y: conflicts: 1 shift/reduce, 2 reduce/reduce + bar.y: expected 0 shift/reduce conflicts + bar.y: expected 0 reduce/reduce conflicts + + New one: + + $ bison bar.y + bar.y: error: shift/reduce conflicts: 1 found, 0 expected + bar.y: error: reduce/reduce conflicts: 2 found, 0 expected + +** Incompatibilities with POSIX Yacc + + The 'yacc' category is no longer part of '-Wall', enable it explicitly + with '-Wyacc'. + +** Additional yylex/yyparse arguments + + The new directive %param declares additional arguments to both yylex and + yyparse. The %lex-param, %parse-param, and %param directives support one + or more arguments. Instead of + + %lex-param {arg1_type *arg1} + %lex-param {arg2_type *arg2} + %parse-param {arg1_type *arg1} + %parse-param {arg2_type *arg2} + + one may now declare + + %param {arg1_type *arg1} {arg2_type *arg2} + +** Types of values for %define variables + + Bison used to make no difference between '%define foo bar' and '%define + foo "bar"'. The former is now called a 'keyword value', and the latter a + 'string value'. A third kind was added: 'code values', such as '%define + foo {bar}'. + + Keyword variables are used for fixed value sets, e.g., + + %define lr.type lalr + + Code variables are used for value in the target language, e.g., + + %define api.value.type {struct semantic_type} + + String variables are used remaining cases, e.g. file names. + +** Variable api.token.prefix + + The variable api.token.prefix changes the way tokens are identified in + the generated files. This is especially useful to avoid collisions + with identifiers in the target language. For instance + + %token FILE for ERROR + %define api.token.prefix {TOK_} + %% + start: FILE for ERROR; + + will generate the definition of the symbols TOK_FILE, TOK_for, and + TOK_ERROR in the generated sources. In particular, the scanner must + use these prefixed token names, although the grammar itself still + uses the short names (as in the sample rule given above). + +** Variable api.value.type + + This new %define variable supersedes the #define macro YYSTYPE. The use + of YYSTYPE is discouraged. In particular, #defining YYSTYPE *and* either + using %union or %defining api.value.type results in undefined behavior. + + Either define api.value.type, or use "%union": + + %union + { + int ival; + char *sval; + } + %token INT "integer" + %token STRING "string" + %printer { fprintf (yyo, "%d", $$); } + %destructor { free ($$); } + + /* In yylex(). */ + yylval.ival = 42; return INT; + yylval.sval = "42"; return STRING; + + The %define variable api.value.type supports both keyword and code values. + + The keyword value 'union' means that the user provides genuine types, not + union member names such as "ival" and "sval" above (WARNING: will fail if + -y/--yacc/%yacc is enabled). + + %define api.value.type union + %token INT "integer" + %token STRING "string" + %printer { fprintf (yyo, "%d", $$); } + %destructor { free ($$); } + + /* In yylex(). */ + yylval.INT = 42; return INT; + yylval.STRING = "42"; return STRING; + + The keyword value variant is somewhat equivalent, but for C++ special + provision is made to allow classes to be used (more about this below). + + %define api.value.type variant + %token INT "integer" + %token STRING "string" + + Code values (in braces) denote user defined types. This is where YYSTYPE + used to be used. + + %code requires + { + struct my_value + { + enum + { + is_int, is_string + } kind; + union + { + int ival; + char *sval; + } u; + }; + } + %define api.value.type {struct my_value} + %token INT "integer" + %token STRING "string" + %printer { fprintf (yyo, "%d", $$); } + %destructor { free ($$); } + + /* In yylex(). */ + yylval.u.ival = 42; return INT; + yylval.u.sval = "42"; return STRING; + +** Variable parse.error + + This variable controls the verbosity of error messages. The use of the + %error-verbose directive is deprecated in favor of "%define parse.error + verbose". + +** Renamed %define variables + + The following variables have been renamed for consistency. Backward + compatibility is ensured, but upgrading is recommended. + + lr.default-reductions -> lr.default-reduction + lr.keep-unreachable-states -> lr.keep-unreachable-state + namespace -> api.namespace + stype -> api.value.type + +** Semantic predicates + + Contributed by Paul Hilfinger. + + The new, experimental, semantic-predicate feature allows actions of the + form "%?{ BOOLEAN-EXPRESSION }", which cause syntax errors (as for + YYERROR) if the expression evaluates to 0, and are evaluated immediately + in GLR parsers, rather than being deferred. The result is that they allow + the programmer to prune possible parses based on the values of run-time + expressions. + +** The directive %expect-rr is now an error in non GLR mode + + It used to be an error only if used in non GLR mode, _and_ if there are + reduce/reduce conflicts. + +** Tokens are numbered in their order of appearance + + Contributed by Valentin Tolmer. + + With '%token A B', A had a number less than the one of B. However, + precedence declarations used to generate a reversed order. This is now + fixed, and introducing tokens with any of %token, %left, %right, + %precedence, or %nonassoc yields the same result. + + When mixing declarations of tokens with a litteral character (e.g., 'a') + or with an identifier (e.g., B) in a precedence declaration, Bison + numbered the litteral characters first. For example + + %right A B 'c' 'd' + + would lead to the tokens declared in this order: 'c' 'd' A B. Again, the + input order is now preserved. + + These changes were made so that one can remove useless precedence and + associativity declarations (i.e., map %nonassoc, %left or %right to + %precedence, or to %token) and get exactly the same output. + +** Useless precedence and associativity + + Contributed by Valentin Tolmer. + + When developing and maintaining a grammar, useless associativity and + precedence directives are common. They can be a nuisance: new ambiguities + arising are sometimes masked because their conflicts are resolved due to + the extra precedence or associativity information. Furthermore, it can + hinder the comprehension of a new grammar: one will wonder about the role + of a precedence, where in fact it is useless. The following changes aim + at detecting and reporting these extra directives. + +*** Precedence warning category + + A new category of warning, -Wprecedence, was introduced. It flags the + useless precedence and associativity directives. + +*** Useless associativity + + Bison now warns about symbols with a declared associativity that is never + used to resolve conflicts. In that case, using %precedence is sufficient; + the parsing tables will remain unchanged. Solving these warnings may raise + useless precedence warnings, as the symbols no longer have associativity. + For example: + + %left '+' + %left '*' + %% + exp: + "number" + | exp '+' "number" + | exp '*' exp + ; + + will produce a + + warning: useless associativity for '+', use %precedence [-Wprecedence] + %left '+' + ^^^ + +*** Useless precedence + + Bison now warns about symbols with a declared precedence and no declared + associativity (i.e., declared with %precedence), and whose precedence is + never used. In that case, the symbol can be safely declared with %token + instead, without modifying the parsing tables. For example: + + %precedence '=' + %% + exp: "var" '=' "number"; + + will produce a + + warning: useless precedence for '=' [-Wprecedence] + %precedence '=' + ^^^ + +*** Useless precedence and associativity + + In case of both useless precedence and associativity, the issue is flagged + as follows: + + %nonassoc '=' + %% + exp: "var" '=' "number"; + + The warning is: + + warning: useless precedence and associativity for '=' [-Wprecedence] + %nonassoc '=' + ^^^ + +** Empty rules + + With help from Joel E. Denny and Gabriel Rassoul. + + Empty rules (i.e., with an empty right-hand side) can now be explicitly + marked by the new %empty directive. Using %empty on a non-empty rule is + an error. The new -Wempty-rule warning reports empty rules without + %empty. On the following grammar: + + %% + s: a b c; + a: ; + b: %empty; + c: 'a' %empty; + + bison reports: + + 3.4-5: warning: empty rule without %empty [-Wempty-rule] + a: {} + ^^ + 5.8-13: error: %empty on non-empty rule + c: 'a' %empty {}; + ^^^^^^ + +** Java skeleton improvements + + The constants for token names were moved to the Lexer interface. Also, it + is possible to add code to the parser's constructors using "%code init" + and "%define init_throws". + Contributed by Paolo Bonzini. + + The Java skeleton now supports push parsing. + Contributed by Dennis Heimbigner. + +** C++ skeletons improvements + +*** The parser header is no longer mandatory (lalr1.cc, glr.cc) + + Using %defines is now optional. Without it, the needed support classes + are defined in the generated parser, instead of additional files (such as + location.hh, position.hh and stack.hh). + +*** Locations are no longer mandatory (lalr1.cc, glr.cc) + + Both lalr1.cc and glr.cc no longer require %location. + +*** syntax_error exception (lalr1.cc) + + The C++ parser features a syntax_error exception, which can be + thrown from the scanner or from user rules to raise syntax errors. + This facilitates reporting errors caught in sub-functions (e.g., + rejecting too large integral literals from a conversion function + used by the scanner, or rejecting invalid combinations from a + factory invoked by the user actions). + +*** %define api.value.type variant + + This is based on a submission from Michiel De Wilde. With help + from Théophile Ranquet. + + In this mode, complex C++ objects can be used as semantic values. For + instance: + + %token <::std::string> TEXT; + %token NUMBER; + %token SEMICOLON ";" + %type <::std::string> item; + %type <::std::list> list; + %% + result: + list { std::cout << $1 << std::endl; } + ; + + list: + %empty { /* Generates an empty string list. */ } + | list item ";" { std::swap ($$, $1); $$.push_back ($2); } + ; + + item: + TEXT { std::swap ($$, $1); } + | NUMBER { $$ = string_cast ($1); } + ; + +*** %define api.token.constructor + + When variants are enabled, Bison can generate functions to build the + tokens. This guarantees that the token type (e.g., NUMBER) is consistent + with the semantic value (e.g., int): + + parser::symbol_type yylex () + { + parser::location_type loc = ...; + ... + return parser::make_TEXT ("Hello, world!", loc); + ... + return parser::make_NUMBER (42, loc); + ... + return parser::make_SEMICOLON (loc); + ... + } + +*** C++ locations + + There are operator- and operator-= for 'location'. Negative line/column + increments can no longer underflow the resulting value. + +* Noteworthy changes in release 2.7.1 (2013-04-15) [stable] + +** Bug fixes + +*** Fix compiler attribute portability (yacc.c) + + With locations enabled, __attribute__ was used unprotected. + +*** Fix some compiler warnings (lalr1.cc) + +* Noteworthy changes in release 2.7 (2012-12-12) [stable] + +** Bug fixes + + Warnings about uninitialized yylloc in yyparse have been fixed. + + Restored C90 compliance (yet no report was ever made). + +** Diagnostics are improved + + Contributed by Théophile Ranquet. + +*** Changes in the format of error messages + + This used to be the format of many error reports: + + input.y:2.7-12: %type redeclaration for exp + input.y:1.7-12: previous declaration + + It is now: + + input.y:2.7-12: error: %type redeclaration for exp + input.y:1.7-12: previous declaration + +*** New format for error reports: carets + + Caret errors have been added to Bison: + + input.y:2.7-12: error: %type redeclaration for exp + %type exp + ^^^^^^ + input.y:1.7-12: previous declaration + %type exp + ^^^^^^ + + or + + input.y:3.20-23: error: ambiguous reference: '$exp' + exp: exp '+' exp { $exp = $1 + $3; }; + ^^^^ + input.y:3.1-3: refers to: $exp at $$ + exp: exp '+' exp { $exp = $1 + $3; }; + ^^^ + input.y:3.6-8: refers to: $exp at $1 + exp: exp '+' exp { $exp = $1 + $3; }; + ^^^ + input.y:3.14-16: refers to: $exp at $3 + exp: exp '+' exp { $exp = $1 + $3; }; + ^^^ + + The default behavior for now is still not to display these unless + explicitly asked with -fcaret (or -fall). However, in a later release, it + will be made the default behavior (but may still be deactivated with + -fno-caret). + +** New value for %define variable: api.pure full + + The %define variable api.pure requests a pure (reentrant) parser. However, + for historical reasons, using it in a location-tracking Yacc parser + resulted in a yyerror function that did not take a location as a + parameter. With this new value, the user may request a better pure parser, + where yyerror does take a location as a parameter (in location-tracking + parsers). + + The use of "%define api.pure true" is deprecated in favor of this new + "%define api.pure full". + +** New %define variable: api.location.type (glr.cc, lalr1.cc, lalr1.java) + + The %define variable api.location.type defines the name of the type to use + for locations. When defined, Bison no longer generates the position.hh + and location.hh files, nor does the parser will include them: the user is + then responsible to define her type. + + This can be used in programs with several parsers to factor their location + and position files: let one of them generate them, and the others just use + them. + + This feature was actually introduced, but not documented, in Bison 2.5, + under the name "location_type" (which is maintained for backward + compatibility). + + For consistency, lalr1.java's %define variables location_type and + position_type are deprecated in favor of api.location.type and + api.position.type. + +** Exception safety (lalr1.cc) + + The parse function now catches exceptions, uses the %destructors to + release memory (the lookahead symbol and the symbols pushed on the stack) + before re-throwing the exception. + + This feature is somewhat experimental. User feedback would be + appreciated. + +** Graph improvements in DOT and XSLT + + Contributed by Théophile Ranquet. + + The graphical presentation of the states is more readable: their shape is + now rectangular, the state number is clearly displayed, and the items are + numbered and left-justified. + + The reductions are now explicitly represented as transitions to other + diamond shaped nodes. + + These changes are present in both --graph output and xml2dot.xsl XSLT + processing, with minor (documented) differences. + +** %language is no longer an experimental feature. + + The introduction of this feature, in 2.4, was four years ago. The + --language option and the %language directive are no longer experimental. + +** Documentation + + The sections about shift/reduce and reduce/reduce conflicts resolution + have been fixed and extended. + + Although introduced more than four years ago, XML and Graphviz reports + were not properly documented. + + The translation of mid-rule actions is now described. + +* Noteworthy changes in release 2.6.5 (2012-11-07) [stable] + + We consider compiler warnings about Bison generated parsers to be bugs. + Rather than working around them in your own project, please consider + reporting them to us. + +** Bug fixes + + Warnings about uninitialized yylval and/or yylloc for push parsers with a + pure interface have been fixed for GCC 4.0 up to 4.8, and Clang 2.9 to + 3.2. + + Other issues in the test suite have been addressed. + + Null characters are correctly displayed in error messages. + + When possible, yylloc is correctly initialized before calling yylex. It + is no longer necessary to initialize it in the %initial-action. + +* Noteworthy changes in release 2.6.4 (2012-10-23) [stable] + + Bison 2.6.3's --version was incorrect. This release fixes this issue. + +* Noteworthy changes in release 2.6.3 (2012-10-22) [stable] + +** Bug fixes + + Bugs and portability issues in the test suite have been fixed. + + Some errors in translations have been addressed, and --help now directs + users to the appropriate place to report them. + + Stray Info files shipped by accident are removed. + + Incorrect definitions of YY_, issued by yacc.c when no parser header is + generated, are removed. + + All the generated headers are self-contained. + +** Header guards (yacc.c, glr.c, glr.cc) + + In order to avoid collisions, the header guards are now + YY___INCLUDED, instead of merely _. + For instance the header generated from + + %define api.prefix "calc" + %defines "lib/parse.h" + + will use YY_CALC_LIB_PARSE_H_INCLUDED as guard. + +** Fix compiler warnings in the generated parser (yacc.c, glr.c) + + The compilation of pure parsers (%define api.pure) can trigger GCC + warnings such as: + + input.c: In function 'yyparse': + input.c:1503:12: warning: 'yylval' may be used uninitialized in this + function [-Wmaybe-uninitialized] + *++yyvsp = yylval; + ^ + + This is now fixed; pragmas to avoid these warnings are no longer needed. + + Warnings from clang ("equality comparison with extraneous parentheses" and + "function declared 'noreturn' should not return") have also been + addressed. + +* Noteworthy changes in release 2.6.2 (2012-08-03) [stable] + +** Bug fixes + + Buffer overruns, complaints from Flex, and portability issues in the test + suite have been fixed. + +** Spaces in %lex- and %parse-param (lalr1.cc, glr.cc) + + Trailing end-of-lines in %parse-param or %lex-param would result in + invalid C++. This is fixed. + +** Spurious spaces and end-of-lines + + The generated files no longer end (nor start) with empty lines. + +* Noteworthy changes in release 2.6.1 (2012-07-30) [stable] + + Bison no longer executes user-specified M4 code when processing a grammar. + +** Future Changes + + In addition to the removal of the features announced in Bison 2.6, the + next major release will remove the "Temporary hack for adding a semicolon + to the user action", as announced in the release 2.5. Instead of: + + exp: exp "+" exp { $$ = $1 + $3 }; + + write: + + exp: exp "+" exp { $$ = $1 + $3; }; + +** Bug fixes + +*** Type names are now properly escaped. + +*** glr.cc: set_debug_level and debug_level work as expected. + +*** Stray @ or $ in actions + + While Bison used to warn about stray $ or @ in action rules, it did not + for other actions such as printers, destructors, or initial actions. It + now does. + +** Type names in actions + + For consistency with rule actions, it is now possible to qualify $$ by a + type-name in destructors, printers, and initial actions. For instance: + + %printer { fprintf (yyo, "(%d, %f)", $$, $$); } <*> <>; + + will display two values for each typed and untyped symbol (provided + that YYSTYPE has both "ival" and "fval" fields). + +* Noteworthy changes in release 2.6 (2012-07-19) [stable] + +** Future changes + + The next major release of Bison will drop support for the following + deprecated features. Please report disagreements to bug-bison@gnu.org. + +*** K&R C parsers + + Support for generating parsers in K&R C will be removed. Parsers + generated for C support ISO C90, and are tested with ISO C99 and ISO C11 + compilers. + +*** Features deprecated since Bison 1.875 + + The definitions of yystype and yyltype will be removed; use YYSTYPE and + YYLTYPE. + + YYPARSE_PARAM and YYLEX_PARAM, deprecated in favor of %parse-param and + %lex-param, will no longer be supported. + + Support for the preprocessor symbol YYERROR_VERBOSE will be removed, use + %error-verbose. + +*** The generated header will be included (yacc.c) + + Instead of duplicating the content of the generated header (definition of + YYSTYPE, yyparse declaration etc.), the generated parser will include it, + as is already the case for GLR or C++ parsers. This change is deferred + because existing versions of ylwrap (e.g., Automake 1.12.1) do not support + it. + +** Generated Parser Headers + +*** Guards (yacc.c, glr.c, glr.cc) + + The generated headers are now guarded, as is already the case for C++ + parsers (lalr1.cc). For instance, with --defines=foo.h: + + #ifndef YY_FOO_H + # define YY_FOO_H + ... + #endif /* !YY_FOO_H */ + +*** New declarations (yacc.c, glr.c) + + The generated header now declares yydebug and yyparse. Both honor + --name-prefix=bar_, and yield + + int bar_parse (void); + + rather than + + #define yyparse bar_parse + int yyparse (void); + + in order to facilitate the inclusion of several parser headers inside a + single compilation unit. + +*** Exported symbols in C++ + + The symbols YYTOKEN_TABLE and YYERROR_VERBOSE, which were defined in the + header, are removed, as they prevent the possibility of including several + generated headers from a single compilation unit. + +*** YYLSP_NEEDED + + For the same reasons, the undocumented and unused macro YYLSP_NEEDED is no + longer defined. + +** New %define variable: api.prefix + + Now that the generated headers are more complete and properly protected + against multiple inclusions, constant names, such as YYSTYPE are a + problem. While yyparse and others are properly renamed by %name-prefix, + YYSTYPE, YYDEBUG and others have never been affected by it. Because it + would introduce backward compatibility issues in projects not expecting + YYSTYPE to be renamed, instead of changing the behavior of %name-prefix, + it is deprecated in favor of a new %define variable: api.prefix. + + The following examples compares both: + + %name-prefix "bar_" | %define api.prefix "bar_" + %token FOO %token FOO + %union { int ival; } %union { int ival; } + %% %% + exp: 'a'; exp: 'a'; + + bison generates: + + #ifndef BAR_FOO_H #ifndef BAR_FOO_H + # define BAR_FOO_H # define BAR_FOO_H + + /* Enabling traces. */ /* Enabling traces. */ + # ifndef YYDEBUG | # ifndef BAR_DEBUG + > # if defined YYDEBUG + > # if YYDEBUG + > # define BAR_DEBUG 1 + > # else + > # define BAR_DEBUG 0 + > # endif + > # else + # define YYDEBUG 0 | # define BAR_DEBUG 0 + > # endif + # endif | # endif + + # if YYDEBUG | # if BAR_DEBUG + extern int bar_debug; extern int bar_debug; + # endif # endif + + /* Tokens. */ /* Tokens. */ + # ifndef YYTOKENTYPE | # ifndef BAR_TOKENTYPE + # define YYTOKENTYPE | # define BAR_TOKENTYPE + enum yytokentype { | enum bar_tokentype { + FOO = 258 FOO = 258 + }; }; + # endif # endif + + #if ! defined YYSTYPE \ | #if ! defined BAR_STYPE \ + && ! defined YYSTYPE_IS_DECLARED | && ! defined BAR_STYPE_IS_DECLARED + typedef union YYSTYPE | typedef union BAR_STYPE + { { + int ival; int ival; + } YYSTYPE; | } BAR_STYPE; + # define YYSTYPE_IS_DECLARED 1 | # define BAR_STYPE_IS_DECLARED 1 + #endif #endif + + extern YYSTYPE bar_lval; | extern BAR_STYPE bar_lval; + + int bar_parse (void); int bar_parse (void); + + #endif /* !BAR_FOO_H */ #endif /* !BAR_FOO_H */ + +* Noteworthy changes in release 2.5.1 (2012-06-05) [stable] + +** Future changes: + + The next major release will drop support for generating parsers in K&R C. + +** yacc.c: YYBACKUP works as expected. + +** glr.c improvements: + +*** Location support is eliminated when not requested: + + GLR parsers used to include location-related code even when locations were + not requested, and therefore not even usable. + +*** __attribute__ is preserved: + + __attribute__ is no longer disabled when __STRICT_ANSI__ is defined (i.e., + when -std is passed to GCC). + +** lalr1.java: several fixes: + + The Java parser no longer throws ArrayIndexOutOfBoundsException if the + first token leads to a syntax error. Some minor clean ups. + +** Changes for C++: + +*** C++11 compatibility: + + C and C++ parsers use "nullptr" instead of "0" when __cplusplus is 201103L + or higher. + +*** Header guards + + The header files such as "parser.hh", "location.hh", etc. used a constant + name for preprocessor guards, for instance: + + #ifndef BISON_LOCATION_HH + # define BISON_LOCATION_HH + ... + #endif // !BISON_LOCATION_HH + + The inclusion guard is now computed from "PREFIX/FILE-NAME", where lower + case characters are converted to upper case, and series of + non-alphanumerical characters are converted to an underscore. + + With "bison -o lang++/parser.cc", "location.hh" would now include: + + #ifndef YY_LANG_LOCATION_HH + # define YY_LANG_LOCATION_HH + ... + #endif // !YY_LANG_LOCATION_HH + +*** C++ locations: + + The position and location constructors (and their initialize methods) + accept new arguments for line and column. Several issues in the + documentation were fixed. + +** liby is no longer asking for "rpl_fprintf" on some platforms. + +** Changes in the manual: + +*** %printer is documented + + The "%printer" directive, supported since at least Bison 1.50, is finally + documented. The "mfcalc" example is extended to demonstrate it. + + For consistency with the C skeletons, the C++ parsers now also support + "yyoutput" (as an alias to "debug_stream ()"). + +*** Several improvements have been made: + + The layout for grammar excerpts was changed to a more compact scheme. + Named references are motivated. The description of the automaton + description file (*.output) is updated to the current format. Incorrect + index entries were fixed. Some other errors were fixed. + +** Building bison: + +*** Conflicting prototypes with recent/modified Flex. + + Fixed build problems with the current, unreleased, version of Flex, and + some modified versions of 2.5.35, which have modified function prototypes. + +*** Warnings during the build procedure have been eliminated. + +*** Several portability problems in the test suite have been fixed: + + This includes warnings with some compilers, unexpected behavior of tools + such as diff, warning messages from the test suite itself, etc. + +*** The install-pdf target works properly: + + Running "make install-pdf" (or -dvi, -html, -info, and -ps) no longer + halts in the middle of its course. + +* Changes in version 2.5 (2011-05-14): + +** Grammar symbol names can now contain non-initial dashes: + + Consistently with directives (such as %error-verbose) and with + %define variables (e.g. push-pull), grammar symbol names may contain + dashes in any position except the beginning. This is a GNU + extension over POSIX Yacc. Thus, use of this extension is reported + by -Wyacc and rejected in Yacc mode (--yacc). + +** Named references: + + Historically, Yacc and Bison have supported positional references + ($n, $$) to allow access to symbol values from inside of semantic + actions code. + + Starting from this version, Bison can also accept named references. + When no ambiguity is possible, original symbol names may be used + as named references: + + if_stmt : "if" cond_expr "then" then_stmt ';' + { $if_stmt = mk_if_stmt($cond_expr, $then_stmt); } + + In the more common case, explicit names may be declared: + + stmt[res] : "if" expr[cond] "then" stmt[then] "else" stmt[else] ';' + { $res = mk_if_stmt($cond, $then, $else); } + + Location information is also accessible using @name syntax. When + accessing symbol names containing dots or dashes, explicit bracketing + ($[sym.1]) must be used. + + These features are experimental in this version. More user feedback + will help to stabilize them. + Contributed by Alex Rozenman. + +** IELR(1) and canonical LR(1): + + IELR(1) is a minimal LR(1) parser table generation algorithm. That + is, given any context-free grammar, IELR(1) generates parser tables + with the full language-recognition power of canonical LR(1) but with + nearly the same number of parser states as LALR(1). This reduction + in parser states is often an order of magnitude. More importantly, + because canonical LR(1)'s extra parser states may contain duplicate + conflicts in the case of non-LR(1) grammars, the number of conflicts + for IELR(1) is often an order of magnitude less as well. This can + significantly reduce the complexity of developing of a grammar. + + Bison can now generate IELR(1) and canonical LR(1) parser tables in + place of its traditional LALR(1) parser tables, which remain the + default. You can specify the type of parser tables in the grammar + file with these directives: + + %define lr.type lalr + %define lr.type ielr + %define lr.type canonical-lr + + The default-reduction optimization in the parser tables can also be + adjusted using "%define lr.default-reductions". For details on both + of these features, see the new section "Tuning LR" in the Bison + manual. + + These features are experimental. More user feedback will help to + stabilize them. + +** LAC (Lookahead Correction) for syntax error handling + + Contributed by Joel E. Denny. + + Canonical LR, IELR, and LALR can suffer from a couple of problems + upon encountering a syntax error. First, the parser might perform + additional parser stack reductions before discovering the syntax + error. Such reductions can perform user semantic actions that are + unexpected because they are based on an invalid token, and they + cause error recovery to begin in a different syntactic context than + the one in which the invalid token was encountered. Second, when + verbose error messages are enabled (with %error-verbose or the + obsolete "#define YYERROR_VERBOSE"), the expected token list in the + syntax error message can both contain invalid tokens and omit valid + tokens. + + The culprits for the above problems are %nonassoc, default + reductions in inconsistent states, and parser state merging. Thus, + IELR and LALR suffer the most. Canonical LR can suffer only if + %nonassoc is used or if default reductions are enabled for + inconsistent states. + + LAC is a new mechanism within the parsing algorithm that solves + these problems for canonical LR, IELR, and LALR without sacrificing + %nonassoc, default reductions, or state merging. When LAC is in + use, canonical LR and IELR behave almost exactly the same for both + syntactically acceptable and syntactically unacceptable input. + While LALR still does not support the full language-recognition + power of canonical LR and IELR, LAC at least enables LALR's syntax + error handling to correctly reflect LALR's language-recognition + power. + + Currently, LAC is only supported for deterministic parsers in C. + You can enable LAC with the following directive: + + %define parse.lac full + + See the new section "LAC" in the Bison manual for additional + details including a few caveats. + + LAC is an experimental feature. More user feedback will help to + stabilize it. + +** %define improvements: + +*** Can now be invoked via the command line: + + Each of these command-line options + + -D NAME[=VALUE] + --define=NAME[=VALUE] + + -F NAME[=VALUE] + --force-define=NAME[=VALUE] + + is equivalent to this grammar file declaration + + %define NAME ["VALUE"] + + except that the manner in which Bison processes multiple definitions + for the same NAME differs. Most importantly, -F and --force-define + quietly override %define, but -D and --define do not. For further + details, see the section "Bison Options" in the Bison manual. + +*** Variables renamed: + + The following %define variables + + api.push_pull + lr.keep_unreachable_states + + have been renamed to + + api.push-pull + lr.keep-unreachable-states + + The old names are now deprecated but will be maintained indefinitely + for backward compatibility. + +*** Values no longer need to be quoted in the grammar file: + + If a %define value is an identifier, it no longer needs to be placed + within quotations marks. For example, + + %define api.push-pull "push" + + can be rewritten as + + %define api.push-pull push + +*** Unrecognized variables are now errors not warnings. + +*** Multiple invocations for any variable is now an error not a warning. + +** Unrecognized %code qualifiers are now errors not warnings. + +** Character literals not of length one: + + Previously, Bison quietly converted all character literals to length + one. For example, without warning, Bison interpreted the operators in + the following grammar to be the same token: + + exp: exp '++' + | exp '+' exp + ; + + Bison now warns when a character literal is not of length one. In + some future release, Bison will start reporting an error instead. + +** Destructor calls fixed for lookaheads altered in semantic actions: + + Previously for deterministic parsers in C, if a user semantic action + altered yychar, the parser in some cases used the old yychar value to + determine which destructor to call for the lookahead upon a syntax + error or upon parser return. This bug has been fixed. + +** C++ parsers use YYRHSLOC: + + Similarly to the C parsers, the C++ parsers now define the YYRHSLOC + macro and use it in the default YYLLOC_DEFAULT. You are encouraged + to use it. If, for instance, your location structure has "first" + and "last" members, instead of + + # define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first = (Rhs)[1].location.first; \ + (Current).last = (Rhs)[N].location.last; \ + } \ + else \ + { \ + (Current).first = (Current).last = (Rhs)[0].location.last; \ + } \ + while (false) + + use: + + # define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first = YYRHSLOC (Rhs, 1).first; \ + (Current).last = YYRHSLOC (Rhs, N).last; \ + } \ + else \ + { \ + (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \ + } \ + while (false) + +** YYLLOC_DEFAULT in C++: + + The default implementation of YYLLOC_DEFAULT used to be issued in + the header file. It is now output in the implementation file, after + the user %code sections so that its #ifndef guard does not try to + override the user's YYLLOC_DEFAULT if provided. + +** YYFAIL now produces warnings and Java parsers no longer implement it: + + YYFAIL has existed for many years as an undocumented feature of + deterministic parsers in C generated by Bison. More recently, it was + a documented feature of Bison's experimental Java parsers. As + promised in Bison 2.4.2's NEWS entry, any appearance of YYFAIL in a + semantic action now produces a deprecation warning, and Java parsers + no longer implement YYFAIL at all. For further details, including a + discussion of how to suppress C preprocessor warnings about YYFAIL + being unused, see the Bison 2.4.2 NEWS entry. + +** Temporary hack for adding a semicolon to the user action: + + Previously, Bison appended a semicolon to every user action for + reductions when the output language defaulted to C (specifically, when + neither %yacc, %language, %skeleton, or equivalent command-line + options were specified). This allowed actions such as + + exp: exp "+" exp { $$ = $1 + $3 }; + + instead of + + exp: exp "+" exp { $$ = $1 + $3; }; + + As a first step in removing this misfeature, Bison now issues a + warning when it appends a semicolon. Moreover, in cases where Bison + cannot easily determine whether a semicolon is needed (for example, an + action ending with a cpp directive or a braced compound initializer), + it no longer appends one. Thus, the C compiler might now complain + about a missing semicolon where it did not before. Future releases of + Bison will cease to append semicolons entirely. + +** Verbose syntax error message fixes: + + When %error-verbose or the obsolete "#define YYERROR_VERBOSE" is + specified, syntax error messages produced by the generated parser + include the unexpected token as well as a list of expected tokens. + The effect of %nonassoc on these verbose messages has been corrected + in two ways, but a more complete fix requires LAC, described above: + +*** When %nonassoc is used, there can exist parser states that accept no + tokens, and so the parser does not always require a lookahead token + in order to detect a syntax error. Because no unexpected token or + expected tokens can then be reported, the verbose syntax error + message described above is suppressed, and the parser instead + reports the simpler message, "syntax error". Previously, this + suppression was sometimes erroneously triggered by %nonassoc when a + lookahead was actually required. Now verbose messages are + suppressed only when all previous lookaheads have already been + shifted or discarded. + +*** Previously, the list of expected tokens erroneously included tokens + that would actually induce a syntax error because conflicts for them + were resolved with %nonassoc in the current parser state. Such + tokens are now properly omitted from the list. + +*** Expected token lists are still often wrong due to state merging + (from LALR or IELR) and default reductions, which can both add + invalid tokens and subtract valid tokens. Canonical LR almost + completely fixes this problem by eliminating state merging and + default reductions. However, there is one minor problem left even + when using canonical LR and even after the fixes above. That is, + if the resolution of a conflict with %nonassoc appears in a later + parser state than the one at which some syntax error is + discovered, the conflicted token is still erroneously included in + the expected token list. Bison's new LAC implementation, + described above, eliminates this problem and the need for + canonical LR. However, LAC is still experimental and is disabled + by default. + +** Java skeleton fixes: + +*** A location handling bug has been fixed. + +*** The top element of each of the value stack and location stack is now + cleared when popped so that it can be garbage collected. + +*** Parser traces now print the top element of the stack. + +** -W/--warnings fixes: + +*** Bison now properly recognizes the "no-" versions of categories: + + For example, given the following command line, Bison now enables all + warnings except warnings for incompatibilities with POSIX Yacc: + + bison -Wall,no-yacc gram.y + +*** Bison now treats S/R and R/R conflicts like other warnings: + + Previously, conflict reports were independent of Bison's normal + warning system. Now, Bison recognizes the warning categories + "conflicts-sr" and "conflicts-rr". This change has important + consequences for the -W and --warnings command-line options. For + example: + + bison -Wno-conflicts-sr gram.y # S/R conflicts not reported + bison -Wno-conflicts-rr gram.y # R/R conflicts not reported + bison -Wnone gram.y # no conflicts are reported + bison -Werror gram.y # any conflict is an error + + However, as before, if the %expect or %expect-rr directive is + specified, an unexpected number of conflicts is an error, and an + expected number of conflicts is not reported, so -W and --warning + then have no effect on the conflict report. + +*** The "none" category no longer disables a preceding "error": + + For example, for the following command line, Bison now reports + errors instead of warnings for incompatibilities with POSIX Yacc: + + bison -Werror,none,yacc gram.y + +*** The "none" category now disables all Bison warnings: + + Previously, the "none" category disabled only Bison warnings for + which there existed a specific -W/--warning category. However, + given the following command line, Bison is now guaranteed to + suppress all warnings: + + bison -Wnone gram.y + +** Precedence directives can now assign token number 0: + + Since Bison 2.3b, which restored the ability of precedence + directives to assign token numbers, doing so for token number 0 has + produced an assertion failure. For example: + + %left END 0 + + This bug has been fixed. + +* Changes in version 2.4.3 (2010-08-05): + +** Bison now obeys -Werror and --warnings=error for warnings about + grammar rules that are useless in the parser due to conflicts. + +** Problems with spawning M4 on at least FreeBSD 8 and FreeBSD 9 have + been fixed. + +** Failures in the test suite for GCC 4.5 have been fixed. + +** Failures in the test suite for some versions of Sun Studio C++ have + been fixed. + +** Contrary to Bison 2.4.2's NEWS entry, it has been decided that + warnings about undefined %prec identifiers will not be converted to + errors in Bison 2.5. They will remain warnings, which should be + sufficient for POSIX while avoiding backward compatibility issues. + +** Minor documentation fixes. + +* Changes in version 2.4.2 (2010-03-20): + +** Some portability problems that resulted in failures and livelocks + in the test suite on some versions of at least Solaris, AIX, HP-UX, + RHEL4, and Tru64 have been addressed. As a result, fatal Bison + errors should no longer cause M4 to report a broken pipe on the + affected platforms. + +** "%prec IDENTIFIER" requires IDENTIFIER to be defined separately. + + POSIX specifies that an error be reported for any identifier that does + not appear on the LHS of a grammar rule and that is not defined by + %token, %left, %right, or %nonassoc. Bison 2.3b and later lost this + error report for the case when an identifier appears only after a + %prec directive. It is now restored. However, for backward + compatibility with recent Bison releases, it is only a warning for + now. In Bison 2.5 and later, it will return to being an error. + [Between the 2.4.2 and 2.4.3 releases, it was decided that this + warning will not be converted to an error in Bison 2.5.] + +** Detection of GNU M4 1.4.6 or newer during configure is improved. + +** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS, + YYLTYPE_IS_TRIVIAL, and __STRICT_ANSI__ in C/C++ parsers are now + avoided. + +** %code is now a permanent feature. + + A traditional Yacc prologue directive is written in the form: + + %{CODE%} + + To provide a more flexible alternative, Bison 2.3b introduced the + %code directive with the following forms for C/C++: + + %code {CODE} + %code requires {CODE} + %code provides {CODE} + %code top {CODE} + + These forms are now considered permanent features of Bison. See the + %code entries in the section "Bison Declaration Summary" in the Bison + manual for a summary of their functionality. See the section + "Prologue Alternatives" for a detailed discussion including the + advantages of %code over the traditional Yacc prologue directive. + + Bison's Java feature as a whole including its current usage of %code + is still considered experimental. + +** YYFAIL is deprecated and will eventually be removed. + + YYFAIL has existed for many years as an undocumented feature of + deterministic parsers in C generated by Bison. Previously, it was + documented for Bison's experimental Java parsers. YYFAIL is no longer + documented for Java parsers and is formally deprecated in both cases. + Users are strongly encouraged to migrate to YYERROR, which is + specified by POSIX. + + Like YYERROR, you can invoke YYFAIL from a semantic action in order to + induce a syntax error. The most obvious difference from YYERROR is + that YYFAIL will automatically invoke yyerror to report the syntax + error so that you don't have to. However, there are several other + subtle differences between YYERROR and YYFAIL, and YYFAIL suffers from + inherent flaws when %error-verbose or "#define YYERROR_VERBOSE" is + used. For a more detailed discussion, see: + + http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html + + The upcoming Bison 2.5 will remove YYFAIL from Java parsers, but + deterministic parsers in C will continue to implement it. However, + because YYFAIL is already flawed, it seems futile to try to make new + Bison features compatible with it. Thus, during parser generation, + Bison 2.5 will produce a warning whenever it discovers YYFAIL in a + rule action. In a later release, YYFAIL will be disabled for + %error-verbose and "#define YYERROR_VERBOSE". Eventually, YYFAIL will + be removed altogether. + + There exists at least one case where Bison 2.5's YYFAIL warning will + be a false positive. Some projects add phony uses of YYFAIL and other + Bison-defined macros for the sole purpose of suppressing C + preprocessor warnings (from GCC cpp's -Wunused-macros, for example). + To avoid Bison's future warning, such YYFAIL uses can be moved to the + epilogue (that is, after the second "%%") in the Bison input file. In + this release (2.4.2), Bison already generates its own code to suppress + C preprocessor warnings for YYFAIL, so projects can remove their own + phony uses of YYFAIL if compatibility with Bison releases prior to + 2.4.2 is not necessary. + +** Internationalization. + + Fix a regression introduced in Bison 2.4: Under some circumstances, + message translations were not installed although supported by the + host system. + +* Changes in version 2.4.1 (2008-12-11): + +** In the GLR defines file, unexpanded M4 macros in the yylval and yylloc + declarations have been fixed. + +** Temporary hack for adding a semicolon to the user action. + + Bison used to prepend a trailing semicolon at the end of the user + action for reductions. This allowed actions such as + + exp: exp "+" exp { $$ = $1 + $3 }; + + instead of + + exp: exp "+" exp { $$ = $1 + $3; }; + + Some grammars still depend on this "feature". Bison 2.4.1 restores + the previous behavior in the case of C output (specifically, when + neither %language or %skeleton or equivalent command-line options + are used) to leave more time for grammars depending on the old + behavior to be adjusted. Future releases of Bison will disable this + feature. + +** A few minor improvements to the Bison manual. + +* Changes in version 2.4 (2008-11-02): + +** %language is an experimental feature. + + We first introduced this feature in test release 2.3b as a cleaner + alternative to %skeleton. Since then, we have discussed the possibility of + modifying its effect on Bison's output file names. Thus, in this release, + we consider %language to be an experimental feature that will likely evolve + in future releases. + +** Forward compatibility with GNU M4 has been improved. + +** Several bugs in the C++ skeleton and the experimental Java skeleton have been + fixed. + +* Changes in version 2.3b (2008-05-27): + +** The quotes around NAME that used to be required in the following directive + are now deprecated: + + %define NAME "VALUE" + +** The directive "%pure-parser" is now deprecated in favor of: + + %define api.pure + + which has the same effect except that Bison is more careful to warn about + unreasonable usage in the latter case. + +** Push Parsing + + Bison can now generate an LALR(1) parser in C with a push interface. That + is, instead of invoking "yyparse", which pulls tokens from "yylex", you can + push one token at a time to the parser using "yypush_parse", which will + return to the caller after processing each token. By default, the push + interface is disabled. Either of the following directives will enable it: + + %define api.push_pull "push" // Just push; does not require yylex. + %define api.push_pull "both" // Push and pull; requires yylex. + + See the new section "A Push Parser" in the Bison manual for details. + + The current push parsing interface is experimental and may evolve. More user + feedback will help to stabilize it. + +** The -g and --graph options now output graphs in Graphviz DOT format, + not VCG format. Like --graph, -g now also takes an optional FILE argument + and thus cannot be bundled with other short options. + +** Java + + Bison can now generate an LALR(1) parser in Java. The skeleton is + "data/lalr1.java". Consider using the new %language directive instead of + %skeleton to select it. + + See the new section "Java Parsers" in the Bison manual for details. + + The current Java interface is experimental and may evolve. More user + feedback will help to stabilize it. + Contributed by Paolo Bonzini. + +** %language + + This new directive specifies the programming language of the generated + parser, which can be C (the default), C++, or Java. Besides the skeleton + that Bison uses, the directive affects the names of the generated files if + the grammar file's name ends in ".y". + +** XML Automaton Report + + Bison can now generate an XML report of the LALR(1) automaton using the new + "--xml" option. The current XML schema is experimental and may evolve. More + user feedback will help to stabilize it. + Contributed by Wojciech Polak. + +** The grammar file may now specify the name of the parser header file using + %defines. For example: + + %defines "parser.h" + +** When reporting useless rules, useless nonterminals, and unused terminals, + Bison now employs the terms "useless in grammar" instead of "useless", + "useless in parser" instead of "never reduced", and "unused in grammar" + instead of "unused". + +** Unreachable State Removal + + Previously, Bison sometimes generated parser tables containing unreachable + states. A state can become unreachable during conflict resolution if Bison + disables a shift action leading to it from a predecessor state. Bison now: + + 1. Removes unreachable states. + + 2. Does not report any conflicts that appeared in unreachable states. + WARNING: As a result, you may need to update %expect and %expect-rr + directives in existing grammar files. + + 3. For any rule used only in such states, Bison now reports the rule as + "useless in parser due to conflicts". + + This feature can be disabled with the following directive: + + %define lr.keep_unreachable_states + + See the %define entry in the "Bison Declaration Summary" in the Bison manual + for further discussion. + +** Lookahead Set Correction in the ".output" Report + + When instructed to generate a ".output" file including lookahead sets + (using "--report=lookahead", for example), Bison now prints each reduction's + lookahead set only next to the associated state's one item that (1) is + associated with the same rule as the reduction and (2) has its dot at the end + of its RHS. Previously, Bison also erroneously printed the lookahead set + next to all of the state's other items associated with the same rule. This + bug affected only the ".output" file and not the generated parser source + code. + +** --report-file=FILE is a new option to override the default ".output" file + name. + +** The "=" that used to be required in the following directives is now + deprecated: + + %file-prefix "parser" + %name-prefix "c_" + %output "parser.c" + +** An Alternative to "%{...%}" -- "%code QUALIFIER {CODE}" + + Bison 2.3a provided a new set of directives as a more flexible alternative to + the traditional Yacc prologue blocks. Those have now been consolidated into + a single %code directive with an optional qualifier field, which identifies + the purpose of the code and thus the location(s) where Bison should generate + it: + + 1. "%code {CODE}" replaces "%after-header {CODE}" + 2. "%code requires {CODE}" replaces "%start-header {CODE}" + 3. "%code provides {CODE}" replaces "%end-header {CODE}" + 4. "%code top {CODE}" replaces "%before-header {CODE}" + + See the %code entries in section "Bison Declaration Summary" in the Bison + manual for a summary of the new functionality. See the new section "Prologue + Alternatives" for a detailed discussion including the advantages of %code + over the traditional Yacc prologues. + + The prologue alternatives are experimental. More user feedback will help to + determine whether they should become permanent features. + +** Revised warning: unset or unused mid-rule values + + Since Bison 2.2, Bison has warned about mid-rule values that are set but not + used within any of the actions of the parent rule. For example, Bison warns + about unused $2 in: + + exp: '1' { $$ = 1; } '+' exp { $$ = $1 + $4; }; + + Now, Bison also warns about mid-rule values that are used but not set. For + example, Bison warns about unset $$ in the mid-rule action in: + + exp: '1' { $1 = 1; } '+' exp { $$ = $2 + $4; }; + + However, Bison now disables both of these warnings by default since they + sometimes prove to be false alarms in existing grammars employing the Yacc + constructs $0 or $-N (where N is some positive integer). + + To enable these warnings, specify the option "--warnings=midrule-values" or + "-W", which is a synonym for "--warnings=all". + +** Default %destructor or %printer with "<*>" or "<>" + + Bison now recognizes two separate kinds of default %destructor's and + %printer's: + + 1. Place "<*>" in a %destructor/%printer symbol list to define a default + %destructor/%printer for all grammar symbols for which you have formally + declared semantic type tags. + + 2. Place "<>" in a %destructor/%printer symbol list to define a default + %destructor/%printer for all grammar symbols without declared semantic + type tags. + + Bison no longer supports the "%symbol-default" notation from Bison 2.3a. + "<*>" and "<>" combined achieve the same effect with one exception: Bison no + longer applies any %destructor to a mid-rule value if that mid-rule value is + not actually ever referenced using either $$ or $n in a semantic action. + + The default %destructor's and %printer's are experimental. More user + feedback will help to determine whether they should become permanent + features. + + See the section "Freeing Discarded Symbols" in the Bison manual for further + details. + +** %left, %right, and %nonassoc can now declare token numbers. This is required + by POSIX. However, see the end of section "Operator Precedence" in the Bison + manual for a caveat concerning the treatment of literal strings. + +** The nonfunctional --no-parser, -n, and %no-parser options have been + completely removed from Bison. + +* Changes in version 2.3a, 2006-09-13: + +** Instead of %union, you can define and use your own union type + YYSTYPE if your grammar contains at least one tag. + Your YYSTYPE need not be a macro; it can be a typedef. + This change is for compatibility with other Yacc implementations, + and is required by POSIX. + +** Locations columns and lines start at 1. + In accordance with the GNU Coding Standards and Emacs. + +** You may now declare per-type and default %destructor's and %printer's: + + For example: + + %union { char *string; } + %token STRING1 + %token STRING2 + %type string1 + %type string2 + %union { char character; } + %token CHR + %type chr + %destructor { free ($$); } %symbol-default + %destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1 + %destructor { } + + guarantees that, when the parser discards any user-defined symbol that has a + semantic type tag other than "", it passes its semantic value to + "free". However, when the parser discards a "STRING1" or a "string1", it + also prints its line number to "stdout". It performs only the second + "%destructor" in this case, so it invokes "free" only once. + + [Although we failed to mention this here in the 2.3a release, the default + %destructor's and %printer's were experimental, and they were rewritten in + future versions.] + +** Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with "-y", + "--yacc", or "%yacc"), Bison no longer generates #define statements for + associating token numbers with token names. Removing the #define statements + helps to sanitize the global namespace during preprocessing, but POSIX Yacc + requires them. Bison still generates an enum for token names in all cases. + +** Handling of traditional Yacc prologue blocks is now more consistent but + potentially incompatible with previous releases of Bison. + + As before, you declare prologue blocks in your grammar file with the + "%{ ... %}" syntax. To generate the pre-prologue, Bison concatenates all + prologue blocks that you've declared before the first %union. To generate + the post-prologue, Bison concatenates all prologue blocks that you've + declared after the first %union. + + Previous releases of Bison inserted the pre-prologue into both the header + file and the code file in all cases except for LALR(1) parsers in C. In the + latter case, Bison inserted it only into the code file. For parsers in C++, + the point of insertion was before any token definitions (which associate + token numbers with names). For parsers in C, the point of insertion was + after the token definitions. + + Now, Bison never inserts the pre-prologue into the header file. In the code + file, it always inserts it before the token definitions. + +** Bison now provides a more flexible alternative to the traditional Yacc + prologue blocks: %before-header, %start-header, %end-header, and + %after-header. + + For example, the following declaration order in the grammar file reflects the + order in which Bison will output these code blocks. However, you are free to + declare these code blocks in your grammar file in whatever order is most + convenient for you: + + %before-header { + /* Bison treats this block like a pre-prologue block: it inserts it into + * the code file before the contents of the header file. It does *not* + * insert it into the header file. This is a good place to put + * #include's that you want at the top of your code file. A common + * example is '#include "system.h"'. */ + } + %start-header { + /* Bison inserts this block into both the header file and the code file. + * In both files, the point of insertion is before any Bison-generated + * token, semantic type, location type, and class definitions. This is a + * good place to define %union dependencies, for example. */ + } + %union { + /* Unlike the traditional Yacc prologue blocks, the output order for the + * new %*-header blocks is not affected by their declaration position + * relative to any %union in the grammar file. */ + } + %end-header { + /* Bison inserts this block into both the header file and the code file. + * In both files, the point of insertion is after the Bison-generated + * definitions. This is a good place to declare or define public + * functions or data structures that depend on the Bison-generated + * definitions. */ + } + %after-header { + /* Bison treats this block like a post-prologue block: it inserts it into + * the code file after the contents of the header file. It does *not* + * insert it into the header file. This is a good place to declare or + * define internal functions or data structures that depend on the + * Bison-generated definitions. */ + } + + If you have multiple occurrences of any one of the above declarations, Bison + will concatenate the contents in declaration order. + + [Although we failed to mention this here in the 2.3a release, the prologue + alternatives were experimental, and they were rewritten in future versions.] + +** The option "--report=look-ahead" has been changed to "--report=lookahead". + The old spelling still works, but is not documented and may be removed + in a future release. + +* Changes in version 2.3, 2006-06-05: + +** GLR grammars should now use "YYRECOVERING ()" instead of "YYRECOVERING", + for compatibility with LALR(1) grammars. + +** It is now documented that any definition of YYSTYPE or YYLTYPE should + be to a type name that does not contain parentheses or brackets. + +* Changes in version 2.2, 2006-05-19: + +** The distribution terms for all Bison-generated parsers now permit + using the parsers in nonfree programs. Previously, this permission + was granted only for Bison-generated LALR(1) parsers in C. + +** %name-prefix changes the namespace name in C++ outputs. + +** The C++ parsers export their token_type. + +** Bison now allows multiple %union declarations, and concatenates + their contents together. + +** New warning: unused values + Right-hand side symbols whose values are not used are reported, + if the symbols have destructors. For instance: + + exp: exp "?" exp ":" exp { $1 ? $1 : $3; } + | exp "+" exp + ; + + will trigger a warning about $$ and $5 in the first rule, and $3 in + the second ($1 is copied to $$ by the default rule). This example + most likely contains three errors, and could be rewritten as: + + exp: exp "?" exp ":" exp + { $$ = $1 ? $3 : $5; free ($1 ? $5 : $3); free ($1); } + | exp "+" exp + { $$ = $1 ? $1 : $3; if ($1) free ($3); } + ; + + However, if the original actions were really intended, memory leaks + and all, the warnings can be suppressed by letting Bison believe the + values are used, e.g.: + + exp: exp "?" exp ":" exp { $1 ? $1 : $3; (void) ($$, $5); } + | exp "+" exp { $$ = $1; (void) $3; } + ; + + If there are mid-rule actions, the warning is issued if no action + uses it. The following triggers no warning: $1 and $3 are used. + + exp: exp { push ($1); } '+' exp { push ($3); sum (); }; + + The warning is intended to help catching lost values and memory leaks. + If a value is ignored, its associated memory typically is not reclaimed. + +** %destructor vs. YYABORT, YYACCEPT, and YYERROR. + Destructors are now called when user code invokes YYABORT, YYACCEPT, + and YYERROR, for all objects on the stack, other than objects + corresponding to the right-hand side of the current rule. + +** %expect, %expect-rr + Incorrect numbers of expected conflicts are now actual errors, + instead of warnings. + +** GLR, YACC parsers. + The %parse-params are available in the destructors (and the + experimental printers) as per the documentation. + +** Bison now warns if it finds a stray "$" or "@" in an action. + +** %require "VERSION" + This specifies that the grammar file depends on features implemented + in Bison version VERSION or higher. + +** lalr1.cc: The token and value types are now class members. + The tokens were defined as free form enums and cpp macros. YYSTYPE + was defined as a free form union. They are now class members: + tokens are enumerations of the "yy::parser::token" struct, and the + semantic values have the "yy::parser::semantic_type" type. + + If you do not want or can update to this scheme, the directive + '%define "global_tokens_and_yystype" "1"' triggers the global + definition of tokens and YYSTYPE. This change is suitable both + for previous releases of Bison, and this one. + + If you wish to update, then make sure older version of Bison will + fail using '%require "2.2"'. + +** DJGPP support added. + +* Changes in version 2.1, 2005-09-16: + +** The C++ lalr1.cc skeleton supports %lex-param. + +** Bison-generated parsers now support the translation of diagnostics like + "syntax error" into languages other than English. The default + language is still English. For details, please see the new + Internationalization section of the Bison manual. Software + distributors should also see the new PACKAGING file. Thanks to + Bruno Haible for this new feature. + +** Wording in the Bison-generated parsers has been changed slightly to + simplify translation. In particular, the message "memory exhausted" + has replaced "parser stack overflow", as the old message was not + always accurate for modern Bison-generated parsers. + +** Destructors are now called when the parser aborts, for all symbols left + behind on the stack. Also, the start symbol is now destroyed after a + successful parse. In both cases, the behavior was formerly inconsistent. + +** When generating verbose diagnostics, Bison-generated parsers no longer + quote the literal strings associated with tokens. For example, for + a syntax error associated with '%token NUM "number"' they might + print 'syntax error, unexpected number' instead of 'syntax error, + unexpected "number"'. + +* Changes in version 2.0, 2004-12-25: + +** Possibly-incompatible changes + + - Bison-generated parsers no longer default to using the alloca function + (when available) to extend the parser stack, due to widespread + problems in unchecked stack-overflow detection. You can "#define + YYSTACK_USE_ALLOCA 1" to require the use of alloca, but please read + the manual to determine safe values for YYMAXDEPTH in that case. + + - Error token location. + During error recovery, the location of the syntax error is updated + to cover the whole sequence covered by the error token: it includes + the shifted symbols thrown away during the first part of the error + recovery, and the lookahead rejected during the second part. + + - Semicolon changes: + . Stray semicolons are no longer allowed at the start of a grammar. + . Semicolons are now required after in-grammar declarations. + + - Unescaped newlines are no longer allowed in character constants or + string literals. They were never portable, and GCC 3.4.0 has + dropped support for them. Better diagnostics are now generated if + forget a closing quote. + + - NUL bytes are no longer allowed in Bison string literals, unfortunately. + +** New features + + - GLR grammars now support locations. + + - New directive: %initial-action. + This directive allows the user to run arbitrary code (including + initializing @$) from yyparse before parsing starts. + + - A new directive "%expect-rr N" specifies the expected number of + reduce/reduce conflicts in GLR parsers. + + - %token numbers can now be hexadecimal integers, e.g., "%token FOO 0x12d". + This is a GNU extension. + + - The option "--report=lookahead" was changed to "--report=look-ahead". + [However, this was changed back after 2.3.] + + - Experimental %destructor support has been added to lalr1.cc. + + - New configure option --disable-yacc, to disable installation of the + yacc command and -ly library introduced in 1.875 for POSIX conformance. + +** Bug fixes + + - For now, %expect-count violations are now just warnings, not errors. + This is for compatibility with Bison 1.75 and earlier (when there are + reduce/reduce conflicts) and with Bison 1.30 and earlier (when there + are too many or too few shift/reduce conflicts). However, in future + versions of Bison we plan to improve the %expect machinery so that + these violations will become errors again. + + - Within Bison itself, numbers (e.g., goto numbers) are no longer + arbitrarily limited to 16-bit counts. + + - Semicolons are now allowed before "|" in grammar rules, as POSIX requires. + +* Changes in version 1.875, 2003-01-01: + +** The documentation license has been upgraded to version 1.2 + of the GNU Free Documentation License. + +** syntax error processing + + - In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error + locations too. This fixes bugs in error-location computation. + + - %destructor + It is now possible to reclaim the memory associated to symbols + discarded during error recovery. This feature is still experimental. + + - %error-verbose + This new directive is preferred over YYERROR_VERBOSE. + + - #defining yyerror to steal internal variables is discouraged. + It is not guaranteed to work forever. + +** POSIX conformance + + - Semicolons are once again optional at the end of grammar rules. + This reverts to the behavior of Bison 1.33 and earlier, and improves + compatibility with Yacc. + + - "parse error" -> "syntax error" + Bison now uniformly uses the term "syntax error"; formerly, the code + and manual sometimes used the term "parse error" instead. POSIX + requires "syntax error" in diagnostics, and it was thought better to + be consistent. + + - The documentation now emphasizes that yylex and yyerror must be + declared before use. C99 requires this. + + - Bison now parses C99 lexical constructs like UCNs and + backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires. + + - File names are properly escaped in C output. E.g., foo\bar.y is + output as "foo\\bar.y". + + - Yacc command and library now available + The Bison distribution now installs a "yacc" command, as POSIX requires. + Also, Bison now installs a small library liby.a containing + implementations of Yacc-compatible yyerror and main functions. + This library is normally not useful, but POSIX requires it. + + - Type clashes now generate warnings, not errors. + + - If the user does not define YYSTYPE as a macro, Bison now declares it + using typedef instead of defining it as a macro. + For consistency, YYLTYPE is also declared instead of defined. + +** Other compatibility issues + + - %union directives can now have a tag before the "{", e.g., the + directive "%union foo {...}" now generates the C code + "typedef union foo { ... } YYSTYPE;"; this is for Yacc compatibility. + The default union tag is "YYSTYPE", for compatibility with Solaris 9 Yacc. + For consistency, YYLTYPE's struct tag is now "YYLTYPE" not "yyltype". + This is for compatibility with both Yacc and Bison 1.35. + + - ";" is output before the terminating "}" of an action, for + compatibility with Bison 1.35. + + - Bison now uses a Yacc-style format for conflict reports, e.g., + "conflicts: 2 shift/reduce, 1 reduce/reduce". + + - "yystype" and "yyltype" are now obsolescent macros instead of being + typedefs or tags; they are no longer documented and are planned to be + withdrawn in a future release. + +** GLR parser notes + + - GLR and inline + Users of Bison have to decide how they handle the portability of the + C keyword "inline". + + - "parsing stack overflow..." -> "parser stack overflow" + GLR parsers now report "parser stack overflow" as per the Bison manual. + +** %parse-param and %lex-param + The macros YYPARSE_PARAM and YYLEX_PARAM provide a means to pass + additional context to yyparse and yylex. They suffer from several + shortcomings: + + - a single argument only can be added, + - their types are weak (void *), + - this context is not passed to ancillary functions such as yyerror, + - only yacc.c parsers support them. + + The new %parse-param/%lex-param directives provide a more precise control. + For instance: + + %parse-param {int *nastiness} + %lex-param {int *nastiness} + %parse-param {int *randomness} + + results in the following signatures: + + int yylex (int *nastiness); + int yyparse (int *nastiness, int *randomness); + + or, if both %pure-parser and %locations are used: + + int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness); + int yyparse (int *nastiness, int *randomness); + +** Bison now warns if it detects conflicting outputs to the same file, + e.g., it generates a warning for "bison -d -o foo.h foo.y" since + that command outputs both code and header to foo.h. + +** #line in output files + - --no-line works properly. + +** Bison can no longer be built by a K&R C compiler; it requires C89 or + later to be built. This change originally took place a few versions + ago, but nobody noticed until we recently asked someone to try + building Bison with a K&R C compiler. + +* Changes in version 1.75, 2002-10-14: + +** Bison should now work on 64-bit hosts. + +** Indonesian translation thanks to Tedi Heriyanto. + +** GLR parsers + Fix spurious parse errors. + +** Pure parsers + Some people redefine yyerror to steal yyparse' private variables. + Reenable this trick until an official feature replaces it. + +** Type Clashes + In agreement with POSIX and with other Yaccs, leaving a default + action is valid when $$ is untyped, and $1 typed: + + untyped: ... typed; + + but the converse remains an error: + + typed: ... untyped; + +** Values of mid-rule actions + The following code: + + foo: { ... } { $$ = $1; } ... + + was incorrectly rejected: $1 is defined in the second mid-rule + action, and is equal to the $$ of the first mid-rule action. + +* Changes in version 1.50, 2002-10-04: + +** GLR parsing + The declaration + %glr-parser + causes Bison to produce a Generalized LR (GLR) parser, capable of handling + almost any context-free grammar, ambiguous or not. The new declarations + %dprec and %merge on grammar rules allow parse-time resolution of + ambiguities. Contributed by Paul Hilfinger. + + Unfortunately Bison 1.50 does not work properly on 64-bit hosts + like the Alpha, so please stick to 32-bit hosts for now. + +** Output Directory + When not in Yacc compatibility mode, when the output file was not + specified, running "bison foo/bar.y" created "foo/bar.c". It + now creates "bar.c". + +** Undefined token + The undefined token was systematically mapped to 2 which prevented + the use of 2 by the user. This is no longer the case. + +** Unknown token numbers + If yylex returned an out of range value, yyparse could die. This is + no longer the case. + +** Error token + According to POSIX, the error token must be 256. + Bison extends this requirement by making it a preference: *if* the + user specified that one of her tokens is numbered 256, then error + will be mapped onto another number. + +** Verbose error messages + They no longer report "..., expecting error or..." for states where + error recovery is possible. + +** End token + Defaults to "$end" instead of "$". + +** Error recovery now conforms to documentation and to POSIX + When a Bison-generated parser encounters a syntax error, it now pops + the stack until it finds a state that allows shifting the error + token. Formerly, it popped the stack until it found a state that + allowed some non-error action other than a default reduction on the + error token. The new behavior has long been the documented behavior, + and has long been required by POSIX. For more details, please see + Paul Eggert, "Reductions during Bison error handling" (2002-05-20) + . + +** Traces + Popped tokens and nonterminals are now reported. + +** Larger grammars + Larger grammars are now supported (larger token numbers, larger grammar + size (= sum of the LHS and RHS lengths), larger LALR tables). + Formerly, many of these numbers ran afoul of 16-bit limits; + now these limits are 32 bits on most hosts. + +** Explicit initial rule + Bison used to play hacks with the initial rule, which the user does + not write. It is now explicit, and visible in the reports and + graphs as rule 0. + +** Useless rules + Before, Bison reported the useless rules, but, although not used, + included them in the parsers. They are now actually removed. + +** Useless rules, useless nonterminals + They are now reported, as a warning, with their locations. + +** Rules never reduced + Rules that can never be reduced because of conflicts are now + reported. + +** Incorrect "Token not used" + On a grammar such as + + %token useless useful + %% + exp: '0' %prec useful; + + where a token was used to set the precedence of the last rule, + bison reported both "useful" and "useless" as useless tokens. + +** Revert the C++ namespace changes introduced in 1.31 + as they caused too many portability hassles. + +** Default locations + By an accident of design, the default computation of @$ was + performed after another default computation was performed: @$ = @1. + The latter is now removed: YYLLOC_DEFAULT is fully responsible of + the computation of @$. + +** Token end-of-file + The token end of file may be specified by the user, in which case, + the user symbol is used in the reports, the graphs, and the verbose + error messages instead of "$end", which remains being the default. + For instance + %token MYEOF 0 + or + %token MYEOF 0 "end of file" + +** Semantic parser + This old option, which has been broken for ages, is removed. + +** New translations + Brazilian Portuguese, thanks to Alexandre Folle de Menezes. + Croatian, thanks to Denis Lackovic. + +** Incorrect token definitions + When given + %token 'a' "A" + bison used to output + #define 'a' 65 + +** Token definitions as enums + Tokens are output both as the traditional #define's, and, provided + the compiler supports ANSI C or is a C++ compiler, as enums. + This lets debuggers display names instead of integers. + +** Reports + In addition to --verbose, bison supports --report=THINGS, which + produces additional information: + - itemset + complete the core item sets with their closure + - lookahead [changed to "look-ahead" in 1.875e through 2.3, but changed back] + explicitly associate lookahead tokens to items + - solved + describe shift/reduce conflicts solving. + Bison used to systematically output this information on top of + the report. Solved conflicts are now attached to their states. + +** Type clashes + Previous versions don't complain when there is a type clash on + the default action if the rule has a mid-rule action, such as in: + + %type bar + %% + bar: '0' {} '0'; + + This is fixed. + +** GNU M4 is now required when using Bison. + +* Changes in version 1.35, 2002-03-25: + +** C Skeleton + Some projects use Bison's C parser with C++ compilers, and define + YYSTYPE as a class. The recent adjustment of C parsers for data + alignment and 64 bit architectures made this impossible. + + Because for the time being no real solution for C++ parser + generation exists, kludges were implemented in the parser to + maintain this use. In the future, when Bison has C++ parsers, this + kludge will be disabled. + + This kludge also addresses some C++ problems when the stack was + extended. + +* Changes in version 1.34, 2002-03-12: + +** File name clashes are detected + $ bison foo.y -d -o foo.x + fatal error: header and parser would both be named "foo.x" + +** A missing ";" at the end of a rule triggers a warning + In accordance with POSIX, and in agreement with other + Yacc implementations, Bison will mandate this semicolon in the near + future. This eases the implementation of a Bison parser of Bison + grammars by making this grammar LALR(1) instead of LR(2). To + facilitate the transition, this release introduces a warning. + +** Revert the C++ namespace changes introduced in 1.31, as they caused too + many portability hassles. + +** DJGPP support added. + +** Fix test suite portability problems. + +* Changes in version 1.33, 2002-02-07: + +** Fix C++ issues + Groff could not be compiled for the definition of size_t was lacking + under some conditions. + +** Catch invalid @n + As is done with $n. + +* Changes in version 1.32, 2002-01-23: + +** Fix Yacc output file names + +** Portability fixes + +** Italian, Dutch translations + +* Changes in version 1.31, 2002-01-14: + +** Many Bug Fixes + +** GNU Gettext and %expect + GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that + Bison dies on incorrect %expectations, we fear there will be + too many bug reports for Gettext, so _for the time being_, %expect + does not trigger an error when the input file is named "plural.y". + +** Use of alloca in parsers + If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use + malloc exclusively. Since 1.29, but was not NEWS'ed. + + alloca is used only when compiled with GCC, to avoid portability + problems as on AIX. + +** yyparse now returns 2 if memory is exhausted; formerly it dumped core. + +** When the generated parser lacks debugging code, YYDEBUG is now 0 + (as POSIX requires) instead of being undefined. + +** User Actions + Bison has always permitted actions such as { $$ = $1 }: it adds the + ending semicolon. Now if in Yacc compatibility mode, the semicolon + is no longer output: one has to write { $$ = $1; }. + +** Better C++ compliance + The output parsers try to respect C++ namespaces. + [This turned out to be a failed experiment, and it was reverted later.] + +** Reduced Grammars + Fixed bugs when reporting useless nonterminals. + +** 64 bit hosts + The parsers work properly on 64 bit hosts. + +** Error messages + Some calls to strerror resulted in scrambled or missing error messages. + +** %expect + When the number of shift/reduce conflicts is correct, don't issue + any warning. + +** The verbose report includes the rule line numbers. + +** Rule line numbers are fixed in traces. + +** Swedish translation + +** Parse errors + Verbose parse error messages from the parsers are better looking. + Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'('' + Now: parse error: unexpected '/', expecting "number" or '-' or '(' + +** Fixed parser memory leaks. + When the generated parser was using malloc to extend its stacks, the + previous allocations were not freed. + +** Fixed verbose output file. + Some newlines were missing. + Some conflicts in state descriptions were missing. + +** Fixed conflict report. + Option -v was needed to get the result. + +** %expect + Was not used. + Mismatches are errors, not warnings. + +** Fixed incorrect processing of some invalid input. + +** Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H. + +** Fixed some typos in the documentation. + +** %token MY_EOF 0 is supported. + Before, MY_EOF was silently renumbered as 257. + +** doc/refcard.tex is updated. + +** %output, %file-prefix, %name-prefix. + New. + +** --output + New, aliasing "--output-file". + +* Changes in version 1.30, 2001-10-26: + +** "--defines" and "--graph" have now an optional argument which is the + output file name. "-d" and "-g" do not change; they do not take any + argument. + +** "%source_extension" and "%header_extension" are removed, failed + experiment. + +** Portability fixes. + +* Changes in version 1.29, 2001-09-07: + +** The output file does not define const, as this caused problems when used + with common autoconfiguration schemes. If you still use ancient compilers + that lack const, compile with the equivalent of the C compiler option + "-Dconst=". Autoconf's AC_C_CONST macro provides one way to do this. + +** Added "-g" and "--graph". + +** The Bison manual is now distributed under the terms of the GNU FDL. + +** The input and the output files has automatically a similar extension. + +** Russian translation added. + +** NLS support updated; should hopefully be less troublesome. + +** Added the old Bison reference card. + +** Added "--locations" and "%locations". + +** Added "-S" and "--skeleton". + +** "%raw", "-r", "--raw" is disabled. + +** Special characters are escaped when output. This solves the problems + of the #line lines with path names including backslashes. + +** New directives. + "%yacc", "%fixed_output_files", "%defines", "%no_parser", "%verbose", + "%debug", "%source_extension" and "%header_extension". + +** @$ + Automatic location tracking. + +* Changes in version 1.28, 1999-07-06: + +** Should compile better now with K&R compilers. + +** Added NLS. + +** Fixed a problem with escaping the double quote character. + +** There is now a FAQ. + +* Changes in version 1.27: + +** The make rule which prevented bison.simple from being created on + some systems has been fixed. + +* Changes in version 1.26: + +** Bison now uses Automake. + +** New mailing lists: and . + +** Token numbers now start at 257 as previously documented, not 258. + +** Bison honors the TMPDIR environment variable. + +** A couple of buffer overruns have been fixed. + +** Problems when closing files should now be reported. + +** Generated parsers should now work even on operating systems which do + not provide alloca(). + +* Changes in version 1.25, 1995-10-16: + +** Errors in the input grammar are not fatal; Bison keeps reading +the grammar file, and reports all the errors found in it. + +** Tokens can now be specified as multiple-character strings: for +example, you could use "<=" for a token which looks like <=, instead +of choosing a name like LESSEQ. + +** The %token_table declaration says to write a table of tokens (names +and numbers) into the parser file. The yylex function can use this +table to recognize multiple-character string tokens, or for other +purposes. + +** The %no_lines declaration says not to generate any #line preprocessor +directives in the parser file. + +** The %raw declaration says to use internal Bison token numbers, not +Yacc-compatible token numbers, when token names are defined as macros. + +** The --no-parser option produces the parser tables without including +the parser engine; a project can now use its own parser engine. +The actions go into a separate file called NAME.act, in the form of +a switch statement body. + +* Changes in version 1.23: + +The user can define YYPARSE_PARAM as the name of an argument to be +passed into yyparse. The argument should have type void *. It should +actually point to an object. Grammar actions can access the variable +by casting it to the proper pointer type. + +Line numbers in output file corrected. + +* Changes in version 1.22: + +--help option added. + +* Changes in version 1.20: + +Output file does not redefine const for C++. + +----- + +Copyright (C) 1995-2015 Free Software Foundation, Inc. + +This file is part of Bison, the GNU Parser Generator. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + LocalWords: yacc YYBACKUP glr GCC lalr ArrayIndexOutOfBoundsException nullptr + LocalWords: cplusplus liby rpl fprintf mfcalc Wyacc stmt cond expr mk sym lr + LocalWords: IELR ielr Lookahead YYERROR nonassoc LALR's api lookaheads yychar + LocalWords: destructor lookahead YYRHSLOC YYLLOC Rhs ifndef YYFAIL cpp sr rr + LocalWords: preprocessor initializer Wno Wnone Werror FreeBSD prec livelocks + LocalWords: Solaris AIX UX RHEL Tru LHS gcc's Wundef YYENABLE NLS YYLTYPE VCG + LocalWords: yyerror cpp's Wunused yylval yylloc prepend yyparse yylex yypush + LocalWords: Graphviz xml nonterminals midrule destructor's YYSTYPE typedef ly + LocalWords: CHR chr printf stdout namespace preprocessing enum pre include's + LocalWords: YYRECOVERING nonfree destructors YYABORT YYACCEPT params enums de + LocalWords: struct yystype DJGPP lex param Haible NUM alloca YYSTACK NUL goto + LocalWords: YYMAXDEPTH Unescaped UCNs YYLTYPE's yyltype typedefs inline Yaccs + LocalWords: Heriyanto Reenable dprec Hilfinger Eggert MYEOF Folle Menezes EOF + LocalWords: Lackovic define's itemset Groff Gettext malloc NEWS'ed YYDEBUG YY + LocalWords: namespaces strerror const autoconfiguration Dconst Autoconf's FDL + LocalWords: Automake TMPDIR LESSEQ ylwrap endif yydebug YYTOKEN YYLSP ival hh + LocalWords: extern YYTOKENTYPE TOKENTYPE yytokentype tokentype STYPE lval pdf + LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp Wother nterm arg init + LocalWords: TOK calc yyo fval Wconflicts parsers yystackp yyval yynerrs + LocalWords: Théophile Ranquet Santet fno fnone stype associativity Tolmer + LocalWords: Wprecedence Rassoul Wempty Paolo Bonzini parser's Michiel loc + LocalWords: redeclaration sval fcaret reentrant XSLT xsl Wmaybe yyvsp Tedi + LocalWords: pragmas noreturn untyped Rozenman unexpanded Wojciech Polak + LocalWords: Alexandre MERCHANTABILITY yytype + +Local Variables: +mode: outline +fill-column: 76 +End: diff --git a/PACKAGING b/PACKAGING new file mode 100644 index 0000000..1110aa3 --- /dev/null +++ b/PACKAGING @@ -0,0 +1,54 @@ +Packaging hints for binary package distributors +=============================================== + +Although the source of the bison package comes as a single package, +in distributions of binary packages the installed files should +be split into two packages: + + bison-runtime + Contents: Runtime libraries and programs. + Audience: Anyone who wants to run internationalized programs + that contain Bison-generated parsers. + + bison + Contents: Tools and documentation for developers that use Bison. + Audience: Anyone who wants to develop programs that use parsers. + Dependencies: requires bison-runtime. + +The 'bison-runtime' binary package is much smaller than the 'bison' +binary package. It should be included in any distribution that +contains localized programs that use the diagnostics contained in +Bison-generated parsers. + +If you want to install both packages at the same time, you simply do +at the toplevel directory: + + ./configure + make + make install + +After installation, the file + + $prefix/share/locale/*/LC_MESSAGES/bison-runtime.mo + +belongs to the bison-runtime package; all other installed files belong +to the bison package. + +----- + +Copyright (C) 2002, 2005, 2009-2015 Free Software Foundation, Inc. + +This file is part of Bison, the GNU Compiler Compiler. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/README b/README new file mode 100644 index 0000000..9cdf33d --- /dev/null +++ b/README @@ -0,0 +1,63 @@ +This package contains the GNU Bison parser generator. + +* Installation +** Build +See the file INSTALL for generic compilation and installation +instructions. + +Bison requires GNU m4 1.4.6 or later. See: + + ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz + +** Internationalization +Bison supports two catalogues: one for Bison itself (i.e., for the +maintainer-side parser generation), and one for the generated parsers +(i.e., for the user-side parser execution). The requirements between +both differ: bison needs ngettext, the generated parsers do not. To +simplify the build system, neither are installed if ngettext is not +supported, even if generated parsers could have been localized. See +http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html for +more details. + +* Questions +See the section FAQ in the documentation (doc/bison.info) for +frequently asked questions. The documentation is also available in +PDF and HTML, provided you have a recent version of Texinfo installed: +run "make pdf" or "make html". + +If you have questions about using Bison and the documentation does +not answer them, please send mail to . + +* Bug reports +Please send bug reports to . Please include the +version number from 'bison --version', and a complete, self-contained +test case in each bug report. + +* Copyright statements +For any copyright year range specified as YYYY-ZZZZ in this package, +note that the range specifies every single year in that closed interval. + + +Local Variables: +mode: outline +End: + +----- + +Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015 Free Software +Foundation, Inc. + +This file is part of Bison, the GNU Compiler Compiler. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/README-alpha b/README-alpha new file mode 100644 index 0000000..f0aa3c9 --- /dev/null +++ b/README-alpha @@ -0,0 +1,30 @@ +-*- text -*- + +This is a test release of this package. Using it more or less +implicitly signs you up to help us find whatever problems you report. + +The documentation still needs more work. Suggestions welcome. +Patches even more welcome. + +Please send comments and problem reports about this test release to +. This program will get better only if you report +the problems you encounter. + +----- + +Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc. + +This file is part of GNU Bison. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/README-release b/README-release new file mode 100644 index 0000000..4d9423a --- /dev/null +++ b/README-release @@ -0,0 +1,100 @@ +Here are most of the steps we (maintainers) follow when making a release. + +* Start from a clean, up-to-date git directory on "master": + + make -k maintainer-clean || { ./configure && make maintainer-clean; } + git checkout master + git pull origin master + +* Ensure that the latest stable versions of autoconf, automake, etc. + are in your PATH. See the buildreq list in bootstrap.conf for + the complete list of tools. + +* Ensure that you have no uncommitted diffs. This should produce no + output: + + git diff + +* Ensure that you've pushed all changes that belong in the release: + + git push origin master + +* Check that the NixOS/Hydra autobuilder is reporting all is well: + + http://hydra.nixos.org/jobset/gnu/bison-master + +* Run the following command to download any new translations: + + ./bootstrap && ./configure + +* Pre-release testing: ensure that the following command succeeds: + + make check syntax-check distcheck + +* To (i) set the date, version number, and release TYPE on line 3 of + NEWS, (ii) commit that, and (iii) tag the release, run + + # "TYPE" must be stable, beta or alpha + make release-commit RELEASE='X.Y TYPE' + +* Run the following to create release tarballs. Your choice selects the + corresponding upload-to destination in the emitted gnupload command. + The different destinations are specified in cfg.mk. See the definitions + of gnu_ftp_host-{alpha,beta,stable}. + + make release RELEASE='X.Y TYPE' + +* Test the tarball. Copy it to a few odd-ball systems and ensure that + it builds and passes all tests. + +* While that's happening, write the release announcement that you will + soon post. Start with the template, $HOME/announce-bison-X.Y + that was just created by that "make" command. + +Once all the builds and tests have passed, + +* Run the gnupload command that was suggested by your "make release" + run above, or run + + make upload RELEASE='X.Y TYPE' + +* Wait a few minutes (maybe up to 30?) and then use the release URLs to + download all tarball/signature pairs and use gpg --verify to ensure + that they're all valid. + +* Push the NEWS-updating changes and the new tag: + + v=$(cat .prev-version) + git push origin master tag v$v + +* Announce it on Savannah first, so you can include the savannah.org + announcement link in the email message. + + Go to the news-submission form: + + https://savannah.gnu.org/news/submit.php?group=bison + + If it does not work, then enable "News" for the project via this link: + + https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=bison + + Write something like the following: + + Subject: bison-X.Y released [stable] + +verbatim+ + ...paste the announcement here... + -verbatim- + + Then go here to approve it: + + https://savannah.gnu.org/news/approve.php?group=bison + +* Send the announcement email message. + +* After each non-alpha release, run + + make web-manual-update + + to update the on-line manual accessible at + + http://www.gnu.org/software/bison/manual/ diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..26bea0a --- /dev/null +++ b/THANKS @@ -0,0 +1,190 @@ +Bison was originally written by Robert Corbett. It would not be what +it is today without the invaluable help of these people: + +Aaro Koskinen aaro.koskinen@iki.fi +Аскар Сафин safinaskar@mail.ru +Airy Andre Airy.Andre@edf.fr +Akim Demaille akim@lrde.epita.fr +Albert Chin-A-Young china@thewrittenword.com +Alexander Belopolsky alexb@rentec.com +Alexandre Duret-Lutz adl@lrde.epita.fr +Andreas Schwab schwab@suse.de +Andrew Suffield asuffield@users.sourceforge.net +Angelo Borsotti angelo.borsotti@gmail.com +Anthony Heading ajrh@ajrh.net +Antonio Silva Correia amsilvacorreia@hotmail.com +Arnold Robbins arnold@skeeve.com +Art Haas ahaas@neosoft.com +Baron Schwartz baron@sequent.org +Ben Pfaff blp@cs.stanford.edu +Benoit Perrot benoit.perrot@epita.fr +Bernd Edlinger bernd.edlinger@hotmail.de +Bernd Kiefer kiefer@dfki.de +Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be +Bill Allombert Bill.Allombert@math.u-bordeaux1.fr +Bob Rossi bob@brasko.net +Brandon Lucia blucia@gmail.com +Bruce Lilly blilly@erols.com +Bruno Haible bruno@clisp.org +Charles-Henri de Boysson de-boy_c@epita.fr +Christian Burger cburger@sunysb.edu +Colin Daley colin.daley@outlook.com +Cris Bailiff c.bailiff+bison@awayweb.com +Cris van Pelt cris@amf03054.office.wxs.nl +Csaba Raduly csaba_22@yahoo.co.uk +Dagobert Michelsen dam@baltic-online.de +Daniel Frużyński daniel@poradnik-webmastera.com +Daniel Galloway dg1751@att.com +Daniel Hagerty hag@gnu.org +David J. MacKenzie djm@gnu.org +David Kastrup dak@gnu.org +Dennis Clarke dclarke@blastwave.org +Derek M. Jones derek@knosof.co.uk +Di-an Jan dianj@freeshell.org +Dick Streefland dick.streefland@altium.nl +Didier Godefroy dg@ulysium.net +Efi Fogel efifogel@gmail.com +Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de +Eric Blake ebb9@byu.net +Evgeny Stambulchik fnevgeny@plasma-gate.weizmann.ac.il +Fabrice Bauzac noon@cote-dazur.com +Florian Krohm florian@edamail.fishkill.ibm.com +Frank Heckenbach frank@g-n-u.de +Frans Englich frans.englich@telia.com +Gabriel Rassoul gabriel.rassoul@epita.fr +Georg Sauthoff gsauthof@TechFak.Uni-Bielefeld.DE +George Neuner gneuner2@comcast.net +Gilles Espinasse g.esp@free.fr +Goran Uddeborg goeran@uddeborg.se +Guido Trentalancia trentalg@aston.ac.uk +H. Merijn Brand h.m.brand@hccnet.nl +Hans Aberg haberg@matematik.su.se +Jan Nieuwenhuizen janneke@gnu.org +Jerry Quinn jlquinn@optonline.net +Jesse Thilo jthilo@gnu.org +Jim Kent jkent@arch.sel.sony.com +Jim Meyering jim@meyering.net +Joel E. Denny joeldenny@joeldenny.org +Johan van Selst johans@stack.nl +John Horigan john@glyphic.com +Jonathan Fabrizio jonathan.fabrizio@lrde.epita.fr +Jonathan Nieder jrnieder@gmail.com +Juan Manuel Guerrero juan.guerrero@gmx.de +Kees Zeelenberg kzlg@users.sourceforge.net +Keith Browne kbrowne@legato.com +Ken Moffat zarniwhoop@ntlworld.com +Laurent Mascherpa laurent.mascherpa@epita.fr +Lie Yan lie.yan@kaust.edu.sa +Magnus Fromreide magfr@lysator.liu.se +Marc Autret autret_m@epita.fr +Marc Mendiola mmendiol@usc.edu +Mark Boyall wolfeinstein@gmail.com +Martin Jacobs martin.jacobs@arcor.de +Martin Mokrejs mmokrejs@natur.cuni.cz +Martin Nylin martin.nylin@linuxmail.org +Matt Kraai kraai@alumni.cmu.edu +Matt Rosing rosing@peakfive.com +Michael Catanzaro mcatanzaro@gnome.org +Michael Felt mamfelt@gmail.com +Michael Hayes m.hayes@elec.canterbury.ac.nz +Michael Raskin 7c6f434c@mail.ru +Michel d'Hooge michel.dhooge@gmail.com +Michiel De Wilde mdewilde.agilent@gmail.com +Mickael Labau labau_m@epita.fr +Mike Castle dalgoda@ix.netcom.com +Mike Sullivan Mike.sullivan@Oracle.COM +Neil Booth NeilB@earthling.net +Nelson H. F. Beebe beebe@math.utah.edu +Nick Bowler nbowler@elliptictech.com +Nicolas Bedon nicolas.bedon@univ-rouen.fr +Nicolas Burrus nicolas.burrus@epita.fr +Nicolas Tisserand nicolas.tisserand@epita.fr +Noah Friedman friedman@gnu.org +Odd Arild Olsen oao@fibula.no +Oleg Smolsky oleg.smolsky@pacific-simulators.co.nz +Oleksii Taran oleksii.taran@gmail.com +Paolo Bonzini bonzini@gnu.org +Paolo Simone Gasparello djgaspa@gmail.com +Pascal Bart pascal.bart@epita.fr +Paul Eggert eggert@cs.ucla.edu +Paul Hilfinger Hilfinger@CS.Berkeley.EDU +Per Allansson per@appgate.com +Peter Eisentraut peter_e@gmx.net +Peter Fales psfales@lucent.com +Peter Hamorsky hamo@upjs.sk +Peter Simons simons@cryp.to +Petr Machata pmachata@redhat.com +Pho pho@cielonegro.org +Piotr Gackiewicz gacek@intertel.com.pl +Quentin Hocquet hocquet@gostai.com +Quoc Peyrot chojin@lrde.epita.fr +R Blake blakers@mac.com +Raja R Harinath harinath@cs.umn.edu +Ralf Wildenhues Ralf.Wildenhues@gmx.de +Rich Wilson richaw@gmail.com +Richard Stallman rms@gnu.org +Rici Lake ricilake@gmail.com +Rob Conde rob.conde@ai-solutions.com +Rob Vermaas rob.vermaas@gmail.com +Robert Anisko anisko_r@epita.fr +Roland Levillain roland@lrde.epita.fr +Satya Kiran Popuri satyakiran@gmail.com +Sebastian Setzer sebastian.setzer.ext@siemens.com +Sebastien Fricker sebastien.fricker@gmail.com +Sergei Steshenko sergstesh@yahoo.com +Shura debil_urod@ngs.ru +Stefano Lattarini stefano.lattarini@gmail.com +Stephen Cameron stephenmcameron@gmail.com +Steve Murphy murf@parsetree.com +Sum Wu sum@geekhouse.org +Théophile Ranquet theophile.ranquet@gmail.com +Thiru Ramakrishnan thiru.ramakrishnan@gmail.com +Thomas Jahns jahns@dkrz.de +Tim Josling tej@melbpc.org.au +Tim Landscheidt tim@tim-landscheidt.de +Tim Van Holder tim.van.holder@pandora.be +Tobias Frost tobi@debian.org +Tom Lane tgl@sss.pgh.pa.us +Tom Tromey tromey@cygnus.com +Tommy Nordgren tommy.nordgren@chello.se +Troy A. Johnson troyj@ecn.purdue.edu +Tys Lefering gccbison@gmail.com +Valentin Tolmer nitnelave1@gmail.com +Victor Khomenko victor.khomenko@newcastle.ac.uk +Vin Shelton acs@alumni.princeton.edu +W.C.A. Wijngaards wouter@NLnetLabs.nl +Wayne Green wayne@infosavvy.com +Wei Song wsong83@gmail.com +Wojciech Polak polak@gnu.org +Wolfgang S. Kechel wolfgang.kechel@prs.de +Wolfram Wagner ww@mpi-sb.mpg.de +Wwp subscript@free.fr +xolodho xolodho@gmail.com +Zack Weinberg zack@codesourcery.com + +Many people are not named here because we lost track of them. We +thank them! Please, help us keeping this list up to date. + +Local Variables: +mode: text +coding: utf-8 +End: + +----- + +Copyright (C) 2000-2015 Free Software Foundation, Inc. + +This file is part of Bison, the GNU Parser Generator. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/TODO b/TODO new file mode 100644 index 0000000..7d4a5fb --- /dev/null +++ b/TODO @@ -0,0 +1,387 @@ +* Short term +** Graphviz display code thoughts +The code for the --graph option is over two files: print_graph, and +graphviz. This is because Bison used to also produce VCG graphs, but since +this is no longer true, maybe we could consider these files for fusion. + +An other consideration worth noting is that print_graph.c (correct me if I +am wrong) should contain generic functions, whereas graphviz.c and other +potential files should contain just the specific code for that output +format. It will probably prove difficult to tell if the implementation is +actually generic whilst only having support for a single format, but it +would be nice to keep stuff a bit tidier: right now, the construction of the +bitset used to show reductions is in the graphviz-specific code, and on the +opposite side we have some use of \l, which is graphviz-specific, in what +should be generic code. + +Little effort seems to have been given to factoring these files and their +rint{,-xml} counterpart. We would very much like to re-use the pretty format +of states from .output for the graphs, etc. + +Also, the underscore in print_graph.[ch] isn't very fitting considering the +dashes in the other filenames. + +Since graphviz dies on medium-to-big grammars, maybe consider an other tool? + +** push-parser +Check it too when checking the different kinds of parsers. And be +sure to check that the initial-action is performed once per parsing. + +** m4 names +b4_shared_declarations is no longer what it is. Make it +b4_parser_declaration for instance. + +** yychar in lalr1.cc +There is a large difference bw maint and master on the handling of +yychar (which was removed in lalr1.cc). See what needs to be +back-ported. + + + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action + invokes YYABORT, YYACCEPT, or YYERROR immediately after altering + yychar. In the case of YYABORT or YYACCEPT, an incorrect + destructor might then be invoked immediately. In the case of + YYERROR, subsequent parser actions might lead to an incorrect + destructor call or verbose syntax error message before the + lookahead is translated. */ + + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yytranslate_ (yychar); + + +** stack.hh +Get rid of it. The original idea is nice, but actually it makes +the code harder to follow, and uselessly different from the other +skeletons. + +** Get rid of fake #lines [Bison: ...] +Possibly as simple as checking whether the column number is nonnegative. + +I have seen messages like the following from GCC. + +:0: fatal error: opening dependency file .deps/libltdl/argz.Tpo: No such file or directory + + +** Discuss about %printer/%destroy in the case of C++. +It would be very nice to provide the symbol classes with an operator<< +and a destructor. Unfortunately the syntax we have chosen for +%destroy and %printer make them hard to reuse. For instance, the user +is invited to write something like + + %printer { debug_stream() << $$; } ; + +which is hard to reuse elsewhere since it wants to use +"debug_stream()" to find the stream to use. The same applies to +%destroy: we told the user she could use the members of the Parser +class in the printers/destructors, which is not good for an operator<< +since it is no longer bound to a particular parser, it's just a +(standalone symbol). + +** Rename LR0.cc +as lr0.cc, why upper case? + +* Various +** YYERRCODE +Defined to 256, but not used, not documented. Probably the token +number for the error token, which POSIX wants to be 256, but which +Bison might renumber if the user used number 256. Keep fix and doc? +Throw away? + +Also, why don't we output the token name of the error token in the +output? It is explicitly skipped: + + /* Skip error token and tokens without identifier. */ + if (sym != errtoken && id) + +Of course there are issues with name spaces, but if we disable we have +something which seems to be more simpler and more consistent instead +of the special case YYERRCODE. + + enum yytokentype { + error = 256, + // ... + }; + + +We could (should?) also treat the case of the undef_token, which is +numbered 257 for yylex, and 2 internal. Both appear for instance in +toknum: + + const unsigned short int + parser::yytoken_number_[] = + { + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + +while here + + enum yytokentype { + TOK_EOF = 0, + TOK_EQ = 258, + +so both 256 and 257 are "mysterious". + + const char* + const parser::yytname_[] = + { + "\"end of command\"", "error", "$undefined", "\"=\"", "\"break\"", + + +** yychar == yyempty_ +The code in yyerrlab reads: + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + +There are only two yychar that can be <= YYEOF: YYEMPTY and YYEOF. +But I can't produce the situation where yychar is YYEMPTY here, is it +really possible? The test suite does not exercise this case. + +This shows that it would be interesting to manage to install skeleton +coverage analysis to the test suite. + +* From lalr1.cc to yacc.c +** Single stack +Merging the three stacks in lalr1.cc simplified the code, prompted for +other improvements and also made it faster (probably because memory +management is performed once instead of three times). I suggest that +we do the same in yacc.c. + +** yysyntax_error +The code bw glr.c and yacc.c is really alike, we can certainly factor +some parts. + + +* Report + +** Figures +Some statistics about the grammar and the parser would be useful, +especially when asking the user to send some information about the +grammars she is working on. We should probably also include some +information about the variables (I'm not sure for instance we even +specify what LR variant was used). + +** GLR +How would Paul like to display the conflicted actions? In particular, +what when two reductions are possible on a given lookahead token, but one is +part of $default. Should we make the two reductions explicit, or just +keep $default? See the following point. + +** Disabled Reductions +See 'tests/conflicts.at (Defaulted Conflicted Reduction)', and decide +what we want to do. + +** Documentation +Extend with error productions. The hard part will probably be finding +the right rule so that a single state does not exhibit too many yet +undocumented ''features''. Maybe an empty action ought to be +presented too. Shall we try to make a single grammar with all these +features, or should we have several very small grammars? + +** --report=conflict-path +Provide better assistance for understanding the conflicts by providing +a sample text exhibiting the (LALR) ambiguity. See the paper from +DeRemer and Penello: they already provide the algorithm. + +** Statically check for potential ambiguities in GLR grammars. See + for an approach. + + +* Extensions + +** $-1 +We should find a means to provide an access to values deep in the +stack. For instance, instead of + + baz: qux { $$ = $-1 + $0 + $1; } + +we should be able to have: + + foo($foo) bar($bar) baz($bar): qux($qux) { $baz = $foo + $bar + $qux; } + +Or something like this. + +** %if and the like +It should be possible to have %if/%else/%endif. The implementation is +not clear: should it be lexical or syntactic. Vadim Maslow thinks it +must be in the scanner: we must not parse what is in a switched off +part of %if. Akim Demaille thinks it should be in the parser, so as +to avoid falling into another CPP mistake. + +** XML Output +There are couple of available extensions of Bison targeting some XML +output. Some day we should consider including them. One issue is +that they seem to be quite orthogonal to the parsing technique, and +seem to depend mostly on the possibility to have some code triggered +for each reduction. As a matter of fact, such hooks could also be +used to generate the yydebug traces. Some generic scheme probably +exists in there. + +XML output for GNU Bison and gcc + http://www.cs.may.ie/~jpower/Research/bisonXML/ + +XML output for GNU Bison + http://yaxx.sourceforge.net/ + +* Unit rules +Maybe we could expand unit rules, i.e., transform + + exp: arith | bool; + arith: exp '+' exp; + bool: exp '&' exp; + +into + + exp: exp '+' exp | exp '&' exp; + +when there are no actions. This can significantly speed up some +grammars. I can't find the papers. In particular the book 'LR +parsing: Theory and Practice' is impossible to find, but according to +'Parsing Techniques: a Practical Guide', it includes information about +this issue. Does anybody have it? + + + +* Documentation + +** History/Bibliography +Some history of Bison and some bibliography would be most welcome. +Are there any Texinfo standards for bibliography? + +* Coding system independence +Paul notes: + + Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is + 255). It also assumes that the 8-bit character encoding is + the same for the invocation of 'bison' as it is for the + invocation of 'cc', but this is not necessarily true when + people run bison on an ASCII host and then use cc on an EBCDIC + host. I don't think these topics are worth our time + addressing (unless we find a gung-ho volunteer for EBCDIC or + PDP-10 ports :-) but they should probably be documented + somewhere. + + More importantly, Bison does not currently allow NUL bytes in + tokens, either via escapes (e.g., "x\0y") or via a NUL byte in + the source code. This should get fixed. + +* Broken options ? +** %token-table +** Skeleton strategy +Must we keep %token-table? + +* Precedence + +** Partial order +It is unfortunate that there is a total order for precedence. It +makes it impossible to have modular precedence information. We should +move to partial orders (sounds like series/parallel orders to me). + +** RR conflicts +See if we can use precedence between rules to solve RR conflicts. See +what POSIX says. + + +* $undefined +From Hans: +- If the Bison generated parser experiences an undefined number in the +character range, that character is written out in diagnostic messages, an +addition to the $undefined value. + +Suggest: Change the name $undefined to undefined; looks better in outputs. + + +* Default Action +From Hans: +- For use with my C++ parser, I transported the "switch (yyn)" statement +that Bison writes to the bison.simple skeleton file. This way, I can remove +the current default rule $$ = $1 implementation, which causes a double +assignment to $$ which may not be OK under C++, replacing it with a +"default:" part within the switch statement. + +Note that the default rule $$ = $1, when typed, is perfectly OK under C, +but in the C++ implementation I made, this rule is different from +$$ = $1. I therefore think that one should implement +a Bison option where every typed default rule is explicitly written out +(same typed ruled can of course be grouped together). + +* Pre and post actions. +From: Florian Krohm +Subject: YYACT_EPILOGUE +To: bug-bison@gnu.org +X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago + +The other day I had the need for explicitly building the parse tree. I +used %locations for that and defined YYLLOC_DEFAULT to call a function +that returns the tree node for the production. Easy. But I also needed +to assign the S-attribute to the tree node. That cannot be done in +YYLLOC_DEFAULT, because it is invoked before the action is executed. +The way I solved this was to define a macro YYACT_EPILOGUE that would +be invoked after the action. For reasons of symmetry I also added +YYACT_PROLOGUE. Although I had no use for that I can envision how it +might come in handy for debugging purposes. +All is needed is to add + +#if YYLSP_NEEDED + YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen)); +#else + YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen); +#endif + +at the proper place to bison.simple. Ditto for YYACT_PROLOGUE. + +I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE +to bison. If you're interested, I'll work on a patch. + +* Better graphics +Equip the parser with a means to create the (visual) parse tree. + +* Complaint submessage indentation. +We already have an implementation that works fairly well for named +reference messages, but it would be nice to use it consistently for all +submessages from Bison. For example, the "previous definition" +submessage or the list of correct values for a %define variable might +look better with indentation. + +However, the current implementation makes the assumption that the +location printed on the first line is not usually much shorter than the +locations printed on the submessage lines that follow. That assumption +may not hold true as often for some kinds of submessages especially if +we ever support multiple grammar files. + +Here's a proposal for how a new implementation might look: + + http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00086.html + + +Local Variables: +mode: outline +coding: utf-8 +End: + +----- + +Copyright (C) 2001-2004, 2006, 2008-2015 Free Software Foundation, Inc. + +This file is part of Bison, the GNU Compiler Compiler. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..422c8e5 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1321 @@ +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.15], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.15])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/00gnulib.m4]) +m4_include([m4/absolute-header.m4]) +m4_include([m4/alloca.m4]) +m4_include([m4/asm-underscore.m4]) +m4_include([m4/assert.m4]) +m4_include([m4/bison-i18n.m4]) +m4_include([m4/c-working.m4]) +m4_include([m4/calloc.m4]) +m4_include([m4/close-stream.m4]) +m4_include([m4/close.m4]) +m4_include([m4/closeout.m4]) +m4_include([m4/codeset.m4]) +m4_include([m4/config-h.m4]) +m4_include([m4/configmake.m4]) +m4_include([m4/cxx.m4]) +m4_include([m4/dirname.m4]) +m4_include([m4/dmalloc.m4]) +m4_include([m4/double-slash-root.m4]) +m4_include([m4/dup2.m4]) +m4_include([m4/environ.m4]) +m4_include([m4/errno_h.m4]) +m4_include([m4/error.m4]) +m4_include([m4/exponentd.m4]) +m4_include([m4/exponentf.m4]) +m4_include([m4/exponentl.m4]) +m4_include([m4/extensions.m4]) +m4_include([m4/extern-inline.m4]) +m4_include([m4/fatal-signal.m4]) +m4_include([m4/fcntl-o.m4]) +m4_include([m4/fcntl.m4]) +m4_include([m4/fcntl_h.m4]) +m4_include([m4/flex.m4]) +m4_include([m4/float_h.m4]) +m4_include([m4/fopen.m4]) +m4_include([m4/fpending.m4]) +m4_include([m4/fpieee.m4]) +m4_include([m4/fprintf-posix.m4]) +m4_include([m4/frexp.m4]) +m4_include([m4/frexpl.m4]) +m4_include([m4/fseterr.m4]) +m4_include([m4/fstat.m4]) +m4_include([m4/getdtablesize.m4]) +m4_include([m4/getopt.m4]) +m4_include([m4/gettext.m4]) +m4_include([m4/gettimeofday.m4]) +m4_include([m4/glibc21.m4]) +m4_include([m4/gnulib-common.m4]) +m4_include([m4/gnulib-comp.m4]) +m4_include([m4/iconv.m4]) +m4_include([m4/include_next.m4]) +m4_include([m4/intlmacosx.m4]) +m4_include([m4/intmax_t.m4]) +m4_include([m4/inttypes-pri.m4]) +m4_include([m4/inttypes.m4]) +m4_include([m4/inttypes_h.m4]) +m4_include([m4/isnan.m4]) +m4_include([m4/isnand.m4]) +m4_include([m4/isnanf.m4]) +m4_include([m4/isnanl.m4]) +m4_include([m4/javacomp.m4]) +m4_include([m4/javaexec.m4]) +m4_include([m4/largefile.m4]) +m4_include([m4/ldexp.m4]) +m4_include([m4/ldexpl.m4]) +m4_include([m4/lib-ld.m4]) +m4_include([m4/lib-link.m4]) +m4_include([m4/lib-prefix.m4]) +m4_include([m4/libunistring-base.m4]) +m4_include([m4/localcharset.m4]) +m4_include([m4/locale-fr.m4]) +m4_include([m4/locale-ja.m4]) +m4_include([m4/locale-zh.m4]) +m4_include([m4/lock.m4]) +m4_include([m4/longlong.m4]) +m4_include([m4/lstat.m4]) +m4_include([m4/m4.m4]) +m4_include([m4/malloc.m4]) +m4_include([m4/math_h.m4]) +m4_include([m4/mbrtowc.m4]) +m4_include([m4/mbsinit.m4]) +m4_include([m4/mbstate_t.m4]) +m4_include([m4/mbswidth.m4]) +m4_include([m4/memchr.m4]) +m4_include([m4/mmap-anon.m4]) +m4_include([m4/mode_t.m4]) +m4_include([m4/msvc-inval.m4]) +m4_include([m4/msvc-nothrow.m4]) +m4_include([m4/multiarch.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/nocrash.m4]) +m4_include([m4/non-recursive-gnulib-prefix-hack.m4]) +m4_include([m4/obstack-printf.m4]) +m4_include([m4/obstack.m4]) +m4_include([m4/off_t.m4]) +m4_include([m4/open.m4]) +m4_include([m4/pathmax.m4]) +m4_include([m4/perror.m4]) +m4_include([m4/pipe2.m4]) +m4_include([m4/po.m4]) +m4_include([m4/posix_spawn.m4]) +m4_include([m4/printf-frexp.m4]) +m4_include([m4/printf-frexpl.m4]) +m4_include([m4/printf-posix-rpl.m4]) +m4_include([m4/printf.m4]) +m4_include([m4/progtest.m4]) +m4_include([m4/quote.m4]) +m4_include([m4/quotearg.m4]) +m4_include([m4/raise.m4]) +m4_include([m4/rawmemchr.m4]) +m4_include([m4/realloc.m4]) +m4_include([m4/sched_h.m4]) +m4_include([m4/setenv.m4]) +m4_include([m4/sig_atomic_t.m4]) +m4_include([m4/sigaction.m4]) +m4_include([m4/signal_h.m4]) +m4_include([m4/signalblocking.m4]) +m4_include([m4/signbit.m4]) +m4_include([m4/size_max.m4]) +m4_include([m4/snprintf-posix.m4]) +m4_include([m4/snprintf.m4]) +m4_include([m4/spawn-pipe.m4]) +m4_include([m4/spawn_h.m4]) +m4_include([m4/sprintf-posix.m4]) +m4_include([m4/ssize_t.m4]) +m4_include([m4/stat.m4]) +m4_include([m4/stdbool.m4]) +m4_include([m4/stddef_h.m4]) +m4_include([m4/stdint.m4]) +m4_include([m4/stdint_h.m4]) +m4_include([m4/stdio_h.m4]) +m4_include([m4/stdlib_h.m4]) +m4_include([m4/stpcpy.m4]) +m4_include([m4/strchrnul.m4]) +m4_include([m4/strdup.m4]) +m4_include([m4/strerror.m4]) +m4_include([m4/strerror_r.m4]) +m4_include([m4/string_h.m4]) +m4_include([m4/strndup.m4]) +m4_include([m4/strnlen.m4]) +m4_include([m4/strverscmp.m4]) +m4_include([m4/sys_socket_h.m4]) +m4_include([m4/sys_stat_h.m4]) +m4_include([m4/sys_time_h.m4]) +m4_include([m4/sys_types_h.m4]) +m4_include([m4/sys_wait_h.m4]) +m4_include([m4/threadlib.m4]) +m4_include([m4/time_h.m4]) +m4_include([m4/timevar.m4]) +m4_include([m4/unistd-safer.m4]) +m4_include([m4/unistd_h.m4]) +m4_include([m4/unlink.m4]) +m4_include([m4/unlocked-io.m4]) +m4_include([m4/vasnprintf.m4]) +m4_include([m4/vfprintf-posix.m4]) +m4_include([m4/vsnprintf-posix.m4]) +m4_include([m4/vsnprintf.m4]) +m4_include([m4/vsprintf-posix.m4]) +m4_include([m4/wait-process.m4]) +m4_include([m4/waitpid.m4]) +m4_include([m4/warn-on-use.m4]) +m4_include([m4/warnings.m4]) +m4_include([m4/wchar_h.m4]) +m4_include([m4/wchar_t.m4]) +m4_include([m4/wctype_h.m4]) +m4_include([m4/wcwidth.m4]) +m4_include([m4/wint_t.m4]) +m4_include([m4/xalloc.m4]) +m4_include([m4/xsize.m4]) +m4_include([m4/xstrndup.m4]) diff --git a/build-aux/announce-gen b/build-aux/announce-gen new file mode 100755 index 0000000..8a6edb5 --- /dev/null +++ b/build-aux/announce-gen @@ -0,0 +1,557 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' + & eval 'exec perl -wS "$0" $argv:q' + if 0; +# Generate a release announcement message. + +my $VERSION = '2013-07-09 06:39'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Written by Jim Meyering + +use strict; + +use Getopt::Long; +use POSIX qw(strftime); + +(my $ME = $0) =~ s|.*/||; + +my %valid_release_types = map {$_ => 1} qw (alpha beta stable); +my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz'); +my %digest_classes = + ( + 'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'), + 'sha1' => ((eval { require Digest::SHA; } and 'Digest::SHA') + or (eval { require Digest::SHA1; } and 'Digest::SHA1')) + ); +my $srcdir = '.'; + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + my @types = sort keys %valid_release_types; + print $STREAM < = C + +Compute the sizes of the C<@file> and return them as a hash. Return +C if one of the computation failed. + +=cut + +sub sizes (@) +{ + my (@file) = @_; + + my $fail = 0; + my %res; + foreach my $f (@file) + { + my $cmd = "du -h $f"; + my $t = `$cmd`; + # FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS + $@ + and (warn "command failed: '$cmd'\n"), $fail = 1; + chomp $t; + $t =~ s/^\s*([\d.]+[MkK]).*/${1}B/; + $res{$f} = $t; + } + return $fail ? undef : %res; +} + +=item C dedicated to the list of <@file>, which +sizes are stored in C<%size>, and which are available from the C<@url>. + +=cut + +sub print_locations ($\@\%@) +{ + my ($title, $url, $size, @file) = @_; + print "Here are the $title:\n"; + foreach my $url (@{$url}) + { + for my $file (@file) + { + print " $url/$file"; + print " (", $$size{$file}, ")" + if exists $$size{$file}; + print "\n"; + } + } + print "\n"; +} + +=item C. + +=cut + +sub print_checksums (@) +{ + my (@file) = @_; + + print "Here are the MD5 and SHA1 checksums:\n"; + print "\n"; + + foreach my $meth (qw (md5 sha1)) + { + my $class = $digest_classes{$meth} or next; + foreach my $f (@file) + { + open IN, '<', $f + or die "$ME: $f: cannot open for reading: $!\n"; + binmode IN; + my $dig = $class->new->addfile(*IN)->hexdigest; + close IN; + print "$dig $f\n"; + } + } + print "\n"; +} + +=item C addressing changes +between versions C<$prev_version> and C<$curr_version>. + +=cut + +sub print_news_deltas ($$$) +{ + my ($news_file, $prev_version, $curr_version) = @_; + + my $news_name = $news_file; + $news_name =~ s|^\Q$srcdir\E/||; + + print "\n$news_name\n\n"; + + # Print all lines from $news_file, starting with the first one + # that mentions $curr_version up to but not including + # the first occurrence of $prev_version. + my $in_items; + + my $re_prefix = qr/(?:\* )?(?:Noteworthy c|Major c|C)(?i:hanges)/; + + my $found_news; + open NEWS, '<', $news_file + or die "$ME: $news_file: cannot open for reading: $!\n"; + while (defined (my $line = )) + { + if ( ! $in_items) + { + # Match lines like these: + # * Major changes in release 5.0.1: + # * Noteworthy changes in release 6.6 (2006-11-22) [stable] + $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$curr_version\E(?:[^\d.]|$)/o + or next; + $in_items = 1; + print $line; + } + else + { + # This regexp must not match version numbers in NEWS items. + # For example, they might well say "introduced in 4.5.5", + # and we don't want that to match. + $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o + and last; + print $line; + $line =~ /\S/ + and $found_news = 1; + } + } + close NEWS; + + $in_items + or die "$ME: $news_file: no matching lines for '$curr_version'\n"; + $found_news + or die "$ME: $news_file: no news item found for '$curr_version'\n"; +} + +sub print_changelog_deltas ($$) +{ + my ($package_name, $prev_version) = @_; + + # Print new ChangeLog entries. + + # First find all CVS-controlled ChangeLog files. + use File::Find; + my @changelog; + find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS' + and push @changelog, $File::Find::name}}, + '.'); + + # If there are no ChangeLog files, we're done. + @changelog + or return; + my %changelog = map {$_ => 1} @changelog; + + # Reorder the list of files so that if there are ChangeLog + # files in the specified directories, they're listed first, + # in this order: + my @dir = qw ( . src lib m4 config doc ); + + # A typical @changelog array might look like this: + # ./ChangeLog + # ./po/ChangeLog + # ./m4/ChangeLog + # ./lib/ChangeLog + # ./doc/ChangeLog + # ./config/ChangeLog + my @reordered; + foreach my $d (@dir) + { + my $dot_slash = $d eq '.' ? $d : "./$d"; + my $target = "$dot_slash/ChangeLog"; + delete $changelog{$target} + and push @reordered, $target; + } + + # Append any remaining ChangeLog files. + push @reordered, sort keys %changelog; + + # Remove leading './'. + @reordered = map { s!^\./!!; $_ } @reordered; + + print "\nChangeLog entries:\n\n"; + # print join ("\n", @reordered), "\n"; + + $prev_version =~ s/\./_/g; + my $prev_cvs_tag = "\U$package_name\E-$prev_version"; + + my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered"; + open DIFF, '-|', $cmd + or die "$ME: cannot run '$cmd': $!\n"; + # Print two types of lines, making minor changes: + # Lines starting with '+++ ', e.g., + # +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247 + # and those starting with '+'. + # Don't print the others. + my $prev_printed_line_empty = 1; + while (defined (my $line = )) + { + if ($line =~ /^\+\+\+ /) + { + my $separator = "*"x70 ."\n"; + $line =~ s///; + $line =~ s/\s.*//; + $prev_printed_line_empty + or print "\n"; + print $separator, $line, $separator; + } + elsif ($line =~ /^\+/) + { + $line =~ s///; + print $line; + $prev_printed_line_empty = ($line =~ /^$/); + } + } + close DIFF; + + # The exit code should be 1. + # Allow in case there are no modified ChangeLog entries. + $? == 256 || $? == 128 + or warn "warning: '$cmd' had unexpected exit code or signal ($?)\n"; +} + +sub get_tool_versions ($$) +{ + my ($tool_list, $gnulib_version) = @_; + @$tool_list + or return (); + + my $fail; + my @tool_version_pair; + foreach my $t (@$tool_list) + { + if ($t eq 'gnulib') + { + push @tool_version_pair, ucfirst $t . ' ' . $gnulib_version; + next; + } + # Assume that the last "word" on the first line of + # 'tool --version' output is the version string. + my ($first_line, undef) = split ("\n", `$t --version`); + if ($first_line =~ /.* (\d[\w.-]+)$/) + { + $t = ucfirst $t; + push @tool_version_pair, "$t $1"; + } + else + { + defined $first_line + and $first_line = ''; + warn "$t: unexpected --version output\n:$first_line"; + $fail = 1; + } + } + + $fail + and exit 1; + + return @tool_version_pair; +} + +{ + # Neutralize the locale, so that, for instance, "du" does not + # issue "1,2" instead of "1.2", what confuses our regexps. + $ENV{LC_ALL} = "C"; + + my $mail_headers; + my $release_type; + my $package_name; + my $prev_version; + my $curr_version; + my $gpg_key_id; + my @url_dir_list; + my @news_file; + my $bootstrap_tools; + my $gnulib_version; + my $print_checksums_p = 1; + + # Reformat the warnings before displaying them. + local $SIG{__WARN__} = sub + { + my ($msg) = @_; + # Warnings from GetOptions. + $msg =~ s/Option (\w)/option --$1/; + warn "$ME: $msg"; + }; + + GetOptions + ( + 'mail-headers=s' => \$mail_headers, + 'release-type=s' => \$release_type, + 'package-name=s' => \$package_name, + 'previous-version=s' => \$prev_version, + 'current-version=s' => \$curr_version, + 'gpg-key-id=s' => \$gpg_key_id, + 'url-directory=s' => \@url_dir_list, + 'news=s' => \@news_file, + 'srcdir=s' => \$srcdir, + 'bootstrap-tools=s' => \$bootstrap_tools, + 'gnulib-version=s' => \$gnulib_version, + 'print-checksums!' => \$print_checksums_p, + 'archive-suffix=s' => \@archive_suffixes, + + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + ) or usage 1; + + my $fail = 0; + # Ensure that each required option is specified. + $release_type + or (warn "release type not specified\n"), $fail = 1; + $package_name + or (warn "package name not specified\n"), $fail = 1; + $prev_version + or (warn "previous version string not specified\n"), $fail = 1; + $curr_version + or (warn "current version string not specified\n"), $fail = 1; + $gpg_key_id + or (warn "GnuPG key ID not specified\n"), $fail = 1; + @url_dir_list + or (warn "URL directory name(s) not specified\n"), $fail = 1; + + my @tool_list = split ',', $bootstrap_tools + if $bootstrap_tools; + + grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version + and (warn "when specifying gnulib as a tool, you must also specify\n" + . "--gnulib-version=V, where V is the result of running git describe\n" + . "in the gnulib source directory.\n"), $fail = 1; + + !$release_type || exists $valid_release_types{$release_type} + or (warn "'$release_type': invalid release type\n"), $fail = 1; + + @ARGV + and (warn "too many arguments:\n", join ("\n", @ARGV), "\n"), + $fail = 1; + $fail + and usage 1; + + my $my_distdir = "$package_name-$curr_version"; + + my $xd = "$package_name-$prev_version-$curr_version.xdelta"; + + my @candidates = map { "$my_distdir.$_" } @archive_suffixes; + my @tarballs = grep {-f $_} @candidates; + + @tarballs + or die "$ME: none of " . join(', ', @candidates) . " were found\n"; + my @sizable = @tarballs; + -f $xd + and push @sizable, $xd; + my %size = sizes (@sizable); + %size + or exit 1; + + my $headers = ''; + if (defined $mail_headers) + { + ($headers = $mail_headers) =~ s/\s+(\S+:)/\n$1/g; + $headers .= "\n"; + } + + # The markup is escaped as <\# so that when this script is sent by + # mail (or part of a diff), Gnus is not triggered. + print < + +FIXME: put comments here + +EOF + + if (@url_dir_list == 1 && @tarballs == 1) + { + # When there's only one tarball and one URL, use a more concise form. + my $m = "$url_dir_list[0]/$tarballs[0]"; + print "Here are the compressed sources and a GPG detached signature[*]:\n" + . " $m\n" + . " $m.sig\n\n"; + } + else + { + print_locations ("compressed sources", @url_dir_list, %size, @tarballs); + -f $xd + and print_locations ("xdelta diffs (useful? if so, " + . "please tell bug-gnulib\@gnu.org)", + @url_dir_list, %size, $xd); + my @sig_files = map { "$_.sig" } @tarballs; + print_locations ("GPG detached signatures[*]", @url_dir_list, %size, + @sig_files); + } + + if ($url_dir_list[0] =~ "gnu\.org") + { + print "Use a mirror for higher download bandwidth:\n"; + if (@tarballs == 1 && $url_dir_list[0] =~ m!http://ftp\.gnu\.org/gnu/!) + { + (my $m = "$url_dir_list[0]/$tarballs[0]") + =~ s!http://ftp\.gnu\.org/gnu/!http://ftpmirror\.gnu\.org/!; + print " $m\n" + . " $m.sig\n\n"; + + } + else + { + print " http://www.gnu.org/order/ftp.html\n\n"; + } + } + + $print_checksums_p + and print_checksums (@sizable); + + print <. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/config.guess b/build-aux/config.guess new file mode 100755 index 0000000..dbfb978 --- /dev/null +++ b/build-aux/config.guess @@ -0,0 +1,1421 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2015 Free Software Foundation, Inc. + +timestamp='2015-01-01' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches to . + + +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 1992-2015 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&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. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + 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 ; set_cc_for_build= ;' + +# 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 + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# 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 tuples: *-*-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 ;; + sh5el) machine=sh5le-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 -q __ELF__ + 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 + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # 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 ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # 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. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + 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 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + 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 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + 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 ;; + 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 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + 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 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # 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 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + 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 -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + 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 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????: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 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + 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 ;; + *: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 + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + 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 ;; + *:AIX:*:[4567]) + 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/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 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 -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 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 -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + 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 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + 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 ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + 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 i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + 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 -q ld.so.1 + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + 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-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + 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 ;; + 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 ;; + 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 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + 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 ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + 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 ;; + 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 ;; + 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 i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + 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 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*: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 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*: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; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + 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; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *: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 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + 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 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *: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 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *: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 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +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/build-aux/config.rpath b/build-aux/config.rpath new file mode 100755 index 0000000..a3e25c8 --- /dev/null +++ b/build-aux/config.rpath @@ -0,0 +1,684 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2015 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + ;; + *nto* | *qnx*) + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + haiku*) + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then + : + else + ld_shlibs=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd2.[01]*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' + ;; + freebsd* | dragonfly*) + library_names_spec='$libname$shrext' + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + haiku*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + *nto* | *qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + tpf*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2015 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-aux/cross-options.pl b/build-aux/cross-options.pl new file mode 100755 index 0000000..0f5009c --- /dev/null +++ b/build-aux/cross-options.pl @@ -0,0 +1,79 @@ +#! /usr/bin/env perl + +use warnings; +use 5.005; +use strict; + +my %option; +my %directive; +my $scanner = `grep -i '"%[a-z]' $ARGV[0]`; +$scanner =~ s/"\[-_\]"/-/g; +while () +{ + if (/^\s* # Initial spaces. + (?:(-\w),\s+)? # $1: $short: Possible short option. + (--[-\w]+) # $2: $long: Long option. + (\[?) # $3: $opt: '[' iff the argument is optional. + (?:=(\S+))? # $4: $arg: Possible argument name. + \s # Spaces. + /x) + { + my ($short, $long, $opt, $arg) = ($1, $2, $3, $4); + $short = '' if ! defined $short; + $short = '-d' if $long eq '--defines' && ! $short; + my $dir = '%' . substr($long, 2); + if (index ($scanner, "\"$dir\"") < 0) + { + if ($long eq '--force-define') { $dir = '%define'; } + else { $dir = ''; } + } + if ($arg) + { + # if $opt, $arg contains the closing ]. + substr ($arg, -1) = '' + if $opt eq '['; + $arg =~ s/^=//; + $arg = lc ($arg); + my $dir_arg = $arg; + # If the argument is compite (e.g., for --define[=NAME[=VALUE]]), + # put each word in @var, to build @var{name}[=@var{value}], not + # @var{name[=value]}]. + $arg =~ s/(\w+)/\@var{$1}/g; + my $long_arg = "=$arg"; + if ($opt eq '[') { + $long_arg = "[$long_arg]"; + $arg = "[$arg]"; + } + # For arguments of directives: this only works if all arguments + # are strings and have the same syntax as on the command line. + if ($dir_arg eq 'name[=value]') + { + $dir_arg = '@var{name} ["@var{value}"]'; + } + else + { + $dir_arg =~ s/(\w+)/\@var{"$1"}/g; + $dir_arg = '[' . $dir_arg . ']' + if $opt eq '['; + } + $long = "$long$long_arg"; + $short = "$short $arg" if $short && $short ne '-d'; + $dir = "$dir $dir_arg" if $dir; + } + $option{$long} = $short; + $directive{$long} = $dir; + } +} + +my $sep = ''; +foreach my $long (sort keys %option) +{ + # Avoid trailing spaces. + print $sep; + $sep = "\n"; + print '@item @option{', $long, "}\n\@tab"; + print ' @option{', $option{$long}, '}' if $option{$long}; + print "\n\@tab"; + print ' @code{', $directive{$long}, '}' if $directive{$long}; + print "\n"; +} diff --git a/build-aux/darwin11.4.0.valgrind b/build-aux/darwin11.4.0.valgrind new file mode 100644 index 0000000..9b0b06f --- /dev/null +++ b/build-aux/darwin11.4.0.valgrind @@ -0,0 +1,64 @@ +# Copyright (C) 2012-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Valgrind suppression file for Bison. + +{ + Mac OS X initialization + Memcheck:Leak + fun:?alloc* + ... + fun:*ImageLoader* +} + +{ + Mac OS X initialization + Memcheck:Leak + fun:?alloc* + ... + fun:*dyld* +} + +{ + Mac OS X initialization + Memcheck:Leak + fun:?alloc* + ... + fun:__CFInitialize +} + +{ + Mac OS X I/O buffer + Memcheck:Leak + fun:malloc + fun:__smakebuf + fun:__swsetup + fun:__sfvwrite + fun:fwrite +} + +{ + Mac OS X I/O buffer + Memcheck:Leak + fun:malloc + fun:__smakebuf + fun:__swsetup + fun:__swbuf + fun:putchar +} + +# Local Variables: +# mode: shell-script +# End: diff --git a/build-aux/depcomp b/build-aux/depcomp new file mode 100755 index 0000000..fda2463 --- /dev/null +++ b/build-aux/depcomp @@ -0,0 +1,756 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2015 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## 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). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## 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. +## 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. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/do-release-commit-and-tag b/build-aux/do-release-commit-and-tag new file mode 100755 index 0000000..a22469d --- /dev/null +++ b/build-aux/do-release-commit-and-tag @@ -0,0 +1,179 @@ +#!/bin/sh +# In a git/autoconf/automake-enabled project with a NEWS file and a version- +# controlled .prev-version file, automate the procedure by which we record +# the date, release-type and version string in the NEWS file. That commit +# will serve to identify the release, so apply a signed tag to it as well. +VERSION=2012-08-01.09 # UTC + +# Note: this is a bash script (could be zsh or dash) + +# Copyright (C) 2009-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Written by Jim Meyering + +ME=$(basename "$0") +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } + +help() +{ + cat <. +EOF + exit +} + +version() +{ + year=$(echo "$VERSION" | sed 's/[^0-9].*//') + cat < +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +EOF + exit +} + +## ------ ## +## Main. ## +## ------ ## + +# Constants. +noteworthy='* Noteworthy changes in release' +noteworthy_stub="$noteworthy ?.? (????-??-??) [?]" + +# Variables. +branch=$(git branch | sed -ne '/^\* /{s///;p;q;}') +builddir=. + +while test $# != 0 +do + # Handle --option=value by splitting apart and putting back on argv. + case $1 in + --*=*) + opt=$(echo "$1" | sed -e 's/=.*//') + val=$(echo "$1" | sed -e 's/[^=]*=//') + shift + set dummy "$opt" "$val" ${1+"$@"}; shift + ;; + esac + + case $1 in + --help|--version) ${1#--};; + --branch) shift; branch=$1; shift ;; + -C|--builddir) shift; builddir=$1; shift ;; + --*) die "unrecognized option: $1";; + *) break;; + esac +done + +test $# = 2 \ + || die "Usage: $ME [OPTION...] VERSION TYPE" + +ver=$1 +type=$2 + + +## ---------------------- ## +## First, sanity checks. ## +## ---------------------- ## + +# Verify that $ver looks like a version number, and... +echo "$ver"|grep -E '^[0-9][0-9.]*[0-9]$' > /dev/null \ + || die "invalid version: $ver" +prev_ver=$(cat .prev-version) \ + || die 'failed to determine previous version number from .prev-version' + +# Verify that $ver is sensible (> .prev-version). +case $(printf "$prev_ver\n$ver\n"|sort -V -u|tr '\n' ':') in + "$prev_ver:$ver:") ;; + *) die "invalid version: $ver (<= $prev_ver)";; +esac + +case $type in + alpha|beta|stable) ;; + *) die "invalid release type: $type";; +esac + +# No local modifications allowed. +case $(git diff-index --name-only HEAD) in + '') ;; + *) die 'this tree is dirty; commit your changes first';; +esac + +# Ensure the current branch name is correct: +curr_br=$(git rev-parse --symbolic-full-name HEAD) +test "$curr_br" = refs/heads/$branch || die not on branch $branch + +# Extract package name from Makefile. +Makefile=$builddir/Makefile +pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' "$Makefile") \ + || die "failed to determine package name from $Makefile" + +# Check that line 3 of NEWS is the stub line about to be replaced. +test "$(sed -n 3p NEWS)" = "$noteworthy_stub" \ + || die "line 3 of NEWS must be exactly '$noteworthy_stub'" + +## --------------- ## +## Then, changes. ## +## --------------- ## + +# Update NEWS to have today's date, plus desired version number and $type. +perl -MPOSIX -ni -e 'my $today = strftime "%F", localtime time;' \ + -e 'my ($type, $ver) = qw('"$type $ver"');' \ + -e 'my $pfx = "'"$noteworthy"'";' \ + -e 'print $.==3 ? "$pfx $ver ($today) [$type]\n" : $_' \ + NEWS || die 'failed to update NEWS' + +printf "version $ver\n\n* NEWS: Record release date.\n" \ + | git commit -F - -a || die 'git commit failed' +git tag -s -m "$pkg $ver" v$ver HEAD || die 'git tag failed' + +# Local variables: +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "VERSION=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: " # UTC" +# End: diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh new file mode 100755 index 0000000..46faaaf --- /dev/null +++ b/build-aux/gendocs.sh @@ -0,0 +1,500 @@ +#!/bin/sh -e +# gendocs.sh -- generate a GNU manual in many formats. This script is +# mentioned in maintain.texi. See the help message below for usage details. + +scriptversion=2015-01-02.22 + +# Copyright 2003-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Original author: Mohit Agarwal. +# Send bug reports and any other correspondence to bug-gnulib@gnu.org. +# +# The latest version of this script, and the companion template, is +# available from the Gnulib repository: +# +# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh +# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template + +# TODO: +# - image importation was only implemented for HTML generated by +# makeinfo. But it should be simple enough to adjust. +# - images are not imported in the source tarball. All the needed +# formats (PDF, PNG, etc.) should be included. + +prog=`basename "$0"` +srcdir=`pwd` + +scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh" +templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template" + +: ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="} +: ${MAKEINFO="makeinfo"} +: ${TEXI2DVI="texi2dvi -t @finalout"} +: ${DOCBOOK2HTML="docbook2html"} +: ${DOCBOOK2PDF="docbook2pdf"} +: ${DOCBOOK2TXT="docbook2txt"} +: ${GENDOCS_TEMPLATE_DIR="."} +: ${PERL='perl'} +: ${TEXI2HTML="texi2html"} +unset CDPATH +unset use_texi2html + +version="gendocs.sh $scriptversion + +Copyright 2013 Free Software Foundation, Inc. +There is NO warranty. You may redistribute this software +under the terms of the GNU General Public License. +For more information about these matters, see the files named COPYING." + +usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE + +Generate output in various formats from PACKAGE.texinfo (or .texi or +.txi) source. See the GNU Maintainers document for a more extensive +discussion: + http://www.gnu.org/prep/maintain_toc.html + +Options: + --email ADR use ADR as contact in generated web pages; always give this. + + -s SRCFILE read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi} + -o OUTDIR write files into OUTDIR, instead of manual/. + -I DIR append DIR to the Texinfo search path. + --common ARG pass ARG in all invocations. + --html ARG pass ARG to makeinfo or texi2html for HTML targets. + --info ARG pass ARG to makeinfo for Info, instead of --no-split. + --no-ascii skip generating the plain text output. + --no-html skip generating the html output. + --no-info skip generating the info output. + --no-tex skip generating the dvi and pdf output. + --source ARG include ARG in tar archive of sources. + --split HOW make split HTML by node, section, chapter; default node. + + --texi2html use texi2html to make HTML target, with all split versions. + --docbook convert through DocBook too (xml, txt, html, pdf). + + --help display this help and exit successfully. + --version display version information and exit successfully. + +Simple example: $prog --email bug-gnu-emacs@gnu.org emacs \"GNU Emacs Manual\" + +Typical sequence: + cd PACKAGESOURCE/doc + wget \"$scripturl\" + wget \"$templateurl\" + $prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\" + +Output will be in a new subdirectory \"manual\" (by default; +use -o OUTDIR to override). Move all the new files into your web CVS +tree, as explained in the Web Pages node of maintain.texi. + +Please use the --email ADDRESS option so your own bug-reporting +address will be used in the generated HTML pages. + +MANUAL-TITLE is included as part of the HTML of the overall +manual/index.html file. It should include the name of the package being +documented. manual/index.html is created by substitution from the file +$GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the +generic template for your own purposes.) + +If you have several manuals, you'll need to run this script several +times with different MANUAL values, specifying a different output +directory with -o each time. Then write (by hand) an overall index.html +with links to them all. + +If a manual's Texinfo sources are spread across several directories, +first copy or symlink all Texinfo sources into a single directory. +(Part of the script's work is to make a tar.gz of the sources.) + +As implied above, by default monolithic Info files are generated. +If you want split Info, or other Info options, use --info to override. + +You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML, +and PERL to control the programs that get executed, and +GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is +looked for. With --docbook, the environment variables DOCBOOK2HTML, +DOCBOOK2PDF, and DOCBOOK2TXT are also consulted. + +By default, makeinfo and texi2dvi are run in the default (English) +locale, since that's the language of most Texinfo manuals. If you +happen to have a non-English manual and non-English web site, see the +SETLANG setting in the source. + +Email bug reports or enhancement requests to bug-gnulib@gnu.org. +" + +MANUAL_TITLE= +PACKAGE= +EMAIL=webmasters@gnu.org # please override with --email +commonarg= # passed to all makeinfo/texi2html invcations. +dirargs= # passed to all tools (-I dir). +dirs= # -I directories. +htmlarg= +infoarg=--no-split +generate_ascii=true +generate_html=true +generate_info=true +generate_tex=true +outdir=manual +source_extra= +split=node +srcfile= + +while test $# -gt 0; do + case $1 in + -s) shift; srcfile=$1;; + -o) shift; outdir=$1;; + -I) shift; dirargs="$dirargs -I '$1'"; dirs="$dirs $1";; + --common) shift; commonarg=$1;; + --docbook) docbook=yes;; + --email) shift; EMAIL=$1;; + --html) shift; htmlarg=$1;; + --info) shift; infoarg=$1;; + --no-ascii) generate_ascii=false;; + --no-html) generate_ascii=false;; + --no-info) generate_info=false;; + --no-tex) generate_tex=false;; + --source) shift; source_extra=$1;; + --split) shift; split=$1;; + --texi2html) use_texi2html=1;; + + --help) echo "$usage"; exit 0;; + --version) echo "$version"; exit 0;; + -*) + echo "$0: Unknown option \`$1'." >&2 + echo "$0: Try \`--help' for more information." >&2 + exit 1;; + *) + if test -z "$PACKAGE"; then + PACKAGE=$1 + elif test -z "$MANUAL_TITLE"; then + MANUAL_TITLE=$1 + else + echo "$0: extra non-option argument \`$1'." >&2 + exit 1 + fi;; + esac + shift +done + +# makeinfo uses the dirargs, but texi2dvi doesn't. +commonarg=" $dirargs $commonarg" + +# For most of the following, the base name is just $PACKAGE +base=$PACKAGE + +if test -n "$srcfile"; then + # but here, we use the basename of $srcfile + base=`basename "$srcfile"` + case $base in + *.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;; + esac + PACKAGE=$base +elif test -s "$srcdir/$PACKAGE.texinfo"; then + srcfile=$srcdir/$PACKAGE.texinfo +elif test -s "$srcdir/$PACKAGE.texi"; then + srcfile=$srcdir/$PACKAGE.texi +elif test -s "$srcdir/$PACKAGE.txi"; then + srcfile=$srcdir/$PACKAGE.txi +else + echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2 + exit 1 +fi + +if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then + echo "$0: cannot read $GENDOCS_TEMPLATE_DIR/gendocs_template." >&2 + echo "$0: it is available from $templateurl." >&2 + exit 1 +fi + +# Function to return size of $1 in something resembling kilobytes. +calcsize() +{ + size=`ls -ksl $1 | awk '{print $1}'` + echo $size +} + +# copy_images OUTDIR HTML-FILE... +# ------------------------------- +# Copy all the images needed by the HTML-FILEs into OUTDIR. +# Look for them in . and the -I directories; this is simpler than what +# makeinfo supports with -I, but hopefully it will suffice. +copy_images() +{ + local odir + odir=$1 + shift + $PERL -n -e " +BEGIN { + \$me = '$prog'; + \$odir = '$odir'; + @dirs = qw(. $dirs); +} +" -e ' +/<img src="(.*?)"/g && ++$need{$1}; + +END { + #print "$me: @{[keys %need]}\n"; # for debugging, show images found. + FILE: for my $f (keys %need) { + for my $d (@dirs) { + if (-f "$d/$f") { + use File::Basename; + my $dest = dirname ("$odir/$f"); + # + use File::Path; + -d $dest || mkpath ($dest) + || die "$me: cannot mkdir $dest: $!\n"; + # + use File::Copy; + copy ("$d/$f", $dest) + || die "$me: cannot copy $d/$f to $dest: $!\n"; + next FILE; + } + } + die "$me: $ARGV: cannot find image $f\n"; + } +} +' -- "$@" || exit 1 +} + +case $outdir in + /*) abs_outdir=$outdir;; + *) abs_outdir=$srcdir/$outdir;; +esac + +echo "Making output for $srcfile" +echo " in `pwd`" +mkdir -p "$outdir/" + +# +if $generate_info; then + cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\"" + echo "Generating info... ($cmd)" + rm -f $PACKAGE.info* # get rid of any strays + eval "$cmd" + tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info* + ls -l "$outdir/$PACKAGE.info.tar.gz" + info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"` + # do not mv the info files, there's no point in having them available + # separately on the web. +fi # end info + +# +if $generate_tex; then + cmd="$SETLANG $TEXI2DVI $dirargs \"$srcfile\"" + printf "\nGenerating dvi... ($cmd)\n" + eval "$cmd" + # compress/finish dvi: + gzip -f -9 $PACKAGE.dvi + dvi_gz_size=`calcsize $PACKAGE.dvi.gz` + mv $PACKAGE.dvi.gz "$outdir/" + ls -l "$outdir/$PACKAGE.dvi.gz" + + cmd="$SETLANG $TEXI2DVI --pdf $dirargs \"$srcfile\"" + printf "\nGenerating pdf... ($cmd)\n" + eval "$cmd" + pdf_size=`calcsize $PACKAGE.pdf` + mv $PACKAGE.pdf "$outdir/" + ls -l "$outdir/$PACKAGE.pdf" +fi # end tex (dvi + pdf) + +# +if $generate_ascii; then + opt="-o $PACKAGE.txt --no-split --no-headers $commonarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" + printf "\nGenerating ascii... ($cmd)\n" + eval "$cmd" + ascii_size=`calcsize $PACKAGE.txt` + gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz" + ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"` + mv $PACKAGE.txt "$outdir/" + ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz" +fi + +# + +if $generate_html; then +# Split HTML at level $1. Used for texi2html. +html_split() +{ + opt="--split=$1 --node-files $commonarg $htmlarg" + cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\"" + printf "\nGenerating html by $1... ($cmd)\n" + eval "$cmd" + split_html_dir=$PACKAGE.html + ( + cd ${split_html_dir} || exit 1 + ln -sf ${PACKAGE}.html index.html + tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html + ) + eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"` + rm -f "$outdir"/html_$1/*.html + mkdir -p "$outdir/html_$1/" + mv ${split_html_dir}/*.html "$outdir/html_$1/" + rmdir ${split_html_dir} +} + +if test -z "$use_texi2html"; then + opt="--no-split --html -o $PACKAGE.html $commonarg $htmlarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" + printf "\nGenerating monolithic html... ($cmd)\n" + rm -rf $PACKAGE.html # in case a directory is left over + eval "$cmd" + html_mono_size=`calcsize $PACKAGE.html` + gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz" + html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"` + copy_images "$outdir/" $PACKAGE.html + mv $PACKAGE.html "$outdir/" + ls -l "$outdir/$PACKAGE.html" "$outdir/$PACKAGE.html.gz" + + # Before Texinfo 5.0, makeinfo did not accept a --split=HOW option, + # it just always split by node. So if we're splitting by node anyway, + # leave it out. + if test "x$split" = xnode; then + split_arg= + else + split_arg=--split=$split + fi + # + opt="--html -o $PACKAGE.html $split_arg $commonarg $htmlarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" + printf "\nGenerating html by $split... ($cmd)\n" + eval "$cmd" + split_html_dir=$PACKAGE.html + copy_images $split_html_dir/ $split_html_dir/*.html + ( + cd $split_html_dir || exit 1 + tar -czf "$abs_outdir/$PACKAGE.html_$split.tar.gz" -- * + ) + eval \ + html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"` + rm -rf "$outdir/html_$split/" + mv $split_html_dir "$outdir/html_$split/" + du -s "$outdir/html_$split/" + ls -l "$outdir/$PACKAGE.html_$split.tar.gz" + +else # use texi2html: + opt="--output $PACKAGE.html $commonarg $htmlarg" + cmd="$SETLANG $TEXI2HTML $opt \"$srcfile\"" + printf "\nGenerating monolithic html with texi2html... ($cmd)\n" + rm -rf $PACKAGE.html # in case a directory is left over + eval "$cmd" + html_mono_size=`calcsize $PACKAGE.html` + gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz" + html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"` + mv $PACKAGE.html "$outdir/" + + html_split node + html_split chapter + html_split section +fi +fi # end html + +# +printf "\nMaking .tar.gz for sources...\n" +d=`dirname $srcfile` +( + cd "$d" + srcfiles=`ls -d *.texinfo *.texi *.txi *.eps $source_extra 2>/dev/null` || true + tar czfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles + ls -l "$abs_outdir/$PACKAGE.texi.tar.gz" +) +texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"` + +# +# Do everything again through docbook. +if test -n "$docbook"; then + opt="-o - --docbook $commonarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml" + printf "\nGenerating docbook XML... ($cmd)\n" + eval "$cmd" + docbook_xml_size=`calcsize $PACKAGE-db.xml` + gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz" + docbook_xml_gz_size=`calcsize "$outdir/$PACKAGE-db.xml.gz"` + mv $PACKAGE-db.xml "$outdir/" + + split_html_db_dir=html_node_db + opt="$commonarg -o $split_html_db_dir" + cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\"" + printf "\nGenerating docbook HTML... ($cmd)\n" + eval "$cmd" + ( + cd ${split_html_db_dir} || exit 1 + tar -czf "$abs_outdir/${PACKAGE}.html_node_db.tar.gz" -- *.html + ) + html_node_db_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node_db.tar.gz"` + rm -f "$outdir"/html_node_db/*.html + mkdir -p "$outdir/html_node_db" + mv ${split_html_db_dir}/*.html "$outdir/html_node_db/" + rmdir ${split_html_db_dir} + + cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\"" + printf "\nGenerating docbook ASCII... ($cmd)\n" + eval "$cmd" + docbook_ascii_size=`calcsize $PACKAGE-db.txt` + mv $PACKAGE-db.txt "$outdir/" + + cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\"" + printf "\nGenerating docbook PDF... ($cmd)\n" + eval "$cmd" + docbook_pdf_size=`calcsize $PACKAGE-db.pdf` + mv $PACKAGE-db.pdf "$outdir/" +fi + +# +printf "\nMaking index.html for $PACKAGE...\n" +if test -z "$use_texi2html"; then + CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\ + /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d" +else + # should take account of --split here. + CONDS="/%%ENDIF.*%%/d;/%%IF *HTML_SECTION%%/d;/%%IF *HTML_CHAPTER%%/d" +fi + +curdate=`$SETLANG date '+%B %d, %Y'` +sed \ + -e "s!%%TITLE%%!$MANUAL_TITLE!g" \ + -e "s!%%EMAIL%%!$EMAIL!g" \ + -e "s!%%PACKAGE%%!$PACKAGE!g" \ + -e "s!%%DATE%%!$curdate!g" \ + -e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \ + -e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \ + -e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \ + -e "s!%%HTML_SECTION_TGZ_SIZE%%!$html_section_tgz_size!g" \ + -e "s!%%HTML_CHAPTER_TGZ_SIZE%%!$html_chapter_tgz_size!g" \ + -e "s!%%INFO_TGZ_SIZE%%!$info_tgz_size!g" \ + -e "s!%%DVI_GZ_SIZE%%!$dvi_gz_size!g" \ + -e "s!%%PDF_SIZE%%!$pdf_size!g" \ + -e "s!%%ASCII_SIZE%%!$ascii_size!g" \ + -e "s!%%ASCII_GZ_SIZE%%!$ascii_gz_size!g" \ + -e "s!%%TEXI_TGZ_SIZE%%!$texi_tgz_size!g" \ + -e "s!%%DOCBOOK_HTML_NODE_TGZ_SIZE%%!$html_node_db_tgz_size!g" \ + -e "s!%%DOCBOOK_ASCII_SIZE%%!$docbook_ascii_size!g" \ + -e "s!%%DOCBOOK_PDF_SIZE%%!$docbook_pdf_size!g" \ + -e "s!%%DOCBOOK_XML_SIZE%%!$docbook_xml_size!g" \ + -e "s!%%DOCBOOK_XML_GZ_SIZE%%!$docbook_xml_gz_size!g" \ + -e "s,%%SCRIPTURL%%,$scripturl,g" \ + -e "s!%%SCRIPTNAME%%!$prog!g" \ + -e "$CONDS" \ +$GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html" + +echo "Done, see $outdir/ subdirectory for new files." + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen new file mode 100755 index 0000000..8e92c0a --- /dev/null +++ b/build-aux/git-version-gen @@ -0,0 +1,226 @@ +#!/bin/sh +# Print a version string. +scriptversion=2014-12-02.19; # UTC + +# Copyright (C) 2007-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# As with any generated file in a VC'd directory, you should add +# /.version to .gitignore, so that you don't accidentally commit it. +# .tarball-version is never generated in a VC'd directory, so needn't +# be listed there. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project@example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .version and +# .tarball-version will exist in distribution tarballs. +# +# EXTRA_DIST = $(top_srcdir)/.version +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + + +me=$0 + +version="git-version-gen $scriptversion + +Copyright 2011 Free Software Foundation, Inc. +There is NO warranty. You may redistribute this software +under the terms of the GNU General Public License. +For more information about these matters, see the files named COPYING." + +usage="\ +Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT] +Print a version string. + +Options: + + --prefix PREFIX prefix of git tags (default 'v') + --fallback VERSION + fallback version to use if \"git --version\" fails + + --help display this help and exit + --version output version information and exit + +Running without arguments will suffice in most cases." + +prefix=v +fallback= + +while test $# -gt 0; do + case $1 in + --help) echo "$usage"; exit 0;; + --version) echo "$version"; exit 0;; + --prefix) shift; prefix="$1";; + --fallback) shift; fallback="$1";; + -*) + echo "$0: Unknown option '$1'." >&2 + echo "$0: Try '--help' for more information." >&2 + exit 1;; + *) + if test "x$tarball_version_file" = x; then + tarball_version_file="$1" + elif test "x$tag_sed_script" = x; then + tag_sed_script="$1" + else + echo "$0: extra non-option argument '$1'." >&2 + exit 1 + fi;; + esac + shift +done + +if test "x$tarball_version_file" = x; then + echo "$usage" + exit 1 +fi + +tag_sed_script="${tag_sed_script:-s/x/x/}" + +nl=' +' + +# Avoid meddling by environment variable of the same name. +v= +v_from_git= + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || v= + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test "x$v" = x \ + && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2 +fi + +if test "x$v" != x +then + : # use $v +# Otherwise, if there is at least one git commit involving the working +# directory, and "git describe" output looks sensible, use that to +# derive a version string. +elif test "`git log -1 --pretty=format:x . 2>&1`" = x \ + && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \ + && case $v in + $prefix[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \ + || { commit_list=failed; + echo "$0: WARNING: git rev-list failed" 1>&2; } + numcommits=`echo "$commit_list" | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + test "$commit_list" = failed && v=UNKNOWN + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; + v_from_git=1 +elif test "x$fallback" = x || git --version >/dev/null 2>&1; then + v=UNKNOWN +else + v=$fallback +fi + +v=`echo "$v" |sed "s/^$prefix//"` + +# Test whether to append the "-dirty" suffix only if the version +# string we're using came from git. I.e., skip the test if it's "UNKNOWN" +# or if it came from .tarball-version. +if test "x$v_from_git" != x; then + # Don't declare a version "dirty" merely because a time stamp has changed. + git update-index --refresh > /dev/null 2>&1 + + dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty= + case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; + esac +fi + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +printf %s "$v" + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog new file mode 100755 index 0000000..de934c2 --- /dev/null +++ b/build-aux/gitlog-to-changelog @@ -0,0 +1,437 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' + & eval 'exec perl -wS "$0" $argv:q' + if 0; +# Convert git log output to ChangeLog format. + +my $VERSION = '2014-11-20 17:25'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2008-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Written by Jim Meyering + +use strict; +use warnings; +use Getopt::Long; +use POSIX qw(strftime); + +(my $ME = $0) =~ s|.*/||; + +# use File::Coda; # http://meyering.net/code/Coda/ +END { + defined fileno STDOUT or return; + close STDOUT and return; + warn "$ME: failed to close standard output: $!\n"; + $? ||= 1; +} + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + print $STREAM <<EOF; +Usage: $ME [OPTIONS] [ARGS] + +Convert git log output to ChangeLog format. If present, any ARGS +are passed to "git log". To avoid ARGS being parsed as options to +$ME, they may be preceded by '--'. + +OPTIONS: + + --amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that + makes a change to SHA1's commit log text or metadata. + --append-dot append a dot to the first line of each commit message if + there is no other punctuation or blank at the end. + --no-cluster never cluster commit messages under the same date/author + header; the default is to cluster adjacent commit messages + if their headers are the same and neither commit message + contains multiple paragraphs. + --srcdir=DIR the root of the source tree, from which the .git/ + directory can be derived. + --since=DATE convert only the logs since DATE; + the default is to convert all log entries. + --until=DATE convert only the logs older than DATE. + --format=FMT set format string for commit subject and body; + see 'man git-log' for the list of format metacharacters; + the default is '%s%n%b%n' + --strip-tab remove one additional leading TAB from commit message lines. + --strip-cherry-pick remove data inserted by "git cherry-pick"; + this includes the "cherry picked from commit ..." line, + and the possible final "Conflicts:" paragraph. + --help display this help and exit + --version output version information and exit + +EXAMPLE: + + $ME --since=2008-01-01 > ChangeLog + $ME -- -n 5 foo > last-5-commits-to-branch-foo + +SPECIAL SYNTAX: + +The following types of strings are interpreted specially when they appear +at the beginning of a log message line. They are not copied to the output. + + Copyright-paperwork-exempt: Yes + Append the "(tiny change)" notation to the usual "date name email" + ChangeLog header to mark a change that does not require a copyright + assignment. + Co-authored-by: Joe User <user\@example.com> + List the specified name and email address on a second + ChangeLog header, denoting a co-author. + Signed-off-by: Joe User <user\@example.com> + These lines are simply elided. + +In a FILE specified via --amend, comment lines (starting with "#") are ignored. +FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on +a line) referring to a commit in the current project, and CODE refers to one +or more consecutive lines of Perl code. Pairs must be separated by one or +more blank line. + +Here is sample input for use with --amend=FILE, from coreutils: + +3a169f4c5d9159283548178668d2fae6fced3030 +# fix typo in title: +s/all tile types/all file types/ + +1379ed974f1fa39b12e2ffab18b3f7a607082202 +# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself. +# Change the author to be Paul. Note the escaped "@": +s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>, + +EOF + } + exit $exit_code; +} + +# If the string $S is a well-behaved file name, simply return it. +# If it contains white space, quotes, etc., quote it, and return the new string. +sub shell_quote($) +{ + my ($s) = @_; + if ($s =~ m![^\w+/.,-]!) + { + # Convert each single quote to '\'' + $s =~ s/\'/\'\\\'\'/g; + # Then single quote the string. + $s = "'$s'"; + } + return $s; +} + +sub quoted_cmd(@) +{ + return join (' ', map {shell_quote $_} @_); +} + +# Parse file F. +# Comment lines (starting with "#") are ignored. +# F must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 +# (alone on a line) referring to a commit in the current project, and +# CODE refers to one or more consecutive lines of Perl code. +# Pairs must be separated by one or more blank line. +sub parse_amend_file($) +{ + my ($f) = @_; + + open F, '<', $f + or die "$ME: $f: failed to open for reading: $!\n"; + + my $fail; + my $h = {}; + my $in_code = 0; + my $sha; + while (defined (my $line = <F>)) + { + $line =~ /^\#/ + and next; + chomp $line; + $line eq '' + and $in_code = 0, next; + + if (!$in_code) + { + $line =~ /^([0-9a-fA-F]{40})$/ + or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"), + $fail = 1, next; + $sha = lc $1; + $in_code = 1; + exists $h->{$sha} + and (warn "$ME: $f:$.: duplicate SHA1\n"), + $fail = 1, next; + } + else + { + $h->{$sha} ||= ''; + $h->{$sha} .= "$line\n"; + } + } + close F; + + $fail + and exit 1; + + return $h; +} + +# git_dir_option $SRCDIR +# +# From $SRCDIR, the --git-dir option to pass to git (none if $SRCDIR +# is undef). Return as a list (0 or 1 element). +sub git_dir_option($) +{ + my ($srcdir) = @_; + my @res = (); + if (defined $srcdir) + { + my $qdir = shell_quote $srcdir; + my $cmd = "cd $qdir && git rev-parse --show-toplevel"; + my $qcmd = shell_quote $cmd; + my $git_dir = qx($cmd); + defined $git_dir + or die "$ME: cannot run $qcmd: $!\n"; + $? == 0 + or die "$ME: $qcmd had unexpected exit code or signal ($?)\n"; + chomp $git_dir; + push @res, "--git-dir=$git_dir/.git"; + } + @res; +} + +{ + my $since_date; + my $until_date; + my $format_string = '%s%n%b%n'; + my $amend_file; + my $append_dot = 0; + my $cluster = 1; + my $strip_tab = 0; + my $strip_cherry_pick = 0; + my $srcdir; + GetOptions + ( + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + 'since=s' => \$since_date, + 'until=s' => \$until_date, + 'format=s' => \$format_string, + 'amend=s' => \$amend_file, + 'append-dot' => \$append_dot, + 'cluster!' => \$cluster, + 'strip-tab' => \$strip_tab, + 'strip-cherry-pick' => \$strip_cherry_pick, + 'srcdir=s' => \$srcdir, + ) or usage 1; + + defined $since_date + and unshift @ARGV, "--since=$since_date"; + defined $until_date + and unshift @ARGV, "--until=$until_date"; + + # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/) + # that makes a correction in the log or attribution of that commit. + my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {}; + + my @cmd = ('git', + git_dir_option $srcdir, + qw(log --log-size), + '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV); + open PIPE, '-|', @cmd + or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n" + . "(Is your Git too old? Version 1.5.1 or later is required.)\n"); + + my $prev_multi_paragraph; + my $prev_date_line = ''; + my @prev_coauthors = (); + while (1) + { + defined (my $in = <PIPE>) + or last; + $in =~ /^log size (\d+)$/ + or die "$ME:$.: Invalid line (expected log size):\n$in"; + my $log_nbytes = $1; + + my $log; + my $n_read = read PIPE, $log, $log_nbytes; + $n_read == $log_nbytes + or die "$ME:$.: unexpected EOF\n"; + + # Extract leading hash. + my ($sha, $rest) = split ':', $log, 2; + defined $sha + or die "$ME:$.: malformed log entry\n"; + $sha =~ /^[0-9a-fA-F]{40}$/ + or die "$ME:$.: invalid SHA1: $sha\n"; + + # If this commit's log requires any transformation, do it now. + my $code = $amend_code->{$sha}; + if (defined $code) + { + eval 'use Safe'; + my $s = new Safe; + # Put the unpreprocessed entry into "$_". + $_ = $rest; + + # Let $code operate on it, safely. + my $r = $s->reval("$code") + or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n"; + + # Note that we've used this entry. + delete $amend_code->{$sha}; + + # Update $rest upon success. + $rest = $_; + } + + # Remove lines inserted by "git cherry-pick". + if ($strip_cherry_pick) + { + $rest =~ s/^\s*Conflicts:\n.*//sm; + $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; + } + + my @line = split "\n", $rest; + my $author_line = shift @line; + defined $author_line + or die "$ME:$.: unexpected EOF\n"; + $author_line =~ /^(\d+) (.*>)$/ + or die "$ME:$.: Invalid line " + . "(expected date/author/email):\n$author_line\n"; + + # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog + # `(tiny change)' annotation. + my $tiny = (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @line) + ? ' (tiny change)' : ''); + + my $date_line = sprintf "%s %s$tiny\n", + strftime ("%F", localtime ($1)), $2; + + my @coauthors = grep /^Co-authored-by:.*$/, @line; + # Omit meta-data lines we've already interpreted. + @line = grep !/^(?:Signed-off-by:[ ].*>$ + |Co-authored-by:[ ] + |Copyright-paperwork-exempt:[ ] + )/x, @line; + + # Remove leading and trailing blank lines. + if (@line) + { + while ($line[0] =~ /^\s*$/) { shift @line; } + while ($line[$#line] =~ /^\s*$/) { pop @line; } + } + + # Record whether there are two or more paragraphs. + my $multi_paragraph = grep /^\s*$/, @line; + + # Format 'Co-authored-by: A U Thor <email@example.com>' lines in + # standard multi-author ChangeLog format. + for (@coauthors) + { + s/^Co-authored-by:\s*/\t /; + s/\s*</ </; + + /<.*?@.*\..*>/ + or warn "$ME: warning: missing email address for " + . substr ($_, 5) . "\n"; + } + + # If clustering of commit messages has been disabled, if this header + # would be different from the previous date/name/email/coauthors header, + # or if this or the previous entry consists of two or more paragraphs, + # then print the header. + if ( ! $cluster + || $date_line ne $prev_date_line + || "@coauthors" ne "@prev_coauthors" + || $multi_paragraph + || $prev_multi_paragraph) + { + $prev_date_line eq '' + or print "\n"; + print $date_line; + @coauthors + and print join ("\n", @coauthors), "\n"; + } + $prev_date_line = $date_line; + @prev_coauthors = @coauthors; + $prev_multi_paragraph = $multi_paragraph; + + # If there were any lines + if (@line == 0) + { + warn "$ME: warning: empty commit message:\n $date_line\n"; + } + else + { + if ($append_dot) + { + # If the first line of the message has enough room, then + if (length $line[0] < 72) + { + # append a dot if there is no other punctuation or blank + # at the end. + $line[0] =~ /[[:punct:]\s]$/ + or $line[0] .= '.'; + } + } + + # Remove one additional leading TAB from each line. + $strip_tab + and map { s/^\t// } @line; + + # Prefix each non-empty line with a TAB. + @line = map { length $_ ? "\t$_" : '' } @line; + + print "\n", join ("\n", @line), "\n"; + } + + defined ($in = <PIPE>) + or last; + $in ne "\n" + and die "$ME:$.: unexpected line:\n$in"; + } + + close PIPE + or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n"; + # FIXME-someday: include $PROCESS_STATUS in the diagnostic + + # Complain about any unused entry in the --amend=F specified file. + my $fail = 0; + foreach my $sha (keys %$amend_code) + { + warn "$ME:$amend_file: unused entry: $sha\n"; + $fail = 1; + } + + exit $fail; +} + +# Local Variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d %02H:%02M" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "'; # UTC" +# End: diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update new file mode 100755 index 0000000..aaea7eb --- /dev/null +++ b/build-aux/gnu-web-doc-update @@ -0,0 +1,194 @@ +#!/bin/sh +# Run this after each non-alpha release, to update the web documentation at +# http://www.gnu.org/software/$pkg/manual/ + +VERSION=2012-12-16.14; # UTC + +# Copyright (C) 2009-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +ME=$(basename "$0") +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } + +help() +{ + cat <<EOF +Usage: $ME + +Run this script from top_srcdir (no arguments) after each non-alpha +release, to update the web documentation at +http://www.gnu.org/software/\$pkg/manual/ + +This script assumes you're using git for revision control, and +requires a .prev-version file as well as a Makefile, from which it +extracts the version number and package name, respectively. Also, it +assumes all documentation is in the doc/ sub-directory. + +Options: + -C, --builddir=DIR location of (configured) Makefile (default: .) + -n, --dry-run don't actually commit anything + --help print this help, then exit + --version print version number, then exit + +Report bugs and patches to <bug-gnulib@gnu.org>. +EOF + exit +} + +version() +{ + year=$(echo "$VERSION" | sed 's/[^0-9].*//') + cat <<EOF +$ME $VERSION +Copyright (C) $year Free Software Foundation, Inc, +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +EOF + exit +} + +# find_tool ENVVAR NAMES... +# ------------------------- +# Search for a required program. Use the value of ENVVAR, if set, +# otherwise find the first of the NAMES that can be run (i.e., +# supports --version). If found, set ENVVAR to the program name, +# die otherwise. +# +# FIXME: code duplication, see also bootstrap. +find_tool () +{ + find_tool_envvar=$1 + shift + find_tool_names=$@ + eval "find_tool_res=\$$find_tool_envvar" + if test x"$find_tool_res" = x; then + for i + do + if ($i --version </dev/null) >/dev/null 2>&1; then + find_tool_res=$i + break + fi + done + else + find_tool_error_prefix="\$$find_tool_envvar: " + fi + test x"$find_tool_res" != x \ + || die "one of these is required: $find_tool_names" + ($find_tool_res --version </dev/null) >/dev/null 2>&1 \ + || die "${find_tool_error_prefix}cannot run $find_tool_res --version" + eval "$find_tool_envvar=\$find_tool_res" + eval "export $find_tool_envvar" +} + +## ------ ## +## Main. ## +## ------ ## + +# Requirements: everything required to bootstrap your package, plus +# these. +find_tool CVS cvs +find_tool GIT git +find_tool RSYNC rsync +find_tool XARGS gxargs xargs + +builddir=. +dryrun= +while test $# != 0 +do + # Handle --option=value by splitting apart and putting back on argv. + case $1 in + --*=*) + opt=$(echo "$1" | sed -e 's/=.*//') + val=$(echo "$1" | sed -e 's/[^=]*=//') + shift + set dummy "$opt" "$val" ${1+"$@"}; shift + ;; + esac + + case $1 in + --help|--version) ${1#--};; + -C|--builddir) shift; builddir=$1; shift ;; + -n|--dry-run) dryrun=echo; shift;; + --*) die "unrecognized option: $1";; + *) break;; + esac +done + +test $# = 0 \ + || die "too many arguments" + +prev=.prev-version +version=$(cat $prev) || die "no $prev file?" +pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' $builddir/Makefile) \ + || die "no Makefile?" +tmp_branch=web-doc-$version-$$ +current_branch=$($GIT branch | sed -ne '/^\* /{s///;p;q;}') + +cleanup() +{ + __st=$? + $dryrun rm -rf "$tmp" + $GIT checkout "$current_branch" + $GIT submodule update --recursive + $GIT branch -d $tmp_branch + exit $__st +} +trap cleanup 0 +trap 'exit $?' 1 2 13 15 + +# We must build using sources for which --version reports the +# just-released version number, not some string like 7.6.18-20761. +# That version string propagates into all documentation. +set -e +$GIT checkout -b $tmp_branch v$version +$GIT submodule update --recursive +./bootstrap +srcdir=$(pwd) +cd "$builddir" + ./config.status --recheck + ./config.status + make + make web-manual +cd "$srcdir" +set +e + +tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1 +( cd $tmp \ + && $CVS -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg ) +$RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual + +( + cd $tmp/$pkg/manual + + # Add all the files. This is simpler than trying to add only the + # new ones because of new directories: it would require iterating on + # adding the outer directories, and then their contents. + # + # find guarantees that we add outer directories first. + find . -name CVS -prune -o -print \ + | $XARGS --no-run-if-empty -- $dryrun $CVS add -ko + + $dryrun $CVS ci -m $version +) + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "VERSION=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/gnupload b/build-aux/gnupload new file mode 100755 index 0000000..f87c195 --- /dev/null +++ b/build-aux/gnupload @@ -0,0 +1,440 @@ +#!/bin/sh +# Sign files and upload them. + +scriptversion=2013-03-19.17; # UTC + +# Copyright (C) 2004-2015 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 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Originally written by Alexandre Duret-Lutz <adl@gnu.org>. +# The master copy of this file is maintained in the gnulib Git repository. +# Please send bug reports and feature requests to bug-gnulib@gnu.org. + +set -e + +GPG='gpg --batch --no-tty' +conffile=.gnuploadrc +to= +dry_run=false +replace= +symlink_files= +delete_files= +delete_symlinks= +collect_var= +dbg= +nl=' +' + +usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...] + +Sign all FILES, and process them at the destinations specified with --to. +If CMD is not given, it defaults to uploading. See examples below. + +Commands: + --delete delete FILES from destination + --symlink create symbolic links + --rmsymlink remove symbolic links + -- treat the remaining arguments as files to upload + +Options: + --to DEST specify a destination DEST for FILES + (multiple --to options are allowed) + --user NAME sign with key NAME + --replace allow replacements of existing files + --symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names + --dry-run do nothing, show what would have been done + (including the constructed directive file) + --version output version information and exit + --help print this help text and exit + +If --symlink-regex is given without EXPR, then the link target name +is created by replacing the version information with '-latest', e.g.: + foo-1.3.4.tar.gz -> foo-latest.tar.gz + +Recognized destinations are: + alpha.gnu.org:DIRECTORY + savannah.gnu.org:DIRECTORY + savannah.nongnu.org:DIRECTORY + ftp.gnu.org:DIRECTORY + build directive files and upload files by FTP + download.gnu.org.ua:{alpha|ftp}/DIRECTORY + build directive files and upload files by SFTP + [user@]host:DIRECTORY upload files with scp + +Options and commands are applied in order. If the file $conffile exists +in the current working directory, its contents are prepended to the +actual command line options. Use this to keep your defaults. Comments +(#) and empty lines in $conffile are allowed. + +<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html> +gives some further background. + +Examples: +1. Upload foobar-1.0.tar.gz to ftp.gnu.org: + gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz + +2. Upload foobar-1.0.tar.gz and foobar-1.0.tar.xz to ftp.gnu.org: + gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz foobar-1.0.tar.xz + +3. Same as above, and also create symbolic links to foobar-latest.tar.*: + gnupload --to ftp.gnu.org:foobar \\ + --symlink-regex \\ + foobar-1.0.tar.gz foobar-1.0.tar.xz + +4. Upload foobar-0.9.90.tar.gz to two sites: + gnupload --to alpha.gnu.org:foobar \\ + --to sources.redhat.com:~ftp/pub/foobar \\ + foobar-0.9.90.tar.gz + +5. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz + (the -- terminates the list of files to delete): + gnupload --to alpha.gnu.org:foobar \\ + --to sources.redhat.com:~ftp/pub/foobar \\ + --delete oopsbar-0.9.91.tar.gz \\ + -- foobar-0.9.91.tar.gz + +gnupload executes a program ncftpput to do the transfers; if you don't +happen to have an ncftp package installed, the ncftpput-ftp script in +the build-aux/ directory of the gnulib package +(http://savannah.gnu.org/projects/gnulib) may serve as a replacement. + +Send patches and bug reports to <bug-gnulib@gnu.org>." + +# Read local configuration file +if test -r "$conffile"; then + echo "$0: Reading configuration file $conffile" + conf=`sed 's/#.*$//;/^$/d' "$conffile" | tr "\015$nl" ' '` + eval set x "$conf \"\$@\"" + shift +fi + +while test -n "$1"; do + case $1 in + -*) + collect_var= + case $1 in + --help) + echo "$usage" + exit $? + ;; + --to) + if test -z "$2"; then + echo "$0: Missing argument for --to" 1>&2 + exit 1 + elif echo "$2" | grep 'ftp-upload\.gnu\.org' >/dev/null; then + echo "$0: Use ftp.gnu.org:PKGNAME or alpha.gnu.org:PKGNAME" >&2 + echo "$0: for the destination, not ftp-upload.gnu.org (which" >&2 + echo "$0: is used for direct ftp uploads, not with gnupload)." >&2 + echo "$0: See --help and its examples if need be." >&2 + exit 1 + else + to="$to $2" + shift + fi + ;; + --user) + if test -z "$2"; then + echo "$0: Missing argument for --user" 1>&2 + exit 1 + else + GPG="$GPG --local-user $2" + shift + fi + ;; + --delete) + collect_var=delete_files + ;; + --replace) + replace="replace: true" + ;; + --rmsymlink) + collect_var=delete_symlinks + ;; + --symlink-regex=*) + symlink_expr=`expr "$1" : '[^=]*=\(.*\)'` + ;; + --symlink-regex) + symlink_expr='s|-[0-9][0-9\.]*\(-[0-9][0-9]*\)\{0,1\}\.|-latest.|' + ;; + --symlink) + collect_var=symlink_files + ;; + --dry-run|-n) + dry_run=: + ;; + --version) + echo "gnupload $scriptversion" + exit $? + ;; + --) + shift + break + ;; + -*) + echo "$0: Unknown option '$1', try '$0 --help'" 1>&2 + exit 1 + ;; + esac + ;; + *) + if test -z "$collect_var"; then + break + else + eval "$collect_var=\"\$$collect_var $1\"" + fi + ;; + esac + shift +done + +dprint() +{ + echo "Running $* ..." +} + +if $dry_run; then + dbg=dprint +fi + +if test -z "$to"; then + echo "$0: Missing destination sites" >&2 + exit 1 +fi + +if test -n "$symlink_files"; then + x=`echo "$symlink_files" | sed 's/[^ ]//g;s/ //g'` + if test -n "$x"; then + echo "$0: Odd number of symlink arguments" >&2 + exit 1 + fi +fi + +if test $# = 0; then + if test -z "${symlink_files}${delete_files}${delete_symlinks}"; then + echo "$0: No file to upload" 1>&2 + exit 1 + fi +else + # Make sure all files exist. We don't want to ask + # for the passphrase if the script will fail. + for file + do + if test ! -f $file; then + echo "$0: Cannot find '$file'" 1>&2 + exit 1 + elif test -n "$symlink_expr"; then + linkname=`echo $file | sed "$symlink_expr"` + if test -z "$linkname"; then + echo "$0: symlink expression produces empty results" >&2 + exit 1 + elif test "$linkname" = $file; then + echo "$0: symlink expression does not alter file name" >&2 + exit 1 + fi + fi + done +fi + +# Make sure passphrase is not exported in the environment. +unset passphrase +unset passphrase_fd_0 +GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg} + +# Reset PATH to be sure that echo is a built-in. We will later use +# 'echo $passphrase' to output the passphrase, so it is important that +# it is a built-in (third-party programs tend to appear in 'ps' +# listings with their arguments...). +# Remember this script runs with 'set -e', so if echo is not built-in +# it will exit now. +if $dry_run || grep -q "^use-agent" $GNUPGHOME/gpg.conf; then :; else + PATH=/empty echo -n "Enter GPG passphrase: " + stty -echo + read -r passphrase + stty echo + echo + passphrase_fd_0="--passphrase-fd 0" +fi + +if test $# -ne 0; then + for file + do + echo "Signing $file ..." + rm -f $file.sig + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 -ba -o $file.sig $file + done +fi + + +# mkdirective DESTDIR BASE FILE STMT +# Arguments: See upload, below +mkdirective () +{ + stmt="$4" + if test -n "$3"; then + stmt=" +filename: $3$stmt" + fi + + cat >${2}.directive<<EOF +version: 1.2 +directory: $1 +comment: gnupload v. $scriptversion$stmt +EOF + if $dry_run; then + echo "File ${2}.directive:" + cat ${2}.directive + echo "File ${2}.directive:" | sed 's/./-/g' + fi +} + +mksymlink () +{ + while test $# -ne 0 + do + echo "symlink: $1 $2" + shift + shift + done +} + +# upload DEST DESTDIR BASE FILE STMT FILES +# Arguments: +# DEST Destination site; +# DESTDIR Destination directory; +# BASE Base name for the directive file; +# FILE Name of the file to distribute (may be empty); +# STMT Additional statements for the directive file; +# FILES List of files to upload. +upload () +{ + dest=$1 + destdir=$2 + base=$3 + file=$4 + stmt=$5 + files=$6 + + rm -f $base.directive $base.directive.asc + case $dest in + alpha.gnu.org:*) + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive + $dbg ncftpput ftp-upload.gnu.org /incoming/alpha $files $base.directive.asc + ;; + ftp.gnu.org:*) + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive + $dbg ncftpput ftp-upload.gnu.org /incoming/ftp $files $base.directive.asc + ;; + savannah.gnu.org:*) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg ncftpput savannah.gnu.org /incoming/savannah/$destdir $files + ;; + savannah.nongnu.org:*) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg ncftpput savannah.nongnu.org /incoming/savannah/$destdir $files + ;; + download.gnu.org.ua:alpha/*|download.gnu.org.ua:ftp/*) + destdir_p1=`echo "$destdir" | sed 's,^[^/]*/,,'` + destdir_topdir=`echo "$destdir" | sed 's,/.*,,'` + mkdirective "$destdir_p1" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive + for f in $files $base.directive.asc + do + echo put $f + done | $dbg sftp -b - puszcza.gnu.org.ua:/incoming/$destdir_topdir + ;; + /*) + dest_host=`echo "$dest" | sed 's,:.*,,'` + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive + $dbg cp $files $base.directive.asc $dest_host + ;; + *) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg scp $files $dest + ;; + esac + rm -f $base.directive $base.directive.asc +} + +##### +# Process any standalone directives +stmt= +if test -n "$symlink_files"; then + stmt="$stmt +`mksymlink $symlink_files`" +fi + +for file in $delete_files +do + stmt="$stmt +archive: $file" +done + +for file in $delete_symlinks +do + stmt="$stmt +rmsymlink: $file" +done + +if test -n "$stmt"; then + for dest in $to + do + destdir=`echo $dest | sed 's/[^:]*://'` + upload "$dest" "$destdir" "`hostname`-$$" "" "$stmt" + done +fi + +# Process actual uploads +for dest in $to +do + for file + do + echo "Uploading $file to $dest ..." + stmt= + # + # allowing file replacement is all or nothing. + if test -n "$replace"; then stmt="$stmt +$replace" + fi + # + files="$file $file.sig" + destdir=`echo $dest | sed 's/[^:]*://'` + if test -n "$symlink_expr"; then + linkname=`echo $file | sed "$symlink_expr"` + stmt="$stmt +symlink: $file $linkname +symlink: $file.sig $linkname.sig" + fi + upload "$dest" "$destdir" "$file" "$file" "$stmt" "$files" + done +done + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/install-sh b/build-aux/install-sh new file mode 100755 index 0000000..0b0fdcb --- /dev/null +++ b/build-aux/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2013-12-25.23; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/javacomp.sh.in b/build-aux/javacomp.sh.in new file mode 100644 index 0000000..88a633d --- /dev/null +++ b/build-aux/javacomp.sh.in @@ -0,0 +1,75 @@ +#!/bin/sh +# Compile a Java program. + +# Copyright (C) 2001-2015 Free Software Foundation, Inc. +# Written by Bruno Haible <haible@clisp.cons.org>, 2001. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# This uses the same choices as javacomp.c, but instead of relying on the +# environment settings at run time, it uses the environment variables +# present at configuration time. +# +# This is a separate shell script, because it must be able to unset JAVA_HOME +# in some cases, which a simple shell command cannot do. +# +# The extra CLASSPATH must have been set prior to calling this script. +# Options that can be passed are -O, -g and "-d DIRECTORY". + +CONF_JAVAC='@CONF_JAVAC@' +CONF_CLASSPATH='@CLASSPATH@' +if test -n "@HAVE_JAVAC_ENVVAR@"; then + # Combine given CLASSPATH and configured CLASSPATH. + if test -n "$CLASSPATH"; then + CLASSPATH="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}" + else + CLASSPATH="$CONF_CLASSPATH" + fi + export CLASSPATH + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@" + exec $CONF_JAVAC "$@" +else + unset JAVA_HOME + if test -n "@HAVE_GCJ_C@"; then + # In this case, $CONF_JAVAC starts with "gcj -C". + CLASSPATH="$CLASSPATH" + export CLASSPATH + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@" + exec $CONF_JAVAC "$@" + else + if test -n "@HAVE_JAVAC@"; then + # In this case, $CONF_JAVAC starts with "javac". + CLASSPATH="$CLASSPATH" + export CLASSPATH + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@" + exec $CONF_JAVAC "$@" + else + if test -n "@HAVE_JIKES@"; then + # In this case, $CONF_JAVAC starts with "jikes". + # Combine given CLASSPATH and configured CLASSPATH. + if test -n "$CLASSPATH"; then + CLASSPATH="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}" + else + CLASSPATH="$CONF_CLASSPATH" + fi + export CLASSPATH + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@" + exec $CONF_JAVAC "$@" + else + echo 'Java compiler not found, try installing gcj or set $JAVAC, then reconfigure' 1>&2 + exit 1 + fi + fi + fi +fi diff --git a/build-aux/javaexec.sh.in b/build-aux/javaexec.sh.in new file mode 100644 index 0000000..8d67d36 --- /dev/null +++ b/build-aux/javaexec.sh.in @@ -0,0 +1,70 @@ +#!/bin/sh +# Execute a Java program. + +# Copyright (C) 2001-2015 Free Software Foundation, Inc. +# Written by Bruno Haible <haible@clisp.cons.org>, 2001. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# This uses the same choices as javaexec.c, but instead of relying on the +# environment settings at run time, it uses the environment variables +# present at configuration time. +# +# This is a separate shell script, because it must be able to unset JAVA_HOME +# in some cases, which a simple shell command cannot do. +# +# The extra CLASSPATH must have been set prior to calling this script. + +CONF_JAVA='@CONF_JAVA@' +CONF_CLASSPATH='@CLASSPATH@' +if test -n "@HAVE_JAVA_ENVVAR@"; then + # Combine given CLASSPATH and configured CLASSPATH. + if test -n "$CLASSPATH"; then + CLASSPATH="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}" + else + CLASSPATH="$CONF_CLASSPATH" + fi + export CLASSPATH + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@" + exec $CONF_JAVA "$@" +else + unset JAVA_HOME + export CLASSPATH + if test -n "@HAVE_GIJ@"; then + # In this case, $CONF_JAVA is "gij". + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@" + exec $CONF_JAVA "$@" + else + if test -n "@HAVE_JAVA@"; then + # In this case, $CONF_JAVA is "java". + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@" + exec $CONF_JAVA "$@" + else + if test -n "@HAVE_JRE@"; then + # In this case, $CONF_JAVA is "jre". + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@" + exec $CONF_JAVA "$@" + else + if test -n "@HAVE_JVIEW@"; then + # In this case, $CONF_JAVA is "jview". + test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@" + exec $CONF_JAVA "$@" + else + echo 'Java virtual machine not found, try installing gij or set $JAVA, then reconfigure' 1>&2 + exit 1 + fi + fi + fi + fi +fi diff --git a/build-aux/linux-gnu.valgrind b/build-aux/linux-gnu.valgrind new file mode 100644 index 0000000..3130fbc --- /dev/null +++ b/build-aux/linux-gnu.valgrind @@ -0,0 +1,16 @@ +# Linux seattle 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012 +# x86_64 GNU/Linux +{ + index + Memcheck:Cond + fun:index + fun:expand_dynamic_string_token + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start + obj:/lib/ld-2.11.3.so +} diff --git a/build-aux/local.mk b/build-aux/local.mk new file mode 100644 index 0000000..7d752c8 --- /dev/null +++ b/build-aux/local.mk @@ -0,0 +1,22 @@ +# Copyright (C) 2000-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +EXTRA_DIST += \ + build-aux/cross-options.pl \ + build-aux/darwin11.4.0.valgrind \ + build-aux/linux-gnu.valgrind \ + build-aux/move-if-change \ + build-aux/prev-version.txt \ + build-aux/update-b4-copyright diff --git a/build-aux/mdate-sh b/build-aux/mdate-sh new file mode 100755 index 0000000..b793600 --- /dev/null +++ b/build-aux/mdate-sh @@ -0,0 +1,224 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. + +scriptversion=2010-08-21.06; # UTC + +# Copyright (C) 1995-2015 Free Software Foundation, Inc. +# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +fi + +case $1 in + '') + echo "$0: No file. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: mdate-sh [--help] [--version] FILE + +Pretty-print the modification day of FILE, in the format: +1 January 1970 + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "mdate-sh $scriptversion" + exit $? + ;; +esac + +error () +{ + echo "$0: $1" >&2 + exit 1 +} + + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# GNU ls changes its time format in response to the TIME_STYLE +# variable. Since we cannot assume 'unset' works, revert this +# variable to its documented default. +if test "${TIME_STYLE+set}" = set; then + TIME_STYLE=posix-long-iso + export TIME_STYLE +fi + +save_arg1=$1 + +# Find out how to get the extended ls output of a file or directory. +if ls -L /dev/null 1>/dev/null 2>&1; then + ls_command='ls -L -l -d' +else + ls_command='ls -l -d' +fi +# Avoid user/group names that might have spaces, when possible. +if ls -n /dev/null 1>/dev/null 2>&1; then + ls_command="$ls_command -n" +fi + +# A 'ls -l' line looks as follows on OS/2. +# drwxrwx--- 0 Aug 11 2001 foo +# This differs from Unix, which adds ownership information. +# drwxrwx--- 2 root root 4096 Aug 11 2001 foo +# +# To find the date, we split the line on spaces and iterate on words +# until we find a month. This cannot work with files whose owner is a +# user named "Jan", or "Feb", etc. However, it's unlikely that '/' +# will be owned by a user whose name is a month. So we first look at +# the extended ls output of the root directory to decide how many +# words should be skipped to get the date. + +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +set x`$ls_command /` + +# Find which argument is the month. +month= +command= +until test $month +do + test $# -gt 0 || error "failed parsing '$ls_command /' output" + shift + # Add another shift to the command. + command="$command shift;" + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +test -n "$month" || error "failed parsing '$ls_command /' output" + +# Get the extended ls output of the file or directory. +set dummy x`eval "$ls_command \"\\\$save_arg1\""` + +# Remove all preceding arguments +eval $command + +# Because of the dummy argument above, month is in $2. +# +# On a POSIX system, we should have +# +# $# = 5 +# $1 = file size +# $2 = month +# $3 = day +# $4 = year or time +# $5 = filename +# +# On Darwin 7.7.0 and 7.6.0, we have +# +# $# = 4 +# $1 = day +# $2 = month +# $3 = year or time +# $4 = filename + +# Get the month. +case $2 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; +esac + +case $3 in + ???*) day=$1;; + *) day=$3; shift;; +esac + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; eval year=\$$# + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for files modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr $year - 1` + fi;; + *) year=$3;; +esac + +# The result. +echo $day $month $year + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/missing b/build-aux/missing new file mode 100755 index 0000000..f62bbae --- /dev/null +++ b/build-aux/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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, see <http://www.gnu.org/licenses/>. + +# 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. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to <bug-automake@gnu.org>." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/move-if-change b/build-aux/move-if-change new file mode 100755 index 0000000..3cd87a9 --- /dev/null +++ b/build-aux/move-if-change @@ -0,0 +1,83 @@ +#!/bin/sh +# Like mv $1 $2, but if the files are the same, just delete $1. +# Status is zero if successful, nonzero otherwise. + +VERSION='2012-01-06 07:23'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +usage="usage: $0 SOURCE DEST" + +help="$usage + or: $0 OPTION +If SOURCE is different than DEST, then move it to DEST; else remove SOURCE. + + --help display this help and exit + --version output version information and exit + +The variable CMPPROG can be used to specify an alternative to 'cmp'. + +Report bugs to <bug-gnulib@gnu.org>." + +version=`expr "$VERSION" : '\([^ ]*\)'` +version="move-if-change (gnulib) $version +Copyright (C) 2011 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law." + +cmpprog=${CMPPROG-cmp} + +for arg +do + case $arg in + --help | --hel | --he | --h) + exec echo "$help" ;; + --version | --versio | --versi | --vers | --ver | --ve | --v) + exec echo "$version" ;; + --) + shift + break ;; + -*) + echo "$0: invalid option: $arg" >&2 + exit 1 ;; + *) + break ;; + esac +done + +test $# -eq 2 || { echo "$0: $usage" >&2; exit 1; } + +if test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null; then + rm -f -- "$1" +else + if mv -f -- "$1" "$2"; then :; else + # Ignore failure due to a concurrent move-if-change. + test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null && rm -f -- "$1" + fi +fi + +## Local Variables: +## eval: (add-hook 'write-file-hooks 'time-stamp) +## time-stamp-start: "VERSION='" +## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-time-zone: "UTC" +## time-stamp-end: "'; # UTC" +## End: diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk new file mode 100755 index 0000000..4d0518f --- /dev/null +++ b/build-aux/prefix-gnulib-mk @@ -0,0 +1,248 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' + & eval 'exec perl -wS "$0" $argv:q' + if 0; + +use strict; +use IO::File; +use Getopt::Long; +use File::Basename; # for dirname + +my $VERSION = '2012-01-21 17:13'; # UTC +(my $ME = $0) =~ s|.*/||; + +my $prefix; +my $lib_name; + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + print $STREAM <<EOF; +Usage: $ME --lib-name=NAME FILE + or: $ME [--help|--version] +Rewrite a gnulib-tool-generated FILE like lib/gnulib.mk to work with +automake's subdir-objects. + +OPTIONS: + +This option must be specified: + + --lib-name=NAME library name, often "lib\$project" + +The following are optional: + + --help display this help and exit + --version output version information and exit + +EOF + } + exit $exit_code; +} + +# contents ($FILE_NAME) +# --------------------- +sub contents ($) +{ + my ($file) = @_; + local $/; # Turn on slurp-mode. + my $f = new IO::File "< $file" or die "$file"; + my $contents = $f->getline or die "$file"; + $f->close; + return $contents; +} + +# prefix_word ($WORD) +# ------------------- +# Do not prefix special words such as variable dereferences. Also, +# "Makefile" is really "Makefile", since precisely there is no +# lib/Makefile. +sub prefix_word ($) +{ + local ($_) = @_; + $_ = $prefix . $_ + unless (/^-/ || m{^\$\(\w+\)} || $_ eq "Makefile" || $_ eq '\\' + || $_ eq '@ALLOCA@'); + return $_; +} + + +# prefix_words ($TEXT) +# -------------------- +sub prefix_words ($) +{ + local ($_) = @_; + s{(\S+)}{prefix_word($1)}gem; + return $_; +} + + +# prefix_assignment ($LHS-AND-ASSIGN-OP, $RHS) +# -------------------------------------------- +sub prefix_assignment ($$) +{ + my ($lhs_and_assign_op, $rhs) = @_; + my $res; + + # Some variables are initialized by gnulib.mk, and we don't want + # that. Change '=' to '+='. + if ($lhs_and_assign_op =~ /^GPERF =$/) + { + # Do not change the RHS, which specifies the GPERF program. + } + elsif ($lhs_and_assign_op =~ + /^(SUBDIRS|EXTRA_DIST|BUILT_SOURCES|SUFFIXES|MOSTLYCLEANFILES + |CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES|AM_CFLAGS + |AM_CPPFLAGS|AM_GNU_GETTEXT)\ =/x) + { + $lhs_and_assign_op =~ s/=/+=/; + } + # We don't want to inherit gnulib's AUTOMAKE_OPTIONS, comment them. + elsif ($lhs_and_assign_op =~ /^AUTOMAKE_OPTIONS =/) + { + $lhs_and_assign_op =~ s/^/# /; + } + elsif ($lhs_and_assign_op =~ /^SUFFIXES /) + { + # Elide any SUFFIXES assignment or concatenation. + $lhs_and_assign_op =~ s/^/# /; + } + # The words are (probably) paths to files in lib/: prefix them. + else + { + $rhs = prefix_words($rhs) + } + + # Variables which name depend on the location: libbison_a_SOURCES => + # lib_libbison_a_SOURCES. + $lhs_and_assign_op =~ s/($lib_name)/lib_$1/g; + + return $lhs_and_assign_op . $rhs; +} + +# prefix $CONTENTS +# ---------------- +# $CONTENTS is a Makefile content. Post-process it so that each file-name +# is prefixed with $prefix (e.g., "lib/"). +# +# Relies heavily on the regularity of the file generated by gnulib-tool. +sub prefix ($) +{ + # Work on $_. + local ($_) = @_; + + # Prefix all the occurrence of files in rules. If there is nothing + # after in the :, it's probably a phony target, or a suffix rule. + # Don't touch it. + s{^([-\w+/]+\.[-\w.]+ *: *\S.*)$} + {prefix_words($1)}gem; + + # Prefix files in variables. + s{^([\w.]+\s*\+?=)(.*)$} + {prefix_assignment($1, $2)}gem; + + # These three guys escape all the other regular rules. + # Require the leading white space to avoid inserting the prefix + # on a line like this: + # charset_alias = $(DESTDIR)$(libdir)/charset.alias + # With $(libdir), it would be erroneous. + s{(\s)(charset\.alias|ref-add\.sed|ref-del\.sed)}{$1$prefix$2}g; + # Unfortunately, as a result we sometimes have lib/lib. + s{($prefix){2}}{$1}g; + + # lib_libcoreutils_a_SOURCES += \ + # imaxtostr.c \ + # inttostr.c \ + # offtostr.c \ + # uinttostr.c \ + # umaxtostr.c + # The above are not handled since they're on continued lines, so + # deal with them manually: + s{^(\s*)((?:[ui]max|u?int|off)tostr\.c(:? \\)?)$}{$1$prefix$2}gm; + + # $(srcdir)/ is actually $(top_srcdir)/$prefix/. + # The trailing slash is required to avoid matching this rule: + # test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile + s{\$\(srcdir\)/}{\$(top_srcdir)/$prefix}g; + + # Sometimes, t-$@ is used instead of $@-t, which, of course, does + # not work when we have a $@ with a directory in it. + s{t-\$\@}{\$\@-t}g; + + # Some AC_SUBST patterns remain and would better be Make macros. + s{\@(MKDIR_P)\@}{\$($1)}g; + + # Adjust paths in mkdir. + s{(\$\(MKDIR_P\))\s*(\w+)}{$1 $prefix$2}g; + + return $_; +} + +# process ($IN) +# ------------- +sub process ($) +{ + my ($file) = @_; + my ($bak) = "$file.bak"; + rename ($file, $bak) or die "$ME: rename $file $bak failed: $!\n"; + my $contents = contents ($bak); + $contents = prefix ($contents); + my $out = new IO::File(">$file") + or die "$ME: $file: failed to open for writing: $!\n"; + print $out $contents; +} + +{ + GetOptions + ( + 'lib-name=s' => \$lib_name, + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + ) or usage 1; + + my $fail = 0; + defined $lib_name + or (warn "$ME: no library name; use --lib-name=NAME\n"), $fail = 1; + + # There must be exactly one argument. + @ARGV == 0 + and (warn "$ME: missing FILE argument\n"), $fail = 1; + 1 < @ARGV + and (warn "$ME: too many arguments:\n", join ("\n", @ARGV), "\n"), + $fail = 1; + $fail + and usage 1; + + my $file = $ARGV[0]; + $prefix = (dirname $file) . '/'; + warn "prefix=$prefix\n"; + + process $file; +} + +### Setup "GNU" style for perl-mode and cperl-mode. +## Local Variables: +## perl-indent-level: 2 +## perl-continued-statement-offset: 2 +## perl-continued-brace-offset: 0 +## perl-brace-offset: 0 +## perl-brace-imaginary-offset: 0 +## perl-label-offset: -2 +## cperl-indent-level: 2 +## cperl-brace-offset: 0 +## cperl-continued-brace-offset: 0 +## cperl-label-offset: -2 +## cperl-extra-newline-before-brace: t +## cperl-merge-trailing-else: nil +## cperl-continued-statement-offset: 2 +## eval: (add-hook 'write-file-hooks 'time-stamp) +## time-stamp-start: "my $VERSION = '" +## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-time-zone: "UTC" +## time-stamp-end: "'; # UTC" +## End: diff --git a/build-aux/prev-version.txt b/build-aux/prev-version.txt new file mode 100644 index 0000000..cd5ac03 --- /dev/null +++ b/build-aux/prev-version.txt @@ -0,0 +1 @@ +2.0 diff --git a/build-aux/snippet/_Noreturn.h b/build-aux/snippet/_Noreturn.h new file mode 100644 index 0000000..c44ad89 --- /dev/null +++ b/build-aux/snippet/_Noreturn.h @@ -0,0 +1,10 @@ +#if !defined _Noreturn && __STDC_VERSION__ < 201112 +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif diff --git a/build-aux/snippet/arg-nonnull.h b/build-aux/snippet/arg-nonnull.h new file mode 100644 index 0000000..0d55e2b --- /dev/null +++ b/build-aux/snippet/arg-nonnull.h @@ -0,0 +1,26 @@ +/* A C macro for declaring that specific arguments must not be NULL. + Copyright (C) 2009-2015 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools + that the values passed as arguments n, ..., m must be non-NULL pointers. + n = 1 stands for the first argument, n = 2 for the second argument etc. */ +#ifndef _GL_ARG_NONNULL +# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 +# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) +# else +# define _GL_ARG_NONNULL(params) +# endif +#endif diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h new file mode 100644 index 0000000..585b38a --- /dev/null +++ b/build-aux/snippet/c++defs.h @@ -0,0 +1,271 @@ +/* C++ compatible function declaration macros. + Copyright (C) 2010-2015 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_CXXDEFS_H +#define _GL_CXXDEFS_H + +/* The three most frequent use cases of these macros are: + + * For providing a substitute for a function that is missing on some + platforms, but is declared and works fine on the platforms on which + it exists: + + #if @GNULIB_FOO@ + # if !@HAVE_FOO@ + _GL_FUNCDECL_SYS (foo, ...); + # endif + _GL_CXXALIAS_SYS (foo, ...); + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif + + * For providing a replacement for a function that exists on all platforms, + but is broken/insufficient and needs to be replaced on some platforms: + + #if @GNULIB_FOO@ + # if @REPLACE_FOO@ + # if !(defined __cplusplus && defined GNULIB_NAMESPACE) + # undef foo + # define foo rpl_foo + # endif + _GL_FUNCDECL_RPL (foo, ...); + _GL_CXXALIAS_RPL (foo, ...); + # else + _GL_CXXALIAS_SYS (foo, ...); + # endif + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif + + * For providing a replacement for a function that exists on some platforms + but is broken/insufficient and needs to be replaced on some of them and + is additionally either missing or undeclared on some other platforms: + + #if @GNULIB_FOO@ + # if @REPLACE_FOO@ + # if !(defined __cplusplus && defined GNULIB_NAMESPACE) + # undef foo + # define foo rpl_foo + # endif + _GL_FUNCDECL_RPL (foo, ...); + _GL_CXXALIAS_RPL (foo, ...); + # else + # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ + _GL_FUNCDECL_SYS (foo, ...); + # endif + _GL_CXXALIAS_SYS (foo, ...); + # endif + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif +*/ + +/* _GL_EXTERN_C declaration; + performs the declaration with C linkage. */ +#if defined __cplusplus +# define _GL_EXTERN_C extern "C" +#else +# define _GL_EXTERN_C extern +#endif + +/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); + declares a replacement function, named rpl_func, with the given prototype, + consisting of return type, parameters, and attributes. + Example: + _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); + */ +#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ + _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) +#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C rettype rpl_func parameters_and_attributes + +/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); + declares the system function, named func, with the given prototype, + consisting of return type, parameters, and attributes. + Example: + _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); + */ +#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C rettype func parameters_and_attributes + +/* _GL_CXXALIAS_RPL (func, rettype, parameters); + declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to rpl_func, if GNULIB_NAMESPACE is defined. + Example: + _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); + */ +#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + rettype (*const func) parameters = ::rpl_func; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); + is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); + except that the C function rpl_func may have a slightly different + declaration. A cast is used to silence the "invalid conversion" error + that would otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + rettype (*const func) parameters = \ + reinterpret_cast<rettype(*)parameters>(::rpl_func); \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS (func, rettype, parameters); + declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to the system provided function func, if GNULIB_NAMESPACE + is defined. + Example: + _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); + */ +#if defined __cplusplus && defined GNULIB_NAMESPACE + /* If we were to write + rettype (*const func) parameters = ::func; + like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls + better (remove an indirection through a 'static' pointer variable), + but then the _GL_CXXALIASWARN macro below would cause a warning not only + for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */ +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static rettype (*func) parameters = ::func; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); + is like _GL_CXXALIAS_SYS (func, rettype, parameters); + except that the C function func may have a slightly different declaration. + A cast is used to silence the "invalid conversion" error that would + otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static rettype (*func) parameters = \ + reinterpret_cast<rettype(*)parameters>(::func); \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); + is like _GL_CXXALIAS_SYS (func, rettype, parameters); + except that the C function is picked among a set of overloaded functions, + namely the one with rettype2 and parameters2. Two consecutive casts + are used to silence the "cannot find a match" and "invalid conversion" + errors that would otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE + /* The outer cast must be a reinterpret_cast. + The inner cast: When the function is defined as a set of overloaded + functions, it works as a static_cast<>, choosing the designated variant. + When the function is defined as a single variant, it works as a + reinterpret_cast<>. The parenthesized cast syntax works both ways. */ +# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ + namespace GNULIB_NAMESPACE \ + { \ + static rettype (*func) parameters = \ + reinterpret_cast<rettype(*)parameters>( \ + (rettype2(*)parameters2)(::func)); \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIASWARN (func); + causes a warning to be emitted when ::func is used but not when + GNULIB_NAMESPACE::func is used. func must be defined without overloaded + variants. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIASWARN(func) \ + _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) +# define _GL_CXXALIASWARN_1(func,namespace) \ + _GL_CXXALIASWARN_2 (func, namespace) +/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, + we enable the warning only when not optimizing. */ +# if !__OPTIMIZE__ +# define _GL_CXXALIASWARN_2(func,namespace) \ + _GL_WARN_ON_USE (func, \ + "The symbol ::" #func " refers to the system function. " \ + "Use " #namespace "::" #func " instead.") +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# define _GL_CXXALIASWARN_2(func,namespace) \ + extern __typeof__ (func) func +# else +# define _GL_CXXALIASWARN_2(func,namespace) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +# endif +#else +# define _GL_CXXALIASWARN(func) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); + causes a warning to be emitted when the given overloaded variant of ::func + is used but not when GNULIB_NAMESPACE::func is used. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ + _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ + GNULIB_NAMESPACE) +# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ + _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) +/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, + we enable the warning only when not optimizing. */ +# if !__OPTIMIZE__ +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ + "The symbol ::" #func " refers to the system function. " \ + "Use " #namespace "::" #func " instead.") +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + extern __typeof__ (func) func +# else +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +# endif +#else +# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +#endif /* _GL_CXXDEFS_H */ diff --git a/build-aux/snippet/warn-on-use.h b/build-aux/snippet/warn-on-use.h new file mode 100644 index 0000000..90f4985 --- /dev/null +++ b/build-aux/snippet/warn-on-use.h @@ -0,0 +1,109 @@ +/* A C macro for emitting warnings if a function is used. + Copyright (C) 2010-2015 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* _GL_WARN_ON_USE (function, "literal string") issues a declaration + for FUNCTION which will then trigger a compiler warning containing + the text of "literal string" anywhere that function is called, if + supported by the compiler. If the compiler does not support this + feature, the macro expands to an unused extern declaration. + + This macro is useful for marking a function as a potential + portability trap, with the intent that "literal string" include + instructions on the replacement function that should be used + instead. However, one of the reasons that a function is a + portability trap is if it has the wrong signature. Declaring + FUNCTION with a different signature in C is a compilation error, so + this macro must use the same type as any existing declaration so + that programs that avoid the problematic FUNCTION do not fail to + compile merely because they included a header that poisoned the + function. But this implies that _GL_WARN_ON_USE is only safe to + use if FUNCTION is known to already have a declaration. Use of + this macro implies that there must not be any other macro hiding + the declaration of FUNCTION; but undefining FUNCTION first is part + of the poisoning process anyway (although for symbols that are + provided only via a macro, the result is a compilation error rather + than a warning containing "literal string"). Also note that in + C++, it is only safe to use if FUNCTION has no overloads. + + For an example, it is possible to poison 'getline' by: + - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], + [getline]) in configure.ac, which potentially defines + HAVE_RAW_DECL_GETLINE + - adding this code to a header that wraps the system <stdio.h>: + #undef getline + #if HAVE_RAW_DECL_GETLINE + _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" + "not universally present; use the gnulib module getline"); + #endif + + It is not possible to directly poison global variables. But it is + possible to write a wrapper accessor function, and poison that + (less common usage, like &environ, will cause a compilation error + rather than issue the nice warning, but the end result of informing + the developer about their portability problem is still achieved): + #if HAVE_RAW_DECL_ENVIRON + static char ***rpl_environ (void) { return &environ; } + _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); + # undef environ + # define environ (*rpl_environ ()) + #endif + */ +#ifndef _GL_WARN_ON_USE + +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +/* A compiler attribute is available in gcc versions 4.3.0 and later. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function __attribute__ ((__warning__ (message))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +/* Verify the existence of the function. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function +# else /* Unsupported. */ +# define _GL_WARN_ON_USE(function, message) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") + is like _GL_WARN_ON_USE (function, "string"), except that the function is + declared with the given prototype, consisting of return type, parameters, + and attributes. + This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does + not work in this case. */ +#ifndef _GL_WARN_ON_USE_CXX +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes \ + __attribute__ ((__warning__ (msg))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +/* Verify the existence of the function. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes +# else /* Unsupported. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_EXTERN_C declaration; + performs the declaration with C linkage. */ +#ifndef _GL_WARN_EXTERN_C +# if defined __cplusplus +# define _GL_WARN_EXTERN_C extern "C" +# else +# define _GL_WARN_EXTERN_C extern +# endif +#endif diff --git a/build-aux/test-driver b/build-aux/test-driver new file mode 100755 index 0000000..8e575b0 --- /dev/null +++ b/build-aux/test-driver @@ -0,0 +1,148 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <<END +Usage: + test-driver --test-name=NAME --log-file=PATH --trs-file=PATH + [--expect-failure={yes|no}] [--color-tests={yes|no}] + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] +The '--test-name', '--log-file' and '--trs-file' options are mandatory. +END +} + +test_name= # Used for reporting. +log_file= # Where to save the output of the test script. +trs_file= # Where to save the metadata of the test run. +expect_failure=no +color_tests=no +enable_hard_errors=yes +while test $# -gt 0; do + case $1 in + --help) print_usage; exit $?;; + --version) echo "test-driver $scriptversion"; exit $?;; + --test-name) test_name=$2; shift;; + --log-file) log_file=$2; shift;; + --trs-file) trs_file=$2; shift;; + --color-tests) color_tests=$2; shift;; + --expect-failure) expect_failure=$2; shift;; + --enable-hard-errors) enable_hard_errors=$2; shift;; + --) shift; break;; + -*) usage_error "invalid option: '$1'";; + *) break;; + esac + shift +done + +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + +if test $color_tests = yes; then + # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. + red='' # Red. + grn='' # Green. + lgn='' # Light green. + blu='' # Blue. + mgn='' # Magenta. + std='' # No color. +else + red= grn= lgn= blu= mgn= std= +fi + +do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' +trap "st=129; $do_exit" 1 +trap "st=130; $do_exit" 2 +trap "st=141; $do_exit" 13 +trap "st=143; $do_exit" 15 + +# Test script is run here. +"$@" >$log_file 2>&1 +estatus=$? + +if test $enable_hard_errors = no && test $estatus -eq 99; then + tweaked_estatus=1 +else + tweaked_estatus=$estatus +fi + +case $tweaked_estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex new file mode 100644 index 0000000..370d450 --- /dev/null +++ b/build-aux/texinfo.tex @@ -0,0 +1,10205 @@ +% 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{2014-12-03.16} +% +% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +% +% This texinfo.tex file is free software: you can redistribute it and/or +% modify it under the terms of the GNU General Public License as +% published by the Free Software Foundation, either version 3 of the +% License, or (at your option) any later version. +% +% This texinfo.tex file is distributed in the hope that it will be +% useful, but WITHOUT ANY WARRANTY; without even the implied warranty +% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. This Exception is an additional permission under section 7 +% of the GNU General Public License, version 3 ("GPLv3"). +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or +% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or +% http://www.gnu.org/software/texinfo/ (the Texinfo home page) +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ +\let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert +\let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ +\let\ptexraggedright=\raggedright +\let\ptexrbrace=\} +\let\ptexslash=\/ +\let\ptexsp=\sp +\let\ptexstar=\* +\let\ptexsup=\sup +\let\ptext=\t +\let\ptextop=\top +{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putworderror\undefined \gdef\putworderror{error}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} + +% sometimes characters are active, so we need control sequences. +\chardef\ampChar = `\& +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dashChar = `\- +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\hashChar = `\# +\chardef\lquoteChar= `\` +\chardef\questChar = `\? +\chardef\rquoteChar= `\' +\chardef\semiChar = `\; +\chardef\slashChar = `\/ +\chardef\underChar = `\_ + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt } + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\thisisundefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% @errormsg{MSG}. Do the index-like expansions on MSG, but if things +% aren't perfect, it's not the end of the world, being an error message, +% after all. +% +\def\errormsg{\begingroup \indexnofonts \doerrormsg} +\def\doerrormsg#1{\errmessage{#1}} + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Output a mark which sets \thischapter, \thissection and \thiscolor. +% We dump everything together because we only have one kind of mark. +% This works because we only use \botmark / \topmark, not \firstmark. +% +% A mark contains a subexpression of the \ifcase ... \fi construct. +% \get*marks macros below extract the needed part using \ifcase. +% +% Another complication is to let the user choose whether \thischapter +% (\thissection) refers to the chapter (section) in effect at the top +% of a page, or that at the bottom of a page. The solution is +% described on page 260 of The TeXbook. It involves outputting two +% marks for the sectioning macros, one before the section break, and +% one after. I won't pretend I can describe this better than DEK... +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 % 0: top marks (\last...) + \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...) + \noexpand\else \the\toks8 % 2: color marks + }% +} +% \topmark doesn't work for the very first chapter (after the title +% page or the contents), so we use \firstmark there -- this gets us +% the mark with the chapter defs, unless the user sneaks in, e.g., +% @setcolor (or @url, or @link, etc.) between @contents and the very +% first @chapter. +\def\gettopheadingmarks{% + \ifcase0\topmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi +} +\def\getbottomheadingmarks{\ifcase1\botmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} + +% Avoid "undefined control sequence" errors. +\def\lastchapterdefs{} +\def\lastsectiondefs{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars} + % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% + % + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi + \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingyyy.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 24pt + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1\relax \unvbox#1\relax +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarly, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as environments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At run-time, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Environment mismatch, #1 expected: +\def\badenverr{% + \errhelp = \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + outside of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal. + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\unskip\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=\endofsentencespacefactor\space} + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=\endofsentencespacefactor\space} + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp = \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% + \fi\fi +} + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox = \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br = \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. Not documented, written for gawk manual. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). This command +% is not documented, not supported, and doesn't work. +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% @include FILE -- \input text of FILE. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable % we want to expand any @value in FILE. + \turnoffactive % and allow special characters in the expansion + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @include of #1^^J}% + \edef\temp{\noexpand\input #1 }% + % + % This trickery is to read FILE outside of a group, in case it makes + % definitions, etc. + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other + \catcode`\`=\other + \catcode`\'=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} +% +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\centersub\centerH + \else + \let\centersub\centerV + \fi + \centersub{\hfil \ignorespaces#1\unskip \hfil}% + \let\centersub\relax % don't let the definition persist, just in case +} +\def\centerH#1{{% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break +}} +% +\newcount\centerpenalty +\def\centerV#1{% + % The idea here is the same as in \startdefun, \cartouche, etc.: if + % @center is the first thing after a section heading, we need to wipe + % out the negative parskip inserted by \sectionheading, but still + % prevent a page break here. + \centerpenalty = \lastpenalty + \ifnum\centerpenalty>10000 \vskip\parskip \fi + \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi + \line{\kern\leftskip #1\kern\rightskip}% +} + +% @sp n outputs n lines of vertical space +% +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment +% +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} +% +\let\c=\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent {\restorefirstparagraphindent \indent}% + \gdef\noindent{\restorefirstparagraphindent \noindent}% + \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% +} +% +\gdef\restorefirstparagraphindent{% + \global\let\indent = \ptexindent + \global\let\noindent = \ptexnoindent + \global\everypar = {}% +} + + +% @refill is a no-op. +\let\refill=\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as being undefined. +\ifx\pdfoutput\thisisundefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% +% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and +% related messages. The final outcome is that it is up to the TeX user +% to double the backslashes and otherwise make the string valid, so +% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to +% do this reliably, so we use it. + +% #1 is a control sequence in which to do the replacements, +% which we \xdef. +\def\txiescapepdf#1{% + \ifx\pdfescapestring\thisisundefined + % No primitive available; should we give a warning or log? + % Many times it won't matter. + \else + % The expandable \pdfescapestring primitive escapes parentheses, + % backslashes, and other special chars. + \xdef#1{\pdfescapestring{#1}}% + \fi +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + % + % Color manipulation macros using ideas from pdfcolor.tex, + % except using rgb instead of cmyk; the latter is said to render as a + % very dark gray on-screen and a very dark halftone in print, instead + % of actual black. The dark red here is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. We use + % black by default, though. + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + % k sets the color for filling (usual text, etc.); + % K sets the color for stroking (thin rules, e.g., normal _'s). + \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\dopdfimage#1#2#3{% + \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \else \gdef\pdfimgext{PDF}% + \fi + \else \gdef\pdfimgext{pdf}% + \fi + \closein 1 + \endgroup + % + % without \immediate, ancient pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifdim \wd0 >0pt width \pdfimagewidth \fi + \ifdim \wd2 >0pt height \pdfimageheight \fi + \ifnum\pdftexversion<13 + #1.\pdfimgext + \else + {#1.\pdfimgext}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + % + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \turnoffactive + \makevalueexpandable + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} + % + % used to mark target names; must be expandable. + \def\pdfmkpgn#1{#1} + % + % by default, use black for everything. + \def\urlcolor{\rgbBlack} + \def\linkcolor{\rgbBlack} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \edef\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + \txiescapepdf\pdfoutlinedest + \fi + % + % Also escape PDF chars in the display string. + \edef\pdfoutlinetext{#1}% + \txiescapepdf\pdfoutlinetext + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % TODO this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Too + % much work for too little return. Just use the ASCII equivalents + % we use for the index sort strings. + % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] + % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + % non-pdf mode + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + + +\message{fonts,} + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Unfortunately, we have to override this for titles and the like, since +% in those cases "rm" is bold. Sigh. +\def\rmisbold{\rm\def\curfontstyle{bf}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +% can get a sort of poor man's double spacing by redefining this. +\def\baselinefactor{1} +% +\newdimen\textleading +\def\setleading#1{% + \dimen0 = #1\relax + \normalbaselineskip = \baselinefactor\dimen0 + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% PDF CMaps. See also LaTeX's t1.cmap. +% +% do nothing with this by default. +\expandafter\let\csname cmapOT1\endcsname\gobble +\expandafter\let\csname cmapOT1IT\endcsname\gobble +\expandafter\let\csname cmapOT1TT\endcsname\gobble + +% if we are producing pdf, and we have \pdffontattr, then define cmaps. +% (\pdffontattr was introduced many years ago, but people still run +% older pdftex's; it's easy to conditionalize, so we do.) +\ifpdf \ifx\pdffontattr\thisisundefined \else + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\fi\fi + + +% Set the font macro #1 to the font named \fontprefix#2. +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). +% Example: +% #1 = \textrm +% #2 = \rmshape +% #3 = 10 +% #4 = \mainmagstep +% #5 = OT1 +% +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble +% +% (end of cmaps) + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\thisisundefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} % where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Definitions for a main text size of 11pt. (The default in Texinfo.) +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1095} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 +\def\chapecsize{1728} + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2}{OT1} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 +\def\sececsize{1440} + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315}{OT1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 +\def\ssececsize{1200} + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 +\def\reducedecsize{1000} + +\textleading = 13.2pt % line spacing for 11pt CM +\textfonts % reset the current fonts +\rm +} % end of 11pt text font size definitions, \definetextfontsizexi + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1000} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 +\def\chapecsize{1440} + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 +\def\sececsize{1200} + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 +\def\ssececsize{1000} + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 +\def\reducedecsize{0900} + +\divide\parskip by 2 % reduce space between paragraphs +\textleading = 12pt % line spacing for 10pt CM +\textfonts % reset the current fonts +\rm +} % end of 10pt text font size definitions, \definetextfontsizex + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xiword{11} +\def\xword{10} +\def\xwordpt{10pt} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + %\wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. We don't +% bother to reset \scriptfont and \scriptscriptfont; awaiting user need. +% +\def\resetmathfonts{% + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf +} + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used +% in, e.g., the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{27pt}} +\def\titlefont#1{{\titlefonts\rmisbold #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{17pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + +% Define these just so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% --karl, 24jan03. + +% Set up the default fonts, so we can use them for creating boxes. +% +\definetextfontsizexi + + +\message{markup,} + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will +% define and register \INITMACRO to be called on markup style changes. +% \INITMACRO can check \currentmarkupstyle for the innermost +% style and the set of \ifmarkupSTYLE switches for all styles +% currently in effect. +\newif\ifmarkupvar +\newif\ifmarkupsamp +\newif\ifmarkupkey +%\newif\ifmarkupfile % @file == @samp. +%\newif\ifmarkupoption % @option == @samp. +\newif\ifmarkupcode +\newif\ifmarkupkbd +%\newif\ifmarkupenv % @env == @code. +%\newif\ifmarkupcommand % @command == @code. +\newif\ifmarkuptex % @tex (and part of @math, for now). +\newif\ifmarkupexample +\newif\ifmarkupverb +\newif\ifmarkupverbatim + +\let\currentmarkupstyle\empty + +\def\setupmarkupstyle#1{% + \csname markup#1true\endcsname + \def\currentmarkupstyle{#1}% + \markupstylesetup +} + +\let\markupstylesetup\empty + +\def\defmarkupstylesetup#1{% + \expandafter\def\expandafter\markupstylesetup + \expandafter{\markupstylesetup #1}% + \def#1% +} + +% Markup style setup for left and right quotes. +\defmarkupstylesetup\markupsetuplq{% + \expandafter\let\expandafter \temp + \csname markupsetuplq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuplqdefault \else \temp \fi +} + +\defmarkupstylesetup\markupsetuprq{% + \expandafter\let\expandafter \temp + \csname markupsetuprq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuprqdefault \else \temp \fi +} + +{ +\catcode`\'=\active +\catcode`\`=\active + +\gdef\markupsetuplqdefault{\let`\lq} +\gdef\markupsetuprqdefault{\let'\rq} + +\gdef\markupsetcodequoteleft{\let`\codequoteleft} +\gdef\markupsetcodequoteright{\let'\codequoteright} +} + +\let\markupsetuplqcode \markupsetcodequoteleft +\let\markupsetuprqcode \markupsetcodequoteright +% +\let\markupsetuplqexample \markupsetcodequoteleft +\let\markupsetuprqexample \markupsetcodequoteright +% +\let\markupsetuplqkbd \markupsetcodequoteleft +\let\markupsetuprqkbd \markupsetcodequoteright +% +\let\markupsetuplqsamp \markupsetcodequoteleft +\let\markupsetuprqsamp \markupsetcodequoteright +% +\let\markupsetuplqverb \markupsetcodequoteleft +\let\markupsetuprqverb \markupsetcodequoteright +% +\let\markupsetuplqverbatim \markupsetcodequoteleft +\let\markupsetuprqverbatim \markupsetcodequoteright + +% Allow an option to not use regular directed right quote/apostrophe +% (char 0x27), but instead the undirected quote from cmtt (char 0x0d). +% The undirected quote is ugly, so don't make it the default, but it +% works for pasting with more pdf viewers (at least evince), the +% lilypond developers report. xpdf does work with the regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi + \else \char'22 \fi +} + +% Commands to set the quote options. +% +\parseargdef\codequoteundirected{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% + \fi\fi +} +% +\parseargdef\codequotebacktick{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% + \fi\fi +} + +% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. +\def\noligaturesquoteleft{\relax\lq} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Font commands. + +% #1 is the font command (\sl or \it), #2 is the text to slant. +% If we are in a monospaced environment, however, 1) always use \ttsl, +% and 2) do not add an italic correction. +\def\dosmartslant#1#2{% + \ifusingtt + {{\ttsl #2}\let\next=\relax}% + {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% + \next +} +\def\smartslanted{\dosmartslant\sl} +\def\smartitalic{\dosmartslant\it} + +% Output an italic correction unless \next (presumed to be the following +% character) is such as not to need one. +\def\smartitaliccorrection{% + \ifx\next,% + \else\ifx\next-% + \else\ifx\next.% + \else\ifx\next\.% + \else\ifx\next\comma% + \else\ptexslash + \fi\fi\fi\fi\fi + \aftersmartic +} + +% Unconditional use \ttsl, and no ic. @var is set to this for defuns. +\def\ttslanted#1{{\ttsl #1}} + +% @cite is like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} + +\def\aftersmartic{} +\def\var#1{% + \let\saveaftersmartic = \aftersmartic + \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% + \smartslanted{#1}% +} + +\let\i=\smartitalic +\let\slanted=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @b, explicit bold. Also @strong. +\def\b#1{{\bf #1}} +\let\strong=\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\plainfrenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + } +\catcode`@=\other +\def\endofsentencespacefactor{3000}% default + +% @t, explicit typewriter. +\def\t#1{% + {\tt \rawbackslash \plainfrenchspacing #1}% + \null +} + +% @samp. +\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} + +% @indicateurl is \samp, that is, with quotes. +\let\indicateurl=\samp + +% @code (and similar) prints in typewriter, but with spaces the same +% size as normal in the surrounding text, without hyphenation, etc. +% This is a subroutine for that. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \plainfrenchspacing + #1% + }% + \null % reset spacefactor to 1000 +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% (But see \codedashfinish below.) +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. +% +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. -- rms. +{ + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active + \global\let'=\rq \global\let`=\lq % default definitions + % + \global\def\code{\begingroup + \setupmarkupstyle{code}% + % The following should really be moved into \setupmarkupstyle handlers. + \catcode\dashChar=\active \catcode\underChar=\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\normaldash + \let_\realunder + \fi + % Given -foo (with a single dash), we do not want to allow a break + % after the hyphen. + \global\let\codedashprev=\codedash + % + \codex + } + % + \gdef\codedash{\futurelet\next\codedashfinish} + \gdef\codedashfinish{% + \normaldash % always output the dash character itself. + % + % Now, output a discretionary to allow a line break, unless + % (a) the next character is a -, or + % (b) the preceding character is a -. + % E.g., given --posix, we do not want to allow a break after either -. + % Given --foo-bar, we do want to allow a break between the - and the b. + \ifx\next\codedash \else + \ifx\codedashprev\codedash + \else \discretionary{}{}{}\fi + \fi + % we need the space after the = for the case when \next itself is a + % space token; it would get swallowed otherwise. As in @code{- a}. + \global\let\codedashprev= \next + } +} +\def\normaldash{-} +% +\def\codex #1{\tclose{#1}\endgroup} + +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} + +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is bad. +% @allowcodebreaks provides a document-level way to turn breaking at - +% and _ on and off. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp = \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% + \fi\fi +} + +% For @command, @env, @file, @option quotes seem unnecessary, +% so use \code rather than \samp. +\let\command=\code +\let\env=\code +\let\file=\code +\let\option=\code + +% @uref (abbreviation for `urlref') aka @url 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. + +% TeX-only option to allow changing PDF output to show only the second +% arg (if given), and not the url (which is then just the link target). +\newif\ifurefurlonlylink + +% The main macro is \urefbreak, which allows breaking at expected +% places within the url. (There used to be another version, which +% didn't support automatic breaking.) +\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} +\let\uref=\urefbreak +% +\def\dourefbreak#1{\urefbreakfinish #1,,,\finish} +\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% look for second arg + \ifdim\wd0 > 0pt + \ifpdf + \ifurefurlonlylink + % PDF plus option to not display url, show just arg + \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. + \unhbox0\ (\urefcode{#1})% + \fi + \else + \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \fi + \else + \urefcode{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% Allow line breaks around only a few characters (only). +\def\urefcatcodes{% + \catcode\ampChar=\active \catcode\dotChar=\active + \catcode\hashChar=\active \catcode\questChar=\active + \catcode\slashChar=\active +} +{ + \urefcatcodes + % + \global\def\urefcode{\begingroup + \setupmarkupstyle{code}% + \urefcatcodes + \let&\urefcodeamp + \let.\urefcodedot + \let#\urefcodehash + \let?\urefcodequest + \let/\urefcodeslash + \codex + } + % + % By default, they are just regular characters. + \global\def&{\normalamp} + \global\def.{\normaldot} + \global\def#{\normalhash} + \global\def?{\normalquest} + \global\def/{\normalslash} +} + +% we put a little stretch before and after the breakable chars, to help +% line breaking of long url's. The unequal skips make look better in +% cmtt at least, especially for dots. +\def\urefprestretchamount{.13em} +\def\urefpoststretchamount{.1em} +\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax} +\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax} +% +\def\urefcodeamp{\urefprestretch \&\urefpoststretch} +\def\urefcodedot{\urefprestretch .\urefpoststretch} +\def\urefcodehash{\urefprestretch \#\urefpoststretch} +\def\urefcodequest{\urefprestretch ?\urefpoststretch} +\def\urefcodeslash{\futurelet\next\urefcodeslashfinish} +{ + \catcode`\/=\active + \global\def\urefcodeslashfinish{% + \urefprestretch \slashChar + % Allow line break only after the final / in a sequence of + % slashes, to avoid line break between the slashes in http://. + \ifx\next/\else \urefpoststretch \fi + } +} + +% One more complication: by default we'll break after the special +% characters, but some people like to break before the special chars, so +% allow that. Also allow no breaking at all, for manual control. +% +\parseargdef\urefbreakstyle{% + \def\txiarg{#1}% + \ifx\txiarg\wordnone + \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordbefore + \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordafter + \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} + \else + \errhelp = \EMsimple + \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\wordafter{after} +\def\wordbefore{before} +\def\wordnone{none} + +\urefbreakstyle after + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\txiarg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\txiarg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct'. +\kbdinputstyle distinct + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. +\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} + +\def\xkey{\key} +\def\kbdsub#1#2#3\par{% + \def\one{#1}\def\three{#3}\def\threex{??}% + \ifx\one\xkey\ifx\threex\three \key{#2}% + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +} + +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\setfont\keyrm\rmshape{8}{1000}{OT1} +%\font\keysy=cmsy9 +%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +% \vbox{\hrule\kern-0.4pt +% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +% \kern-0.4pt\hrule}% +% \kern-.06em\raise0.4pt\hbox{\angleright}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} + +% @clicksequence{File @click{} Open ...} +\def\clicksequence#1{\begingroup #1\endgroup} + +% @clickstyle @arrow (by default) +\parseargdef\clickstyle{\def\click{#1}} +\def\click{\arrow} + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ = \active + \gdef\mathunderscore{% + \catcode`\_=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a math (or tt) \. +% FYI, plain.tex uses \\ as a temporary control sequence (for no +% particular reason), but this is not advertised and we don't care. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + % have to provide another name for sup operator + \let\mathopsup=\sup + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \catcode`' = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + \let' = \ptexquoteright + } +} + +% for @sub and @sup, if in math mode, just do a normal sub/superscript. +% If in text, use math to place as sub/superscript, but switch +% into text mode, with smaller fonts. This is a different font than the +% one used for real math sub/superscripts (8pt vs. 7pt), but let's not +% fix it (significant additions to font machinery) until someone notices. +% +\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} +\def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}% +% +\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} +\def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}% + +% ctrl is no longer a Texinfo command, but leave this definition for fun. +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. +% Ignore unless FMTNAME == tex; then it is like @iftex and @tex, +% except specified as a normal braced arg, so no newlines to worry about. +% +\def\outfmtnametex{tex} +% +\long\def\inlinefmt#1{\doinlinefmt #1,\finish} +\long\def\doinlinefmt#1,#2,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi +} +% +% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if +% FMTNAME is tex, else ELSE-TEXT. +\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} +\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi +} +% +% For raw, must switch into @tex before parsing the argument, to avoid +% setting catcodes prematurely. Doing it this way means that, for +% example, @inlineraw{html, foo{bar} gets a parse error instead of being +% ignored. But this isn't important because if people want a literal +% *right* brace they would have to use a command anyway, so they may as +% well use a command to get a left brace too. We could re-use the +% delimiter character idea from \verb, but it seems like overkill. +% +\long\def\inlineraw{\tex \doinlineraw} +\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} +\def\doinlinerawtwo#1,#2,\finish{% + \def\inlinerawname{#1}% + \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi + \endgroup % close group opened by \tex. +} + +% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. +% +\long\def\inlineifset#1{\doinlineifset #1,\finish} +\long\def\doinlineifset#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax + \else\ignorespaces#2\fi +} + +% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. +% +\long\def\inlineifclear#1{\doinlineifclear #1,\finish} +\long\def\doinlineifclear#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi +} + + +\message{glyphs,} +% and logos. + +% @@ prints an @, as does @atchar{}. +\def\@{\char64 } +\let\atchar=\@ + +% @{ @} @lbracechar{} @rbracechar{} all generate brace characters. +% Unless we're in typewriter, use \ecfont because the CM text fonts do +% not have braces, and we don't want to switch into math. +\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} +\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} +\let\{=\mylbrace \let\lbracechar=\{ +\let\}=\myrbrace \let\rbracechar=\} +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux/toc files. + \catcode`\{ = \other \catcode`\} = \other + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. +\let\, = \ptexc +\let\dotaccent = \ptexdot +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \ptext +\let\ubaraccent = \ptexb +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi + \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{% + \ifx\textnominalsize\xwordpt + % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. + % Revert to plain's \scriptsize, which is 7pt. + \count255=\the\fam $\fam\count255 \scriptstyle A$% + \else + % For 11pt, we can use our lllsize. + \selectfonts\lllsize A% + \fi + }% + \vss + }}% + \kern-.15em + \TeX +} + +% Some math mode symbols. +\def\bullet{$\ptexbullet$} +\def\geq{\ifmmode \ge\else $\ge$\fi} +\def\leq{\ifmmode \le\else $\le$\fi} +\def\minus{\ifmmode -\else $-$\fi} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=\endofsentencespacefactor +} + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, they should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} +\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% Glyphs from the EC fonts. We don't use \let for the aliases, because +% sometimes we redefine the original macro, and the alias should reflect +% the redefinition. +% +% Use LaTeX names for the Icelandic letters. +\def\DH{{\ecfont \char"D0}} % Eth +\def\dh{{\ecfont \char"F0}} % eth +\def\TH{{\ecfont \char"DE}} % Thorn +\def\th{{\ecfont \char"FE}} % thorn +% +\def\guillemetleft{{\ecfont \char"13}} +\def\guillemotleft{\guillemetleft} +\def\guillemetright{{\ecfont \char"14}} +\def\guillemotright{\guillemetright} +\def\guilsinglleft{{\ecfont \char"0E}} +\def\guilsinglright{{\ecfont \char"0F}} +\def\quotedblbase{{\ecfont \char"12}} +\def\quotesinglbase{{\ecfont \char"0D}} +% +% This positioning is not perfect (see the ogonek LaTeX package), but +% we have the precomposed glyphs for the most common cases. We put the +% tests to use those glyphs in the single \ogonek macro so we have fewer +% dummy definitions to worry about for index entries, etc. +% +% ogonek is also used with other letters in Lithuanian (IOU), but using +% the precomposed glyphs for those is not so easy since they aren't in +% the same EC font. +\def\ogonek#1{{% + \def\temp{#1}% + \ifx\temp\macrocharA\Aogonek + \else\ifx\temp\macrochara\aogonek + \else\ifx\temp\macrocharE\Eogonek + \else\ifx\temp\macrochare\eogonek + \else + \ecfont \setbox0=\hbox{#1}% + \ifdim\ht0=1ex\accent"0C #1% + \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% + \fi + \fi\fi\fi\fi + }% +} +\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} +\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} +\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} +\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} +% +% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. +\def\ecfont{% + % We can't distinguish serif/sans and italic/slanted, but this + % is used for crude hacks anyway (like adding French and German + % quotes to documents typeset with CM, where we lose kerning), so + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% + \ifmonospace + % typewriter: + \font\thisecfont = ectt\ecsize \space at \nominalsize + \else + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi + \fi + \thisecfont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\thisisundefined +\def\Orb{\mathhexbox20D} +\fi + +% Quotes. +\chardef\quotedblleft="5C +\chardef\quotedblright=`\" +\chardef\quoteleft=`\` +\chardef\quoteright=`\' + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + +\parseargdef\shorttitlepage{% + \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page = \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +% Settings used for typesetting titles: no hyphenation, no indentation, +% don't worry much about spacing, ragged right. This should be used +% inside a \vbox, and fonts need to be set appropriately first. Because +% it is always used for titles, nothing else, we call \rmisbold. \par +% should be specified before the end of the \vbox, since a vbox is a group. +% +\def\raggedtitlesettings{% + \rmisbold + \hyphenpenalty=10000 + \parindent=0pt + \tolerance=5000 + \ptexraggedright +} + +% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\parseargdef\title{% + \checkenv\titlepage + \vbox{\titlefonts \raggedtitlesettings #1\par}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\secfonts\rmisbold \leftline{#1}}% + \fi +} + + +% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make TeX use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + +% @evenheadingmarks top \thischapter <- chapter at the top of a page +% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page +% +% The same set of arguments for: +% +% @oddheadingmarks +% @evenfootingmarks +% @oddfootingmarks +% @everyheadingmarks +% @everyfootingmarks + +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} + \headingmarks{odd}{footing}{#1} } +% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. +\def\headingmarks#1#2#3 {% + \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname + \global\expandafter\let\csname get#1#2marks\endcsname \temp +} + +\everyheadingmarks bottom +\everyfootingmarks bottom + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\headingsoff{% non-global headings elimination + \evenheadline={\hfil}\evenfootline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}% +} + +\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting +\HEADINGSoff % it's the default + +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\thisisundefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil\relax + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + % + % Try typesetting the item mark so that if the document erroneously says + % something like @itemize @samp (intending @table), there's an error + % right away at the @itemize. It's not the best error message in the + % world, but it's better than leaving it to the @item. This means if + % the user wants an empty mark, they have to say @w{} not just @w. + \def\itemcontents{#1}% + \setbox0 = \hbox{\itemcontents}% + % + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + % + \let\item=\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + % + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a <number>. + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. Assignments +% have to be global since we are inside the implicit group of an +% alignment entry. \everycr below resets \everytab so we don't have to +% undo it ourselves. +\def\headitemfont{\b}% for people to use in the template row; not changeable +\def\headitem{% + \checkenv\multitable + \crcr + \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings + \global\everytab={\bf}% can't use \headitemfont since the parsing differs + \the\everytab % for the first item +}% +% +% default for tables with no headings. +\let\headitemcrhook=\relax +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we again encounter the problem the 1sp was intended to solve. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + % + \everycr = {% + \noalign{% + \global\everytab={}% Reset from possible headitem. + \global\colcount=0 % Reset the column counter. + % + % Check for saved footnotes, etc.: + \checkinserts + % + % Perhaps a \nobreak, then reset: + \headitemcrhook + \global\let\headitemcrhook=\relax + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +% Test to see if parskip is larger than space between lines of +% table. If not, do nothing. +% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\-=\active \catcode`\_=\active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\normaldash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +% Unfortunately, this has the consequence that when _ is in the *value* +% of an @set, it does not print properly in the roman fonts (get the cmr +% dot accent at position 126 instead). No fix comes to mind, and it's +% been this way since 2003 or earlier, so just ignore it. +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get the special treatment we need for `@end ifset,' we call +% \makecond and then redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end executes the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written +% without the @) is in fact defined. We can only feasibly check at the +% TeX level, so something like `mathcode' is going to considered +% defined even though it is not a Texinfo command. +% +\makecond{ifcommanddefined} +\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} +% +\def\doifcmddefined#1#2{{% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname #2\endcsname\relax + #1% If not defined, \let\next as above. + \fi + \expandafter + }\next +} +\def\ifcmddefinedfail{\doignore{ifcommanddefined}} + +% @ifcommandnotdefined CMD ... handled similar to @ifclear above. +\makecond{ifcommandnotdefined} +\def\ifcommandnotdefined{% + \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} +\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} + +% Set the `txicommandconditionals' variable, so documents have a way to +% test if the @ifcommand...defined conditionals are available. +\set txicommandconditionals + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \relax + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % + % Need these unexpandable (because we define \tt as a dummy) + % definitions when @{ or @} appear in index entry text. Also, more + % complicated, when \tex is in effect and \{ is a \delimiter again. + % We can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. Perhaps we + % should use @lbracechar and @rbracechar? + \def\{{{\tt\char123}}% + \def\}{{\tt\char125}}% + % + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % This is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty + % + % Do the redefinitions. + \commondummies +} + +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % Do the redefinitions. + \commondummies + \otherbackslash +} + +% Called from \indexdummies and \atdummies. +% +\def\commondummies{% + % + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter + % + \commondummiesnofonts + % + \definedummyletter\_% + \definedummyletter\-% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\DH + \definedummyword\L + \definedummyword\O + \definedummyword\OE + \definedummyword\TH + \definedummyword\aa + \definedummyword\ae + \definedummyword\dh + \definedummyword\exclamdown + \definedummyword\l + \definedummyword\o + \definedummyword\oe + \definedummyword\ordf + \definedummyword\ordm + \definedummyword\questiondown + \definedummyword\ss + \definedummyword\th + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX + % + % Assorted special characters. + \definedummyword\arrow + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\entrybreak + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\expansion + \definedummyword\geq + \definedummyword\guillemetleft + \definedummyword\guillemetright + \definedummyword\guilsinglleft + \definedummyword\guilsinglright + \definedummyword\lbracechar + \definedummyword\leq + \definedummyword\minus + \definedummyword\ogonek + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\quotedblbase + \definedummyword\quotedblleft + \definedummyword\quotedblright + \definedummyword\quoteleft + \definedummyword\quoteright + \definedummyword\quotesinglbase + \definedummyword\rbracechar + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + % + \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ogonek + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sansserif + \definedummyword\sc + \definedummyword\slanted + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\abbr + \definedummyword\acronym + \definedummyword\anchor + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\dmn + \definedummyword\email + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\image + \definedummyword\indicateurl + \definedummyword\inforef + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref + % + % Consider: + % @macro mkind{arg1,arg2} + % @cindex \arg2\ + % @end macro + % @mkind{foo, bar} + % The space after the comma will end up in the temporary definition + % that we make for arg2 (see \parsemargdef ff.). We want all this to be + % expanded for the sake of the index, so we end up just seeing "bar". + \let\xeatspaces = \eatspaces +} + +% For testing: output @{ and @} in index sort strings as \{ and \}. +\newif\ifusebracesinindexes + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\definedummyletter##1{\let##1\empty}% + % All control words become @asis by default; overrides below. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + \def\_{\normalunderscore}% + \def\-{}% @- shouldn't affect sorting + % + % Unfortunately, texindex is not prepared to handle braces in the + % content at all. So for index sorting, we map @{ and @} to strings + % starting with |, since that ASCII character is between ASCII { and }. + \ifusebracesinindexes + \def\lbracechar{\lbracecmd}% + \def\rbracechar{\rbracecmd}% + \else + \def\lbracechar{|a}% + \def\rbracechar{|b}% + \fi + \let\{=\lbracechar + \let\}=\rbracechar + % + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\DH{DZZ}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\TH{ZZZ}% + \def\aa{aa}% + \def\ae{ae}% + \def\dh{dzz}% + \def\exclamdown{!}% + \def\l{l}% + \def\oe{oe}% + \def\ordf{a}% + \def\ordm{o}% + \def\o{o}% + \def\questiondown{?}% + \def\ss{ss}% + \def\th{zzz}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\arrow{->}% + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{==>}% + \def\geq{>=}% + \def\guillemetleft{<<}% + \def\guillemetright{>>}% + \def\guilsinglleft{<}% + \def\guilsinglright{>}% + \def\leq{<=}% + \def\minus{-}% + \def\point{.}% + \def\pounds{pounds}% + \def\print{-|}% + \def\quotedblbase{"}% + \def\quotedblleft{"}% + \def\quotedblright{"}% + \def\quoteleft{`}% + \def\quoteright{'}% + \def\quotesinglbase{,}% + \def\registeredsymbol{R}% + \def\result{=>}% + \def\textdegree{o}% + % + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax + \else \indexlquoteignore \fi + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist +} + +% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us +% ignore left quotes in the sort term. +{\catcode`\`=\active + \gdef\indexlquoteignore{\let`=\empty}} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{\ifhmode + #1% + \else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\whatsitskip glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip +}} + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this freezes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % When reading the text of entry, convert explicit line breaks + % from @* into spaces. The user might give these in long section + % titles, for instance. + \def\*{\unskip\space\ignorespaces}% + \def\entrybreak{\hfil\break}% + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\entrybreak{\unskip\space\ignorespaces}% +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt + \ % + \else + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi + \fi + \par + \endgroup +} + +% Like plain.tex's \dotfill, except uses up at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % + \output = {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% Let's start with @part. +\outer\parseargdef\part{\partzzz{#1}} +\def\partzzz#1{% + \chapoddpage + \null + \vskip.3\vsize % move it down on the page a bit + \begingroup + \noindent \titlefonts\rmisbold #1\par % the text + \let\lastnode=\empty % no node to associate with + \writetocentry{part}{#1}{}% but put it in the toc + \headingsoff % no headline or footline on the part page + \chapoddpage + \endgroup +} + +% \unnumberedno is an oxymoron. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines these (using marks) as the number+name, number +% and name of the chapter. Page headings and footings can use +% these. @section does likewise. +\def\thischapter{} +\def\thischapternum{} +\def\thischaptername{} +\def\thissection{} +\def\thissectionnum{} +\def\thissectionname{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achieve this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unnlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 + \else + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unnlevel + \chardef\unnlevel = \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unnlevel + \def\headtype{U}% + \else + \chardef\unnlevel = 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + % \putwordChapter can contain complex things in translations. + \toks0=\expandafter{\putwordChapter}% + \message{\the\toks0 \space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz +% +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + % \putwordAppendix can contain complex things in translations. + \toks0=\expandafter{\putwordAppendix}% + \message{\the\toks0 \space \appendixletter}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +% normally unnmhead0 calls unnumberedzzz: +\outer\parseargdef\unnumbered{\unnmhead0{#1}} +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the<toks register> to achieve this: TeX expands \the<toks> only once, + % simply yielding the contents of <toks register>. (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +% +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +% normally calls appendixsectionzzz: +\outer\parseargdef\appendixsection{\apphead1{#1}} +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +% normally calls unnumberedseczzz: +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +% +% normally calls numberedsubseczzz: +\outer\parseargdef\numberedsubsec{\numhead2{#1}} +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +% normally calls appendixsubseczzz: +\outer\parseargdef\appendixsubsec{\apphead2{#1}} +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +% normally calls unnumberedsubseczzz: +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +% +% normally numberedsubsubseczzz: +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally appendixsubsubseczzz: +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally unnumberedsubsubseczzz: +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip \nobreak + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +% Parameter controlling skip before chapter headings (if needed) +\newskip\chapheadingskip + +% Define plain chapter starts, and page on/off switching for it. +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +% Because \domark is called before \chapoddpage, the filler page will +% get the headings for the next chapter, which is wrong. But we don't +% care -- we just disable all headings on the filler page. +\def\chapoddpage{% + \chappager + \ifodd\pageno \else + \begingroup + \headingsoff + \null + \chappager + \endgroup + \fi +} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% Not used for @heading series. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yappendixkeyword{Yappendix} +\def\Yomitfromtockeyword{Yomitfromtoc} +% +\def\chapmacro#1#2#3{% + \checkenv{}% chapters, etc., should not start inside an environment. + % + % Insert the first mark before the heading break (see notes for \domark). + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + % \noexpand\putwordAppendix avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \else + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + % \noexpand\putwordChapter avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordChapter{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert the chapter heading break. + \pchapsepmacro + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \domark + % + {% + \chapfonts \rmisbold + \let\footnote=\errfootnoteheading % give better error message + % + % Have to define \lastsection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\lastsection{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. + \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} + + +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% + \nobreak\bigskip \nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text of the title, +% #2 is the section level (sec/subsec/subsubsec), +% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), +% #4 is the section number. +% +\def\seckeyword{sec} +% +\def\sectionheading#1#2#3#4{% + {% + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % It is ok for the @heading series commands to appear inside an + % environment (it's been historically allowed, though the logic is + % dubious), but not the others. + \ifx\temptype\Yomitfromtockeyword\else + \checkenv{}% non-@*heading should not be in an environment. + \fi + \let\footnote=\errfootnoteheading + % + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rmisbold + % + % Insert first mark before the heading break (see notes for \domark). + \let\prevsectiondefs=\lastsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword + % Don't redefine \thissection. + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \fi\fi\fi + % + % Go into vertical mode. Usually we'll already be there, but we + % don't want the following whatsit to end up in a preceding paragraph + % if the document didn't happen to have a blank line. + \par + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \global\let\prevsectiondefs=\lastsectiondefs + \domark + % + % Only insert the space after the number if we have a section number. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\lastsection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \lastsection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\lastsection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\lastsection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) However, when a paragraph is not started next + % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out + % or the negative glue will cause weirdly wrong output, typically + % obscuring the section heading with something else. + \vskip-\parskip + % + % This is so the last item on the main vertical list is a known + % \penalty > 10000, so \startdefun, etc., can recognize the situation + % and do the needful. + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=\active + \catcode`\$=\active + \catcode`\<=\active + \catcode`\>=\active + \catcode`\\=\active + \catcode`\^=\active + \catcode`\_=\active + \catcode`\|=\active + \catcode`\~=\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \tocreadfilename +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund <tege@matematik.su.se> + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi +} + +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} + +% Normal (long) toc. +% +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\partentry = \shortpartentry + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} +\let\shortcontents = \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Parts, in the main contents. Replace the part number, which doesn't +% exist, with an empty box. Let's hope all the numbers have the same width. +% Also ignore the page number, which is conventionally not printed. +\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} +\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} +% +% Parts, in the short toc. +\def\shortpartentry#1#2#3#4{% + \penalty-300 + \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip + \shortchapentry{{\bf #1}}{\numeralbox}{}{}% +} + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @tex ... @end tex escapes into raw TeX temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain @ character. + +\envdef\tex{% + \setupmarkupstyle{tex}% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie + \catcode `\%=14 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other + \catcode `\`=\other + \catcode `\'=\other + \escapechar=`\\ + % + % ' is active in math mode (mathcode"8000). So reset it, and all our + % other math active characters (just in case), to plain's definitions. + \mathactive + % + % Inverse of the list at the beginning of the file. + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\/=\ptexslash + \let\sp=\ptexsp + \let\*=\ptexstar + %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode + \let\t=\ptext + \expandafter \let\csname top\endcsname=\ptextop % we've made it outer + \let\frenchspacing=\plainfrenchspacing + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % + % If this cartouche directly follows a sectioning command, we need the + % \parskip glue (backspaced over by default) or the cartouche can + % collide with the section heading. + \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi + % + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\newdimen\nonfillparindent +\def\nonfillstart{% + \aboveenvbreak + \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + % Turn off paragraph indentation but redefine \indent to emulate + % the normal \indent. + \nonfillparindent=\parindent + \parindent = 0pt + \let\indent\nonfillindent + % + \emergencystretch = 0pt % don't try to avoid overfull boxes + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \let\exdent=\nofillexdent +} + +\begingroup +\obeyspaces +% We want to swallow spaces (but not other tokens) after the fake +% @indent in our nonfill-environments, where spaces are normally +% active and set to @tie, resulting in them not being ignored after +% @indent. +\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% +\gdef\nonfillindentcheck{% +\ifx\temp % +\expandafter\nonfillindentgobble% +\else% +\leavevmode\nonfillindentbox% +\fi% +}% +\endgroup +\def\nonfillindentgobble#1{\nonfillindent} +\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it in one command. #1 is the env name, #2 the definition. +\def\makedispenvdef#1#2{% + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two environment synonyms (#1 and #2) for an environment. +\def\maketwodispenvdef#1#2#3{% + \makedispenvdef{#1}{#3}% + \makedispenvdef{#2}{#3}% +} +% +% @lisp: indented, narrowed, typewriter font; +% @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvdef{lisp}{example}{% + \nonfillstart + \tt\setupmarkupstyle{example}% + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenvdef{display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenvdef{format}{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing = t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill\relax + \gobble +} +\let\Eflushright = \afterenvbreak + + +% @raggedright does more-or-less normal line breaking but no right +% justification. From plain.tex. Don't stretch around special +% characters in urls in this environment, since the stretch at the right +% should be enough. +\envdef\raggedright{% + \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax + \def\urefprestretchamount{0pt}% + \def\urefpoststretchamount{0pt}% +} +\let\Eraggedright\par + +\envdef\raggedleft{% + \parindent=0pt \leftskip0pt plus2em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedleft\par + +\envdef\raggedcenter{% + \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedcenter\par + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\makedispenvdef{quotation}{\quotationstart} +% +\def\quotationstart{% + \indentedblockstart % same as \indentedblock, but increase right margin too. + \ifx\nonarrowing\relax + \advance\rightskip by \lispnarrowing + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\thisisundefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallquotation{\Equotation} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + +% @indentedblock is like @quotation, but indents only on the left and +% has no optional argument. +% +\makedispenvdef{indentedblock}{\indentedblockstart} +% +\def\indentedblockstart{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \exdentamount = \lispnarrowing + \else + \let\nonarrowing = \relax + \fi +} + +% Keep a nonzero parskip for the environment, since we're doing normal filling. +% +\def\Eindentedblock{% + \par + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallindentedblock{\Eindentedblock} + + +% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} +% If we want to allow any <char> as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% + % Don't do the quotes -- if we do, @set txicodequoteundirected and + % @set txicodequotebacktick will not have effect on @verb and + % @verbatim, and ?` and !` ligatures won't get disabled. + %\do\`\do\'% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \setupmarkupstyle{verb}% + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion. +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +% We typeset each line of the verbatim in an \hbox, so we can handle +% tabs. The \global is in case the verbatim line starts with an accent, +% or some other command that starts with a begin-group. Otherwise, the +% entire \verbbox would disappear at the corresponding end-group, before +% it is typeset. Meanwhile, we can't have nested verbatim commands +% (can we?), so the \global won't be overwriting itself. +\newbox\verbbox +\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} +% +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab + \divide\dimen\verbbox by\tabw + \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw + \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw + \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox + }% + } +\endgroup + +% start the verbatim environment. +\def\setupverbatim{% + \let\nonarrowing = t% + \nonfillstart + \tt % easiest (and conventionally used) font for verbatim + % The \leavevmode here is for blank lines. Otherwise, we would + % never \starttabox and the \egroup would end verbatim mode. + \def\par{\leavevmode\egroup\box\verbbox\endgraf}% + \tabexpand + \setupmarkupstyle{verbatim}% + % Respect line breaks, + % print special symbols as themselves, and + % make each space count. + % Must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'<char>#1<char>'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deflastargmargin \deflastargmargin=18pt +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a further refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil\relax + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remaining is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \doingtypefnfalse % distinguish typed functions from all else + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +\newif\ifdoingtypefn % doing typed function? +\newif\ifrettypeownline % typeset return type on its own line? + +% @deftypefnnewline on|off says whether the return type of typed functions +% are printed on their own line. This affects @deftypefn, @deftypefun, +% @deftypeop, and @deftypemethod. +% +\parseargdef\deftypefnnewline{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @txideftypefnnl value `\temp', + must be on|off}% + \fi\fi +} + +% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \doingtypefntrue + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +% Types: + +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + \par + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % Determine if we are typesetting the return type of a typed function + % on a line by itself. + \rettypeownlinefalse + \ifdoingtypefn % doing a typed function specifically? + % then check user option for putting return type on its own line: + \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else + \rettypeownlinetrue + \fi + \fi + % + % How we'll format the category name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. We'll always have at + % least two. + \tempnum = 2 + % + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % + % If doing a return type on its own line, we'll have another line. + \ifrettypeownline + \advance\tempnum by 1 + \def\maybeshapeline{0in \hsize}% + \else + \def\maybeshapeline{}% + \fi + % + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % + % The final paragraph shape: + \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 + % + % Put the category name at the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% text of the return type + \ifx\temp\empty\else + \tclose{\temp}% typeset the return type + \ifrettypeownline + % put return type on its own line; prohibit line break following: + \hfil\vadjust{\nobreak}\break + \else + \space % type on same line, so just followed by a space + \fi + \fi % no return type + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. We used to recommend @var for that, so + % leave the code in, but it's strange for @var to lead to typewriter. + % Nowadays we recommend @code, since the difference between a ttsl hyphen + % and a tt hyphen is pretty tiny. @code also disables ?` !`. + \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +% these should not use \errmessage; the glibc manual, at least, actually +% has such constructs (when documenting function pointers). +\def\badparencount{% + \message{Warning: unbalanced parentheses in @def...}% + \global\parencount=0 +} +\def\badbrackcount{% + \message{Warning: unbalanced square brackets in @def...}% + \global\brackcount=0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\thisisundefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{\begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % + % ... and for \example: + \spaceisspace + % + % The \empty here causes a following catcode 5 newline to be eaten as + % part of reading whitespace after a control sequence. It does not + % eat a catcode 13 newline. There's no good way to handle the two + % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX + % would then have different behavior). See the Macro Details node in + % the manual for the workaround we recommend for macros and + % line-oriented commands. + % + \scantokens{#1\empty}% +\endgroup} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} + +% Utility routines. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=\other \catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \ +% to recognize macro arguments; this is the job of \mbodybackslash. +% +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. +% +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. +% +\def\scanctxt{% used as subroutine + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi +} + +\def\scanargctxt{% used for copying and captions, not macros. + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% used for @macro definitions + \scanctxt + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +\def\macroargctxt{% used when scanning invocations + \scanctxt + \catcode`\\=0 +} +% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" +% for the single characters \ { }. Thus, we end up with the "commands" +% that would be written @\ @{ @} in a Texinfo document. +% +% We already have @{ and @}. For @\, we define it here, and only for +% this purpose, to produce a typewriter backslash (so, the @\ that we +% define for @math can't be used with @macro calls): +% +\def\\{\normalbackslash}% +% +% We would like to do this for \, too, since that is what makeinfo does. +% But it is not possible, because Texinfo already has a command @, for a +% cedilla accent. Documents must use @comma{} instead. +% +% \anythingelse will almost certainly be an error of some kind. + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. +% +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\margbackslash#1{\char`\#1 } + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0\relax + \else + \expandafter\parsemargdef \argl;% + \if\paramno>256\relax + \ifx\eTeXversion\thisisundefined + \errhelp = \EMsimple + \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} + \fi + \fi + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + \addtomacrolist{\the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\definedummyword\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx #1\relax + % remove this + \else + \noexpand\definedummyword \noexpand#1% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% <parameter list> is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname#1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% For macro processing make @ a letter so that we can make Texinfo private macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH +% in the params list to some hook where the argument is to be expanded. If +% there are less than 10 arguments that hook is to be replaced by ##N where N +% is the position in that list, that is to say the macro arguments are to be +% defined `a la TeX in the macro body. +% +% That gets used by \mbodybackslash (above). +% +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. +% +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime underwhich the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, no macro can have more than 256 arguments (else error). +\def\parsemargdef#1;{% + \paramno=0\def\paramlist{}% + \let\hash\relax + \let\xeatspaces\relax + \parsemargdefxxx#1,;,% + % In case that there are 10 or more arguments we parse again the arguments + % list to set new definitions for the \macarg.BLAH macros corresponding to + % each BLAH argument. It was anyhow needed to parse already once this list + % in order to count the arguments, and as macros with at most 9 arguments + % are by far more frequent than macro with 10 or more arguments, defining + % twice the \macarg.BLAH macros does not cost too much processing power. + \ifnum\paramno<10\relax\else + \paramno0\relax + \parsemmanyargdef@@#1,;,% 10 or more arguments + \fi +} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1 + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +\def\parsemmanyargdef@@#1,{% + \if#1;\let\next=\relax + \else + \let\next=\parsemmanyargdef@@ + \edef\tempb{\eatspaces{#1}}% + \expandafter\def\expandafter\tempa + \expandafter{\csname macarg.\tempb\endcsname}% + % Note that we need some extra \noexpand\noexpand, this is because we + % don't want \the to be expanded in the \parsermacbody as it uses an + % \xdef . + \expandafter\edef\tempa + {\noexpand\noexpand\noexpand\the\toks\the\paramno}% + \advance\paramno by 1\relax + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) +% + +\catcode `\@\texiatcatcode +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\catcode `\@=11\relax + +\let\endargs@\relax +\let\nil@\relax +\def\nilm@{\nil@}% +\long\def\nillm@{\nil@}% + +% This macro is expanded during the Texinfo macro expansion, not during its +% definition. It gets all the arguments values and assigns them to macros +% macarg.ARGNAME +% +% #1 is the macro name +% #2 is the list of argument names +% #3 is the list of argument values +\def\getargvals@#1#2#3{% + \def\macargdeflist@{}% + \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. + \def\paramlist{#2,\nil@}% + \def\macroname{#1}% + \begingroup + \macroargctxt + \def\argvaluelist{#3,\nil@}% + \def\@tempa{#3}% + \ifx\@tempa\empty + \setemptyargvalues@ + \else + \getargvals@@ + \fi +} + +% +\def\getargvals@@{% + \ifx\paramlist\nilm@ + % Some sanity check needed here that \argvaluelist is also empty. + \ifx\argvaluelist\nillm@ + \else + \errhelp = \EMsimple + \errmessage{Too many arguments in macro `\macroname'!}% + \fi + \let\next\macargexpandinbody@ + \else + \ifx\argvaluelist\nillm@ + % No more arguments values passed to macro. Set remaining named-arg + % macros to empty. + \let\next\setemptyargvalues@ + \else + % pop current arg name into \@tempb + \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% + \expandafter\@tempa\expandafter{\paramlist}% + % pop current argument value into \@tempc + \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% + \expandafter\@tempa\expandafter{\argvaluelist}% + % Here \@tempb is the current arg name and \@tempc is the current arg value. + % First place the new argument macro definition into \@tempd + \expandafter\macname\expandafter{\@tempc}% + \expandafter\let\csname macarg.\@tempb\endcsname\relax + \expandafter\def\expandafter\@tempe\expandafter{% + \csname macarg.\@tempb\endcsname}% + \edef\@tempd{\long\def\@tempe{\the\macname}}% + \push@\@tempd\macargdeflist@ + \let\next\getargvals@@ + \fi + \fi + \next +} + +\def\push@#1#2{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#2% + \expandafter\expandafter\expandafter{% + \expandafter#1#2}% +} + +% Replace arguments by their values in the macro body, and place the result +% in macro \@tempa +\def\macvalstoargs@{% + % To do this we use the property that token registers that are \the'ed + % within an \edef expand only once. So we are going to place all argument + % values into respective token registers. + % + % First we save the token context, and initialize argument numbering. + \begingroup + \paramno0\relax + % Then, for each argument number #N, we place the corresponding argument + % value into a new token list register \toks#N + \expandafter\putargsintokens@\saveparamlist@,;,% + % Then, we expand the body so that argument are replaced by their + % values. The trick for values not to be expanded themselves is that they + % are within tokens and that tokens expand only once in an \edef . + \edef\@tempc{\csname mac.\macroname .body\endcsname}% + % Now we restore the token stack pointer to free the token list registers + % which we have used, but we make sure that expanded body is saved after + % group. + \expandafter + \endgroup + \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% + } + +\def\macargexpandinbody@{% + %% Define the named-macro outside of this group and then close this group. + \expandafter + \endgroup + \macargdeflist@ + % First the replace in body the macro arguments by their values, the result + % is in \@tempa . + \macvalstoargs@ + % Then we point at the \norecurse or \gobble (for recursive) macro value + % with \@tempb . + \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname + % Depending on whether it is recursive or not, we need some tailing + % \egroup . + \ifx\@tempb\gobble + \let\@tempc\relax + \else + \let\@tempc\egroup + \fi + % And now we do the real job: + \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% + \@tempd +} + +\def\putargsintokens@#1,{% + \if#1;\let\next\relax + \else + \let\next\putargsintokens@ + % First we allocate the new token list register, and give it a temporary + % alias \@tempb . + \toksdef\@tempb\the\paramno + % Then we place the argument value into that token list register. + \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname + \expandafter\@tempb\expandafter{\@tempa}% + \advance\paramno by 1\relax + \fi + \next +} + +% Save the token stack pointer into macro #1 +\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} +% Restore the token stack pointer from number in macro #1 +\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} +% newtoks that can be used non \outer . +\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} + +% Tailing missing arguments are set to empty +\def\setemptyargvalues@{% + \ifx\paramlist\nilm@ + \let\next\macargexpandinbody@ + \else + \expandafter\setemptyargvaluesparser@\paramlist\endargs@ + \let\next\setemptyargvalues@ + \fi + \next +} + +\def\setemptyargvaluesparser@#1,#2\endargs@{% + \expandafter\def\expandafter\@tempa\expandafter{% + \expandafter\def\csname macarg.#1\endcsname{}}% + \push@\@tempa\macargdeflist@ + \def\paramlist{#2}% +} + +% #1 is the element target macro +% #2 is the list macro +% #3,#4\endargs@ is the list value +\def\pop@#1#2#3,#4\endargs@{% + \def#1{#3}% + \def#2{#4}% +} +\long\def\longpop@#1#2#3,#4\endargs@{% + \long\def#1{#3}% + \long\def#2{#4}% +} + +% This defines a Texinfo @macro. There are eight cases: recursive and +% nonrecursive macros of zero, one, up to nine, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +% +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else + \ifnum\paramno<10\relax % at most 9 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \else % 10 or more + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \fi + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % at most 9 + \ifnum\paramno<10\relax + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % 10 or more: + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse + \fi + \fi + \fi} + +\catcode `\@\texiatcatcode\relax + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg). +% +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \macnamexxx} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Make them active and then expand them all to nothing. +% +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{% + \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=\node +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \lastsection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\lastsection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout + }% + \fi +} + +% @xrefautosectiontitle on|off says whether @section(ing) names are used +% automatically in xrefs, if the third arg is not explicitly specified. +% This was provided as a "secret" @set xref-automatic-section-title +% variable, now it's official. +% +\parseargdef\xrefautomaticsectiontitle{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', + must be on|off}% + \fi\fi +} + +% +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +% +\newbox\toprefbox +\newbox\printedrefnamebox +\newbox\infofilenamebox +\newbox\printedmanualbox +% +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + % + % Get args without leading/trailing spaces. + \def\printedrefname{\ignorespaces #3}% + \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% + % + \def\infofilename{\ignorespaces #4}% + \setbox\infofilenamebox = \hbox{\infofilename\unskip}% + % + \def\printedmanual{\ignorespaces #5}% + \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% + % + % If the printed reference name (arg #3) was not explicitly given in + % the @xref, figure out what we want to use. + \ifdim \wd\printedrefnamebox = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax + % Not auto section-title: use node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Auto section-title: use chapter/section title inside + % the square brackets if we have it. + \ifdim \wd\printedmanualbox > 0pt + % It is in another manual, so we don't have it; use node name. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We (should) know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + {\indexnofonts + \turnoffactive + \makevalueexpandable + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \edef\pdfxrefdest{#1}% + \ifx\pdfxrefdest\empty + \def\pdfxrefdest{Top}% no empty targets + \else + \txiescapepdf\pdfxrefdest % escape PDF special chars + \fi + % + \leavevmode + \startlink attr{/Border [0 0 0]}% + \ifnum\filenamelength>0 + goto file{\the\filename.pdf} name{\pdfxrefdest}% + \else + goto name{\pdfmkpgn{\pdfxrefdest}}% + \fi + }% + \setcolor{\linkcolor}% + \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd\printedrefnamebox = 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % If the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd\printedmanualbox > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox to print the node names, TeX does not insert + % empty discretionaries after hyphens, which means that it will not + % find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, + % this is a loss. Therefore, we give the text of the node name + % again, so it is as if TeX is seeing it for the first time. + % + \ifdim \wd\printedmanualbox > 0pt + % Cross-manual reference with a printed manual name. + % + \crossmanualxref{\cite{\printedmanual\unskip}}% + % + \else\ifdim \wd\infofilenamebox > 0pt + % Cross-manual reference with only an info filename (arg 4), no + % printed manual name (arg 5). This is essentially the same as + % the case above; we output the filename, since we have nothing else. + % + \crossmanualxref{\code{\infofilename\unskip}}% + % + \else + % Reference within this manual. + % + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via the macro below so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi\fi + \fi + \endlink +\endgroup} + +% Output a cross-manual xref to #1. Used just above (twice). +% +% Only include the text "Section ``foo'' in" if the foo is neither +% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply +% "see The Foo Manual", the idea being to refer to the whole manual. +% +% But, this being TeX, we can't easily compare our node name against the +% string "Top" while ignoring the possible spaces before and after in +% the input. By adding the arbitrary 7sp below, we make it much less +% likely that a real node name would have the same width as "Top" (e.g., +% in a monospaced font). Hopefully it will never happen in practice. +% +% For the same basic reason, we retypeset the "Top" at every +% reference, since the current font is indeterminate. +% +\def\crossmanualxref#1{% + \setbox\toprefbox = \hbox{Top\kern7sp}% + \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% + \ifdim \wd2 > 7sp % nonempty? + \ifdim \wd2 = \wd\toprefbox \else % same as Top? + \putwordSection{} ``\printedrefname'' \putwordin{}\space + \fi + \fi + #1% +} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% +\def\refx#1#2{% + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + {\toks0 = {#1}% avoid expansion of possibly-complex value + \message{\linenumber Undefined cross reference `\the\toks0'.}}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. + {% + \count1=128 + \def\loop{% + \catcode\count1=\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi + }% + }% + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\@=0 +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for Info output only. +\let\footnotestyle=\comment + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % + % Nested footnotes are not supported in TeX, that would take a lot + % more work. (\startsavinginserts does not suffice.) + \let\footnote=\errfootnotenest + % + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=\pagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + % + % Invoke rest of plain TeX footnote routine. + \futurelet\next\fo@t +} +}%end \catcode `\@=11 + +\def\errfootnotenest{% + \errhelp=\EMsimple + \errmessage{Nested footnotes not supported in texinfo.tex, + even though they work in makeinfo; sorry} +} + +\def\errfootnoteheading{% + \errhelp=\EMsimple + \errmessage{Footnotes in chapters, sections, etc., are not supported} +} + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarly, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. +% +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\thisisundefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \else \ifx\centersub\centerV + % for @center @image, we need a vbox so we can have our vertical space + \imagevmodetrue + \vbox\bgroup % vbox has better behavior than vtop herev + \fi\fi + % + \ifimagevmode + \nobreak\medskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \fi + % + % Leave vertical mode so that indentation from an enclosing + % environment such as @quotation is respected. + % However, if we're at the top level, we don't want the + % normal paragraph indentation. + % On the other hand, if we are in the case of @center @image, we don't + % want to start a paragraph, which will create a hsize-width box and + % eradicate the centering. + \ifx\centersub\centerV\else \noindent \fi + % + % Output the image. + \ifpdf + \dopdfimage{#1}{#2}{#3}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode + \medskip % space after a standalone image + \fi + \ifx\centersub\centerV \egroup \fi +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \lastsection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\lastsection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies + % + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \lastsection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + +\message{localization,} + +% For single-language documents, @documentlanguage is usually given very +% early, just after @documentencoding. Single argument is the language +% (de) or locale (de_DE) abbreviation. +% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{% + \tex % read txi-??.tex file in plain TeX. + % Read the file by the name they passed if it exists. + \let_ = \normalunderscore % normal _ character for filename test + \openin 1 txi-#1.tex + \ifeof 1 + \documentlanguagetrywithoutunderscore #1_\finish + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 + \endgroup % end raw TeX +} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 +} +}% end of special _ catcode +% +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? Putting it in the current +directory should work if nowhere else does.} + +% This macro is called from txi-??.tex files; the first argument is the +% \language name to set (without the "\lang@" prefix), the second and +% third args are \{left,right}hyphenmin. +% +% The language names to pass are determined when the format is built. +% See the etex.log file created at that time, e.g., +% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. +% +% With TeX Live 2008, etex now includes hyphenation patterns for all +% available languages. This means we can support hyphenation in +% Texinfo, at least to some extent. (This still doesn't solve the +% accented characters problem.) +% +\catcode`@=11 +\def\txisetlanguage#1#2#3{% + % do not set the language if the name is undefined in the current TeX. + \expandafter\ifx\csname lang@#1\endcsname \relax + \message{no patterns for #1}% + \else + \global\language = \csname lang@#1\endcsname + \fi + % but there is no harm in adjusting the hyphenmin values regardless. + \global\lefthyphenmin = #2\relax + \global\righthyphenmin = #3\relax +} + +% Helpers for encodings. +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{\tie} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\guillemetleft} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\guillemetright} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\DH} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\TH} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\dh} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\th} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{\tie} + \gdef^^a1{\ogonek{A}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\ogonek{a}} + \gdef^^b2{\ogonek{ }} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\ogonek{E}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\DH} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\ogonek{e}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'{\dotless{i}}} + \gdef^^ee{\^{\dotless{i}}} + \gdef^^ef{\v d} + % + \gdef^^f0{\dh} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\def\globallet{\global\let} % save some \expandafter's below + +% @U{xxxx} to produce U+xxxx, if we support it. +\def\U#1{% + \expandafter\ifx\csname uni:#1\endcsname \relax + \errhelp = \EMsimple + \errmessage{Unicode character U+#1 not supported, sorry}% + \else + \csname uni:#1\endcsname + \fi +} + +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + % define an additional control sequence for this code point. + \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D0}{\DH} + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DE}{\TH} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F0}{\dh} + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FE}{\th} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0104}{\ogonek{A}} + \DeclareUnicodeCharacter{0105}{\ogonek{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{02DB}{\ogonek{ }} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2018}{\quoteleft} + \DeclareUnicodeCharacter{2019}{\quoteright} + \DeclareUnicodeCharacter{201A}{\quotesinglbase} + \DeclareUnicodeCharacter{201C}{\quotedblleft} + \DeclareUnicodeCharacter{201D}{\quotedblright} + \DeclareUnicodeCharacter{201E}{\quotedblbase} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{2039}{\guilsinglleft} + \DeclareUnicodeCharacter{203A}{\guilsinglright} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be very finicky about underfull hboxes, either. +\hbadness = 6666 + +% Following George Bush, get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % if we don't reset these, they will remain at "1 true in" of + % whatever layout pdftex was dumped with. + \pdfhorigin = 1 true in + \pdfvorigin = 1 true in + \fi + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{607.2pt}{6in}% that's 46 lines + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.25 trim size. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5in}% + {-.2in}{0in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .5cm +}} + +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs = 1 + \parskip = 1.5pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing = 0.25in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .4cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{673.2pt}{160mm}% that's 51 lines + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs = 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs = 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 = #1\relax + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +\def^^L{\par} % remove \outer, so ^L can appear in an @comment + +% DEL is a comment character, in case @c does not suffice. +\catcode`\^^? = 14 + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other \def\normaldoublequote{"} +\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix +\catcode`\+=\other \def\normalplus{+} +\catcode`\<=\other \def\normalless{<} +\catcode`\>=\other \def\normalgreater{>} +\catcode`\^=\other \def\normalcaret{^} +\catcode`\_=\other \def\normalunderscore{_} +\catcode`\|=\other \def\normalverticalbar{|} +\catcode`\~=\other \def\normaltilde{~} + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde +\chardef\hat=`\^ +\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +\let\realunder=_ +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } + +\catcode`\|=\active +\def|{{\tt\char124}} + +\chardef \less=`\< +\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless +\chardef \gtr=`\> +\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr +\catcode`\+=\active \def+{{\tt \char 43}} +\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% used for headline/footline in the output routine, in case the page +% breaks in the middle of an @tex block. +\def\texinfochars{% + \let< = \activeless + \let> = \activegtr + \let~ = \activetilde + \let^ = \activehat + \markupsetuplqdefault \markupsetuprqdefault + \let\b = \strong + \let\i = \smartitalic + % in principle, all other definitions in \tex have to be undone too. +} + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + +\catcode`\@=0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} + +% In texinfo, backslash is an active character; it prints the backslash +% in fixed width font. +\catcode`\\=\active % @ for escape char from now on. + +% The story here is that in math mode, the \char of \backslashcurfont +% ends up printing the roman \ from the math symbol font (because \char +% in math mode uses the \mathcode, and plain.tex sets +% \mathcode`\\="026E). It seems better for @backslashchar{} to always +% print a typewriter backslash, hence we use an explicit \mathchar, +% which is the decimal equivalent of "715c (class 7, e.g., use \fam; +% ignored family value; char position "5C). We can't use " for the +% usual hex value because it has already been made active. +@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. + +% On startup, @fixbackslash assigns: +% @let \ = @normalbackslash +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. We switch back and forth between these. +@gdef@rawbackslash{@let\=@backslashcurfont} +@gdef@otherbackslash{@let\=@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. Also revert - to its normal character, in +% case the active - from code has slipped in. +% +{@catcode`- = @active + @gdef@normalturnoffactive{% + @let-=@normaldash + @let"=@normaldoublequote + @let$=@normaldollar %$ font-lock fix + @let+=@normalplus + @let<=@normalless + @let>=@normalgreater + @let\=@normalbackslash + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let~=@normaltilde + @markupsetuplqdefault + @markupsetuprqdefault + @unsepspaces + } +} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\' in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also turn back on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active + @catcode`@_=@active +} + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These (along with & and #) are made active for url-breaking, so need +% active definitions as the normal characters. +@def@normaldot{.} +@def@normalquest{?} +@def@normalslash{/} + +% These look ok in all fonts, so just make them not special. +% @hashchar{} gets its own user-level command, because of #line. +@catcode`@& = @other @def@normalamp{&} +@catcode`@# = @other @def@normalhash{#} +@catcode`@% = @other @def@normalpercent{%} + +@let @hashchar = @normalhash + +@c Finally, make ` and ' active, so that txicodequoteundirected and +@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we +@c don't make ` and ' active, @code will not get them as active chars. +@c Do this last of all since we use ` in the previous @catcode assignments. +@catcode`@'=@active +@catcode`@`=@active +@markupsetuplqdefault +@markupsetuprqdefault + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/build-aux/update-b4-copyright b/build-aux/update-b4-copyright new file mode 100755 index 0000000..901ff05 --- /dev/null +++ b/build-aux/update-b4-copyright @@ -0,0 +1,152 @@ +#!/usr/bin/perl -0777 -pi + +# Update b4_copyright invocations or b4_copyright_years definitions to +# include the current year. + +# Copyright (C) 2009-2015 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 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use strict; +use warnings; + +my $margin = 72; + +my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR}; +if (!$this_year || $this_year !~ m/^\d{4}$/) + { + my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ()); + $this_year = $year + 1900; + } +my $old_re = <<'EOF' + ( + (?:^|\n) + #BEFORE + (?: + b4_copyright\(\[[^][]*] + | m4_(?:push|pop)def\(\[b4_copyright_years] + ) + #AFTER + ) + (?: + ,\s* + ( + \[\s* (?:\d{4}(?:,\s*|-))* (\d{4}) \s*] + ) + )? + \) +EOF + ; + +while (/($old_re)/gx) + { + my $start = pos() - length ($1); + my $b4_copyright_line = $2; + my $year_lines = $3; + my $final_year = $4; + $year_lines .= ')'; + + # If there was a second argument, it contains years, so update them. + if ($final_year) + { + $b4_copyright_line .= ','; + if ($final_year != $this_year) + { + # Update the year. + $year_lines =~ s/$final_year/$final_year, $this_year/; + } + + # Normalize all whitespace. + $year_lines =~ s/\s+/ /g; + + # Put spaces after commas. + $year_lines =~ s/, ?/, /g; + + # Compress to intervals. + $year_lines =~ + s/ + (\d{4}) + (?: + (,\ |-) + ((??{ + if ($2 eq '-') { '\d{4}'; } + elsif (!$3) { $1 + 1; } + else { $3 + 1; } + })) + )+ + /$1-$3/gx; + + # Format within margin. + my $year_lines_new; + my $indent = index ($b4_copyright_line, '['); + --$indent if ($b4_copyright_line =~ m/^\n/); + while (length $year_lines) + { + my $text_margin = $margin - $indent; + if (($year_lines =~ s/^(.{1,$text_margin})(?: |$)//) + || ($year_lines =~ s/^([\S]+)(?: |$)//)) + { + my $line = "\n" . (' 'x$indent) . $1; + ++$indent if (!$year_lines_new); + $year_lines_new .= $line; + } + else + { + # Should be unreachable, but we don't want an infinite + # loop if it can be reached. + die; + } + } + + # Replace the old invocation. Should never die. + die if (!s/$old_re\G/$b4_copyright_line$year_lines_new/x); + + # Prepare for the next search. + pos () = $start + length ("$b4_copyright_line$year_lines_new"); + } + } + +while (/(\bb4_copyright\()/g) + { + my $start = pos () - length ($1); + my $end = pos (); + my $re = $old_re; + pos () = $start; + $re =~ s/\#BEFORE/\\G/; + if (!/$re/x) + { + my $line = (substr ($_, 0, $start) =~ s/\n/\n/g) + 1; + print STDERR + "$ARGV:$line: warning: failed to update a b4_copyright\n"; + } + pos () = $end; + } + +while (/(\[b4_copyright_years])/g) + { + my $start = pos () - length ($1); + my $end = pos (); + my $re = $old_re; + $re =~ s/\#AFTER/\\G/; + if (!/$re/x) + { + # The substr operation blows away pos (), so restoring pos () + # at the end is necessary. + my $line = (substr ($_, 0, $start) =~ s/\n/\n/g) + 1; + print STDERR + "$ARGV:$line: warning: failed to update a" + . " b4_copyright_years\n"; + } + pos () = $end; + } diff --git a/build-aux/update-copyright b/build-aux/update-copyright new file mode 100755 index 0000000..4eb4b93 --- /dev/null +++ b/build-aux/update-copyright @@ -0,0 +1,274 @@ +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}' + & eval 'exec perl -wS -0777 -pi "$0" $argv:q' + if 0; +# Update an FSF copyright year list to include the current year. + +my $VERSION = '2015-01-15.20:53'; # UTC + +# Copyright (C) 2009-2015 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 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Written by Jim Meyering and Joel E. Denny + +# The arguments to this script should be names of files that contain +# copyright statements to be updated. The copyright holder's name +# defaults to "Free Software Foundation, Inc." but may be changed to +# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment +# variable. +# +# For example, you might wish to use the update-copyright target rule +# in maint.mk from gnulib's maintainer-makefile module. +# +# Iff a copyright statement is recognized in a file and the final +# year is not the current year, then the statement is updated for the +# new year and it is reformatted to: +# +# 1. Fit within 72 columns. +# 2. Convert 2-digit years to 4-digit years by prepending "19". +# 3. Expand copyright year intervals. (See "Environment variables" +# below.) +# +# A warning is printed for every file for which no copyright +# statement is recognized. +# +# Each file's copyright statement must be formatted correctly in +# order to be recognized. For example, each of these is fine: +# +# Copyright @copyright{} 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +# +# # Copyright (C) 1990-2005, 2007-2009 Free Software +# # Foundation, Inc. +# +# /* +# * Copyright © 90,2005,2007-2009 +# * Free Software Foundation, Inc. +# */ +# +# However, the following format is not recognized because the line +# prefix changes after the first line: +# +# ## Copyright (C) 1990-2005, 2007-2009 Free Software +# # Foundation, Inc. +# +# However, any correctly formatted copyright statement following +# a non-matching copyright statements would be recognized. +# +# The exact conditions that a file's copyright statement must meet +# to be recognized are: +# +# 1. It is the first copyright statement that meets all of the +# following conditions. Subsequent copyright statements are +# ignored. +# 2. Its format is "Copyright (C)", then a list of copyright years, +# and then the name of the copyright holder. +# 3. The "(C)" takes one of the following forms or is omitted +# entirely: +# +# A. (C) +# B. (c) +# C. @copyright{} +# D. © +# +# 4. The "Copyright" appears at the beginning of a line, except that it +# may be prefixed by any sequence (e.g., a comment) of no more than +# 5 characters -- including white space. +# 5. Iff such a prefix is present, the same prefix appears at the +# beginning of each remaining line within the FSF copyright +# statement. There is one exception in order to support C-style +# comments: if the first line's prefix contains nothing but +# whitespace surrounding a "/*", then the prefix for all subsequent +# lines is the same as the first line's prefix except with each of +# "/" and possibly "*" replaced by a " ". The replacement of "*" +# by " " is consistent throughout all subsequent lines. +# 6. Blank lines, even if preceded by the prefix, do not appear +# within the FSF copyright statement. +# 7. Each copyright year is 2 or 4 digits, and years are separated by +# commas or dashes. Whitespace may appear after commas. +# +# Environment variables: +# +# 1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement +# is reformatted even if it does not need updating for the new +# year. If unset or set to 0, only updated FSF copyright +# statements are reformatted. +# 2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive +# copyright years (such as 90, 1991, 1992-2007, 2008) in a +# reformatted FSF copyright statement is collapsed to a single +# interval (such as 1990-2008). If unset or set to 0, all existing +# copyright year intervals in a reformatted FSF copyright statement +# are expanded instead. +# If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps +# to the minimal containing range. For example, convert +# 2000, 2004-2007, 2009 to 2000-2009. +# 3. For testing purposes, you can set the assumed current year in +# UPDATE_COPYRIGHT_YEAR. +# 4. The default maximum line length for a copyright line is 72. +# Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length. +# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other +# than "Free Software Foundation, Inc.". + +use strict; +use warnings; + +my $copyright_re = 'Copyright'; +my $circle_c_re = '(?:\([cC]\)|@copyright{}|\\\\\(co|©)'; +my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; +$holder ||= 'Free Software Foundation, Inc.'; +my $prefix_max = 5; +my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH}; +!$margin || $margin !~ m/^\d+$/ + and $margin = 72; + +my $tab_width = 8; + +my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR}; +if (!$this_year || $this_year !~ m/^\d{4}$/) + { + my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ()); + $this_year = $year + 1900; + } + +# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead. +my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n"; + +my $leading; +my $prefix; +my $ws_re; +my $stmt_re; +while (/(^|\n)(.{0,$prefix_max})$copyright_re/g) + { + $leading = "$1$2"; + $prefix = $2; + if ($prefix =~ /^(\s*\/)\*(\s*)$/) + { + $prefix =~ s,/, ,; + my $prefix_ws = $prefix; + $prefix_ws =~ s/\*/ /; # Only whitespace. + if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/) + { + $prefix = $prefix_ws; + } + } + $ws_re = '[ \t\r\f]'; # \s without \n + $ws_re = + "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)"; + my $holder_re = $holder; + $holder_re =~ s/\s/$ws_re/g; + my $stmt_remainder_re = + "(?:$ws_re$circle_c_re)?" + . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*" + . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re"; + if (/\G$stmt_remainder_re/) + { + $stmt_re = + quotemeta($leading) . "($copyright_re$stmt_remainder_re)"; + last; + } + } +if (defined $stmt_re) + { + /$stmt_re/ or die; # Should never die. + my $stmt = $1; + my $final_year_orig = $2; + + # Handle two-digit year numbers like "98" and "99". + my $final_year = $final_year_orig; + $final_year <= 99 + and $final_year += 1900; + + if ($final_year != $this_year) + { + # Update the year. + $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/; + } + if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'}) + { + # Normalize all whitespace including newline-prefix sequences. + $stmt =~ s/$ws_re/ /g; + + # Put spaces after commas. + $stmt =~ s/, ?/, /g; + + # Convert 2-digit to 4-digit years. + $stmt =~ s/(\b\d\d\b)/19$1/g; + + # Make the use of intervals consistent. + if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS}) + { + $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg; + } + else + { + $stmt =~ + s/ + (\d{4}) + (?: + (,\ |-) + ((??{ + if ($2 eq '-') { '\d{4}'; } + elsif (!$3) { $1 + 1; } + else { $3 + 1; } + })) + )+ + /$1-$3/gx; + + # When it's 2, emit a single range encompassing all year numbers. + $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2 + and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/; + } + + # Format within margin. + my $stmt_wrapped; + my $text_margin = $margin - length($prefix); + if ($prefix =~ /^(\t+)/) + { + $text_margin -= length($1) * ($tab_width - 1); + } + while (length $stmt) + { + if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//) + || ($stmt =~ s/^([\S]+)(?: |$)//)) + { + my $line = $1; + $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading; + $stmt_wrapped .= $line; + } + else + { + # Should be unreachable, but we don't want an infinite + # loop if it can be reached. + die; + } + } + + # Replace the old copyright statement. + s/$stmt_re/$stmt_wrapped/; + } + } +else + { + print STDERR "$ARGV: warning: copyright statement not found\n"; + } + +# Local variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d.%02H:%02M" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "'; # UTC" +# End: diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free new file mode 100755 index 0000000..82a09b3 --- /dev/null +++ b/build-aux/useless-if-before-free @@ -0,0 +1,207 @@ +eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}' + & eval 'exec perl -wST "$0" $argv:q' + if 0; +# Detect instances of "if (p) free (p);". +# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. + +my $VERSION = '2012-01-06 07:23'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2008-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Written by Jim Meyering + +use strict; +use warnings; +use Getopt::Long; + +(my $ME = $0) =~ s|.*/||; + +# use File::Coda; # http://meyering.net/code/Coda/ +END { + defined fileno STDOUT or return; + close STDOUT and return; + warn "$ME: failed to close standard output: $!\n"; + $? ||= 1; +} + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + print $STREAM <<EOF; +Usage: $ME [OPTIONS] FILE... + +Detect any instance in FILE of a useless "if" test before a free call, e.g., +"if (p) free (p);". Any such test may be safely removed without affecting +the semantics of the C code in FILE. Use --name=FOO --name=BAR to also +detect free-like functions named FOO and BAR. + +OPTIONS: + + --list print only the name of each matching FILE (\\0-terminated) + --name=N add name N to the list of \'free\'-like functions to detect; + may be repeated + + --help display this help and exit + --version output version information and exit + +Exit status: + + 0 one or more matches + 1 no match + 2 an error + +EXAMPLE: + +For example, this command prints all removable "if" tests before "free" +and "kfree" calls in the linux kernel sources: + + git ls-files -z |xargs -0 $ME --name=kfree + +EOF + } + exit $exit_code; +} + +sub is_NULL ($) +{ + my ($expr) = @_; + return ($expr eq 'NULL' || $expr eq '0'); +} + +{ + sub EXIT_MATCH {0} + sub EXIT_NO_MATCH {1} + sub EXIT_ERROR {2} + my $err = EXIT_NO_MATCH; + + my $list; + my @name = qw(free); + GetOptions + ( + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + list => \$list, + 'name=s@' => \@name, + ) or usage 1; + + # Make sure we have the right number of non-option arguments. + # Always tell the user why we fail. + @ARGV < 1 + and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR; + + my $or = join '|', @name; + my $regexp = qr/(?:$or)/; + + # Set the input record separator. + # Note: this makes it impractical to print line numbers. + $/ = '"'; + + my $found_match = 0; + FILE: + foreach my $file (@ARGV) + { + open FH, '<', $file + or (warn "$ME: can't open '$file' for reading: $!\n"), + $err = EXIT_ERROR, next; + while (defined (my $line = <FH>)) + { + while ($line =~ + /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\) + # 1 2 3 + (?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;| + \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg) + { + my $all = $1; + my ($lhs, $rhs) = ($2, $3); + my ($free_opnd, $braced_free_opnd) = ($4, $5); + my $non_NULL; + if (!defined $rhs) { $non_NULL = $lhs } + elsif (is_NULL $rhs) { $non_NULL = $lhs } + elsif (is_NULL $lhs) { $non_NULL = $rhs } + else { next } + + # Compare the non-NULL part of the "if" expression and the + # free'd expression, without regard to white space. + $non_NULL =~ tr/ \t//d; + my $e2 = defined $free_opnd ? $free_opnd : $braced_free_opnd; + $e2 =~ tr/ \t//d; + if ($non_NULL eq $e2) + { + $found_match = 1; + $list + and (print "$file\0"), next FILE; + print "$file: $all\n"; + } + } + } + } + continue + { + close FH; + } + + $found_match && $err == EXIT_NO_MATCH + and $err = EXIT_MATCH; + + exit $err; +} + +my $foo = <<'EOF'; +# The above is to *find* them. +# This adjusts them, removing the unnecessary "if (p)" part. + +# FIXME: do something like this as an option (doesn't do braces): +free=xfree +git grep -l -z "$free *(" \ + | xargs -0 useless-if-before-free -l --name="$free" \ + | xargs -0 perl -0x3b -pi -e \ + 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s' + +# Use the following to remove redundant uses of kfree inside braces. +# Note that -0777 puts perl in slurp-whole-file mode; +# but we have plenty of memory, these days... +free=kfree +git grep -l -z "$free *(" \ + | xargs -0 useless-if-before-free -l --name="$free" \ + | xargs -0 perl -0777 -pi -e \ + 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms' + +Be careful that the result of the above transformation is valid. +If the matched string is followed by "else", then obviously, it won't be. + +When modifying files, refuse to process anything other than a regular file. +EOF + +## Local Variables: +## mode: perl +## indent-tabs-mode: nil +## eval: (add-hook 'write-file-hooks 'time-stamp) +## time-stamp-start: "my $VERSION = '" +## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-time-zone: "UTC" +## time-stamp-end: "'; # UTC" +## End: diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files new file mode 100755 index 0000000..3bf93c3 --- /dev/null +++ b/build-aux/vc-list-files @@ -0,0 +1,113 @@ +#!/bin/sh +# List version-controlled file names. + +# Print a version string. +scriptversion=2011-05-16.22; # UTC + +# Copyright (C) 2006-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# List the specified version-controlled files. +# With no argument, list them all. With a single DIRECTORY argument, +# list the version-controlled files in that directory. + +# If there's an argument, it must be a single, "."-relative directory name. +# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/ + +postprocess= +case $1 in + --help) cat <<EOF +Usage: $0 [-C SRCDIR] [DIR...] + +Output a list of version-controlled files in DIR (default .), relative to +SRCDIR (default .). SRCDIR must be the top directory of a checkout. + +Options: + --help print this help, then exit + --version print version number, then exit + -C SRCDIR change directory to SRCDIR before generating list + +Report bugs and patches to <bug-gnulib@gnu.org>. +EOF + exit ;; + + --version) + year=`echo "$scriptversion" | sed 's/[^0-9].*//'` + cat <<EOF +vc-list-files $scriptversion +Copyright (C) $year Free Software Foundation, Inc, +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +EOF + exit ;; + + -C) + test "$2" = . || postprocess="| sed 's|^|$2/|'" + cd "$2" || exit 1 + shift; shift ;; +esac + +test $# = 0 && set . + +for dir +do + if test -d .git; then + test "x$dir" = x. \ + && dir= sed_esc= \ + || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; } + # Ignore git symlinks - either they point into the tree, in which case + # we don't need to visit the target twice, or they point somewhere + # else (often into a submodule), in which case the content does not + # belong to this package. + eval exec git ls-tree -r 'HEAD:"$dir"' \ + \| sed -n '"s/^100[^ ]*./$sed_esc/p"' $postprocess + elif test -d .hg; then + eval exec hg locate '"$dir/*"' $postprocess + elif test -d .bzr; then + test "$postprocess" = '' && postprocess="| sed 's|^\./||'" + eval exec bzr ls -R --versioned '"$dir"' $postprocess + elif test -d CVS; then + test "$postprocess" = '' && postprocess="| sed 's|^\./||'" + if test -x build-aux/cvsu; then + eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess + elif (cvsu --help) >/dev/null 2>&1; then + eval cvsu --find --types=AFGM '"$dir"' $postprocess + else + eval awk -F/ \''{ \ + if (!$1 && $3 !~ /^-/) { \ + f=FILENAME; \ + if (f ~ /CVS\/Entries$/) \ + f = substr(f, 1, length(f)-11); \ + print f $2; \ + }}'\'' \ + `find "$dir" -name Entries -print` /dev/null' $postprocess + fi + elif test -d .svn; then + eval exec svn list -R '"$dir"' $postprocess + else + echo "$0: Failed to determine type of version control used in `pwd`" 1>&2 + exit 1 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/ylwrap b/build-aux/ylwrap new file mode 100755 index 0000000..7c2d927 --- /dev/null +++ b/build-aux/ylwrap @@ -0,0 +1,247 @@ +#! /bin/sh +# ylwrap - wrapper for lex/yacc invocations. + +scriptversion=2013-01-12.17; # UTC + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# Written by Tom Tromey <tromey@cygnus.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +get_dirname () +{ + case $1 in + */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; + # Otherwise, we want the empty string (not "."). + esac +} + +# guard FILE +# ---------- +# The CPP macro used to guard inclusion of FILE. +guard () +{ + printf '%s\n' "$1" \ + | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ + -e 's/__*/_/g' +} + +# quote_for_sed [STRING] +# ---------------------- +# Return STRING (or stdin) quoted to be used as a sed pattern. +quote_for_sed () +{ + case $# in + 0) cat;; + 1) printf '%s\n' "$1";; + esac \ + | sed -e 's|[][\\.*]|\\&|g' +} + +case "$1" in + '') + echo "$0: No files given. Try '$0 --help' for more information." 1>&2 + exit 1 + ;; + --basedir) + basedir=$2 + shift 2 + ;; + -h|--h*) + cat <<\EOF +Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... + +Wrapper for lex/yacc invocations, renaming files as desired. + + INPUT is the input file + OUTPUT is one file PROG generates + DESIRED is the file we actually want instead of OUTPUT + PROGRAM is program to run + ARGS are passed to PROG + +Any number of OUTPUT,DESIRED pairs may be used. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v|--v*) + echo "ylwrap $scriptversion" + exit $? + ;; +esac + + +# The input. +input=$1 +shift +# We'll later need for a correct munging of "#line" directives. +input_sub_rx=`get_dirname "$input" | quote_for_sed` +case $input in + [\\/]* | ?:[\\/]*) + # Absolute path; do nothing. + ;; + *) + # Relative path. Make it absolute. + input=`pwd`/$input + ;; +esac +input_rx=`get_dirname "$input" | quote_for_sed` + +# Since DOS filename conventions don't allow two dots, +# the DOS version of Bison writes out y_tab.c instead of y.tab.c +# and y_tab.h instead of y.tab.h. Test to see if this is the case. +y_tab_nodot=false +if test -f y_tab.c || test -f y_tab.h; then + y_tab_nodot=true +fi + +# The parser itself, the first file, is the destination of the .y.c +# rule in the Makefile. +parser=$1 + +# A sed program to s/FROM/TO/g for all the FROM/TO so that, for +# instance, we rename #include "y.tab.h" into #include "parse.h" +# during the conversion from y.tab.c to parse.c. +sed_fix_filenames= + +# Also rename header guards, as Bison 2.7 for instance uses its header +# guard in its implementation file. +sed_fix_header_guards= + +while test $# -ne 0; do + if test x"$1" = x"--"; then + shift + break + fi + from=$1 + # Handle y_tab.c and y_tab.h output by DOS + if $y_tab_nodot; then + case $from in + "y.tab.c") from=y_tab.c;; + "y.tab.h") from=y_tab.h;; + esac + fi + shift + to=$1 + shift + sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" + sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" +done + +# The program to run. +prog=$1 +shift +# Make any relative path in $prog absolute. +case $prog in + [\\/]* | ?:[\\/]*) ;; + *[\\/]*) prog=`pwd`/$prog ;; +esac + +dirname=ylwrap$$ +do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' +trap "ret=129; $do_exit" 1 +trap "ret=130; $do_exit" 2 +trap "ret=141; $do_exit" 13 +trap "ret=143; $do_exit" 15 +mkdir $dirname || exit 1 + +cd $dirname + +case $# in + 0) "$prog" "$input" ;; + *) "$prog" "$@" "$input" ;; +esac +ret=$? + +if test $ret -eq 0; then + for from in * + do + to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` + if test -f "$from"; then + # If $2 is an absolute path name, then just use that, + # otherwise prepend '../'. + case $to in + [\\/]* | ?:[\\/]*) target=$to;; + *) target=../$to;; + esac + + # Do not overwrite unchanged header files to avoid useless + # recompilations. Always update the parser itself: it is the + # destination of the .y.c rule in the Makefile. Divert the + # output of all other files to a temporary file so we can + # compare them to existing versions. + if test $from != $parser; then + realtarget=$target + target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` + fi + + # Munge "#line" or "#" directives. Don't let the resulting + # debug information point at an absolute srcdir. Use the real + # output file name, not yy.lex.c for instance. Adjust the + # include guards too. + sed -e "/^#/!b" \ + -e "s|$input_rx|$input_sub_rx|" \ + -e "$sed_fix_filenames" \ + -e "$sed_fix_header_guards" \ + "$from" >"$target" || ret=$? + + # Check whether files must be updated. + if test "$from" != "$parser"; then + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$to is unchanged" + rm -f "$target" + else + echo "updating $to" + mv -f "$target" "$realtarget" + fi + fi + else + # A missing file is only an error for the parser. This is a + # blatant hack to let us support using "yacc -d". If -d is not + # specified, don't fail when the header file is "missing". + if test "$from" = "$parser"; then + ret=1 + fi + fi + done +fi + +# Remove the directory. +cd .. +rm -rf $dirname + +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/cfg.mk b/cfg.mk new file mode 100644 index 0000000..7d0fe9a --- /dev/null +++ b/cfg.mk @@ -0,0 +1,180 @@ +# Customize maint.mk -*- makefile -*- +# Copyright (C) 2008-2015 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 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Update version, then recompile so that tests/bison --version be +# up-to-date, then compile our parser again with our up-to-date bison. +.PHONY: regen +regen: _version + $(MAKE) $(AM_MAKEFLAGS) + touch $(srcdir)/src/parse-gram.y + $(MAKE) $(AM_MAKEFLAGS) + +# Used in maint.mk's web-manual rule +manual_title = The Yacc-compatible Parser Generator +gendocs_options_ = -I $(abs_top_srcdir)/doc -I $(abs_top_builddir)/doc + +# It's useful to run maintainer-*check* targets during development, but we +# don't want to wait on a recompile because of an update to $(VERSION). Thus, +# override the _is-dist-target from GNUmakefile so that maintainer-*check* +# targets are filtered out. +_is-dist-target = $(filter-out %clean maintainer-check% maintainer-%-check, \ + $(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS))) + +url_dir_list = \ + ftp://$(gnu_rel_host)/gnu/bison + +# Tests not to run as part of "make distcheck". +local-checks-to-skip = \ + sc_immutable_NEWS \ + sc_prohibit_atoi_atof + +# The local directory containing the checked-out copy of gnulib used in +# this release. Used solely to get a date for the "announcement" target. +gnulib_dir = $(srcdir)/gnulib + +bootstrap-tools = autoconf,automake,flex,gettext,gnulib + +announcement_Cc_ = \ + bug-bison@gnu.org, help-bison@gnu.org, bison-patches@gnu.org, \ + coordinator@translationproject.org + +update-copyright: update-b4-copyright update-package-copyright-year +update-copyright-env = \ + UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1 + + +## -------------------- ## +## More syntax-checks. ## +## -------------------- ## + +# At least for Mac OS X's grep, the order between . and [ in "[^.[]" +# matters: +# $ LC_ALL=fr_FR grep -nE '[^[.]' /dev/null +# $ LC_ALL=C grep -nE '[^[.]' /dev/null +# grep: invalid collating element or class +# $ LC_ALL=fr_FR grep -nE '[^.[]' /dev/null +# $ LC_ALL=C grep -nE '[^.[]' /dev/null +sc_at_parser_check: + @prohibit='AT_PARSER_CHECK\(\[+[^.[]|AT_CHECK\(\[+\./' \ + halt='use AT_PARSER_CHECK for and only for generated parsers' \ + $(_sc_search_regexp) + +# Indent only with spaces. +# Taken from Coreutils. +sc_prohibit_tab_based_indentation: + @prohibit='^ * ' \ + halt='TAB in indentation; use only spaces' \ + $(_sc_search_regexp) + +# Prohibit the use of `...` in tests/. Use $(...) instead. +# Taken from Coreutils. +# Not ready for Bison yet. +#sc_prohibit_test_backticks: +# @prohibit='`' in_vc_files='^tests/' \ +# halt='use $$(...), not `...` in tests/' \ +# $(_sc_search_regexp) + +# Enforce recommended preprocessor indentation style. +# Taken from Coreutils. +sc_preprocessor_indentation: + @if cppi --version >/dev/null 2>&1; then \ + $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \ + || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \ + exit 1; }; \ + else \ + echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ + fi + +########################################################### +# Taken from Coreutils. +_p0 = \([^"'/]\|"\([^\"]\|[\].\)*"\|'\([^\']\|[\].\)*' +_pre = $(_p0)\|[/][^"'/*]\|[/]"\([^\"]\|[\].\)*"\|[/]'\([^\']\|[\].\)*'\)* +_pre_anchored = ^\($(_pre)\) +_comment_and_close = [^*]\|[*][^/*]\)*[*][*]*/ +# help font-lock mode: ' + +# A sed expression that removes ANSI C and ISO C99 comments. +# Derived from the one in GNU gettext's 'moopp' preprocessor. +_sed_remove_comments = \ +/[/][/*]/{ \ + ta; \ + :a; \ + s,$(_pre_anchored)//.*,\1,; \ + te; \ + s,$(_pre_anchored)/[*]\($(_comment_and_close),\1 ,; \ + ta; \ + /^$(_pre)[/][*]/{ \ + s,$(_pre_anchored)/[*].*,\1 ,; \ + tu; \ + :u; \ + n; \ + s,^\($(_comment_and_close),,; \ + tv; \ + s,^.*$$,,; \ + bu; \ + :v; \ + }; \ + :e; \ +} +# Quote all single quotes. +_sed_rm_comments_q = $(subst ','\'',$(_sed_remove_comments)) +# help font-lock mode: ' + +_space_before_paren_exempt =? \\n\\$$ +_space_before_paren_exempt = \ + (^ *\#|(LA)?LR\([01]\)|percent_(code|define)|b4_syncline|m4_(define|init)|symbol) +# Ensure that there is a space before each open parenthesis in C code. +sc_space_before_open_paren: + @if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \ + fail=0; \ + for c in $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$'); do \ + sed '$(_sed_rm_comments_q)' $$c 2>/dev/null \ + | grep -i '[[:alnum:]](' \ + | grep -vE '$(_space_before_paren_exempt)' \ + | grep . && { fail=1; echo "*** $$c"; }; \ + done; \ + test $$fail = 1 && \ + { echo '$(ME): the above files lack a space-before-open-paren' \ + 1>&2; exit 1; } || :; \ + else :; \ + fi + +## -------------------------- ## +## syntax-checks exceptions. ## +## -------------------------- ## + +exclude = \ + $(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a)))) +$(call exclude, \ + bindtextdomain=^lib/main.c$$ \ + preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \ + program_name=^lib/main.c$$ \ + prohibit_always-defined_macros=^data/yacc.c$$|^djgpp/ \ + prohibit_always-defined_macros+=?|^lib/timevar.c$$ \ + prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \ + prohibit_always-defined_macros+=?|^tests/regression.at$$ \ + prohibit_always_true_header_tests=^djgpp/subpipe.h$$|^lib/timevar.c$$ \ + prohibit_always_true_header_tests+=?|^m4/timevar.m4$$ \ + prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \ + prohibit_doubled_word=^tests/named-refs.at$$ \ + prohibit_magic_number_exit=^doc/bison.texi$$ \ + prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \ + prohibit_strcmp=^doc/bison\.texi|tests/local\.at$$ \ + prohibit_tab_based_indentation=\.(am|mk)$$|^djgpp/|^\.git \ + require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \ + space_before_open_paren=^(data/|djgpp/) \ + unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \ +) diff --git a/configure b/configure new file mode 100755 index 0000000..4bc6562 --- /dev/null +++ b/configure @@ -0,0 +1,39751 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for GNU Bison 3.0.4. +# +# Report bugs to <bug-bison@gnu.org>. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and bug-bison@gnu.org +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GNU Bison' +PACKAGE_TARNAME='bison' +PACKAGE_VERSION='3.0.4' +PACKAGE_STRING='GNU Bison 3.0.4' +PACKAGE_BUGREPORT='bug-bison@gnu.org' +PACKAGE_URL='http://www.gnu.org/software/bison/' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +gl_use_threads_default= +ac_header_list= +ac_func_list= +gl_getopt_required=POSIX +gl_getopt_required=POSIX +gt_needs= +ac_config_libobj_dir=lib +ac_subst_vars='gltests_LTLIBOBJS +gltests_LIBOBJS +gl_LTLIBOBJS +gl_LIBOBJS +CONFIG_INCLUDE +am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +HAVE_JVIEW +HAVE_JRE +HAVE_JAVA +HAVE_GIJ +HAVE_JAVA_ENVVAR +CONF_JAVA +HAVE_JVIEW_IN_PATH +HAVE_JRE_IN_PATH +HAVE_JAVA_IN_PATH +HAVE_GIJ_IN_PATH +HAVE_JIKES +HAVE_JAVAC +HAVE_GCJ_C +HAVE_JAVAC_ENVVAR +CLASSPATH_SEPARATOR +CLASSPATH +CONF_JAVAC +HAVE_JIKES_IN_PATH +HAVE_JAVAC_IN_PATH +HAVE_GCJ_IN_PATH +GCC +AUTOM4TE +CROSS_COMPILING_FALSE +CROSS_COMPILING_TRUE +VALGRIND_PREBISON +VALGRIND +aclocaldir +BISON_LOCALEDIR +POSUB +INTLLIBS +LTLIBICONV +LIBICONV +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +LIBBISON_LTLIBDEPS +LIBBISON_LIBDEPS +gltests_WITNESS +REPLACE_TOWLOWER +REPLACE_ISWCNTRL +HAVE_WCTYPE_H +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_ISWCNTRL +REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T +HAVE_ISWBLANK +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK +HAVE_WINT_T +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H +NEXT_WCHAR_H +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE +LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE +LIBUNISTRING_UNIWIDTH_H +LIBUNISTRING_UNITYPES_H +HAVE_UNISTD_H +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H +NEXT_UNISTD_H +UNISTD_H_DEFINES_STRUCT_TIMESPEC +PTHREAD_H_DEFINES_STRUCT_TIMESPEC +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +TIME_H_DEFINES_STRUCT_TIMESPEC +NEXT_AS_FIRST_DIRECTIVE_TIME_H +NEXT_TIME_H +REPLACE_LOCALTIME +REPLACE_GMTIME +REPLACE_TIMEGM +REPLACE_NANOSLEEP +REPLACE_MKTIME +REPLACE_LOCALTIME_R +HAVE_TIMEGM +HAVE_STRPTIME +HAVE_NANOSLEEP +HAVE_DECL_LOCALTIME_R +GNULIB_TIME_R +GNULIB_TIMEGM +GNULIB_STRPTIME +GNULIB_NANOSLEEP +GNULIB_MKTIME +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H +NEXT_SYS_WAIT_H +GNULIB_WAITPID +WINDOWS_64_BIT_OFF_T +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H +NEXT_SYS_TYPES_H +NEXT_AS_FIRST_DIRECTIVE_STRING_H +NEXT_STRING_H +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H +NEXT_STDLIB_H +NEXT_AS_FIRST_DIRECTIVE_STDIO_H +NEXT_STDIO_H +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H +NEXT_STDDEF_H +GL_GENERATE_STDDEF_H_FALSE +GL_GENERATE_STDDEF_H_TRUE +STDDEF_H +HAVE_WCHAR_T +HAVE_MAX_ALIGN_T +REPLACE_NULL +HAVE__BOOL +GL_GENERATE_STDBOOL_H_FALSE +GL_GENERATE_STDBOOL_H_TRUE +STDBOOL_H +HAVE_SPAWN_H +NEXT_AS_FIRST_DIRECTIVE_SPAWN_H +NEXT_SPAWN_H +NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H +NEXT_SIGNAL_H +GL_GENERATE_SCHED_H_FALSE +GL_GENERATE_SCHED_H_TRUE +SCHED_H +HAVE_STRUCT_SCHED_PARAM +HAVE_SCHED_H +NEXT_AS_FIRST_DIRECTIVE_SCHED_H +NEXT_SCHED_H +REPLACE_RAISE +REPLACE_PTHREAD_SIGMASK +HAVE_SIGHANDLER_T +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T +HAVE_STRUCT_SIGACTION_SA_SIGACTION +HAVE_SIGACTION +HAVE_SIGINFO_T +HAVE_SIGSET_T +HAVE_RAISE +HAVE_PTHREAD_SIGMASK +HAVE_POSIX_SIGNALBLOCKING +GNULIB_SIGACTION +GNULIB_SIGPROCMASK +GNULIB_SIGNAL_H_SIGPIPE +GNULIB_RAISE +GNULIB_PTHREAD_SIGMASK +ASM_SYMBOL_PREFIX +LIB_POSIX_SPAWN +REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN +REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 +REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE +REPLACE_POSIX_SPAWN +HAVE_POSIX_SPAWN_FILE_ACTIONS_T +HAVE_POSIX_SPAWNATTR_T +HAVE_POSIX_SPAWN +GNULIB_POSIX_SPAWNATTR_DESTROY +GNULIB_POSIX_SPAWNATTR_SETSIGMASK +GNULIB_POSIX_SPAWNATTR_GETSIGMASK +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM +GNULIB_POSIX_SPAWNATTR_SETPGROUP +GNULIB_POSIX_SPAWNATTR_GETPGROUP +GNULIB_POSIX_SPAWNATTR_SETFLAGS +GNULIB_POSIX_SPAWNATTR_GETFLAGS +GNULIB_POSIX_SPAWNATTR_INIT +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT +GNULIB_POSIX_SPAWNP +GNULIB_POSIX_SPAWN +UNDEFINE_STRTOK_R +REPLACE_STRTOK_R +REPLACE_STRSIGNAL +REPLACE_STRNLEN +REPLACE_STRNDUP +REPLACE_STRNCAT +REPLACE_STRERROR_R +REPLACE_STRERROR +REPLACE_STRCHRNUL +REPLACE_STRCASESTR +REPLACE_STRSTR +REPLACE_STRDUP +REPLACE_STPNCPY +REPLACE_MEMMEM +REPLACE_MEMCHR +HAVE_STRVERSCMP +HAVE_DECL_STRSIGNAL +HAVE_DECL_STRERROR_R +HAVE_DECL_STRTOK_R +HAVE_STRCASESTR +HAVE_STRSEP +HAVE_STRPBRK +HAVE_DECL_STRNLEN +HAVE_DECL_STRNDUP +HAVE_DECL_STRDUP +HAVE_STRCHRNUL +HAVE_STPNCPY +HAVE_STPCPY +HAVE_RAWMEMCHR +HAVE_DECL_MEMRCHR +HAVE_MEMPCPY +HAVE_DECL_MEMMEM +HAVE_MEMCHR +HAVE_FFSLL +HAVE_FFSL +HAVE_MBSLEN +GNULIB_STRVERSCMP +GNULIB_STRSIGNAL +GNULIB_STRERROR_R +GNULIB_STRERROR +GNULIB_MBSTOK_R +GNULIB_MBSSEP +GNULIB_MBSSPN +GNULIB_MBSPBRK +GNULIB_MBSCSPN +GNULIB_MBSCASESTR +GNULIB_MBSPCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSCASECMP +GNULIB_MBSSTR +GNULIB_MBSRCHR +GNULIB_MBSCHR +GNULIB_MBSNLEN +GNULIB_MBSLEN +GNULIB_STRTOK_R +GNULIB_STRCASESTR +GNULIB_STRSTR +GNULIB_STRSEP +GNULIB_STRPBRK +GNULIB_STRNLEN +GNULIB_STRNDUP +GNULIB_STRNCAT +GNULIB_STRDUP +GNULIB_STRCHRNUL +GNULIB_STPNCPY +GNULIB_STPCPY +GNULIB_RAWMEMCHR +GNULIB_MEMRCHR +GNULIB_MEMPCPY +GNULIB_MEMMEM +GNULIB_MEMCHR +GNULIB_FFSLL +GNULIB_FFSL +LOCALE_FR_UTF8 +LOCALE_ZH_CN +LOCALE_JA +REPLACE_WCSWIDTH +REPLACE_WCWIDTH +REPLACE_WCSNRTOMBS +REPLACE_WCSRTOMBS +REPLACE_WCRTOMB +REPLACE_MBSNRTOWCS +REPLACE_MBSRTOWCS +REPLACE_MBRLEN +REPLACE_MBRTOWC +REPLACE_MBSINIT +REPLACE_WCTOB +REPLACE_BTOWC +REPLACE_MBSTATE_T +HAVE_DECL_WCWIDTH +HAVE_DECL_WCTOB +HAVE_WCSWIDTH +HAVE_WCSTOK +HAVE_WCSSTR +HAVE_WCSPBRK +HAVE_WCSSPN +HAVE_WCSCSPN +HAVE_WCSRCHR +HAVE_WCSCHR +HAVE_WCSDUP +HAVE_WCSXFRM +HAVE_WCSCOLL +HAVE_WCSNCASECMP +HAVE_WCSCASECMP +HAVE_WCSNCMP +HAVE_WCSCMP +HAVE_WCSNCAT +HAVE_WCSCAT +HAVE_WCPNCPY +HAVE_WCSNCPY +HAVE_WCPCPY +HAVE_WCSCPY +HAVE_WCSNLEN +HAVE_WCSLEN +HAVE_WMEMSET +HAVE_WMEMMOVE +HAVE_WMEMCPY +HAVE_WMEMCMP +HAVE_WMEMCHR +HAVE_WCSNRTOMBS +HAVE_WCSRTOMBS +HAVE_WCRTOMB +HAVE_MBSNRTOWCS +HAVE_MBSRTOWCS +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSINIT +HAVE_BTOWC +GNULIB_WCSWIDTH +GNULIB_WCSTOK +GNULIB_WCSSTR +GNULIB_WCSPBRK +GNULIB_WCSSPN +GNULIB_WCSCSPN +GNULIB_WCSRCHR +GNULIB_WCSCHR +GNULIB_WCSDUP +GNULIB_WCSXFRM +GNULIB_WCSCOLL +GNULIB_WCSNCASECMP +GNULIB_WCSCASECMP +GNULIB_WCSNCMP +GNULIB_WCSCMP +GNULIB_WCSNCAT +GNULIB_WCSCAT +GNULIB_WCPNCPY +GNULIB_WCSNCPY +GNULIB_WCPCPY +GNULIB_WCSCPY +GNULIB_WCSNLEN +GNULIB_WCSLEN +GNULIB_WMEMSET +GNULIB_WMEMMOVE +GNULIB_WMEMCPY +GNULIB_WMEMCMP +GNULIB_WMEMCHR +GNULIB_WCWIDTH +GNULIB_WCSNRTOMBS +GNULIB_WCSRTOMBS +GNULIB_WCRTOMB +GNULIB_MBSNRTOWCS +GNULIB_MBSRTOWCS +GNULIB_MBRLEN +GNULIB_MBRTOWC +GNULIB_MBSINIT +GNULIB_WCTOB +GNULIB_BTOWC +NEXT_AS_FIRST_DIRECTIVE_MATH_H +NEXT_MATH_H +SED +LTLIBMULTITHREAD +LIBMULTITHREAD +LTLIBTHREAD +LIBTHREAD +LIBPTH_PREFIX +LTLIBPTH +LIBPTH +LOCALCHARSET_TESTS_ENVIRONMENT +GLIBC21 +LDEXPL_LIBM +LDEXP_LIBM +ISNAN_LIBM +ISNANL_LIBM +ISNAND_LIBM +ISNANF_LIBM +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H +NEXT_INTTYPES_H +UINT64_MAX_EQ_ULONG_MAX +UINT32_MAX_LT_UINTMAX_MAX +PRIPTR_PREFIX +PRI_MACROS_BROKEN +INT64_MAX_EQ_LONG_MAX +INT32_MAX_LT_INTMAX_MAX +REPLACE_STRTOUMAX +REPLACE_STRTOIMAX +HAVE_DECL_STRTOUMAX +HAVE_DECL_STRTOIMAX +HAVE_DECL_IMAXDIV +HAVE_DECL_IMAXABS +GNULIB_STRTOUMAX +GNULIB_STRTOIMAX +GNULIB_IMAXDIV +GNULIB_IMAXABS +GL_GENERATE_STDINT_H_FALSE +GL_GENERATE_STDINT_H_TRUE +STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +HAVE_SYS_BITYPES_H +HAVE_SYS_INTTYPES_H +HAVE_STDINT_H +NEXT_AS_FIRST_DIRECTIVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_WCHAR_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H +NEXT_SYS_TIME_H +REPLACE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +HAVE_GETTIMEOFDAY +GNULIB_GETTIMEOFDAY +LTLIBINTL +LIBINTL +GNULIB_GL_UNISTD_H_GETOPT +GETOPT_H +HAVE_GETOPT_H +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H +NEXT_GETOPT_H +WINDOWS_64_BIT_ST_SIZE +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H +NEXT_SYS_STAT_H +REPLACE_UTIMENSAT +REPLACE_STAT +REPLACE_MKNOD +REPLACE_MKFIFO +REPLACE_MKDIR +REPLACE_LSTAT +REPLACE_FUTIMENS +REPLACE_FSTATAT +REPLACE_FSTAT +HAVE_UTIMENSAT +HAVE_MKNODAT +HAVE_MKNOD +HAVE_MKFIFOAT +HAVE_MKFIFO +HAVE_MKDIRAT +HAVE_LSTAT +HAVE_LCHMOD +HAVE_FUTIMENS +HAVE_FSTATAT +HAVE_FCHMODAT +GNULIB_UTIMENSAT +GNULIB_STAT +GNULIB_MKNODAT +GNULIB_MKNOD +GNULIB_MKFIFOAT +GNULIB_MKFIFO +GNULIB_MKDIRAT +GNULIB_LSTAT +GNULIB_LCHMOD +GNULIB_FUTIMENS +GNULIB_FSTATAT +GNULIB_FSTAT +GNULIB_FCHMODAT +REPLACE_TRUNCL +REPLACE_TRUNCF +REPLACE_TRUNC +REPLACE_SQRTL +REPLACE_SIGNBIT_USING_GCC +REPLACE_SIGNBIT +REPLACE_ROUNDL +REPLACE_ROUNDF +REPLACE_ROUND +REPLACE_REMAINDERL +REPLACE_REMAINDERF +REPLACE_REMAINDER +REPLACE_NAN +REPLACE_MODFL +REPLACE_MODFF +REPLACE_MODF +REPLACE_LOGBL +REPLACE_LOGBF +REPLACE_LOGB +REPLACE_LOG2L +REPLACE_LOG2F +REPLACE_LOG2 +REPLACE_LOG1PL +REPLACE_LOG1PF +REPLACE_LOG1P +REPLACE_LOG10L +REPLACE_LOG10F +REPLACE_LOG10 +REPLACE_LOGL +REPLACE_LOGF +REPLACE_LOG +REPLACE_LDEXPL +REPLACE_ISNAN +REPLACE_ISINF +REPLACE_ISFINITE +REPLACE_ILOGBF +REPLACE_ILOGB +REPLACE_HYPOTL +REPLACE_HYPOTF +REPLACE_HYPOT +REPLACE_HUGE_VAL +REPLACE_FREXPL +REPLACE_FREXP +REPLACE_FREXPF +REPLACE_FMODL +REPLACE_FMODF +REPLACE_FMOD +REPLACE_FMAL +REPLACE_FMAF +REPLACE_FMA +REPLACE_FLOORL +REPLACE_FLOORF +REPLACE_FLOOR +REPLACE_FABSL +REPLACE_EXP2L +REPLACE_EXP2 +REPLACE_EXPM1F +REPLACE_EXPM1 +REPLACE_CEILL +REPLACE_CEILF +REPLACE_CEIL +REPLACE_CBRTL +REPLACE_CBRTF +HAVE_DECL_TRUNCL +HAVE_DECL_TRUNCF +HAVE_DECL_TRUNC +HAVE_DECL_TANL +HAVE_DECL_SQRTL +HAVE_DECL_SINL +HAVE_DECL_ROUNDL +HAVE_DECL_ROUNDF +HAVE_DECL_ROUND +HAVE_DECL_RINTF +HAVE_DECL_REMAINDERL +HAVE_DECL_REMAINDER +HAVE_DECL_LOGB +HAVE_DECL_LOG2L +HAVE_DECL_LOG2F +HAVE_DECL_LOG2 +HAVE_DECL_LOG10L +HAVE_DECL_LOGL +HAVE_DECL_LDEXPL +HAVE_DECL_FREXPL +HAVE_DECL_FLOORL +HAVE_DECL_FLOORF +HAVE_DECL_EXPM1L +HAVE_DECL_EXP2L +HAVE_DECL_EXP2F +HAVE_DECL_EXP2 +HAVE_DECL_EXPL +HAVE_DECL_COSL +HAVE_DECL_COPYSIGNF +HAVE_DECL_CEILL +HAVE_DECL_CEILF +HAVE_DECL_CBRTL +HAVE_DECL_CBRTF +HAVE_DECL_ATANL +HAVE_DECL_ASINL +HAVE_DECL_ACOSL +HAVE_TANHF +HAVE_TANL +HAVE_TANF +HAVE_SQRTL +HAVE_SQRTF +HAVE_SINHF +HAVE_SINL +HAVE_SINF +HAVE_RINTL +HAVE_RINT +HAVE_REMAINDERF +HAVE_REMAINDER +HAVE_POWF +HAVE_MODFL +HAVE_MODFF +HAVE_LOGBL +HAVE_LOGBF +HAVE_LOG1PL +HAVE_LOG1PF +HAVE_LOG1P +HAVE_LOG10L +HAVE_LOG10F +HAVE_LOGL +HAVE_LOGF +HAVE_LDEXPF +HAVE_ISNANL +HAVE_ISNAND +HAVE_ISNANF +HAVE_ILOGBL +HAVE_ILOGBF +HAVE_ILOGB +HAVE_HYPOTL +HAVE_HYPOTF +HAVE_FREXPF +HAVE_FMODL +HAVE_FMODF +HAVE_FMAL +HAVE_FMAF +HAVE_FMA +HAVE_FABSL +HAVE_FABSF +HAVE_EXPM1F +HAVE_EXPM1 +HAVE_EXPL +HAVE_EXPF +HAVE_COSHF +HAVE_COSL +HAVE_COSF +HAVE_COPYSIGNL +HAVE_COPYSIGN +HAVE_CBRTL +HAVE_CBRTF +HAVE_CBRT +HAVE_ATAN2F +HAVE_ATANL +HAVE_ATANF +HAVE_ASINL +HAVE_ASINF +HAVE_ACOSL +HAVE_ACOSF +GNULIB_TRUNCL +GNULIB_TRUNCF +GNULIB_TRUNC +GNULIB_TANHF +GNULIB_TANL +GNULIB_TANF +GNULIB_SQRTL +GNULIB_SQRTF +GNULIB_SINHF +GNULIB_SINL +GNULIB_SINF +GNULIB_SIGNBIT +GNULIB_ROUNDL +GNULIB_ROUNDF +GNULIB_ROUND +GNULIB_RINTL +GNULIB_RINTF +GNULIB_RINT +GNULIB_REMAINDERL +GNULIB_REMAINDERF +GNULIB_REMAINDER +GNULIB_POWF +GNULIB_MODFL +GNULIB_MODFF +GNULIB_MODF +GNULIB_LOGBL +GNULIB_LOGBF +GNULIB_LOGB +GNULIB_LOG2L +GNULIB_LOG2F +GNULIB_LOG2 +GNULIB_LOG1PL +GNULIB_LOG1PF +GNULIB_LOG1P +GNULIB_LOG10L +GNULIB_LOG10F +GNULIB_LOG10 +GNULIB_LOGL +GNULIB_LOGF +GNULIB_LOG +GNULIB_LDEXPL +GNULIB_LDEXPF +GNULIB_ISNANL +GNULIB_ISNAND +GNULIB_ISNANF +GNULIB_ISNAN +GNULIB_ISINF +GNULIB_ISFINITE +GNULIB_ILOGBL +GNULIB_ILOGBF +GNULIB_ILOGB +GNULIB_HYPOTL +GNULIB_HYPOTF +GNULIB_HYPOT +GNULIB_FREXPL +GNULIB_FREXP +GNULIB_FREXPF +GNULIB_FMODL +GNULIB_FMODF +GNULIB_FMOD +GNULIB_FMAL +GNULIB_FMAF +GNULIB_FMA +GNULIB_FLOORL +GNULIB_FLOORF +GNULIB_FLOOR +GNULIB_FABSL +GNULIB_FABSF +GNULIB_EXPM1L +GNULIB_EXPM1F +GNULIB_EXPM1 +GNULIB_EXP2L +GNULIB_EXP2F +GNULIB_EXP2 +GNULIB_EXPL +GNULIB_EXPF +GNULIB_COSHF +GNULIB_COSL +GNULIB_COSF +GNULIB_COPYSIGNL +GNULIB_COPYSIGNF +GNULIB_COPYSIGN +GNULIB_CEILL +GNULIB_CEILF +GNULIB_CEIL +GNULIB_CBRTL +GNULIB_CBRTF +GNULIB_CBRT +GNULIB_ATAN2F +GNULIB_ATANL +GNULIB_ATANF +GNULIB_ASINL +GNULIB_ASINF +GNULIB_ACOSL +GNULIB_ACOSF +HAVE_FEATURES_H +APPLE_UNIVERSAL_BUILD +HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +REPLACE_VSPRINTF +REPLACE_VSNPRINTF +REPLACE_VPRINTF +REPLACE_VFPRINTF +REPLACE_VDPRINTF +REPLACE_VASPRINTF +REPLACE_TMPFILE +REPLACE_STDIO_WRITE_FUNCS +REPLACE_STDIO_READ_FUNCS +REPLACE_SPRINTF +REPLACE_SNPRINTF +REPLACE_RENAMEAT +REPLACE_RENAME +REPLACE_REMOVE +REPLACE_PRINTF +REPLACE_POPEN +REPLACE_PERROR +REPLACE_OBSTACK_PRINTF +REPLACE_GETLINE +REPLACE_GETDELIM +REPLACE_FTELLO +REPLACE_FTELL +REPLACE_FSEEKO +REPLACE_FSEEK +REPLACE_FREOPEN +REPLACE_FPURGE +REPLACE_FPRINTF +REPLACE_FOPEN +REPLACE_FFLUSH +REPLACE_FDOPEN +REPLACE_FCLOSE +REPLACE_DPRINTF +HAVE_VDPRINTF +HAVE_VASPRINTF +HAVE_RENAMEAT +HAVE_POPEN +HAVE_PCLOSE +HAVE_FTELLO +HAVE_FSEEKO +HAVE_DPRINTF +HAVE_DECL_VSNPRINTF +HAVE_DECL_SNPRINTF +HAVE_DECL_OBSTACK_PRINTF +HAVE_DECL_GETLINE +HAVE_DECL_GETDELIM +HAVE_DECL_FTELLO +HAVE_DECL_FSEEKO +HAVE_DECL_FPURGE +GNULIB_VSPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VPRINTF_POSIX +GNULIB_VPRINTF +GNULIB_VFPRINTF_POSIX +GNULIB_VFPRINTF +GNULIB_VDPRINTF +GNULIB_VSCANF +GNULIB_VFSCANF +GNULIB_VASPRINTF +GNULIB_TMPFILE +GNULIB_STDIO_H_SIGPIPE +GNULIB_STDIO_H_NONBLOCKING +GNULIB_SPRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_SCANF +GNULIB_RENAMEAT +GNULIB_RENAME +GNULIB_REMOVE +GNULIB_PUTS +GNULIB_PUTCHAR +GNULIB_PUTC +GNULIB_PRINTF_POSIX +GNULIB_PRINTF +GNULIB_POPEN +GNULIB_PERROR +GNULIB_PCLOSE +GNULIB_OBSTACK_PRINTF_POSIX +GNULIB_OBSTACK_PRINTF +GNULIB_GETLINE +GNULIB_GETDELIM +GNULIB_GETCHAR +GNULIB_GETC +GNULIB_FWRITE +GNULIB_FTELLO +GNULIB_FTELL +GNULIB_FSEEKO +GNULIB_FSEEK +GNULIB_FSCANF +GNULIB_FREOPEN +GNULIB_FREAD +GNULIB_FPUTS +GNULIB_FPUTC +GNULIB_FPURGE +GNULIB_FPRINTF_POSIX +GNULIB_FPRINTF +GNULIB_FOPEN +GNULIB_FGETS +GNULIB_FGETC +GNULIB_FFLUSH +GNULIB_FDOPEN +GNULIB_FCLOSE +GNULIB_DPRINTF +REPLACE_ITOLD +GL_GENERATE_FLOAT_H_FALSE +GL_GENERATE_FLOAT_H_TRUE +FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H +NEXT_FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H +NEXT_FCNTL_H +REPLACE_OPENAT +REPLACE_OPEN +REPLACE_FCNTL +HAVE_OPENAT +HAVE_FCNTL +GNULIB_OPENAT +GNULIB_OPEN +GNULIB_NONBLOCKING +GNULIB_FCNTL +EOVERFLOW_VALUE +EOVERFLOW_HIDDEN +ENOLINK_VALUE +ENOLINK_HIDDEN +EMULTIHOP_VALUE +EMULTIHOP_HIDDEN +GL_GENERATE_ERRNO_H_FALSE +GL_GENERATE_ERRNO_H_TRUE +ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H +NEXT_ERRNO_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +pkglibexecdir +runstatedir +lispdir +HAVE_WINSOCK2_H +HAVE_MSVC_INVALID_PARAMETER_HANDLER +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS +UNISTD_H_HAVE_WINSOCK2_H +REPLACE_WRITE +REPLACE_USLEEP +REPLACE_UNLINKAT +REPLACE_UNLINK +REPLACE_TTYNAME_R +REPLACE_SYMLINKAT +REPLACE_SYMLINK +REPLACE_SLEEP +REPLACE_RMDIR +REPLACE_READLINKAT +REPLACE_READLINK +REPLACE_READ +REPLACE_PWRITE +REPLACE_PREAD +REPLACE_LSEEK +REPLACE_LINKAT +REPLACE_LINK +REPLACE_LCHOWN +REPLACE_ISATTY +REPLACE_GETPAGESIZE +REPLACE_GETGROUPS +REPLACE_GETLOGIN_R +REPLACE_GETDTABLESIZE +REPLACE_GETDOMAINNAME +REPLACE_GETCWD +REPLACE_FTRUNCATE +REPLACE_FCHOWNAT +REPLACE_DUP2 +REPLACE_DUP +REPLACE_CLOSE +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_TTYNAME_R +HAVE_DECL_SETHOSTNAME +HAVE_DECL_GETUSERSHELL +HAVE_DECL_GETPAGESIZE +HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETDOMAINNAME +HAVE_DECL_FDATASYNC +HAVE_DECL_FCHDIR +HAVE_DECL_ENVIRON +HAVE_USLEEP +HAVE_UNLINKAT +HAVE_SYMLINKAT +HAVE_SYMLINK +HAVE_SLEEP +HAVE_SETHOSTNAME +HAVE_READLINKAT +HAVE_READLINK +HAVE_PWRITE +HAVE_PREAD +HAVE_PIPE2 +HAVE_PIPE +HAVE_LINKAT +HAVE_LINK +HAVE_LCHOWN +HAVE_GROUP_MEMBER +HAVE_GETPAGESIZE +HAVE_GETLOGIN +HAVE_GETHOSTNAME +HAVE_GETGROUPS +HAVE_GETDTABLESIZE +HAVE_FTRUNCATE +HAVE_FSYNC +HAVE_FDATASYNC +HAVE_FCHOWNAT +HAVE_FCHDIR +HAVE_FACCESSAT +HAVE_EUIDACCESS +HAVE_DUP3 +HAVE_DUP2 +HAVE_CHOWN +GNULIB_WRITE +GNULIB_USLEEP +GNULIB_UNLINKAT +GNULIB_UNLINK +GNULIB_UNISTD_H_SIGPIPE +GNULIB_UNISTD_H_NONBLOCKING +GNULIB_TTYNAME_R +GNULIB_SYMLINKAT +GNULIB_SYMLINK +GNULIB_SLEEP +GNULIB_SETHOSTNAME +GNULIB_RMDIR +GNULIB_READLINKAT +GNULIB_READLINK +GNULIB_READ +GNULIB_PWRITE +GNULIB_PREAD +GNULIB_PIPE2 +GNULIB_PIPE +GNULIB_LSEEK +GNULIB_LINKAT +GNULIB_LINK +GNULIB_LCHOWN +GNULIB_ISATTY +GNULIB_GROUP_MEMBER +GNULIB_GETUSERSHELL +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETLOGIN +GNULIB_GETHOSTNAME +GNULIB_GETGROUPS +GNULIB_GETDTABLESIZE +GNULIB_GETDOMAINNAME +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FSYNC +GNULIB_FDATASYNC +GNULIB_FCHOWNAT +GNULIB_FCHDIR +GNULIB_FACCESSAT +GNULIB_EUIDACCESS +GNULIB_ENVIRON +GNULIB_DUP3 +GNULIB_DUP2 +GNULIB_DUP +GNULIB_CLOSE +GNULIB_CHOWN +GNULIB_CHDIR +REPLACE_WCTOMB +REPLACE_UNSETENV +REPLACE_STRTOD +REPLACE_SETENV +REPLACE_REALPATH +REPLACE_REALLOC +REPLACE_RANDOM_R +REPLACE_QSORT_R +REPLACE_PUTENV +REPLACE_PTSNAME_R +REPLACE_PTSNAME +REPLACE_MKSTEMP +REPLACE_MBTOWC +REPLACE_MALLOC +REPLACE_CANONICALIZE_FILE_NAME +REPLACE_CALLOC +HAVE_DECL_UNSETENV +HAVE_UNLOCKPT +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL +HAVE_STRTOD +HAVE_DECL_SETENV +HAVE_SETENV +HAVE_SECURE_GETENV +HAVE_RPMATCH +HAVE_REALPATH +HAVE_RANDOM_R +HAVE_RANDOM_H +HAVE_RANDOM +HAVE_PTSNAME_R +HAVE_PTSNAME +HAVE_POSIX_OPENPT +HAVE_MKSTEMPS +HAVE_MKSTEMP +HAVE_MKOSTEMPS +HAVE_MKOSTEMP +HAVE_MKDTEMP +HAVE_GRANTPT +HAVE_GETSUBOPT +HAVE_DECL_GETLOADAVG +HAVE_CANONICALIZE_FILE_NAME +HAVE_ATOLL +HAVE__EXIT +GNULIB_WCTOMB +GNULIB_UNSETENV +GNULIB_UNLOCKPT +GNULIB_SYSTEM_POSIX +GNULIB_STRTOULL +GNULIB_STRTOLL +GNULIB_STRTOD +GNULIB_SETENV +GNULIB_SECURE_GETENV +GNULIB_RPMATCH +GNULIB_REALPATH +GNULIB_REALLOC_POSIX +GNULIB_RANDOM_R +GNULIB_RANDOM +GNULIB_QSORT_R +GNULIB_PUTENV +GNULIB_PTSNAME_R +GNULIB_PTSNAME +GNULIB_POSIX_OPENPT +GNULIB_MKSTEMPS +GNULIB_MKSTEMP +GNULIB_MKOSTEMPS +GNULIB_MKOSTEMP +GNULIB_MKDTEMP +GNULIB_MBTOWC +GNULIB_MALLOC_POSIX +GNULIB_GRANTPT +GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_CANONICALIZE_FILE_NAME +GNULIB_CALLOC_POSIX +GNULIB_ATOLL +GNULIB__EXIT +GL_GENERATE_ALLOCA_H_FALSE +GL_GENERATE_ALLOCA_H_TRUE +ALLOCA_H +ALLOCA +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +XSLTPROC +HELP2MAN +PERL +M4_DEBUGFILE +M4_GNU +M4 +YFLAGS +YACC +FLEX_CXX_WORKS_FALSE +FLEX_CXX_WORKS_TRUE +LEXLIB +LEX_OUTPUT_ROOT +LEX_IS_FLEX +LEX +DOT +ENABLE_YACC_FALSE +ENABLE_YACC_TRUE +CXX_COMPILER_POSIXLY_CORRECT +BISON_CXX_WORKS_FALSE +BISON_CXX_WORKS_TRUE +BISON_CXX_WORKS +C_COMPILER_POSIXLY_CORRECT +BISON_C_WORKS +FLEX_SCANNER_CXXFLAGS +WARN_CXXFLAGS_TEST +WERROR_CXXFLAGS +WARN_CXXFLAGS +WARN_CFLAGS_TEST +WERROR_CFLAGS +WARN_CFLAGS +ENABLE_GCC_WARNINGS_FALSE +ENABLE_GCC_WARNINGS_TRUE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +RANLIB +ARFLAGS +AR +EGREP +GREP +CPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +PACKAGE_COPYRIGHT_YEAR +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +enable_threads +enable_gcc_warnings +enable_yacc +enable_assert +with_gnu_ld +enable_rpath +with_libpth_prefix +with_dmalloc +enable_nls +with_libiconv_prefix +with_libintl_prefix +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CPP +YACC +YFLAGS +M4' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures GNU Bison 3.0.4 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/bison] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GNU Bison 3.0.4:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-largefile omit support for large files + --enable-threads={posix|solaris|pth|windows} + specify multithreading API + --disable-threads build without multithread safety + --enable-gcc-warnings turn on lots of GCC warnings (not recommended). + Also, issue synclines from the examples/ to + the corresponding source in the Texinfo doc. + --disable-yacc do not build a yacc command or an -ly library + --disable-assert turn off assertions + --disable-rpath do not hardcode runtime library paths + --disable-nls do not use Native Language Support + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-libpth-prefix[=DIR] search for libpth in DIR/include and DIR/lib + --without-libpth-prefix don't search for libpth in includedir and libdir + --with-dmalloc use dmalloc, as in + http://www.dmalloc.com/dmalloc.tar.gz + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. + M4 Location of GNU M4 1.4.6 or later. Defaults to the first program + of 'm4', 'gm4', or 'gnum4' on PATH that meets Autoconf needs. + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <bug-bison@gnu.org>. +GNU Bison home page: <http://www.gnu.org/software/bison/>. +General help using GNU software: <http://www.gnu.org/gethelp/>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GNU Bison configure 3.0.4 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## -------------------------------- ## +## Report this to bug-bison@gnu.org ## +## -------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 <conftest.val; ac_retval=0 +else + ac_retval=1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f conftest.val + + fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_compute_int + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GNU Bison $as_me 3.0.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " locale.h" +as_fn_append ac_func_list " _set_invalid_parameter_handler" +as_fn_append ac_header_list " sys/socket.h" +as_fn_append ac_func_list " getdtablesize" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_func_list " fcntl" +as_fn_append ac_func_list " symlink" +as_fn_append ac_header_list " stdio_ext.h" +as_fn_append ac_func_list " vasnprintf" +as_fn_append ac_header_list " features.h" +as_fn_append ac_func_list " snprintf" +as_fn_append ac_func_list " __fseterr" +as_fn_append ac_header_list " sys/stat.h" +gl_getopt_required=GNU +as_fn_append ac_header_list " getopt.h" +as_fn_append ac_header_list " sys/time.h" +as_fn_append ac_func_list " gettimeofday" +as_fn_append ac_header_list " wchar.h" +as_fn_append ac_header_list " stdint.h" +as_fn_append ac_header_list " inttypes.h" +as_fn_append ac_func_list " lstat" +as_fn_append ac_header_list " math.h" +as_fn_append ac_func_list " mbsinit" +as_fn_append ac_func_list " mbrtowc" +as_fn_append ac_func_list " isascii" +as_fn_append ac_header_list " sys/mman.h" +as_fn_append ac_func_list " mprotect" +as_fn_append ac_func_list " obstack_printf" +as_fn_append ac_header_list " sys/param.h" +as_fn_append ac_func_list " strerror_r" +as_fn_append ac_func_list " __xpg_strerror_r" +as_fn_append ac_func_list " pipe2" +gl_printf_safe=yes +as_fn_append ac_header_list " sched.h" +as_fn_append ac_func_list " sigaction" +as_fn_append ac_func_list " sigaltstack" +as_fn_append ac_func_list " siginterrupt" +as_fn_append ac_header_list " spawn.h" +as_fn_append ac_func_list " strdup" +as_fn_append ac_func_list " catgets" +as_fn_append ac_func_list " strndup" +as_fn_append ac_header_list " sys/wait.h" +as_fn_append ac_func_list " pipe" +as_fn_append ac_func_list " iswcntrl" +as_fn_append ac_header_list " wctype.h" +as_fn_append ac_func_list " wcwidth" +as_fn_append ac_func_list " setlocale" +gt_needs="$gt_needs need-ngettext" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +PACKAGE_COPYRIGHT_YEAR=2015 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_COPYRIGHT_YEAR $PACKAGE_COPYRIGHT_YEAR +_ACEOF + + +ac_aux_dir= +for ac_dir in build-aux "$srcdir"/build-aux; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +# We use Automake 1.14's %D% and %C%. +# +# We want gnits strictness only when rolling a stable release. For +# release candidates, we use version strings like 2.4.3_rc1, but gnits +# doesn't like that, so we let the underscore disable gnits. Between +# releases, we want to be able run make dist without being required to +# add a bogus NEWS entry. In that case, the version string +# automatically contains a dash, which we also let disable gnits. +am__api_version='1.15' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='bison' + VERSION='3.0.4' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: <http://www.gnu.org/software/coreutils/>. + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +ac_config_headers="$ac_config_headers lib/config.h:lib/config.in.h" + + +# Checks for the compiler. +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdbool.h> +#include <stdlib.h> +#include <wchar.h> +#include <stdio.h> + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if ${ac_cv_prog_cc_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +# Gnulib (early checks). + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +$as_echo_n "checking for Minix Amsterdam compiler... " >&6; } +if ${gl_cv_c_amsterdam_compiler+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __ACK__ +Amsterdam +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Amsterdam" >/dev/null 2>&1; then : + gl_cv_c_amsterdam_compiler=yes +else + gl_cv_c_amsterdam_compiler=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +$as_echo "$gl_cv_c_amsterdam_compiler" >&6; } + if test -z "$AR"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + AR='cc -c.a' + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test -z "$ARFLAGS"; then + ARFLAGS='cru' + fi + fi + else + if test -z "$ARFLAGS"; then + ARFLAGS='cru' + fi + fi + + + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + fi + fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + +$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if ${ac_cv_should_define__xopen_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_should_define__xopen_source=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <wchar.h> + mbstate_t x; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include <wchar.h> + mbstate_t x; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +$as_echo "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + + + + + + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM> + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h + +fi + + + + + + + # Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; gl_use_threads=$enableval +else + if test -n "$gl_use_threads_default"; then + gl_use_threads="$gl_use_threads_default" + else + case "$host_os" in + osf*) gl_use_threads=no ;; + cygwin*) + case `uname -r` in + 1.[0-5].*) gl_use_threads=no ;; + *) gl_use_threads=yes ;; + esac + ;; + *) gl_use_threads=yes ;; + esac + fi + +fi + + if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then + # For using <pthread.h>: + case "$host_os" in + osf*) + # On OSF/1, the compiler needs the flag -D_REENTRANT so that it + # groks <pthread.h>. cc also understands the flag -pthread, but + # we don't use it because 1. gcc-2.95 doesn't understand -pthread, + # 2. putting a flag into CPPFLAGS that has an effect on the linker + # causes the AC_LINK_IFELSE test below to succeed unexpectedly, + # leading to wrong values of LIBTHREAD and LTLIBTHREAD. + CPPFLAGS="$CPPFLAGS -D_REENTRANT" + ;; + esac + # Some systems optimize for single-threaded programs by default, and + # need special flags to disable these optimizations. For example, the + # definition of 'errno' in <errno.h>. + case "$host_os" in + aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; + solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; + esac + fi + + + + + # Code from module absolute-header: + # Code from module alignof: + # Code from module alloca-opt: + # Code from module announce-gen: + # Code from module argmatch: + # Code from module assert: + # Code from module binary-io: + # Code from module bitrotate: + # Code from module c-ctype: + # Code from module c-strcase: + # Code from module c-strcaseeq: + # Code from module calloc-posix: + # Code from module cloexec: + # Code from module close: + # Code from module close-stream: + # Code from module closeout: + # Code from module concat-filename: + # Code from module config-h: + # Code from module configmake: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module dup2: + # Code from module environ: + # Code from module errno: + # Code from module error: + # Code from module exitfail: + # Code from module extensions: + + # Code from module extern-inline: + # Code from module fatal-signal: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fd-hook: + # Code from module fd-safer-flag: + # Code from module fdl: + # Code from module filename: + # Code from module float: + # Code from module fopen: + # Code from module fopen-safer: + # Code from module fpending: + # Code from module fpieee: + + # Code from module fprintf-posix: + # Code from module fpucw: + # Code from module frexp-nolibm: + # Code from module frexpl-nolibm: + # Code from module fseterr: + # Code from module fstat: + # Code from module gendocs: + # Code from module getdtablesize: + # Code from module getopt-gnu: + # Code from module getopt-posix: + # Code from module gettext: + # Code from module gettext-h: + # Code from module gettimeofday: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gpl-3.0: + # Code from module hash: + # Code from module havelib: + # Code from module include_next: + # Code from module intprops: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module isnan: + # Code from module isnand: + # Code from module isnand-nolibm: + # Code from module isnanf: + # Code from module isnanf-nolibm: + # Code from module isnanl: + # Code from module isnanl-nolibm: + # Code from module javacomp-script: + # Code from module javaexec-script: + # Code from module largefile: + + # Code from module ldexp: + # Code from module ldexpl: + # Code from module localcharset: + # Code from module lock: + # Code from module lstat: + # Code from module maintainer-makefile: + # Code from module malloc-gnu: + # Code from module malloc-posix: + # Code from module math: + # Code from module mbrtowc: + # Code from module mbsinit: + # Code from module mbswidth: + # Code from module memchr: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nocrash: + # Code from module non-recursive-gnulib-prefix-hack: + # Code from module obstack: + # Code from module obstack-printf: + # Code from module open: + # Code from module pathmax: + # Code from module perror: + # Code from module pipe2: + # Code from module pipe2-safer: + # Code from module posix_spawn-internal: + # Code from module posix_spawn_file_actions_addclose: + # Code from module posix_spawn_file_actions_adddup2: + # Code from module posix_spawn_file_actions_addopen: + # Code from module posix_spawn_file_actions_destroy: + # Code from module posix_spawn_file_actions_init: + # Code from module posix_spawnattr_destroy: + # Code from module posix_spawnattr_init: + # Code from module posix_spawnattr_setflags: + # Code from module posix_spawnattr_setsigmask: + # Code from module posix_spawnp: + # Code from module printf-frexp: + # Code from module printf-frexpl: + # Code from module printf-posix: + # Code from module printf-safe: + # Code from module progname: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module raise: + # Code from module rawmemchr: + # Code from module readme-release: + # Code from module realloc-posix: + # Code from module sched: + # Code from module sigaction: + # Code from module signal-h: + # Code from module signbit: + # Code from module sigprocmask: + # Code from module size_max: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-posix: + # Code from module spawn: + # Code from module spawn-pipe: + # Code from module sprintf-posix: + # Code from module ssize_t: + # Code from module stat: + # Code from module stdbool: + # Code from module stddef: + # Code from module stdint: + # Code from module stdio: + # Code from module stdlib: + # Code from module stpcpy: + # Code from module strchrnul: + # Code from module strdup-posix: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror_r-posix: + # Code from module string: + # Code from module strndup: + # Code from module strnlen: + # Code from module strverscmp: + # Code from module sys_stat: + # Code from module sys_time: + # Code from module sys_types: + # Code from module sys_wait: + # Code from module threadlib: + + + + # Code from module time: + # Code from module unistd: + # Code from module unistd-safer: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module unlink: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module update-copyright: + # Code from module useless-if-before-free: + # Code from module vasnprintf: + # Code from module vc-list-files: + # Code from module verify: + # Code from module vfprintf-posix: + # Code from module vsnprintf: + # Code from module vsnprintf-posix: + # Code from module vsprintf-posix: + # Code from module wait-process: + # Code from module waitpid: + # Code from module warnings: + # Code from module wchar: + # Code from module wctype-h: + # Code from module wcwidth: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-oversized: + # Code from module xconcat-filename: + # Code from module xmemdup0: + # Code from module xsize: + # Code from module xstrndup: + + +# Gnulib uses '#pragma GCC diagnostic push' to silence some +# warnings, but older gcc doesn't support this. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pragma GCC diagnostic push works" >&5 +$as_echo_n "checking whether pragma GCC diagnostic push works... " >&6; } +if ${lv_cv_gcc_pragma_push_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_CFLAGS=$CFLAGS + CFLAGS='-Wunknown-pragmas -Werror' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #pragma GCC diagnostic push + #pragma GCC diagnostic pop + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + lv_cv_gcc_pragma_push_works=yes +else + lv_cv_gcc_pragma_push_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$save_CFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lv_cv_gcc_pragma_push_works" >&5 +$as_echo "$lv_cv_gcc_pragma_push_works" >&6; } + +# Check whether --enable-gcc-warnings was given. +if test "${enable_gcc_warnings+set}" = set; then : + enableval=$enable_gcc_warnings; case $enable_gcc_warnings in + yes|no) ;; + *) as_fn_error $? "invalid value for --gcc-warnings: $enable_gcc_warnings" "$LINENO" 5;; + esac +else + enable_gcc_warnings=no +fi + + if test "$enable_gcc_warnings" = yes; then + ENABLE_GCC_WARNINGS_TRUE= + ENABLE_GCC_WARNINGS_FALSE='#' +else + ENABLE_GCC_WARNINGS_TRUE='#' + ENABLE_GCC_WARNINGS_FALSE= +fi + +if test "$enable_gcc_warnings" = yes; then + warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align -Wdocumentation + -Wformat -Wpointer-arith -Wwrite-strings' + warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes' + warn_cxx='-Wnoexcept' + # Warnings for the test suite only. + # + # -fno-color-diagnostics: Clang's use of colors in the error + # messages is confusing the tests looking at the compiler's output + # (e.g., synclines.at). + warn_tests='-Wundef -pedantic -Wsign-compare -fno-color-diagnostics' + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # Clang supports many of GCC's -W options, but only issues warnings + # on the ones it does not recognize. In that case, gl_WARN_ADD + # thinks the option is supported, and unknown options are then added + # to CFLAGS. But then, when -Werror is added in the test suite for + # instance, the warning about the unknown option turns into an + # error. + # + # This should be addressed by gnulib's gl_WARN_ADD, but in the + # meanwhile, turn warnings about unknown options into errors in + # CFLAGS, and restore CFLAGS after the tests. + save_CFLAGS=$CFLAGS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_c__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_c__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_c__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror=unknown-warning-option" >&5 +$as_echo_n "checking whether C compiler handles -Werror=unknown-warning-option... " >&6; } +if ${gl_cv_warn_c__Werror_unknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror=unknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_c__Werror_unknown_warning_option=yes +else + gl_cv_warn_c__Werror_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror_unknown_warning_option" >&5 +$as_echo "$gl_cv_warn_c__Werror_unknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror_unknown_warning_option" = xyes; then : + as_fn_append CFLAGS " -Werror=unknown-warning-option" +fi + + + for i in $warn_common $warn_c; + do + +as_gl_Warn=`$as_echo "gl_cv_warn_c_$i" | $as_tr_sh` +gl_positive="$i" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $i" >&5 +$as_echo_n "checking whether C compiler handles $i... " >&6; } +if eval \${$as_gl_Warn+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_gl_Warn=yes" +else + eval "$as_gl_Warn=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +eval ac_res=\$$as_gl_Warn + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes"; then : + as_fn_append WARN_CFLAGS " $i" +fi + + + done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 +$as_echo_n "checking whether C compiler handles -Werror... " >&6; } +if ${gl_cv_warn_c__Werror+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_c__Werror=yes +else + gl_cv_warn_c__Werror=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5 +$as_echo "$gl_cv_warn_c__Werror" >&6; } +if test "x$gl_cv_warn_c__Werror" = xyes; then : + as_fn_append WERROR_CFLAGS " -Werror" +fi + + + + # Warnings for the test suite, and maybe for bison if GCC is modern + # enough. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wmissing-declarations" >&5 +$as_echo_n "checking whether C compiler handles -Wmissing-declarations... " >&6; } +if ${gl_cv_warn_c__Wmissing_declarations+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-declarations" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_c__Wmissing_declarations=yes +else + gl_cv_warn_c__Wmissing_declarations=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wmissing_declarations" >&5 +$as_echo "$gl_cv_warn_c__Wmissing_declarations" >&6; } +if test "x$gl_cv_warn_c__Wmissing_declarations" = xyes; then : + as_fn_append WARN_CFLAGS_TEST " -Wmissing-declarations" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wmissing-prototypes" >&5 +$as_echo_n "checking whether C compiler handles -Wmissing-prototypes... " >&6; } +if ${gl_cv_warn_c__Wmissing_prototypes+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-prototypes" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_c__Wmissing_prototypes=yes +else + gl_cv_warn_c__Wmissing_prototypes=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wmissing_prototypes" >&5 +$as_echo "$gl_cv_warn_c__Wmissing_prototypes" >&6; } +if test "x$gl_cv_warn_c__Wmissing_prototypes" = xyes; then : + as_fn_append WARN_CFLAGS_TEST " -Wmissing-prototypes" +fi + + + test $lv_cv_gcc_pragma_push_works = yes && + as_fn_append WARN_CFLAGS " $WARN_CFLAGS_TEST" + + # Warnings for the test suite only. + for i in $warn_tests; + do + +as_gl_Warn=`$as_echo "gl_cv_warn_c_$i" | $as_tr_sh` +gl_positive="$i" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $i" >&5 +$as_echo_n "checking whether C compiler handles $i... " >&6; } +if eval \${$as_gl_Warn+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_gl_Warn=yes" +else + eval "$as_gl_Warn=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +eval ac_res=\$$as_gl_Warn + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes"; then : + as_fn_append WARN_CFLAGS_TEST " $i" +fi + + + done + CFLAGS=$save_CFLAGS + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + save_CXXFLAGS=$CXXFLAGS + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Werror=unknown-warning-option" >&5 +$as_echo_n "checking whether C++ compiler handles -Werror=unknown-warning-option... " >&6; } +if ${gl_cv_warn_cxx__Werror_unknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Werror=unknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Werror_unknown_warning_option=yes +else + gl_cv_warn_cxx__Werror_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Werror_unknown_warning_option" >&5 +$as_echo "$gl_cv_warn_cxx__Werror_unknown_warning_option" >&6; } +if test "x$gl_cv_warn_cxx__Werror_unknown_warning_option" = xyes; then : + as_fn_append CXXFLAGS " -Werror=unknown-warning-option" +fi + + + for i in $warn_common $warn_cxx; + do + +as_gl_Warn=`$as_echo "gl_cv_warn_cxx_$i" | $as_tr_sh` +gl_positive="$i" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles $i" >&5 +$as_echo_n "checking whether C++ compiler handles $i... " >&6; } +if eval \${$as_gl_Warn+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + eval "$as_gl_Warn=yes" +else + eval "$as_gl_Warn=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +eval ac_res=\$$as_gl_Warn + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes"; then : + as_fn_append WARN_CXXFLAGS " $i" +fi + + + done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wzero-as-null-pointer-constant" >&5 +$as_echo_n "checking whether C++ compiler handles -Wzero-as-null-pointer-constant... " >&6; } +if ${gl_cv_warn_cxx__Wzero_as_null_pointer_constant+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wzero-as-null-pointer-constant" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +nullptr + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Wzero_as_null_pointer_constant=yes +else + gl_cv_warn_cxx__Wzero_as_null_pointer_constant=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Wzero_as_null_pointer_constant" >&5 +$as_echo "$gl_cv_warn_cxx__Wzero_as_null_pointer_constant" >&6; } +if test "x$gl_cv_warn_cxx__Wzero_as_null_pointer_constant" = xyes; then : + as_fn_append WARN_CXXFLAGS " -Wzero-as-null-pointer-constant" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Werror" >&5 +$as_echo_n "checking whether C++ compiler handles -Werror... " >&6; } +if ${gl_cv_warn_cxx__Werror+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Werror=yes +else + gl_cv_warn_cxx__Werror=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Werror" >&5 +$as_echo "$gl_cv_warn_cxx__Werror" >&6; } +if test "x$gl_cv_warn_cxx__Werror" = xyes; then : + as_fn_append WERROR_CXXFLAGS " -Werror" +fi + + + # Warnings for the test suite only. + for i in $warn_tests; + do + +as_gl_Warn=`$as_echo "gl_cv_warn_cxx_$i" | $as_tr_sh` +gl_positive="$i" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles $i" >&5 +$as_echo_n "checking whether C++ compiler handles $i... " >&6; } +if eval \${$as_gl_Warn+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors $gl_positive" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + eval "$as_gl_Warn=yes" +else + eval "$as_gl_Warn=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +eval ac_res=\$$as_gl_Warn + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes"; then : + as_fn_append WARN_CXXFLAGS_TEST " $i" +fi + + + done + # Clang++ 3.2+ reject C code generated by Flex. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wno-null-conversion" >&5 +$as_echo_n "checking whether C++ compiler handles -Wno-null-conversion... " >&6; } +if ${gl_cv_warn_cxx__Wno_null_conversion+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wnull-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Wno_null_conversion=yes +else + gl_cv_warn_cxx__Wno_null_conversion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Wno_null_conversion" >&5 +$as_echo "$gl_cv_warn_cxx__Wno_null_conversion" >&6; } +if test "x$gl_cv_warn_cxx__Wno_null_conversion" = xyes; then : + as_fn_append FLEX_SCANNER_CXXFLAGS " -Wno-null-conversion" +fi + + + # So does G++ 4.8... + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wno-sign-compare" >&5 +$as_echo_n "checking whether C++ compiler handles -Wno-sign-compare... " >&6; } +if ${gl_cv_warn_cxx__Wno_sign_compare+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Wno_sign_compare=yes +else + gl_cv_warn_cxx__Wno_sign_compare=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Wno_sign_compare" >&5 +$as_echo "$gl_cv_warn_cxx__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn_cxx__Wno_sign_compare" = xyes; then : + as_fn_append FLEX_SCANNER_CXXFLAGS " -Wno-sign-compare" +fi + + + # ... possiby in std=c++11 mode. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wno-zero-as-null-pointer-constant" >&5 +$as_echo_n "checking whether C++ compiler handles -Wno-zero-as-null-pointer-constant... " >&6; } +if ${gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wzero-as-null-pointer-constant" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant=yes +else + gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant" >&5 +$as_echo "$gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant" >&6; } +if test "x$gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant" = xyes; then : + as_fn_append FLEX_SCANNER_CXXFLAGS " -Wno-zero-as-null-pointer-constant" +fi + + + CXXFLAGS=$save_CXXFLAGS + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + int test_array[CHAR_BIT]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compile a simple C program +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + BISON_C_WORKS=: + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports POSIXLY_CORRECT=1" >&5 +$as_echo_n "checking whether $CC supports POSIXLY_CORRECT=1... " >&6; } +if ${bison_cv_c_supports_posixly_correct+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' +case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in + xx) gl_had_POSIXLY_CORRECT=exported ;; + x) gl_had_POSIXLY_CORRECT=yes ;; + *) gl_had_POSIXLY_CORRECT= ;; +esac +POSIXLY_CORRECT=1 +export POSIXLY_CORRECT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bison_cv_c_supports_posixly_correct=yes +else + bison_cv_c_supports_posixly_correct=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;; + *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bison_cv_c_supports_posixly_correct" >&5 +$as_echo "$bison_cv_c_supports_posixly_correct" >&6; } +case $bison_cv_c_supports_posixly_correct in + yes) C_COMPILER_POSIXLY_CORRECT=true + ;; + no) C_COMPILER_POSIXLY_CORRECT=false +;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX builds executables that work" >&5 +$as_echo_n "checking whether $CXX builds executables that work... " >&6; } +if ${bison_cv_cxx_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + bison_cv_cxx_works=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <cstdlib> + #include <iostream> + #include <map> + #include <string> + using namespace std; +int +main () +{ +std::cerr << ""; + cout << ""; + typedef std::pair<unsigned int, int> uipair; + std::map<unsigned int, int> m; + std::map<unsigned int, int>::iterator i; + m.insert (uipair (4, -4)); + for (i = m.begin (); i != m.end (); ++i) + if (i->first != 4) + return 1; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + if { ac_try='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_objext $LIBS >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + if test "$cross_compiling" = yes; then : + bison_cv_cxx_works=cross +else + if { ac_try='./conftest$ac_exeext' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + bison_cv_cxx_works=yes +fi +fi +fi + rm -f conftest$ac_exeext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bison_cv_cxx_works" >&5 +$as_echo "$bison_cv_cxx_works" >&6; } + + case $bison_cv_cxx_works in + yes) + BISON_CXX_WORKS=':';; + no | cross) + BISON_CXX_WORKS='exit 77';; + esac + + + if test $bison_cv_cxx_works = yes; then + BISON_CXX_WORKS_TRUE= + BISON_CXX_WORKS_FALSE='#' +else + BISON_CXX_WORKS_TRUE='#' + BISON_CXX_WORKS_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports POSIXLY_CORRECT=1" >&5 +$as_echo_n "checking whether $CXX supports POSIXLY_CORRECT=1... " >&6; } +if ${bison_cv_cxx_supports_posixly_correct+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' +case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in + xx) gl_had_POSIXLY_CORRECT=exported ;; + x) gl_had_POSIXLY_CORRECT=yes ;; + *) gl_had_POSIXLY_CORRECT= ;; +esac +POSIXLY_CORRECT=1 +export POSIXLY_CORRECT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + bison_cv_cxx_supports_posixly_correct=yes +else + bison_cv_cxx_supports_posixly_correct=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;; + *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bison_cv_cxx_supports_posixly_correct" >&5 +$as_echo "$bison_cv_cxx_supports_posixly_correct" >&6; } +case $bison_cv_cxx_supports_posixly_correct in + yes) CXX_COMPILER_POSIXLY_CORRECT=true + ;; + no) CXX_COMPILER_POSIXLY_CORRECT=false +;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Check whether --enable-yacc was given. +if test "${enable_yacc+set}" = set; then : + enableval=$enable_yacc; +else + enable_yacc=yes +fi + + if test "$enable_yacc" = yes; then + ENABLE_YACC_TRUE= + ENABLE_YACC_FALSE='#' +else + ENABLE_YACC_TRUE='#' + ENABLE_YACC_FALSE= +fi + + +# Checks for programs. + +DOT=${DOT-"${am_missing_run}dot"} + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +$as_echo "$LEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test "x$LEX" != "x:"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lex is flex" >&5 +$as_echo_n "checking whether lex is flex... " >&6; } +if ${ac_cv_prog_lex_is_flex+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.l <<_ACEOF +%option debug nodefault noinput nounput noyywrap never-interactive +%x SC_CONF_TEST +%% +a { BEGIN SC_CONF_TEST; } +_ACEOF +if { { ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + ac_cv_prog_lex_is_flex=yes +else + ac_cv_prog_lex_is_flex=no +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_is_flex" >&5 +$as_echo "$ac_cv_prog_lex_is_flex" >&6; } +LEX_IS_FLEX=`test "$ac_cv_prog_lex_is_flex" = yes && echo true || echo false` + +cat >conftest.l <<_ACEOF +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ + yyless ((input () != 0)); } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; +#endif +int +main (void) +{ + return ! yylex () + ! yywrap (); +} +_ACEOF +{ { ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 +$as_echo_n "checking lex output file root... " >&6; } +if ${ac_cv_prog_lex_root+:} false; then : + $as_echo_n "(cached) " >&6 +else + +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +$as_echo "$ac_cv_prog_lex_root" >&6; } +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +if test -z "${LEXLIB+set}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 +$as_echo_n "checking lex library... " >&6; } +if ${ac_cv_lib_lex+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_save_LIBS=$LIBS + ac_cv_lib_lex='none needed' + for ac_lib in '' -lfl -ll; do + LIBS="$ac_lib $ac_save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lex=$ac_lib +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + test "$ac_cv_lib_lex" != 'none needed' && break + done + LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +$as_echo "$ac_cv_lib_lex" >&6; } + test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +$as_echo_n "checking whether yytext is a pointer... " >&6; } +if ${ac_cv_prog_lex_yytext_pointer+:} false; then : + $as_echo_n "(cached) " >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +ac_save_LIBS=$LIBS +LIBS="$LEXLIB $ac_save_LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define YYTEXT_POINTER 1 +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_prog_lex_yytext_pointer=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h + +fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c + +fi +$LEX_IS_FLEX || test "X$LEX" = X: || { + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: bypassing lex because flex is required" >&5 +$as_echo "$as_me: WARNING: bypassing lex because flex is required" >&2;} + LEX=: +} + if $LEX_IS_FLEX && test $bison_cv_cxx_works = yes; then + FLEX_CXX_WORKS_TRUE= + FLEX_CXX_WORKS_FALSE='#' +else + FLEX_CXX_WORKS_TRUE='#' + FLEX_CXX_WORKS_FALSE= +fi + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU M4 that supports accurate traces" >&5 +$as_echo_n "checking for GNU M4 that supports accurate traces... " >&6; } +if ${ac_cv_path_M4+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.m4f +ac_had_posixly_correct=${POSIXLY_CORRECT:+yes} +{ POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} +if test -z "$M4"; then + ac_path_M4_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in m4 gm4 gnum4; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_M4="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_M4" || continue + # Root out GNU M4 1.4.5, as well as non-GNU m4 that ignore -t, -F. + # Root out GNU M4 1.4.15 with buggy false negative replacement strstr. + # Root out Glibc 2.9 - 2.12 and GNU M4 1.4.11 - 1.4.15 with buggy + # false positive strstr. + ac_snippet=change'quote(<,>)in''dir(<if''def>,mac,bug)' + ac_snippet=${ac_snippet}pat'subst(a,\(b\)\|\(a\),\1)d'nl + ac_snippet=${ac_snippet}${as_nl}if'else(in''dex(..wi.d.,.d.),-1,bug)' + ac_snippet=${ac_snippet}${as_nl}if'else(in''dex(;:11-:12-:12-:12-:12-:12-:12-:12-:12.:12.:12.:12.:12.:12.:12.:12.:12-,:12-:12-:12-:12-:12-:12-:12-:12-),-1,,strstr-bug2)' + test -z "`$ac_path_M4 -F conftest.m4f </dev/null 2>&1`" \ + && test -z "`$as_echo $ac_snippet | $ac_path_M4 --trace=mac 2>&1`" \ + && test -f conftest.m4f \ + && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=: + rm -f conftest.m4f + $ac_path_M4_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_M4"; then + as_fn_error $? "no acceptable m4 could be found in \$PATH. +GNU M4 1.4.6 or later is required; 1.4.16 or newer is recommended. +GNU M4 1.4.15 uses a buggy replacement strstr on some systems. +Glibc 2.9 - 2.12 and GNU M4 1.4.11 - 1.4.15 have another strstr bug." "$LINENO" 5 + fi +else + ac_cv_path_M4=$M4 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_M4" >&5 +$as_echo "$ac_cv_path_M4" >&6; } + M4=$ac_cv_path_M4 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_cv_path_M4 accepts --gnu" >&5 +$as_echo_n "checking whether $ac_cv_path_M4 accepts --gnu... " >&6; } +if ${ac_cv_prog_gnu_m4_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + case `$M4 --help < /dev/null 2>&1` in + *--gnu*) ac_cv_prog_gnu_m4_gnu=yes ;; + *) ac_cv_prog_gnu_m4_gnu=no ;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_m4_gnu" >&5 +$as_echo "$ac_cv_prog_gnu_m4_gnu" >&6; } + if test "$ac_cv_prog_gnu_m4_gnu" = yes; then + M4_GNU=--gnu + else + M4_GNU= + fi + + if test x$ac_had_posixly_correct = xyes; then + POSIXLY_CORRECT=: + if test $ac_cv_prog_gnu_m4_gnu = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the version of M4 that was found does not support -g" >&5 +$as_echo "$as_me: WARNING: the version of M4 that was found does not support -g" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using it with POSIXLY_CORRECT set may cause problems" >&5 +$as_echo "$as_me: WARNING: using it with POSIXLY_CORRECT set may cause problems" >&2;} + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how m4 supports trace files" >&5 +$as_echo_n "checking how m4 supports trace files... " >&6; } +if ${ac_cv_prog_gnu_m4_debugfile+:} false; then : + $as_echo_n "(cached) " >&6 +else + case `$M4 --help < /dev/null 2>&1` in + *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;; + *) ac_cv_prog_gnu_m4_debugfile=--error-output ;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_m4_debugfile" >&5 +$as_echo "$ac_cv_prog_gnu_m4_debugfile" >&6; } + M4_DEBUGFILE=$ac_cv_prog_gnu_m4_debugfile + + + +cat >>confdefs.h <<_ACEOF +#define M4 "$M4" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define M4_GNU_OPTION "$M4_GNU" +_ACEOF + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$PERL"; then + as_fn_error $? "perl not found" "$LINENO" 5 +fi + +HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} + +# Extract the first word of "xsltproc", so it can be a program name with args. +set dummy xsltproc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_XSLTPROC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $XSLTPROC in + [\\/]* | ?:[\\/]*) + ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +XSLTPROC=$ac_cv_path_XSLTPROC +if test -n "$XSLTPROC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 +$as_echo "$XSLTPROC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Checks for header files. + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + +# Checks for compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + +# Gnulib (later checks). Putting them here rather than right after +# gl_EARLY avoids some redundant checks. + + + + + + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <alloca.h> +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + + + + + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + + + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_POSIX_OPENPT=0; + GNULIB_PTSNAME=0; + GNULIB_PTSNAME_R=0; + GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; + GNULIB_RANDOM=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SECURE_GETENV=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_POSIX_OPENPT=1; + HAVE_PTSNAME=1; + HAVE_PTSNAME_R=1; + HAVE_RANDOM=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SECURE_GETENV=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PTSNAME=0; + REPLACE_PTSNAME_R=0; + REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; + REPLACE_RANDOM_R=0; + REPLACE_REALLOC=0; + REPLACE_REALPATH=0; + REPLACE_SETENV=0; + REPLACE_STRTOD=0; + REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if ${gl_cv_func_malloc_posix+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_malloc_posix=yes +else + gl_cv_func_malloc_posix=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +$as_echo "$gl_cv_func_malloc_posix" >&6; } + + + GNULIB_CHDIR=0; + GNULIB_CHOWN=0; + GNULIB_CLOSE=0; + GNULIB_DUP=0; + GNULIB_DUP2=0; + GNULIB_DUP3=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; + GNULIB_FACCESSAT=0; + GNULIB_FCHDIR=0; + GNULIB_FCHOWNAT=0; + GNULIB_FDATASYNC=0; + GNULIB_FSYNC=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETGROUPS=0; + GNULIB_GETHOSTNAME=0; + GNULIB_GETLOGIN=0; + GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_GROUP_MEMBER=0; + GNULIB_ISATTY=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LINKAT=0; + GNULIB_LSEEK=0; + GNULIB_PIPE=0; + GNULIB_PIPE2=0; + GNULIB_PREAD=0; + GNULIB_PWRITE=0; + GNULIB_READ=0; + GNULIB_READLINK=0; + GNULIB_READLINKAT=0; + GNULIB_RMDIR=0; + GNULIB_SETHOSTNAME=0; + GNULIB_SLEEP=0; + GNULIB_SYMLINK=0; + GNULIB_SYMLINKAT=0; + GNULIB_TTYNAME_R=0; + GNULIB_UNISTD_H_NONBLOCKING=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_UNLINK=0; + GNULIB_UNLINKAT=0; + GNULIB_USLEEP=0; + GNULIB_WRITE=0; + HAVE_CHOWN=1; + HAVE_DUP2=1; + HAVE_DUP3=1; + HAVE_EUIDACCESS=1; + HAVE_FACCESSAT=1; + HAVE_FCHDIR=1; + HAVE_FCHOWNAT=1; + HAVE_FDATASYNC=1; + HAVE_FSYNC=1; + HAVE_FTRUNCATE=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETGROUPS=1; + HAVE_GETHOSTNAME=1; + HAVE_GETLOGIN=1; + HAVE_GETPAGESIZE=1; + HAVE_GROUP_MEMBER=1; + HAVE_LCHOWN=1; + HAVE_LINK=1; + HAVE_LINKAT=1; + HAVE_PIPE=1; + HAVE_PIPE2=1; + HAVE_PREAD=1; + HAVE_PWRITE=1; + HAVE_READLINK=1; + HAVE_READLINKAT=1; + HAVE_SETHOSTNAME=1; + HAVE_SLEEP=1; + HAVE_SYMLINK=1; + HAVE_SYMLINKAT=1; + HAVE_UNLINKAT=1; + HAVE_USLEEP=1; + HAVE_DECL_ENVIRON=1; + HAVE_DECL_FCHDIR=1; + HAVE_DECL_FDATASYNC=1; + HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN_R=1; + HAVE_DECL_GETPAGESIZE=1; + HAVE_DECL_GETUSERSHELL=1; + HAVE_DECL_SETHOSTNAME=1; + HAVE_DECL_TTYNAME_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; + REPLACE_CHOWN=0; + REPLACE_CLOSE=0; + REPLACE_DUP=0; + REPLACE_DUP2=0; + REPLACE_FCHOWNAT=0; + REPLACE_FTRUNCATE=0; + REPLACE_GETCWD=0; + REPLACE_GETDOMAINNAME=0; + REPLACE_GETDTABLESIZE=0; + REPLACE_GETLOGIN_R=0; + REPLACE_GETGROUPS=0; + REPLACE_GETPAGESIZE=0; + REPLACE_ISATTY=0; + REPLACE_LCHOWN=0; + REPLACE_LINK=0; + REPLACE_LINKAT=0; + REPLACE_LSEEK=0; + REPLACE_PREAD=0; + REPLACE_PWRITE=0; + REPLACE_READ=0; + REPLACE_READLINK=0; + REPLACE_READLINKAT=0; + REPLACE_RMDIR=0; + REPLACE_SLEEP=0; + REPLACE_SYMLINK=0; + REPLACE_SYMLINKAT=0; + REPLACE_TTYNAME_R=0; + REPLACE_UNLINK=0; + REPLACE_UNLINKAT=0; + REPLACE_USLEEP=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + + + + + + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +$as_echo_n "checking whether // is distinct from /... " >&6; } +if ${gl_cv_double_slash_root+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # <bug-gnulib@gnu.org>. + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +$as_echo "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +$as_echo_n "checking if environ is properly declared... " >&6; } + if ${gt_cv_var_environ_declaration+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + #include <unistd.h> + #endif + /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ + #include <stdlib.h> + + extern struct { int foo; } environ; +int +main () +{ +environ.foo = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_var_environ_declaration=no +else + gt_cv_var_environ_declaration=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +$as_echo "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +$as_echo_n "checking whether the preprocessor supports include_next... " >&6; } +if ${gl_cv_have_include_next+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat <<EOF > conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include <stdio.h> +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <conftest.h> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_have_include_next=yes +else + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <conftest.h> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_have_include_next=buggy +else + gl_cv_have_include_next=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +$as_echo "$gl_cv_have_include_next" >&6; } + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 +$as_echo_n "checking whether system header files limit the line length... " >&6; } +if ${gl_cv_pragma_columns+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __TANDEM +choke me +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "choke me" >/dev/null 2>&1; then : + gl_cv_pragma_columns=yes +else + gl_cv_pragma_columns=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 +$as_echo "$gl_cv_pragma_columns" >&6; } + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +$as_echo_n "checking for complete errno.h... " >&6; } +if ${gl_cv_header_errno_h_complete+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "booboo" >/dev/null 2>&1; then : + gl_cv_header_errno_h_complete=no +else + gl_cv_header_errno_h_complete=yes +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +$as_echo "$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5 +$as_echo_n "checking absolute name of <errno.h>... " >&6; } +if ${gl_cv_next_errno_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'errno.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_errno_h + gl_cv_next_errno_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 +$as_echo "$gl_cv_next_errno_h" >&6; } + fi + NEXT_ERRNO_H=$gl_cv_next_errno_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'errno.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_errno_h + fi + NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive + + + + + ERRNO_H='errno.h' + fi + + if test -n "$ERRNO_H"; then + GL_GENERATE_ERRNO_H_TRUE= + GL_GENERATE_ERRNO_H_FALSE='#' +else + GL_GENERATE_ERRNO_H_TRUE='#' + GL_GENERATE_ERRNO_H_FALSE= +fi + + + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 +$as_echo_n "checking for EMULTIHOP value... " >&6; } +if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EMULTIHOP=yes +else + gl_cv_header_errno_h_EMULTIHOP=no +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EMULTIHOP=hidden +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +"; then : + +fi + + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in + yes | no) + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + ;; + *) + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +$as_echo_n "checking for ENOLINK value... " >&6; } +if ${gl_cv_header_errno_h_ENOLINK+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_ENOLINK=yes +else + gl_cv_header_errno_h_ENOLINK=no +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_ENOLINK = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_ENOLINK=hidden +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +"; then : + +fi + + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in + yes | no) + ENOLINK_HIDDEN=0; ENOLINK_VALUE= + ;; + *) + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +$as_echo_n "checking for EOVERFLOW value... " >&6; } +if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EOVERFLOW=yes +else + gl_cv_header_errno_h_EOVERFLOW=no +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include <stdio.h> +#include <stdlib.h> +"; then : + +fi + + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in + yes | no) + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ;; + *) + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ;; + esac + + + fi + + +ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror_r" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R $ac_have_decl +_ACEOF + +for ac_func in strerror_r +do : + ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" +if test "x$ac_cv_func_strerror_r" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRERROR_R 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +$as_echo_n "checking whether strerror_r returns char *... " >&6; } +if ${ac_cv_func_strerror_r_char_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + extern char *strerror_r (); +int +main () +{ +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h + +fi + + + XGETTEXT_EXTRA_OPTIONS= + + + + + + ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "#include <signal.h> +" +if test "x$ac_cv_type_sig_atomic_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIG_ATOMIC_T 1 +_ACEOF + + +else + +$as_echo "#define sig_atomic_t int" >>confdefs.h + +fi + + + + GNULIB_FCNTL=0; + GNULIB_NONBLOCKING=0; + GNULIB_OPEN=0; + GNULIB_OPENAT=0; + HAVE_FCNTL=1; + HAVE_OPENAT=1; + REPLACE_FCNTL=0; + REPLACE_OPEN=0; + REPLACE_OPENAT=0; + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +$as_echo_n "checking for working fcntl.h... " >&6; } +if ${gl_cv_header_working_fcntl_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_header_working_fcntl_h=cross-compiling +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/stat.h> + #if HAVE_UNISTD_H + # include <unistd.h> + #else /* on Windows with MSVC */ + # include <io.h> + # include <stdlib.h> + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include <fcntl.h> + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + +int +main () +{ + + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_header_working_fcntl_h=yes +else + case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +$as_echo "$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOATIME $ac_val +_ACEOF + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOFOLLOW $ac_val +_ACEOF + + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + + + GNULIB_DPRINTF=0; + GNULIB_FCLOSE=0; + GNULIB_FDOPEN=0; + GNULIB_FFLUSH=0; + GNULIB_FGETC=0; + GNULIB_FGETS=0; + GNULIB_FOPEN=0; + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_FPURGE=0; + GNULIB_FPUTC=0; + GNULIB_FPUTS=0; + GNULIB_FREAD=0; + GNULIB_FREOPEN=0; + GNULIB_FSCANF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FWRITE=0; + GNULIB_GETC=0; + GNULIB_GETCHAR=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_PCLOSE=0; + GNULIB_PERROR=0; + GNULIB_POPEN=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_PUTS=0; + GNULIB_REMOVE=0; + GNULIB_RENAME=0; + GNULIB_RENAMEAT=0; + GNULIB_SCANF=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_STDIO_H_NONBLOCKING=0; + GNULIB_STDIO_H_SIGPIPE=0; + GNULIB_TMPFILE=0; + GNULIB_VASPRINTF=0; + GNULIB_VFSCANF=0; + GNULIB_VSCANF=0; + GNULIB_VDPRINTF=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + HAVE_DECL_FPURGE=1; + HAVE_DECL_FSEEKO=1; + HAVE_DECL_FTELLO=1; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + HAVE_DECL_OBSTACK_PRINTF=1; + HAVE_DECL_SNPRINTF=1; + HAVE_DECL_VSNPRINTF=1; + HAVE_DPRINTF=1; + HAVE_FSEEKO=1; + HAVE_FTELLO=1; + HAVE_PCLOSE=1; + HAVE_POPEN=1; + HAVE_RENAMEAT=1; + HAVE_VASPRINTF=1; + HAVE_VDPRINTF=1; + REPLACE_DPRINTF=0; + REPLACE_FCLOSE=0; + REPLACE_FDOPEN=0; + REPLACE_FFLUSH=0; + REPLACE_FOPEN=0; + REPLACE_FPRINTF=0; + REPLACE_FPURGE=0; + REPLACE_FREOPEN=0; + REPLACE_FSEEK=0; + REPLACE_FSEEKO=0; + REPLACE_FTELL=0; + REPLACE_FTELLO=0; + REPLACE_GETDELIM=0; + REPLACE_GETLINE=0; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_PERROR=0; + REPLACE_POPEN=0; + REPLACE_PRINTF=0; + REPLACE_REMOVE=0; + REPLACE_RENAME=0; + REPLACE_RENAMEAT=0; + REPLACE_SNPRINTF=0; + REPLACE_SPRINTF=0; + REPLACE_STDIO_READ_FUNCS=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_TMPFILE=0; + REPLACE_VASPRINTF=0; + REPLACE_VDPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_VSNPRINTF=0; + REPLACE_VSPRINTF=0; + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +$as_echo_n "checking for stdint.h... " >&6; } +if ${gl_cv_header_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <stdint.h> +int +main () +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_stdint_h=yes +else + gl_cv_header_stdint_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 +$as_echo "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +$as_echo_n "checking for inttypes.h... " >&6; } +if ${gl_cv_header_inttypes_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <inttypes.h> + +int +main () +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_inttypes_h=yes +else + gl_cv_header_inttypes_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 +$as_echo "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports size specifiers as in C99" >&5 +$as_echo_n "checking whether printf supports size specifiers as in C99... " >&6; } +if ${gl_cv_func_printf_sizes_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_printf_sizes_c99="guessing no";; + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_sizes_c99="guessing no";; + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_sizes_c99="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include <sys/types.h> +#if HAVE_STDINT_H_WITH_UINTMAX +# include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +# include <inttypes.h> +#endif +static char buf[100]; +int main () +{ + int result = 0; +#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX + buf[0] = '\0'; + if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 + || strcmp (buf, "12345671 33") != 0) + result |= 1; +#endif + buf[0] = '\0'; + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 + || strcmp (buf, "12345672 33") != 0) + result |= 2; + buf[0] = '\0'; + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 + || strcmp (buf, "12345673 33") != 0) + result |= 4; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 + || strcmp (buf, "1.5 33") != 0) + result |= 8; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_sizes_c99=yes +else + gl_cv_func_printf_sizes_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_sizes_c99" >&5 +$as_echo "$gl_cv_func_printf_sizes_c99" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports 'long double' arguments" >&5 +$as_echo_n "checking whether printf supports 'long double' arguments... " >&6; } +if ${gl_cv_func_printf_long_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; + *) gl_cv_func_printf_long_double="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +static char buf[10000]; +int main () +{ + int result = 0; + buf[0] = '\0'; + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000 33") != 0) + result |= 1; + buf[0] = '\0'; + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000e+00 33") != 0) + result |= 2; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.75 33") != 0) + result |= 4; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_long_double=yes +else + gl_cv_func_printf_long_double=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_long_double" >&5 +$as_echo "$gl_cv_func_printf_long_double" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'double' arguments" >&5 +$as_echo_n "checking whether printf supports infinite 'double' arguments... " >&6; } +if ${gl_cv_func_printf_infinite+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; + darwin*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; + hpux*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite="guessing no";; + netbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static int +have_minus_zero () +{ + static double plus_zero = 0.0; + double minus_zero = - plus_zero; + return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; +} +static char buf[10000]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%f", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%f", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%f", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%e", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 4; + if (sprintf (buf, "%e", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 4; + if (sprintf (buf, "%e", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 8; + if (sprintf (buf, "%g", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 16; + if (sprintf (buf, "%g", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 16; + if (sprintf (buf, "%g", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 32; + /* This test fails on HP-UX 10.20. */ + if (have_minus_zero ()) + if (sprintf (buf, "%g", - zero) < 0 + || strcmp (buf, "-0") != 0) + result |= 64; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_infinite=yes +else + gl_cv_func_printf_infinite=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite" >&5 +$as_echo "$gl_cv_func_printf_infinite" >&6; } + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5 +$as_echo_n "checking whether long double and double are the same... " >&6; } +if ${gl_cv_long_double_equals_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +int +main () +{ +typedef int check[sizeof (long double) == sizeof (double) + && LDBL_MANT_DIG == DBL_MANT_DIG + && LDBL_MAX_EXP == DBL_MAX_EXP + && LDBL_MIN_EXP == DBL_MIN_EXP + ? 1 : -1]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_long_double_equals_double=yes +else + gl_cv_long_double_equals_double=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5 +$as_echo "$gl_cv_long_double_equals_double" >&6; } + if test $gl_cv_long_double_equals_double = yes; then + +$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h + + HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 + else + HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 + fi + + + + + + + + if test -n "$gl_printf_safe"; then + +$as_echo "#define CHECK_PRINTF_SAFE 1" >>confdefs.h + + fi + case "$gl_cv_func_printf_long_double" in + *yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'long double' arguments" >&5 +$as_echo_n "checking whether printf supports infinite 'long double' arguments... " >&6; } +if ${gl_cv_func_printf_infinite_long_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; + *) + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite_long_double="guessing no";; + esac + ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include <stdlib.h> +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <mach/thread_status.h> +#include <mach/exception.h> +#include <mach/task.h> +#include <pthread.h> +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <winerror.h> +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include <signal.h> +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + +#include <float.h> +#include <stdio.h> +#include <string.h> +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static char buf[10000]; +static long double zeroL = 0.0L; +int main () +{ + int result = 0; + nocrash_init(); + if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; + if (sprintf (buf, "%Le", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Le", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Le", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; + if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; +#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + } + { + /* Signalling NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + } + { /* Pseudo-NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 4; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 4; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 4; + } + { /* Pseudo-Infinity. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 8; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 8; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 8; + } + { /* Pseudo-Zero. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 16; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 16; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 16; + } + { /* Unnormalized number. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 32; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 32; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 32; + } + { /* Pseudo-Denormal. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 64; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 64; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 64; + } +#endif + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_infinite_long_double=yes +else + gl_cv_func_printf_infinite_long_double=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite_long_double" >&5 +$as_echo "$gl_cv_func_printf_infinite_long_double" >&6; } + ;; + *) + gl_cv_func_printf_infinite_long_double="irrelevant" + ;; + esac + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'a' and 'A' directives" >&5 +$as_echo_n "checking whether printf supports the 'a' and 'A' directives... " >&6; } +if ${gl_cv_func_printf_directive_a+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc >= 2.5 systems. + *-gnu*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <features.h> + #ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__ + BZ2908 + #endif + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "BZ2908" >/dev/null 2>&1; then : + gl_cv_func_printf_directive_a="guessing yes" +else + gl_cv_func_printf_directive_a="guessing no" +fi +rm -f conftest* + + ;; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_a="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +static char buf[100]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.922p+1 33") != 0 + && strcmp (buf, "0x3.244p+0 33") != 0 + && strcmp (buf, "0x6.488p-1 33") != 0 + && strcmp (buf, "0xc.91p-2 33") != 0)) + result |= 1; + if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "-0X1.922P+1 33") != 0 + && strcmp (buf, "-0X3.244P+0 33") != 0 + && strcmp (buf, "-0X6.488P-1 33") != 0 + && strcmp (buf, "-0XC.91P-2 33") != 0)) + result |= 2; + /* This catches a FreeBSD 6.1 bug: it doesn't round. */ + if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.83p+0 33") != 0 + && strcmp (buf, "0x3.05p-1 33") != 0 + && strcmp (buf, "0x6.0ap-2 33") != 0 + && strcmp (buf, "0xc.14p-3 33") != 0)) + result |= 4; + /* This catches a FreeBSD 6.1 bug. See + <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */ + if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 + || buf[0] == '0') + result |= 8; + /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */ + if (sprintf (buf, "%.1a", 1.999) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + result |= 16; + /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a + glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */ + if (sprintf (buf, "%.1La", 1.999L) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + result |= 32; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_directive_a=yes +else + gl_cv_func_printf_directive_a=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_a" >&5 +$as_echo "$gl_cv_func_printf_directive_a" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'F' directive" >&5 +$as_echo_n "checking whether printf supports the 'F' directive... " >&6; } +if ${gl_cv_func_printf_directive_f+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; + darwin*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_f="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +static char buf[100]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 + || strcmp (buf, "1234567.000000 33") != 0) + result |= 1; + if (sprintf (buf, "%F", 1.0 / zero) < 0 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) + result |= 2; + /* This catches a Cygwin 1.5.x bug. */ + if (sprintf (buf, "%.F", 1234.0) < 0 + || strcmp (buf, "1234") != 0) + result |= 4; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_directive_f=yes +else + gl_cv_func_printf_directive_f=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_f" >&5 +$as_echo "$gl_cv_func_printf_directive_f" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'n' directive" >&5 +$as_echo_n "checking whether printf supports the 'n' directive... " >&6; } +if ${gl_cv_func_printf_directive_n+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + mingw*) gl_cv_func_printf_directive_n="guessing no";; + *) gl_cv_func_printf_directive_n="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifdef _MSC_VER +/* See page about "Parameter Validation" on msdn.microsoft.com. */ +static void cdecl +invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, unsigned int line, + uintptr_t dummy) +{ + exit (1); +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; +#ifdef _MSC_VER + _set_invalid_parameter_handler (invalid_parameter_handler); +#endif + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 + || strcmp (buf, "123 ") != 0 + || count != 4) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_directive_n=yes +else + gl_cv_func_printf_directive_n=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_n" >&5 +$as_echo "$gl_cv_func_printf_directive_n" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'ls' directive" >&5 +$as_echo_n "checking whether printf supports the 'ls' directive... " >&6; } +if ${gl_cv_func_printf_directive_ls+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#include <string.h> +int main () +{ + int result = 0; + char buf[100]; + /* Test whether %ls works at all. + This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on + Cygwin 1.5. */ + { + static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "abc") != 0) + result |= 1; + } + /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an + assertion failure inside libc), but not on OpenBSD 4.0. */ + { + static const wchar_t wstring[] = { 'a', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "a") != 0) + result |= 2; + } + /* Test whether precisions in %ls are supported as specified in ISO C 99 + section 7.19.6.1: + "If a precision is specified, no more than that many bytes are written + (including shift sequences, if any), and the array shall contain a + null wide character if, to equal the multibyte character sequence + length given by the precision, the function would need to access a + wide character one past the end of the array." + This test fails on Solaris 10. */ + { + static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%.2ls", wstring) < 0 + || strcmp (buf, "ab") != 0) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_directive_ls=yes +else + gl_cv_func_printf_directive_ls=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_ls" >&5 +$as_echo "$gl_cv_func_printf_directive_ls" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if ${gl_cv_func_printf_positions+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_positions=yes +else + gl_cv_func_printf_positions=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +$as_echo "$gl_cv_func_printf_positions" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the grouping flag" >&5 +$as_echo_n "checking whether printf supports the grouping flag... " >&6; } +if ${gl_cv_func_printf_flag_grouping+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () +{ + if (sprintf (buf, "%'d %d", 1234567, 99) < 0 + || buf[strlen (buf) - 1] != '9') + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_flag_grouping=yes +else + gl_cv_func_printf_flag_grouping=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_grouping" >&5 +$as_echo "$gl_cv_func_printf_flag_grouping" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the left-adjust flag correctly" >&5 +$as_echo_n "checking whether printf supports the left-adjust flag correctly... " >&6; } +if ${gl_cv_func_printf_flag_leftadjust+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on HP-UX 11. + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess no on HP-UX 10 and older. + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_printf_flag_leftadjust="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () +{ + /* Check that a '-' flag is not annihilated by a negative width. */ + if (sprintf (buf, "a%-*sc", -3, "b") < 0 + || strcmp (buf, "ab c") != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_flag_leftadjust=yes +else + gl_cv_func_printf_flag_leftadjust=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_leftadjust" >&5 +$as_echo "$gl_cv_func_printf_flag_leftadjust" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the zero flag correctly" >&5 +$as_echo_n "checking whether printf supports the zero flag correctly... " >&6; } +if ${gl_cv_func_printf_flag_zero+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +static char buf[100]; +static double zero = 0.0; +int main () +{ + if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0 + || (strcmp (buf, " inf") != 0 + && strcmp (buf, " infinity") != 0)) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_flag_zero=yes +else + gl_cv_func_printf_flag_zero=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_zero" >&5 +$as_echo "$gl_cv_func_printf_flag_zero" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports large precisions" >&5 +$as_echo_n "checking whether printf supports large precisions... " >&6; } +if ${gl_cv_func_printf_precision+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess no only on Solaris, native Windows, and BeOS systems. + solaris*) gl_cv_func_printf_precision="guessing no" ;; + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +static char buf[5000]; +int main () +{ + int result = 0; +#ifdef __BEOS__ + /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ + return 1; +#endif + if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) + result |= 1; + if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5) + result |= 2; + if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5 + || buf[0] != '1') + result |= 4; + if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5 + || buf[0] != '1') + result |= 4; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_precision=yes +else + gl_cv_func_printf_precision=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_precision" >&5 +$as_echo "$gl_cv_func_printf_precision" >&6; } + + + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf survives out-of-memory conditions" >&5 +$as_echo_n "checking whether printf survives out-of-memory conditions... " >&6; } +if ${gl_cv_func_printf_enomem+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_func_printf_enomem="guessing no" + if test "$cross_compiling" = no; then + if test $APPLE_UNIVERSAL_BUILD = 0; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include <stdlib.h> +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <mach/thread_status.h> +#include <mach/exception.h> +#include <mach/task.h> +#include <pthread.h> +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data1024; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <winerror.h> +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include <signal.h> +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + +#include <stdio.h> +#include <sys/types.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <errno.h> +int main() +{ + struct rlimit limit; + int ret; + nocrash_init (); + /* Some printf implementations allocate temporary space with malloc. */ + /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ +#ifdef RLIMIT_DATA + if (getrlimit (RLIMIT_DATA, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_DATA, &limit) < 0) + return 77; +#endif + /* On Linux systems, malloc() is limited by RLIMIT_AS. */ +#ifdef RLIMIT_AS + if (getrlimit (RLIMIT_AS, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_AS, &limit) < 0) + return 77; +#endif + /* Some printf implementations allocate temporary space on the stack. */ +#ifdef RLIMIT_STACK + if (getrlimit (RLIMIT_STACK, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_STACK, &limit) < 0) + return 77; +#endif + ret = printf ("%.5000000f", 1.0); + return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + (./conftest 2>&5 + result=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $result" >&5 + if test $result != 0 && test $result != 77; then result=1; fi + exit $result + ) >/dev/null 2>/dev/null + case $? in + 0) gl_cv_func_printf_enomem="yes" ;; + 77) gl_cv_func_printf_enomem="guessing no" ;; + *) gl_cv_func_printf_enomem="no" ;; + esac + else + gl_cv_func_printf_enomem="guessing no" + fi + rm -fr conftest* + else + gl_cv_func_printf_enomem="guessing no" + fi + fi + if test "$gl_cv_func_printf_enomem" = "guessing no"; then + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Solaris. + solaris*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on AIX. + aix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on HP-UX/hppa. + hpux*) case "$host_cpu" in + hppa*) gl_cv_func_printf_enomem="guessing yes";; + *) gl_cv_func_printf_enomem="guessing no";; + esac + ;; + # Guess yes on IRIX. + irix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on OSF/1. + osf*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_enomem="guessing no";; + esac + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_enomem" >&5 +$as_echo "$gl_cv_func_printf_enomem" >&6; } + + + + case "$gl_cv_func_printf_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +$as_echo_n "checking for unsigned long long int... " >&6; } +if ${ac_cv_type_unsigned_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main () +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + ac_cv_type_unsigned_long_long_int=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +$as_echo_n "checking for long long int... " >&6; } +if ${ac_cv_type_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main () +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +$as_echo "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +$as_echo_n "checking for wchar_t... " >&6; } +if ${gt_cv_c_wchar_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + wchar_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wchar_t=yes +else + gt_cv_c_wchar_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +$as_echo "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +$as_echo_n "checking for wint_t... " >&6; } +if ${gt_cv_c_wint_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + wint_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wint_t=yes +else + gt_cv_c_wint_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +$as_echo "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h + + fi + + + + + + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +$as_echo_n "checking for intmax_t... " >&6; } +if ${gt_cv_c_intmax_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdlib.h> +#if HAVE_STDINT_H_WITH_UINTMAX +#include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include <inttypes.h> +#endif + +int +main () +{ +intmax_t x = -1; return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_intmax_t=yes +else + gt_cv_c_intmax_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +$as_echo "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h + + else + + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + +cat >>confdefs.h <<_ACEOF +#define intmax_t $ac_type +_ACEOF + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +$as_echo_n "checking where to find the exponent in a 'double'... " >&6; } +if ${gl_cv_cc_double_expbit0+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "mixed_endianness" >/dev/null 2>&1; then : + gl_cv_cc_double_expbit0="unknown" +else + + : +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_double_expbit0=`cat conftest.out` +else + gl_cv_cc_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +$as_echo "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5 +$as_echo_n "checking whether snprintf returns a byte count as in C99... " >&6; } +if ${gl_cv_func_snprintf_retval_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_retval_c99=yes +else + gl_cv_func_snprintf_retval_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5 +$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; } + + + + + + + for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h> +" +if test "x$ac_cv_have_decl__snprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF $ac_have_decl +_ACEOF + + + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + +$as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h + + ;; + esac + + + GNULIB_ACOSF=0; + GNULIB_ACOSL=0; + GNULIB_ASINF=0; + GNULIB_ASINL=0; + GNULIB_ATANF=0; + GNULIB_ATANL=0; + GNULIB_ATAN2F=0; + GNULIB_CBRT=0; + GNULIB_CBRTF=0; + GNULIB_CBRTL=0; + GNULIB_CEIL=0; + GNULIB_CEILF=0; + GNULIB_CEILL=0; + GNULIB_COPYSIGN=0; + GNULIB_COPYSIGNF=0; + GNULIB_COPYSIGNL=0; + GNULIB_COSF=0; + GNULIB_COSL=0; + GNULIB_COSHF=0; + GNULIB_EXPF=0; + GNULIB_EXPL=0; + GNULIB_EXP2=0; + GNULIB_EXP2F=0; + GNULIB_EXP2L=0; + GNULIB_EXPM1=0; + GNULIB_EXPM1F=0; + GNULIB_EXPM1L=0; + GNULIB_FABSF=0; + GNULIB_FABSL=0; + GNULIB_FLOOR=0; + GNULIB_FLOORF=0; + GNULIB_FLOORL=0; + GNULIB_FMA=0; + GNULIB_FMAF=0; + GNULIB_FMAL=0; + GNULIB_FMOD=0; + GNULIB_FMODF=0; + GNULIB_FMODL=0; + GNULIB_FREXPF=0; + GNULIB_FREXP=0; + GNULIB_FREXPL=0; + GNULIB_HYPOT=0; + GNULIB_HYPOTF=0; + GNULIB_HYPOTL=0; + GNULIB_ILOGB=0; + GNULIB_ILOGBF=0; + GNULIB_ILOGBL=0; + GNULIB_ISFINITE=0; + GNULIB_ISINF=0; + GNULIB_ISNAN=0; + GNULIB_ISNANF=0; + GNULIB_ISNAND=0; + GNULIB_ISNANL=0; + GNULIB_LDEXPF=0; + GNULIB_LDEXPL=0; + GNULIB_LOG=0; + GNULIB_LOGF=0; + GNULIB_LOGL=0; + GNULIB_LOG10=0; + GNULIB_LOG10F=0; + GNULIB_LOG10L=0; + GNULIB_LOG1P=0; + GNULIB_LOG1PF=0; + GNULIB_LOG1PL=0; + GNULIB_LOG2=0; + GNULIB_LOG2F=0; + GNULIB_LOG2L=0; + GNULIB_LOGB=0; + GNULIB_LOGBF=0; + GNULIB_LOGBL=0; + GNULIB_MODF=0; + GNULIB_MODFF=0; + GNULIB_MODFL=0; + GNULIB_POWF=0; + GNULIB_REMAINDER=0; + GNULIB_REMAINDERF=0; + GNULIB_REMAINDERL=0; + GNULIB_RINT=0; + GNULIB_RINTF=0; + GNULIB_RINTL=0; + GNULIB_ROUND=0; + GNULIB_ROUNDF=0; + GNULIB_ROUNDL=0; + GNULIB_SIGNBIT=0; + GNULIB_SINF=0; + GNULIB_SINL=0; + GNULIB_SINHF=0; + GNULIB_SQRTF=0; + GNULIB_SQRTL=0; + GNULIB_TANF=0; + GNULIB_TANL=0; + GNULIB_TANHF=0; + GNULIB_TRUNC=0; + GNULIB_TRUNCF=0; + GNULIB_TRUNCL=0; + HAVE_ACOSF=1; + HAVE_ACOSL=1; + HAVE_ASINF=1; + HAVE_ASINL=1; + HAVE_ATANF=1; + HAVE_ATANL=1; + HAVE_ATAN2F=1; + HAVE_CBRT=1; + HAVE_CBRTF=1; + HAVE_CBRTL=1; + HAVE_COPYSIGN=1; + HAVE_COPYSIGNL=1; + HAVE_COSF=1; + HAVE_COSL=1; + HAVE_COSHF=1; + HAVE_EXPF=1; + HAVE_EXPL=1; + HAVE_EXPM1=1; + HAVE_EXPM1F=1; + HAVE_FABSF=1; + HAVE_FABSL=1; + HAVE_FMA=1; + HAVE_FMAF=1; + HAVE_FMAL=1; + HAVE_FMODF=1; + HAVE_FMODL=1; + HAVE_FREXPF=1; + HAVE_HYPOTF=1; + HAVE_HYPOTL=1; + HAVE_ILOGB=1; + HAVE_ILOGBF=1; + HAVE_ILOGBL=1; + HAVE_ISNANF=1; + HAVE_ISNAND=1; + HAVE_ISNANL=1; + HAVE_LDEXPF=1; + HAVE_LOGF=1; + HAVE_LOGL=1; + HAVE_LOG10F=1; + HAVE_LOG10L=1; + HAVE_LOG1P=1; + HAVE_LOG1PF=1; + HAVE_LOG1PL=1; + HAVE_LOGBF=1; + HAVE_LOGBL=1; + HAVE_MODFF=1; + HAVE_MODFL=1; + HAVE_POWF=1; + HAVE_REMAINDER=1; + HAVE_REMAINDERF=1; + HAVE_RINT=1; + HAVE_RINTL=1; + HAVE_SINF=1; + HAVE_SINL=1; + HAVE_SINHF=1; + HAVE_SQRTF=1; + HAVE_SQRTL=1; + HAVE_TANF=1; + HAVE_TANL=1; + HAVE_TANHF=1; + HAVE_DECL_ACOSL=1; + HAVE_DECL_ASINL=1; + HAVE_DECL_ATANL=1; + HAVE_DECL_CBRTF=1; + HAVE_DECL_CBRTL=1; + HAVE_DECL_CEILF=1; + HAVE_DECL_CEILL=1; + HAVE_DECL_COPYSIGNF=1; + HAVE_DECL_COSL=1; + HAVE_DECL_EXPL=1; + HAVE_DECL_EXP2=1; + HAVE_DECL_EXP2F=1; + HAVE_DECL_EXP2L=1; + HAVE_DECL_EXPM1L=1; + HAVE_DECL_FLOORF=1; + HAVE_DECL_FLOORL=1; + HAVE_DECL_FREXPL=1; + HAVE_DECL_LDEXPL=1; + HAVE_DECL_LOGL=1; + HAVE_DECL_LOG10L=1; + HAVE_DECL_LOG2=1; + HAVE_DECL_LOG2F=1; + HAVE_DECL_LOG2L=1; + HAVE_DECL_LOGB=1; + HAVE_DECL_REMAINDER=1; + HAVE_DECL_REMAINDERL=1; + HAVE_DECL_RINTF=1; + HAVE_DECL_ROUND=1; + HAVE_DECL_ROUNDF=1; + HAVE_DECL_ROUNDL=1; + HAVE_DECL_SINL=1; + HAVE_DECL_SQRTL=1; + HAVE_DECL_TANL=1; + HAVE_DECL_TRUNC=1; + HAVE_DECL_TRUNCF=1; + HAVE_DECL_TRUNCL=1; + REPLACE_CBRTF=0; + REPLACE_CBRTL=0; + REPLACE_CEIL=0; + REPLACE_CEILF=0; + REPLACE_CEILL=0; + REPLACE_EXPM1=0; + REPLACE_EXPM1F=0; + REPLACE_EXP2=0; + REPLACE_EXP2L=0; + REPLACE_FABSL=0; + REPLACE_FLOOR=0; + REPLACE_FLOORF=0; + REPLACE_FLOORL=0; + REPLACE_FMA=0; + REPLACE_FMAF=0; + REPLACE_FMAL=0; + REPLACE_FMOD=0; + REPLACE_FMODF=0; + REPLACE_FMODL=0; + REPLACE_FREXPF=0; + REPLACE_FREXP=0; + REPLACE_FREXPL=0; + REPLACE_HUGE_VAL=0; + REPLACE_HYPOT=0; + REPLACE_HYPOTF=0; + REPLACE_HYPOTL=0; + REPLACE_ILOGB=0; + REPLACE_ILOGBF=0; + REPLACE_ISFINITE=0; + REPLACE_ISINF=0; + REPLACE_ISNAN=0; + REPLACE_LDEXPL=0; + REPLACE_LOG=0; + REPLACE_LOGF=0; + REPLACE_LOGL=0; + REPLACE_LOG10=0; + REPLACE_LOG10F=0; + REPLACE_LOG10L=0; + REPLACE_LOG1P=0; + REPLACE_LOG1PF=0; + REPLACE_LOG1PL=0; + REPLACE_LOG2=0; + REPLACE_LOG2F=0; + REPLACE_LOG2L=0; + REPLACE_LOGB=0; + REPLACE_LOGBF=0; + REPLACE_LOGBL=0; + REPLACE_MODF=0; + REPLACE_MODFF=0; + REPLACE_MODFL=0; + REPLACE_NAN=0; + REPLACE_REMAINDER=0; + REPLACE_REMAINDERF=0; + REPLACE_REMAINDERL=0; + REPLACE_ROUND=0; + REPLACE_ROUNDF=0; + REPLACE_ROUNDL=0; + REPLACE_SIGNBIT=0; + REPLACE_SIGNBIT_USING_GCC=0; + REPLACE_SQRTL=0; + REPLACE_TRUNC=0; + REPLACE_TRUNCF=0; + REPLACE_TRUNCL=0; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } +if ${gl_cv_func_frexp_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + double x; +int +main () +{ +int e; return frexp (x, &e) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_frexp_no_libm=yes +else + gl_cv_func_frexp_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 +$as_echo "$gl_cv_func_frexp_no_libm" >&6; } + +ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" +if test "x$ac_cv_have_decl_alarm" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ALARM $ac_have_decl +_ACEOF + + + + + GNULIB_FCHMODAT=0; + GNULIB_FSTAT=0; + GNULIB_FSTATAT=0; + GNULIB_FUTIMENS=0; + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + GNULIB_MKDIRAT=0; + GNULIB_MKFIFO=0; + GNULIB_MKFIFOAT=0; + GNULIB_MKNOD=0; + GNULIB_MKNODAT=0; + GNULIB_STAT=0; + GNULIB_UTIMENSAT=0; + HAVE_FCHMODAT=1; + HAVE_FSTATAT=1; + HAVE_FUTIMENS=1; + HAVE_LCHMOD=1; + HAVE_LSTAT=1; + HAVE_MKDIRAT=1; + HAVE_MKFIFO=1; + HAVE_MKFIFOAT=1; + HAVE_MKNOD=1; + HAVE_MKNODAT=1; + HAVE_UTIMENSAT=1; + REPLACE_FSTAT=0; + REPLACE_FSTATAT=0; + REPLACE_FUTIMENS=0; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; + REPLACE_MKFIFO=0; + REPLACE_MKNOD=0; + REPLACE_STAT=0; + REPLACE_UTIMENSAT=0; + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +$as_echo_n "checking whether stat file-mode macros are broken... " >&6; } +if ${ac_cv_header_stat_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/stat.h> + +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif + +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif + +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif + +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stat_broken=no +else + ac_cv_header_stat_broken=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +$as_echo "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h + +fi + + + + + + case "$host_os" in + mingw*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 +$as_echo_n "checking for 64-bit off_t... " >&6; } +if ${gl_cv_type_off_t_64+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_off_t_64=yes +else + gl_cv_type_off_t_64=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 +$as_echo "$gl_cv_type_off_t_64" >&6; } + if test $gl_cv_type_off_t_64 = no; then + WINDOWS_64_BIT_OFF_T=1 + else + WINDOWS_64_BIT_OFF_T=0 + fi + WINDOWS_64_BIT_ST_SIZE=1 + ;; + *) + WINDOWS_64_BIT_OFF_T=0 + WINDOWS_64_BIT_ST_SIZE=0 + ;; + esac + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } +if ${gl_cv_next_sys_stat_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +$as_echo "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + + + + if test $WINDOWS_64_BIT_ST_SIZE = 1; then + +$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h + + fi + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_type_nlink_t" = xyes; then : + +else + +$as_echo "#define nlink_t int" >>confdefs.h + +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_getopt_h='<'getopt.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5 +$as_echo_n "checking absolute name of <getopt.h>... " >&6; } +if ${gl_cv_next_getopt_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_getopt_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'getopt.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_getopt_h + gl_cv_next_getopt_h='"'$gl_header'"' + else + gl_cv_next_getopt_h='<'getopt.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5 +$as_echo "$gl_cv_next_getopt_h" >&6; } + fi + NEXT_GETOPT_H=$gl_cv_next_getopt_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'getopt.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_getopt_h + fi + NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_getopt_h = yes; then + HAVE_GETOPT_H=1 + else + HAVE_GETOPT_H=0 + fi + + + gl_replace_getopt= + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + for ac_header in getopt.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETOPT_H 1 +_ACEOF + +else + gl_replace_getopt=yes +fi + +done + + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + for ac_func in getopt_long_only +do : + ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" +if test "x$ac_cv_func_getopt_long_only" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETOPT_LONG_ONLY 1 +_ACEOF + +else + gl_replace_getopt=yes +fi +done + + fi + + if test -z "$gl_replace_getopt"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 +$as_echo_n "checking whether getopt is POSIX compatible... " >&6; } +if ${gl_cv_func_getopt_posix+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $cross_compiling = no; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_posix=maybe +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_posix=maybe +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_posix=yes +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 +$as_echo "$gl_cv_func_getopt_posix" >&6; } + case "$gl_cv_func_getopt_posix" in + *no) gl_replace_getopt=yes ;; + esac + fi + + if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 +$as_echo_n "checking for working GNU getopt function... " >&6; } +if ${gl_cv_func_getopt_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the + # optstring is necessary for programs like m4 that have POSIX-mandated + # semantics for supporting options interspersed with files. + # Also, since getopt_long is a GNU extension, we require optind=0. + # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; + # so take care to revert to the correct (non-)export state. + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in + xx) gl_had_POSIXLY_CORRECT=exported ;; + x) gl_had_POSIXLY_CORRECT=yes ;; + *) gl_had_POSIXLY_CORRECT= ;; + esac + POSIXLY_CORRECT=1 + export POSIXLY_CORRECT + if test "$cross_compiling" = yes; then : + gl_cv_func_getopt_gnu="guessing no" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> + #include <stddef.h> + #include <string.h> + +#include <stdlib.h> +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on Mac OS X. */ +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <mach/thread_status.h> +#include <mach/exception.h> +#include <mach/task.h> +#include <pthread.h> +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <winerror.h> +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} +#else +/* Avoid a crash on POSIX systems. */ +#include <signal.h> +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + + +int +main () +{ + + int result = 0; + + nocrash_init(); + + /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, + and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, + OSF/1 5.1, Solaris 10. */ + { + static char conftest[] = "conftest"; + static char plus[] = "-+"; + char *argv[3] = { conftest, plus, NULL }; + opterr = 0; + if (getopt (2, argv, "+a") != '?') + result |= 1; + } + /* This code succeeds on glibc 2.8, mingw, + and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, + IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ + { + static char program[] = "program"; + static char p[] = "-p"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, p, foo, bar, NULL }; + + optind = 1; + if (getopt (4, argv, "p::") != 'p') + result |= 2; + else if (optarg != NULL) + result |= 4; + else if (getopt (4, argv, "p::") != -1) + result |= 6; + else if (optind != 2) + result |= 8; + } + /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ + { + static char program[] = "program"; + static char foo[] = "foo"; + static char p[] = "-p"; + char *argv[] = { program, foo, p, NULL }; + optind = 0; + if (getopt (3, argv, "-p") != 1) + result |= 16; + else if (getopt (3, argv, "-p") != 'p') + result |= 16; + } + /* This code fails on glibc 2.11. */ + { + static char program[] = "program"; + static char b[] = "-b"; + static char a[] = "-a"; + char *argv[] = { program, b, a, NULL }; + optind = opterr = 0; + if (getopt (3, argv, "+:a:b") != 'b') + result |= 32; + else if (getopt (3, argv, "+:a:b") != ':') + result |= 32; + } + /* This code dumps core on glibc 2.14. */ + { + static char program[] = "program"; + static char w[] = "-W"; + static char dummy[] = "dummy"; + char *argv[] = { program, w, dummy, NULL }; + optind = opterr = 1; + if (getopt (3, argv, "W;") != 'W') + result |= 64; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_gnu=yes +else + gl_cv_func_getopt_gnu=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + case $gl_had_POSIXLY_CORRECT in + exported) ;; + yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;; + *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 +$as_echo "$gl_cv_func_getopt_gnu" >&6; } + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 +$as_echo_n "checking for working GNU getopt_long function... " >&6; } +if ${gl_cv_func_getopt_long_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; + *) gl_cv_func_getopt_long_gnu="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> + #include <stddef.h> + #include <string.h> + +int +main () +{ +static const struct option long_options[] = + { + { "xtremely-",no_argument, NULL, 1003 }, + { "xtra", no_argument, NULL, 1001 }, + { "xtreme", no_argument, NULL, 1002 }, + { "xtremely", no_argument, NULL, 1003 }, + { NULL, 0, NULL, 0 } + }; + /* This code fails on OpenBSD 5.0. */ + { + static char program[] = "program"; + static char xtremel[] = "--xtremel"; + char *argv[] = { program, xtremel, NULL }; + int option_index; + optind = 1; opterr = 0; + if (getopt_long (2, argv, "", long_options, &option_index) != 1003) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_long_gnu=yes +else + gl_cv_func_getopt_long_gnu=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5 +$as_echo "$gl_cv_func_getopt_long_gnu" >&6; } + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + + if test $REPLACE_GETOPT = 1; then + + GETOPT_H=getopt.h + +$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h + + + + fi + +ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default" +if test "x$ac_cv_have_decl_getenv" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV $ac_have_decl +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + +int +main () +{ +int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + + + GNULIB_GETTIMEOFDAY=0; + HAVE_GETTIMEOFDAY=1; + HAVE_STRUCT_TIMEVAL=1; + HAVE_SYS_TIME_H=1; + REPLACE_GETTIMEOFDAY=0; + REPLACE_STRUCT_TIMEVAL=0; + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5 +$as_echo_n "checking absolute name of <sys/time.h>... " >&6; } +if ${gl_cv_next_sys_time_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_time_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_time_h + gl_cv_next_sys_time_h='"'$gl_header'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +$as_echo "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +$as_echo_n "checking for struct timeval... " >&6; } +if ${gl_cv_sys_struct_timeval+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #if HAVE_WINSOCK2_H + # include <winsock2.h> + #endif + +int +main () +{ +static struct timeval x; x.tv_sec = x.tv_usec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timeval=yes +else + gl_cv_sys_struct_timeval=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 +$as_echo "$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 +$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; } +if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> + #if HAVE_WINSOCK2_H + # include <winsock2.h> + #endif + +int +main () +{ +static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timeval_tv_sec=yes +else + gl_cv_sys_struct_timeval_tv_sec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 +$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; } + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + + for gl_func in gettimeofday; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <time.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5 +$as_echo_n "checking absolute name of <stdint.h>... " >&6; } +if ${gl_cv_next_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_stdint_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdint.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdint_h + gl_cv_next_stdint_h='"'$gl_header'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +$as_echo "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdint.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdint_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +$as_echo_n "checking whether stdint.h conforms to C99... " >&6; } +if ${gl_cv_header_working_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" +#endif + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +#include <limits.h> /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if test "$cross_compiling" = yes; then : + gl_cv_header_working_stdint_h=yes + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +#include <stdio.h> +#include <string.h> +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main () +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +$as_echo "$gl_cv_header_working_stdint_h" >&6; } + fi + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else + for ac_header in sys/inttypes.h sys/bitypes.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + else + HAVE_SYS_INTTYPES_H=0 + fi + + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + else + HAVE_SYS_BITYPES_H=0 + fi + + + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + +#include <limits.h>"; then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + +#include <limits.h>"; then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +$as_echo_n "checking whether $gltype is signed... " >&6; } +if eval \${gl_cv_type_${gltype}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + result=yes +else + result=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result + +fi +eval ac_res=\$gl_cv_type_${gltype}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SIGNED_${GLTYPE} 1 +_ACEOF + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if eval \${gl_cv_type_${gltype}_suffix+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result +_ACEOF + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if eval \${gl_cv_type_${gltype}_suffix+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result +_ACEOF + + done + + + + if test $BITSIZEOF_WINT_T -lt 32; then + BITSIZEOF_WINT_T=32 + fi + + STDINT_H=stdint.h + fi + + if test -n "$STDINT_H"; then + GL_GENERATE_STDINT_H_TRUE= + GL_GENERATE_STDINT_H_FALSE='#' +else + GL_GENERATE_STDINT_H_TRUE='#' + GL_GENERATE_STDINT_H_FALSE= +fi + + + + + + GNULIB_IMAXABS=0; + GNULIB_IMAXDIV=0; + GNULIB_STRTOIMAX=0; + GNULIB_STRTOUMAX=0; + HAVE_DECL_IMAXABS=1; + HAVE_DECL_IMAXDIV=1; + HAVE_DECL_STRTOIMAX=1; + HAVE_DECL_STRTOUMAX=1; + REPLACE_STRTOIMAX=0; + REPLACE_STRTOUMAX=0; + INT32_MAX_LT_INTMAX_MAX=1; + INT64_MAX_EQ_LONG_MAX='defined _LP64'; + PRI_MACROS_BROKEN=0; + PRIPTR_PREFIX=__PRIPTR_PREFIX; + UINT32_MAX_LT_UINTMAX_MAX=1; + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_inttypes_h='<'inttypes.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5 +$as_echo_n "checking absolute name of <inttypes.h>... " >&6; } +if ${gl_cv_next_inttypes_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_inttypes_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <inttypes.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'inttypes.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_inttypes_h + gl_cv_next_inttypes_h='"'$gl_header'"' + else + gl_cv_next_inttypes_h='<'inttypes.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 +$as_echo "$gl_cv_next_inttypes_h" >&6; } + fi + NEXT_INTTYPES_H=$gl_cv_next_inttypes_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'inttypes.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_inttypes_h + fi + NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in imaxabs imaxdiv strtoimax strtoumax; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <inttypes.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + for ac_header in inttypes.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_inttypes_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if ${gt_cv_inttypes_pri_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <inttypes.h> +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_inttypes_pri_broken=no +else + gt_cv_inttypes_pri_broken=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +$as_echo "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +cat >>confdefs.h <<_ACEOF +#define PRI_MACROS_BROKEN 1 +_ACEOF + + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if ${gl_cv_cc_float_expbit0+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_cc_float_expbit0="word 0 bit 23" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + + ISNANF_LIBM= + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnanf_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x; +int +main () +{ +return isnanf (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanf_no_libm=yes +else + gl_cv_func_isnanf_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_no_libm" >&5 +$as_echo "$gl_cv_func_isnanf_no_libm" >&6; } + + if test $gl_cv_func_isnanf_no_libm = no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used with libm" >&5 +$as_echo_n "checking whether isnan(float) can be used with libm... " >&6; } +if ${gl_cv_func_isnanf_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x; +int +main () +{ +return isnanf (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanf_in_libm=yes +else + gl_cv_func_isnanf_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_in_libm" >&5 +$as_echo "$gl_cv_func_isnanf_in_libm" >&6; } + + if test $gl_cv_func_isnanf_in_libm = yes; then + ISNANF_LIBM=-lm + fi + fi + if test $gl_cv_func_isnanf_no_libm = yes \ + || test $gl_cv_func_isnanf_in_libm = yes; then + save_LIBS="$LIBS" + LIBS="$LIBS $ISNANF_LIBM" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5 +$as_echo_n "checking whether isnan(float) works... " >&6; } +if ${gl_cv_func_isnanf_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; + *) gl_cv_func_isnanf_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <math.h> +#if __GNUC__ >= 4 +# undef isnanf +# define isnanf(x) __builtin_isnanf ((float)(x)) +#elif defined isnan +# undef isnanf +# define isnanf(x) isnan ((float)(x)) +#endif +/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ +#ifdef __DECC +static float +NaN () +{ + static float zero = 0.0f; + return zero / zero; +} +#else +# define NaN() (0.0f / 0.0f) +#endif +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; float value; } memory_float; +int main() +{ + int result = 0; + + if (isnanf (1.0f / 0.0f)) + result |= 1; + + if (!isnanf (NaN ())) + result |= 2; + +#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT + /* The isnanf function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit. */ + if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0) + { + memory_float m; + + m.value = NaN (); + /* Set the bits below the exponent to 01111...111. */ + m.word[0] &= -1U << FLT_EXPBIT0_BIT; + m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1; + if (!isnanf (m.value)) + result |= 4; + } +#endif + + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanf_works=yes +else + gl_cv_func_isnanf_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_works" >&5 +$as_echo "$gl_cv_func_isnanf_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_isnanf_works" in + *yes) gl_func_isnanf=yes ;; + *) gl_func_isnanf=no; ISNANF_LIBM= ;; + esac + else + gl_func_isnanf=no + fi + if test $gl_func_isnanf != yes; then + HAVE_ISNANF=0 + fi + + + + + ISNAND_LIBM= + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnand_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #else + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x; +int +main () +{ +return isnand (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnand_no_libm=yes +else + gl_cv_func_isnand_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5 +$as_echo "$gl_cv_func_isnand_no_libm" >&6; } + + if test $gl_cv_func_isnand_no_libm = no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used with libm" >&5 +$as_echo_n "checking whether isnan(double) can be used with libm... " >&6; } +if ${gl_cv_func_isnand_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #elif defined isnan + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x; +int +main () +{ +return isnand (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnand_in_libm=yes +else + gl_cv_func_isnand_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_in_libm" >&5 +$as_echo "$gl_cv_func_isnand_in_libm" >&6; } + + if test $gl_cv_func_isnand_in_libm = yes; then + ISNAND_LIBM=-lm + fi + fi + if test $gl_cv_func_isnand_no_libm = yes \ + || test $gl_cv_func_isnand_in_libm = yes; then + gl_func_isnand=yes + else + gl_func_isnand=no + HAVE_ISNAND=0 + fi + + + + + ISNANL_LIBM= + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnanl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x; +int +main () +{ +return isnanl (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanl_no_libm=yes +else + gl_cv_func_isnanl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5 +$as_echo "$gl_cv_func_isnanl_no_libm" >&6; } + + if test $gl_cv_func_isnanl_no_libm = no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used with libm" >&5 +$as_echo_n "checking whether isnan(long double) can be used with libm... " >&6; } +if ${gl_cv_func_isnanl_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x; +int +main () +{ +return isnanl (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanl_in_libm=yes +else + gl_cv_func_isnanl_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_in_libm" >&5 +$as_echo "$gl_cv_func_isnanl_in_libm" >&6; } + + if test $gl_cv_func_isnanl_in_libm = yes; then + ISNANL_LIBM=-lm + fi + fi + if test $gl_cv_func_isnanl_no_libm = yes \ + || test $gl_cv_func_isnanl_in_libm = yes; then + save_LIBS="$LIBS" + LIBS="$LIBS $ISNANL_LIBM" + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5 +$as_echo_n "checking whether isnanl works... " >&6; } +if ${gl_cv_func_isnanl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; + *) + case "$host_os" in + netbsd*) gl_cv_func_isnanl_works="guessing no";; + *) gl_cv_func_isnanl_works="guessing yes";; + esac + ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <limits.h> +#include <math.h> +#if __GNUC__ >= 4 +# undef isnanl +# define isnanl(x) __builtin_isnanl ((long double)(x)) +#elif defined isnan +# undef isnanl +# define isnanl(x) isnan ((long double)(x)) +#endif +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif +int main () +{ + int result = 0; + + if (!isnanl (NaNl ())) + result |= 1; + + { + memory_long_double m; + unsigned int i; + + /* The isnanl function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (!isnanl (m.value)) + result |= 1; + } + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 2; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 2; + } + /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, + Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in + Intel IA-64 Architecture Software Developer's Manual, Volume 1: + Application Architecture. + Table 5-2 "Floating-Point Register Encodings" + Figure 5-6 "Memory to Floating-Point Register Data Translation" + */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (!isnanl (x.value)) + result |= 4; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + result |= 8; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + result |= 16; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 32; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 64; + } +#endif + + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanl_works=yes +else + gl_cv_func_isnanl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 +$as_echo "$gl_cv_func_isnanl_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_isnanl_works" in + *yes) gl_func_isnanl=yes ;; + *) gl_func_isnanl=no; ISNANL_LIBM= ;; + esac + else + gl_func_isnanl=no + fi + if test $gl_func_isnanl != yes; then + HAVE_ISNANL=0 + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexp() can be used without linking with libm... " >&6; } +if ${gl_cv_func_ldexp_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include <math.h> + double (*funcptr) (double, int) = ldexp; + double x; +int +main () +{ +return ldexp (x, -1) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ldexp_no_libm=yes +else + gl_cv_func_ldexp_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5 +$as_echo "$gl_cv_func_ldexp_no_libm" >&6; } + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if ${am_cv_langinfo_codeset+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int +main () +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_langinfo_codeset=yes +else + am_cv_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +$as_echo "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + +ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +$as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if ${ac_cv_gnu_library_2_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky" >/dev/null 2>&1; then : + ac_cv_gnu_library_2_1=yes +else + ac_cv_gnu_library_2_1=no +fi +rm -f conftest* + + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +$as_echo "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${acl_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$acl_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${acl_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + acl_cv_prog_gnu_ld=yes + ;; +*) + acl_cv_prog_gnu_ld=no + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } +if ${acl_cv_rpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; : +else + enable_rpath=yes +fi + + + + + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +$as_echo_n "checking for 64-bit host... " >&6; } +if ${gl_cv_solaris_64bit+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sixtyfour bits" >/dev/null 2>&1; then : + gl_cv_solaris_64bit=yes +else + gl_cv_solaris_64bit=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +$as_echo "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + + + + gl_threads_api=none + LIBTHREAD= + LTLIBTHREAD= + LIBMULTITHREAD= + LTLIBMULTITHREAD= + if test "$gl_use_threads" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 +$as_echo_n "checking whether imported symbols can be declared weak... " >&6; } +if ${gl_cv_have_weak+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_have_weak=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern void xyzzy (); +#pragma weak xyzzy +int +main () +{ +xyzzy(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_have_weak=maybe +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $gl_cv_have_weak = maybe; then + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __ELF__ + Extensible Linking Format + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : + gl_cv_have_weak="guessing yes" +else + gl_cv_have_weak="guessing no" +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#pragma weak fputs +int main () +{ + return (fputs == NULL); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_have_weak=yes +else + gl_cv_have_weak=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 +$as_echo "$gl_cv_have_weak" >&6; } + if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then + # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that + # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY. + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : + gl_have_pthread_h=yes +else + gl_have_pthread_h=no +fi + + + if test "$gl_have_pthread_h" = yes; then + # Other possible tests: + # -lpthreads (FSU threads, PCthreads) + # -lgthreads + gl_have_pthread= + # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist + # in libc. IRIX 6.5 has the first one in both libc and libpthread, but + # the second one only in libpthread, and lock.c needs it. + # + # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 + # needs -pthread for some reason. See: + # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html + save_LIBS=$LIBS + for gl_pthread in '' '-pthread'; do + LIBS="$LIBS $gl_pthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> + pthread_mutex_t m; + pthread_mutexattr_t ma; + +int +main () +{ +pthread_mutex_lock (&m); + pthread_mutexattr_init (&ma); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_have_pthread=yes + LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread + LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$save_LIBS + test -n "$gl_have_pthread" && break + done + + # Test for libpthread by looking for pthread_kill. (Not pthread_self, + # since it is defined as a macro on OSF/1.) + if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then + # The program links fine without libpthread. But it may actually + # need to link with libpthread in order to create multiple threads. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_kill=yes +else + ac_cv_lib_pthread_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : + LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread + # On Solaris and HP-UX, most pthread functions exist also in libc. + # Therefore pthread_in_use() needs to actually try to create a + # thread: pthread_create from libc will fail, whereas + # pthread_create will actually create a thread. + case "$host_os" in + solaris* | hpux*) + +$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h + + esac + +fi + + elif test -z "$gl_have_pthread"; then + # Some library is needed. Try libpthread and libc_r. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_kill=yes +else + ac_cv_lib_pthread_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : + gl_have_pthread=yes + LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread + LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread +fi + + if test -z "$gl_have_pthread"; then + # For FreeBSD 4. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 +$as_echo_n "checking for pthread_kill in -lc_r... " >&6; } +if ${ac_cv_lib_c_r_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_r_pthread_kill=yes +else + ac_cv_lib_c_r_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } +if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : + gl_have_pthread=yes + LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r + LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r +fi + + fi + fi + if test -n "$gl_have_pthread"; then + gl_threads_api=posix + +$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h + + if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then + if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then + +$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h + + LIBTHREAD= + LTLIBTHREAD= + fi + fi + fi + fi + fi + if test -z "$gl_have_pthread"; then + if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then + gl_have_solaristhread= + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <thread.h> +#include <synch.h> + +int +main () +{ +thr_self(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_have_solaristhread=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + if test -n "$gl_have_solaristhread"; then + gl_threads_api=solaris + LIBTHREAD=-lthread + LTLIBTHREAD=-lthread + LIBMULTITHREAD="$LIBTHREAD" + LTLIBMULTITHREAD="$LTLIBTHREAD" + +$as_echo "#define USE_SOLARIS_THREADS 1" >>confdefs.h + + if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then + +$as_echo "#define USE_SOLARIS_THREADS_WEAK 1" >>confdefs.h + + LIBTHREAD= + LTLIBTHREAD= + fi + fi + fi + fi + if test "$gl_use_threads" = pth; then + gl_save_CPPFLAGS="$CPPFLAGS" + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libpth" >&5 +$as_echo_n "checking how to link with libpth... " >&6; } +if ${ac_cv_libpth_libs+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libpth-prefix was given. +if test "${with_libpth_prefix+set}" = set; then : + withval=$with_libpth_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBPTH= + LTLIBPTH= + INCPTH= + LIBPTH_PREFIX= + HAVE_LIBPTH= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='pth ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBPTH; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBPTH; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" + else + LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a" + else + LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'pth'; then + LIBPTH_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'pth'; then + LIBPTH_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCPTH; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCPTH="${INCPTH}${INCPTH:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBPTH; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBPTH; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBPTH="${LIBPTH}${LIBPTH:+ }$dep" + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep" + ;; + esac + done + fi + else + LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir" + done + fi + + + + + + + ac_cv_libpth_libs="$LIBPTH" + ac_cv_libpth_ltlibs="$LTLIBPTH" + ac_cv_libpth_cppflags="$INCPTH" + ac_cv_libpth_prefix="$LIBPTH_PREFIX" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libpth_libs" >&5 +$as_echo "$ac_cv_libpth_libs" >&6; } + LIBPTH="$ac_cv_libpth_libs" + LTLIBPTH="$ac_cv_libpth_ltlibs" + INCPTH="$ac_cv_libpth_cppflags" + LIBPTH_PREFIX="$ac_cv_libpth_prefix" + + for element in $INCPTH; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + + + HAVE_LIBPTH=yes + + + + gl_have_pth= + gl_save_LIBS="$LIBS" + LIBS="$LIBS $LIBPTH" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pth.h> +int +main () +{ +pth_self(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_have_pth=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + if test -n "$gl_have_pth"; then + gl_threads_api=pth + LIBTHREAD="$LIBPTH" + LTLIBTHREAD="$LTLIBPTH" + LIBMULTITHREAD="$LIBTHREAD" + LTLIBMULTITHREAD="$LTLIBTHREAD" + +$as_echo "#define USE_PTH_THREADS 1" >>confdefs.h + + if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then + if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then + +$as_echo "#define USE_PTH_THREADS_WEAK 1" >>confdefs.h + + LIBTHREAD= + LTLIBTHREAD= + fi + fi + else + CPPFLAGS="$gl_save_CPPFLAGS" + fi + fi + if test -z "$gl_have_pthread"; then + case "$gl_use_threads" in + yes | windows | win32) # The 'win32' is for backward compatibility. + if { case "$host_os" in + mingw*) true;; + *) false;; + esac + }; then + gl_threads_api=windows + +$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h + + fi + ;; + esac + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5 +$as_echo_n "checking for multithread API to use... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5 +$as_echo "$gl_threads_api" >&6; } + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file + echo >conftest.file + if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_lstat_dereferences_slashed_symlink=yes +else + gl_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + # If the 'ln -s' command failed, then we probably don't even + # have an lstat function. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" + fi + rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + + + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + GNULIB_WMEMCHR=0; + GNULIB_WMEMCMP=0; + GNULIB_WMEMCPY=0; + GNULIB_WMEMMOVE=0; + GNULIB_WMEMSET=0; + GNULIB_WCSLEN=0; + GNULIB_WCSNLEN=0; + GNULIB_WCSCPY=0; + GNULIB_WCPCPY=0; + GNULIB_WCSNCPY=0; + GNULIB_WCPNCPY=0; + GNULIB_WCSCAT=0; + GNULIB_WCSNCAT=0; + GNULIB_WCSCMP=0; + GNULIB_WCSNCMP=0; + GNULIB_WCSCASECMP=0; + GNULIB_WCSNCASECMP=0; + GNULIB_WCSCOLL=0; + GNULIB_WCSXFRM=0; + GNULIB_WCSDUP=0; + GNULIB_WCSCHR=0; + GNULIB_WCSRCHR=0; + GNULIB_WCSCSPN=0; + GNULIB_WCSSPN=0; + GNULIB_WCSPBRK=0; + GNULIB_WCSSTR=0; + GNULIB_WCSTOK=0; + GNULIB_WCSWIDTH=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_WMEMCHR=1; + HAVE_WMEMCMP=1; + HAVE_WMEMCPY=1; + HAVE_WMEMMOVE=1; + HAVE_WMEMSET=1; + HAVE_WCSLEN=1; + HAVE_WCSNLEN=1; + HAVE_WCSCPY=1; + HAVE_WCPCPY=1; + HAVE_WCSNCPY=1; + HAVE_WCPNCPY=1; + HAVE_WCSCAT=1; + HAVE_WCSNCAT=1; + HAVE_WCSCMP=1; + HAVE_WCSNCMP=1; + HAVE_WCSCASECMP=1; + HAVE_WCSNCASECMP=1; + HAVE_WCSCOLL=1; + HAVE_WCSXFRM=1; + HAVE_WCSDUP=1; + HAVE_WCSCHR=1; + HAVE_WCSRCHR=1; + HAVE_WCSCSPN=1; + HAVE_WCSSPN=1; + HAVE_WCSPBRK=1; + HAVE_WCSSTR=1; + HAVE_WCSTOK=1; + HAVE_WCSWIDTH=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCSNRTOMBS=0; + REPLACE_WCWIDTH=0; + REPLACE_WCSWIDTH=0; + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +$as_echo_n "checking for mbstate_t... " >&6; } +if ${ac_cv_type_mbstate_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int +main () +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_mbstate_t=yes +else + ac_cv_type_mbstate_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +$as_echo "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +$as_echo "#define mbstate_t int" >>confdefs.h + + fi + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if ${gt_cv_locale_ja+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if ${gt_cv_locale_zh_CN+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if ${gt_cv_locale_fr_utf8+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + + + GNULIB_FFSL=0; + GNULIB_FFSLL=0; + GNULIB_MEMCHR=0; + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNCAT=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRERROR_R=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + HAVE_FFSL=1; + HAVE_FFSLL=1; + HAVE_MEMCHR=1; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR_R=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSIGNAL=0; + REPLACE_STRTOK_R=0; + UNDEFINE_STRTOK_R=0; + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes; then : + gl_have_mmap=yes +else + gl_have_mmap=no +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +$as_echo_n "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1; then : + gl_have_mmap_anonymous=yes +fi +rm -f conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/mman.h> +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1; then : + +$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -f conftest* + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +$as_echo "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +$as_echo_n "checking whether memchr works... " >&6; } +if ${gl_cv_func_memchr_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_memchr_works="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> +#if HAVE_SYS_MMAN_H +# include <fcntl.h> +# include <unistd.h> +# include <sys/types.h> +# include <sys/mman.h> +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +int +main () +{ + + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_memchr_works=yes +else + gl_cv_func_memchr_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +$as_echo "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi + + + +ac_fn_c_check_decl "$LINENO" "obstack_printf" "ac_cv_have_decl_obstack_printf" "$ac_includes_default" +if test "x$ac_cv_have_decl_obstack_printf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OBSTACK_PRINTF $ac_have_decl +_ACEOF + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +$as_echo_n "checking for promoted mode_t type... " >&6; } +if ${gl_cv_promoted_mode_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main () +{ +typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_promoted_mode_t='int' +else + gl_cv_promoted_mode_t='mode_t' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +$as_echo "$gl_cv_promoted_mode_t" >&6; } + +cat >>confdefs.h <<_ACEOF +#define PROMOTED_MODE_T $gl_cv_promoted_mode_t +_ACEOF + + + + + + REPLACE_STRERROR_0=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +$as_echo_n "checking whether strerror(0) succeeds... " >&6; } +if ${gl_cv_func_strerror_0_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + #include <errno.h> + +int +main () +{ +int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strerror_0_works=yes +else + gl_cv_func_strerror_0_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 +$as_echo "$gl_cv_func_strerror_0_works" >&6; } + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + +$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 +$as_echo_n "checking for strerror_r with POSIX signature... " >&6; } +if ${gl_cv_func_strerror_r_posix_signature+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + int strerror_r (int, char *, size_t); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_strerror_r_posix_signature=yes +else + gl_cv_func_strerror_r_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 +$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; } + if test $gl_cv_func_strerror_r_posix_signature = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 +$as_echo_n "checking whether strerror_r works... " >&6; } +if ${gl_cv_func_strerror_r_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess no on AIX. + aix*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on HP-UX. + hpux*) gl_cv_func_strerror_r_works="guessing no";; + # Guess no on BSD variants. + *bsd*) gl_cv_func_strerror_r_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_strerror_r_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <string.h> + +int +main () +{ +int result = 0; + char buf[79]; + if (strerror_r (EACCES, buf, 0) < 0) + result |= 1; + errno = 0; + if (strerror_r (EACCES, buf, sizeof buf) != 0) + result |= 2; + strcpy (buf, "Unknown"); + if (strerror_r (0, buf, sizeof buf) != 0) + result |= 4; + if (errno) + result |= 8; + if (strstr (buf, "nknown") || strstr (buf, "ndefined")) + result |= 0x10; + errno = 0; + *buf = 0; + if (strerror_r (-3, buf, sizeof buf) < 0) + result |= 0x20; + if (errno) + result |= 0x40; + if (!*buf) + result |= 0x80; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strerror_r_works=yes +else + gl_cv_func_strerror_r_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +$as_echo "$gl_cv_func_strerror_r_works" >&6; } + else + + if test $ac_cv_func___xpg_strerror_r = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 +$as_echo_n "checking whether __xpg_strerror_r works... " >&6; } +if ${gl_cv_func_strerror_r_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_strerror_r_works="guessing no" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <string.h> + extern + #ifdef __cplusplus + "C" + #endif + int __xpg_strerror_r(int, char *, size_t); + +int +main () +{ +int result = 0; + char buf[256] = "^"; + char copy[256]; + char *str = strerror (-1); + strcpy (copy, str); + if (__xpg_strerror_r (-2, buf, 1) == 0) + result |= 1; + if (*buf) + result |= 2; + __xpg_strerror_r (-2, buf, 256); + if (strcmp (str, copy)) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strerror_r_works=yes +else + gl_cv_func_strerror_r_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 +$as_echo "$gl_cv_func_strerror_r_works" >&6; } + fi + fi + fi + fi + +ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror_r" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R $ac_have_decl +_ACEOF + + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + + + + GNULIB_POSIX_SPAWN=0; + GNULIB_POSIX_SPAWNP=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0; + GNULIB_POSIX_SPAWNATTR_INIT=0; + GNULIB_POSIX_SPAWNATTR_GETFLAGS=0; + GNULIB_POSIX_SPAWNATTR_SETFLAGS=0; + GNULIB_POSIX_SPAWNATTR_GETPGROUP=0; + GNULIB_POSIX_SPAWNATTR_SETPGROUP=0; + GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0; + GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0; + GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0; + GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0; + GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0; + GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0; + GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0; + GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0; + GNULIB_POSIX_SPAWNATTR_DESTROY=0; + HAVE_POSIX_SPAWN=1; + HAVE_POSIX_SPAWNATTR_T=1; + HAVE_POSIX_SPAWN_FILE_ACTIONS_T=1; + + REPLACE_POSIX_SPAWN=0; + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; + + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0; + + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0; + + + + + + LIB_POSIX_SPAWN= + + gl_saved_libs=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing posix_spawn" >&5 +$as_echo_n "checking for library containing posix_spawn... " >&6; } +if ${ac_cv_search_posix_spawn+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char posix_spawn (); +int +main () +{ +return posix_spawn (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_posix_spawn=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_posix_spawn+:} false; then : + break +fi +done +if ${ac_cv_search_posix_spawn+:} false; then : + +else + ac_cv_search_posix_spawn=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_posix_spawn" >&5 +$as_echo "$ac_cv_search_posix_spawn" >&6; } +ac_res=$ac_cv_search_posix_spawn +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_posix_spawn" = "none required" || + LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn +fi + + for ac_func in posix_spawn +do : + ac_fn_c_check_func "$LINENO" "posix_spawn" "ac_cv_func_posix_spawn" +if test "x$ac_cv_func_posix_spawn" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POSIX_SPAWN 1 +_ACEOF + +fi +done + + LIBS=$gl_saved_libs + + if test $ac_cv_func_posix_spawn != yes; then + HAVE_POSIX_SPAWN=0 + fi + + + + + if test $ac_cv_func_posix_spawn = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn works" >&5 +$as_echo_n "checking whether posix_spawn works... " >&6; } +if ${gl_cv_func_posix_spawn_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test $cross_compiling = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <spawn.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> + +extern char **environ; + +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + +#ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +#endif +#ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +#endif + +#define CHILD_PROGRAM_FILENAME "/non/exist/ent" + +static int +fd_safer (int fd) +{ + if (0 <= fd && fd <= 2) + { + int f = fd_safer (dup (fd)); + int e = errno; + close (fd); + errno = e; + fd = f; + } + + return fd; +} + +int +main () +{ + char *argv[2] = { CHILD_PROGRAM_FILENAME, NULL }; + int ofd[2]; + sigset_t blocked_signals; + sigset_t fatal_signal_set; + posix_spawn_file_actions_t actions; + bool actions_allocated; + posix_spawnattr_t attrs; + bool attrs_allocated; + int err; + pid_t child; + int status; + int exitstatus; + + setvbuf (stdout, NULL, _IOFBF, 0); + puts ("This should be seen only once."); + if (pipe (ofd) < 0 || (ofd[1] = fd_safer (ofd[1])) < 0) + { + perror ("cannot create pipe"); + exit (1); + } + sigprocmask (SIG_SETMASK, NULL, &blocked_signals); + sigemptyset (&fatal_signal_set); + sigaddset (&fatal_signal_set, SIGINT); + sigaddset (&fatal_signal_set, SIGTERM); + sigaddset (&fatal_signal_set, SIGHUP); + sigaddset (&fatal_signal_set, SIGPIPE); + sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL); + actions_allocated = false; + attrs_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (err = posix_spawn_file_actions_adddup2 (&actions, ofd[0], STDIN_FILENO)) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ofd[0])) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) != 0 + || (err = posix_spawnattr_init (&attrs)) != 0 + || (attrs_allocated = true, + (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0 + || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0) + || (err = posix_spawnp (&child, CHILD_PROGRAM_FILENAME, &actions, &attrs, argv, environ)) != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + if (err == ENOENT) + return 0; + else + { + errno = err; + perror ("subprocess failed"); + exit (1); + } + } + posix_spawn_file_actions_destroy (&actions); + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + close (ofd[0]); + close (ofd[1]); + status = 0; + while (waitpid (child, &status, 0) != child) + ; + if (!WIFEXITED (status)) + { + fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); + exit (1); + } + exitstatus = WEXITSTATUS (status); + if (exitstatus != 127) + { + fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); + exit (1); + } + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if test -s conftest$ac_exeext \ + && ./conftest$ac_exeext > conftest.out \ + && echo 'This should be seen only once.' > conftest.ok \ + && cmp conftest.out conftest.ok > /dev/null; then + gl_cv_func_posix_spawn_works=yes + else + gl_cv_func_posix_spawn_works=no + fi +else + gl_cv_func_posix_spawn_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $gl_cv_func_posix_spawn_works = yes; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Test whether posix_spawn_file_actions_addopen supports filename arguments + that contain special characters such as '*'. */ + +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <spawn.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> + +extern char **environ; + +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + +#ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +#endif +#ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +#endif + +#define CHILD_PROGRAM_FILENAME "conftest" +#define DATA_FILENAME "conftest%=*#?" + +static int +parent_main (void) +{ + FILE *fp; + char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL }; + posix_spawn_file_actions_t actions; + bool actions_allocated; + int err; + pid_t child; + int status; + int exitstatus; + + /* Create a data file with specific contents. */ + fp = fopen (DATA_FILENAME, "wb"); + if (fp == NULL) + { + perror ("cannot create data file"); + return 1; + } + fwrite ("Halle Potta", 1, 11, fp); + if (fflush (fp) || fclose (fp)) + { + perror ("cannot prepare data file"); + return 2; + } + + /* Avoid reading from our stdin, as it could block. */ + freopen ("/dev/null", "rb", stdin); + + /* Test whether posix_spawn_file_actions_addopen with this file name + actually works, but spawning a child that reads from this file. */ + actions_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, DATA_FILENAME, O_RDONLY, 0600)) != 0 + || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + errno = err; + perror ("subprocess failed"); + return 3; + } + posix_spawn_file_actions_destroy (&actions); + status = 0; + while (waitpid (child, &status, 0) != child) + ; + if (!WIFEXITED (status)) + { + fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); + return 4; + } + exitstatus = WEXITSTATUS (status); + if (exitstatus != 0) + { + fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); + return 5; + } + return 0; +} + +static int +child_main (void) +{ + char buf[1024]; + + /* See if reading from STDIN_FILENO yields the expected contents. */ + if (fread (buf, 1, sizeof (buf), stdin) == 11 + && memcmp (buf, "Halle Potta", 11) == 0) + return 0; + else + return 8; +} + +static void +cleanup_then_die (int sig) +{ + /* Clean up data file. */ + unlink (DATA_FILENAME); + + /* Re-raise the signal and die from it. */ + signal (sig, SIG_DFL); + raise (sig); +} + +int +main (int argc, char *argv[]) +{ + int exitstatus; + + if (!(argc > 1 && strcmp (argv[1], "-child") == 0)) + { + /* This is the parent process. */ + signal (SIGINT, cleanup_then_die); + signal (SIGTERM, cleanup_then_die); + #ifdef SIGHUP + signal (SIGHUP, cleanup_then_die); + #endif + + exitstatus = parent_main (); + } + else + { + /* This is the child process. */ + + exitstatus = child_main (); + } + unlink (DATA_FILENAME); + return exitstatus; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + gl_cv_func_posix_spawn_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + else + case "$host_os" in + aix*) gl_cv_func_posix_spawn_works="guessing no";; + *) gl_cv_func_posix_spawn_works="guessing yes";; + esac + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_works" >&5 +$as_echo "$gl_cv_func_posix_spawn_works" >&6; } + + case "$gl_cv_func_posix_spawn_works" in + *yes) + +$as_echo "#define HAVE_WORKING_POSIX_SPAWN 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawnattr_setschedpolicy is supported" >&5 +$as_echo_n "checking whether posix_spawnattr_setschedpolicy is supported... " >&6; } +if ${gl_cv_func_spawnattr_setschedpolicy+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <spawn.h> +#if POSIX_SPAWN_SETSCHEDULER + POSIX scheduling supported +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "POSIX scheduling supported" >/dev/null 2>&1; then : + gl_cv_func_spawnattr_setschedpolicy=yes +else + gl_cv_func_spawnattr_setschedpolicy=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_spawnattr_setschedpolicy" >&5 +$as_echo "$gl_cv_func_spawnattr_setschedpolicy" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawnattr_setschedparam is supported" >&5 +$as_echo_n "checking whether posix_spawnattr_setschedparam is supported... " >&6; } +if ${gl_cv_func_spawnattr_setschedparam+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <spawn.h> +#if POSIX_SPAWN_SETSCHEDPARAM + POSIX scheduling supported +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "POSIX scheduling supported" >/dev/null 2>&1; then : + gl_cv_func_spawnattr_setschedparam=yes +else + gl_cv_func_spawnattr_setschedparam=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_spawnattr_setschedparam" >&5 +$as_echo "$gl_cv_func_spawnattr_setschedparam" >&6; } + ;; + *) REPLACE_POSIX_SPAWN=1 ;; + esac + fi + + + + + + + + + + + + + + + + + gl_cv_func_vfprintf_posix=no + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + # vfprintf exists and is + # already POSIX compliant. + gl_cv_func_vfprintf_posix=yes + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + if test $gl_cv_func_vfprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vfprintf.$ac_objext" + + REPLACE_VFPRINTF=1 + +$as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h + + : + + fi + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER +MicrosoftCompiler +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "MicrosoftCompiler" >/dev/null 2>&1; then : + gl_asmext='asm' + gl_c_asm_opt='-c -Fa' + +else + gl_asmext='s' + gl_c_asm_opt='-S' + +fi +rm -f conftest* + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C symbols are prefixed with underscore at the linker level" >&5 +$as_echo_n "checking whether C symbols are prefixed with underscore at the linker level... " >&6; } +if ${gl_cv_prog_as_underscore+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <<EOF +#ifdef __cplusplus +extern "C" int foo (void); +#endif +int foo(void) { return 0; } +EOF + # Look for the assembly language name in the .s file. + { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } >/dev/null 2>&1 + if grep _foo conftest.$gl_asmext >/dev/null ; then + gl_cv_prog_as_underscore=yes + else + gl_cv_prog_as_underscore=no + fi + rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_as_underscore" >&5 +$as_echo "$gl_cv_prog_as_underscore" >&6; } + if test $gl_cv_prog_as_underscore = yes; then + USER_LABEL_PREFIX=_ + else + USER_LABEL_PREFIX= + fi + +cat >>confdefs.h <<_ACEOF +#define USER_LABEL_PREFIX $USER_LABEL_PREFIX +_ACEOF + + ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"' + + + + GNULIB_PTHREAD_SIGMASK=0; + GNULIB_RAISE=0; + GNULIB_SIGNAL_H_SIGPIPE=0; + GNULIB_SIGPROCMASK=0; + GNULIB_SIGACTION=0; + HAVE_POSIX_SIGNALBLOCKING=1; + HAVE_PTHREAD_SIGMASK=1; + HAVE_RAISE=1; + HAVE_SIGSET_T=1; + HAVE_SIGINFO_T=1; + HAVE_SIGACTION=1; + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + + HAVE_SIGHANDLER_T=1; + REPLACE_PTHREAD_SIGMASK=0; + REPLACE_RAISE=0; + + + ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " + #include <signal.h> + /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ + #include <sys/types.h> + +" +if test "x$ac_cv_type_sigset_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGSET_T 1 +_ACEOF + +gl_cv_type_sigset_t=yes +else + gl_cv_type_sigset_t=no +fi + + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + + + + + +ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_snprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF $ac_have_decl +_ACEOF + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdbool.h> + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + + + REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; + HAVE_WCHAR_T=1; + + + +ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default" +if test "x$ac_cv_have_decl_strdup" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRDUP $ac_have_decl +_ACEOF + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 +$as_echo_n "checking absolute name of <string.h>... " >&6; } +if ${gl_cv_next_string_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'string.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_string_h + gl_cv_next_string_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +$as_echo "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'string.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_string_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive + + + + + + + for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + +ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" +if test "x$ac_cv_have_decl_strndup" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNDUP $ac_have_decl +_ACEOF + + + +ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" +if test "x$ac_cv_have_decl_strnlen" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNLEN $ac_have_decl +_ACEOF + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5 +$as_echo_n "checking absolute name of <sys/types.h>... " >&6; } +if ${gl_cv_next_sys_types_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_types_h + gl_cv_next_sys_types_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +$as_echo "$gl_cv_next_sys_types_h" >&6; } + fi + NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/types.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_types_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + + + + + + + + + + + + + GNULIB_WAITPID=0; + + + + + GNULIB_MKTIME=0; + GNULIB_NANOSLEEP=0; + GNULIB_STRPTIME=0; + GNULIB_TIMEGM=0; + GNULIB_TIME_R=0; + HAVE_DECL_LOCALTIME_R=1; + HAVE_NANOSLEEP=1; + HAVE_STRPTIME=1; + HAVE_TIMEGM=1; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_MKTIME=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5 +$as_echo_n "checking for struct timespec in <time.h>... " >&6; } +if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timespec_in_time_h=yes +else + gl_cv_sys_struct_timespec_in_time_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; } + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5 +$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; } +if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timespec_in_sys_time_h=yes +else + gl_cv_sys_struct_timespec_in_sys_time_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5 +$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; } +if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timespec_in_pthread_h=yes +else + gl_cv_sys_struct_timespec_in_pthread_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 +$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5 +$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; } +if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timespec_in_unistd_h=yes +else + gl_cv_sys_struct_timespec_in_unistd_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + fi + fi + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_time_h='<'time.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5 +$as_echo_n "checking absolute name of <time.h>... " >&6; } +if ${gl_cv_next_time_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_time_h + gl_cv_next_time_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 +$as_echo "$gl_cv_next_time_h" >&6; } + fi + NEXT_TIME_H=$gl_cv_next_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive + + + + + + + + + + + + + + +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' + + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi + +ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_feof_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_ferror_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fflush_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fgets_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputc_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputs_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fread_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getchar_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putc_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putchar_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" +if test "x$ac_cv_have_decl_unsetenv" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_UNSETENV $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_vsnprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF $ac_have_decl +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5 +$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; } +if ${gl_cv_header_wchar_h_correct_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_wchar_h_correct_inline=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +extern int zero (void); +int main () { return zero(); } + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + mv conftest.$ac_objext conftest1.$ac_objext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int zero (void) { return 0; } + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + mv conftest.$ac_objext conftest2.$ac_objext + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 +$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; } + if test $gl_cv_header_wchar_h_correct_inline = no; then + as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted." "$LINENO" 5 + fi + + + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; + + + + + + + + + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' +else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= +fi + + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' + + + + + + + + + + gl_source_base='lib' + + + if test $ac_cv_func_alloca_works = no; then + : + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +$as_echo_n "checking for alloca as a compiler built-in... " >&6; } +if ${gl_cv_rpl_alloca+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Need own alloca" >/dev/null 2>&1; then : + gl_cv_rpl_alloca=yes +else + gl_cv_rpl_alloca=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +$as_echo "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + + if test -n "$ALLOCA_H"; then + GL_GENERATE_ALLOCA_H_TRUE= + GL_GENERATE_ALLOCA_H_FALSE='#' +else + GL_GENERATE_ALLOCA_H_TRUE='#' + GL_GENERATE_ALLOCA_H_FALSE= +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5 +$as_echo_n "checking whether to enable assertions... " >&6; } + # Check whether --enable-assert was given. +if test "${enable_assert+set}" = set; then : + enableval=$enable_assert; if test "x$enableval" = xno; then : + +$as_echo "#define NDEBUG 1" >>confdefs.h + +elif test "x$enableval" != xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5 +$as_echo "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;} + enable_assert=yes +fi +else + enable_assert=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5 +$as_echo "$enable_assert" >&6; } + + + + + if test $gl_cv_func_malloc_posix = yes; then + +$as_echo "#define HAVE_CALLOC_POSIX 1" >>confdefs.h + + else + REPLACE_CALLOC=1 + fi + + if test $REPLACE_CALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" + + fi + + + + + + GNULIB_CALLOC_POSIX=1 + + + + + +$as_echo "#define GNULIB_TEST_CALLOC_POSIX 1" >>confdefs.h + + + + + +$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + REPLACE_CLOSE=1 + fi + + + + if test $REPLACE_CLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + + + + + + GNULIB_CLOSE=1 + + + + + +$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h + + + + + : + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_CLOSE_STREAM 1 +_ACEOF + + + + : + + + + if test "x$datarootdir" = x; then + datarootdir='${datadir}' + + fi + if test "x$docdir" = x; then + docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' + + fi + if test "x$htmldir" = x; then + htmldir='${docdir}' + + fi + if test "x$dvidir" = x; then + dvidir='${docdir}' + + fi + if test "x$pdfdir" = x; then + pdfdir='${docdir}' + + fi + if test "x$psdir" = x; then + psdir='${docdir}' + + fi + if test "x$lispdir" = x; then + lispdir='${datarootdir}/emacs/site-lisp' + + fi + if test "x$localedir" = x; then + localedir='${datarootdir}/locale' + + fi + if test "x$runstatedir" = x; then + runstatedir='${localstatedir}/run' + + fi + + pkglibexecdir='${libexecdir}/${PACKAGE}' + + + + + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_DIRNAME 1 +_ACEOF + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +$as_echo_n "checking whether // is distinct from /... " >&6; } +if ${gl_cv_double_slash_root+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # <bug-gnulib@gnu.org>. + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +$as_echo "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + +$as_echo "#define HAVE_DUP2 1" >>confdefs.h + + + if test $HAVE_DUP2 = 1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +$as_echo_n "checking whether dup2 works... " >&6; } +if ${gl_cv_func_dup2_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a + # closed fd may yield -EBADF instead of -1 / errno=EBADF. + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> +#include <fcntl.h> +#include <errno.h> +int +main () +{ +int result = 0; +#ifdef HAVE_GETDTABLESIZE + int bad_fd = getdtablesize (); +#else + int bad_fd = 1000000; +#endif +#ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; +#endif + if (dup2 (1, 1) == 0) + result |= 2; +#ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; +#endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + return result; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_dup2_works=yes +else + gl_cv_func_dup2_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 +$as_echo "$gl_cv_func_dup2_works" >&6; } + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + for ac_func in setdtablesize +do : + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SETDTABLESIZE 1 +_ACEOF + +fi +done + + ;; + esac + fi + + + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + + + + + + GNULIB_DUP2=1 + + + + + +$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h + + + + + + + + + + GNULIB_ENVIRON=1 + + + + + +$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +$as_echo_n "checking for error_at_line... " >&6; } +if ${ac_cv_lib_error_at_line+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <error.h> +int +main () +{ +error_at_line (0, 0, "", 0, "an error occurred"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_error_at_line=yes +else + ac_cv_lib_error_at_line=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +$as_echo "$ac_cv_lib_error_at_line" >&6; } + + if test $ac_cv_lib_error_at_line = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" + + + + : + + fi + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" + + + + + + : + + + + + + + if test $ac_cv_func_fcntl = no; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 +$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; } +if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + # Guess that it works on glibc systems + case $host_os in #(( + *-gnu*) gl_cv_func_fcntl_f_dupfd_works="guessing yes";; + *) gl_cv_func_fcntl_f_dupfd_works="guessing no";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_GETDTABLESIZE +# include <unistd.h> +#endif +#include <fcntl.h> +#include <errno.h> + +int +main () +{ +int result = 0; +#ifdef HAVE_GETDTABLESIZE + int bad_fd = getdtablesize (); +#else + int bad_fd = 1000000; +#endif + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_fcntl_f_dupfd_works=yes +else + gl_cv_func_fcntl_f_dupfd_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 +$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; } + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + +$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 +$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } +if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <fcntl.h> +#ifndef F_DUPFD_CLOEXEC +choke me +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_fcntl_f_dupfd_cloexec=yes +else + gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + gl_cv_func_fcntl_f_dupfd_cloexec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 +$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } + if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + fi + fi + + + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" + + fi + + + + + + GNULIB_FCNTL=1 + + + + + +$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5 +$as_echo_n "checking absolute name of <fcntl.h>... " >&6; } +if ${gl_cv_next_fcntl_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fcntl.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'fcntl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_fcntl_h + gl_cv_next_fcntl_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +$as_echo "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'fcntl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fcntl_h + fi + NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive + + + + + + + + + + + for gl_func in fcntl openat; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fcntl.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_FD_SAFER_FLAG 1 +_ACEOF + + + + + + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd*) + case "$host_cpu" in + i[34567]86 ) + FLOAT_H=float.h + ;; + x86_64 ) + # On x86_64 systems, the C compiler may still be generating + # 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + +else + FLOAT_H=float.h +fi +rm -f conftest* + + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + REPLACE_ITOLD=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 +$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; } +if ${gl_cv_func_itold_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host" in + sparc*-*-linux*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __arch64__ + yes + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_func_itold_works="guessing no" +else + gl_cv_func_itold_works="guessing yes" +fi +rm -f conftest* + + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_itold_works=yes +else + gl_cv_func_itold_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 +$as_echo "$gl_cv_func_itold_works" >&6; } + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5 +$as_echo_n "checking absolute name of <float.h>... " >&6; } +if ${gl_cv_next_float_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'float.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_float_h + gl_cv_next_float_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +$as_echo "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'float.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_float_h + fi + NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive + + + + + fi + + if test -n "$FLOAT_H"; then + GL_GENERATE_FLOAT_H_TRUE= + GL_GENERATE_FLOAT_H_FALSE='#' +else + GL_GENERATE_FLOAT_H_TRUE='#' + GL_GENERATE_FLOAT_H_FALSE= +fi + + + + if test $REPLACE_FLOAT_LDBL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" + + fi + if test $REPLACE_ITOLD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" + + fi + + + + case "$host_os" in + mingw* | pw*) + REPLACE_FOPEN=1 + gl_cv_func_fopen_slash="guessing no" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen recognizes a trailing slash" >&5 +$as_echo_n "checking whether fopen recognizes a trailing slash... " >&6; } +if ${gl_cv_func_fopen_slash+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_fopen_slash="guessing no" ;; + *) + gl_cv_func_fopen_slash="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdio.h> +int main () +{ + return fopen ("conftest.sl/", "w") != NULL; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_fopen_slash=yes +else + gl_cv_func_fopen_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.sl + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_slash" >&5 +$as_echo "$gl_cv_func_fopen_slash" >&6; } + ;; + esac + case "$gl_cv_func_fopen_slash" in + *no) + +$as_echo "#define FOPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_FOPEN=1 + ;; + esac + + if test $REPLACE_FOPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fopen.$ac_objext" + + : + fi + + + + + + GNULIB_FOPEN=1 + + + + + +$as_echo "#define GNULIB_TEST_FOPEN 1" >>confdefs.h + + + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_FOPEN_SAFER 1 +_ACEOF + + + + + fp_headers=' + #include <stdio.h> + #if HAVE_STDIO_EXT_H + # include <stdio_ext.h> + #endif + ' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpending" >&5 +$as_echo_n "checking for __fpending... " >&6; } +if ${gl_cv_func___fpending+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$fp_headers +int +main () +{ +return ! __fpending (stdin); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func___fpending=yes +else + gl_cv_func___fpending=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func___fpending" >&5 +$as_echo "$gl_cv_func___fpending" >&6; } + if test $gl_cv_func___fpending = yes; then + ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers +" +if test "x$ac_cv_have_decl___fpending" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL___FPENDING $ac_have_decl +_ACEOF + + fi + + if test $gl_cv_func___fpending = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5 +$as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; } +if ${ac_cv_sys_pending_output_n_bytes+:} false; then : + $as_echo_n "(cached) " >&6 +else + + for ac_expr in \ + \ + '# glibc2' \ + 'fp->_IO_write_ptr - fp->_IO_write_base' \ + \ + '# traditional Unix' \ + 'fp->_ptr - fp->_base' \ + \ + '# BSD' \ + 'fp->_p - fp->_bf._base' \ + \ + '# SCO, Unixware' \ + '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ + \ + '# QNX' \ + '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ + \ + '# old glibc?' \ + 'fp->__bufp - fp->__buffer' \ + \ + '# old glibc iostream?' \ + 'fp->_pptr - fp->_pbase' \ + \ + '# emx+gcc' \ + 'fp->_ptr - fp->_buffer' \ + \ + '# Minix' \ + 'fp->_ptr - fp->_buf' \ + \ + '# Plan9' \ + 'fp->wp - fp->buf' \ + \ + '# VMS' \ + '(*fp)->_ptr - (*fp)->_base' \ + \ + '# e.g., DGUX R4.11; the info is not available' \ + 1 \ + ; do + + # Skip each embedded comment. + case "$ac_expr" in '#'*) continue;; esac + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *fp = stdin; (void) ($ac_expr); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + fp_done=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$fp_done" = yes && break + done + + ac_cv_sys_pending_output_n_bytes=$ac_expr + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_pending_output_n_bytes" >&5 +$as_echo "$ac_cv_sys_pending_output_n_bytes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define PENDING_OUTPUT_N_BYTES $ac_cv_sys_pending_output_n_bytes +_ACEOF + + + fi + + + + + + + + + + + + + + + + gl_cv_func_fprintf_posix=no + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + # fprintf exists and is + # already POSIX compliant. + gl_cv_func_fprintf_posix=yes + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + if test $gl_cv_func_fprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fprintf.$ac_objext" + + REPLACE_FPRINTF=1 + +$as_echo "#define REPLACE_FPRINTF_POSIX 1" >>confdefs.h + + : + + fi + + + + + + + GNULIB_FPRINTF_POSIX=1 + + + + + +$as_echo "#define GNULIB_TEST_FPRINTF_POSIX 1" >>confdefs.h + + + + + + + if test $gl_cv_func_frexp_no_libm = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 +$as_echo_n "checking whether frexp works... " >&6; } +if ${gl_cv_func_frexp_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; + *) gl_cv_func_frexp_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <math.h> +#include <string.h> +#if HAVE_DECL_ALARM +# include <signal.h> +# include <unistd.h> +#endif +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + ICC 10.0 has a bug when optimizing the expression -zero. + The expression -DBL_MIN * DBL_MIN does not work when cross-compiling + to PowerPC on Mac OS X 10.5. */ +#if defined __hpux || defined __sgi || defined __ICC +static double +compute_minus_zero (void) +{ + return -DBL_MIN * DBL_MIN; +} +# define minus_zero compute_minus_zero () +#else +double minus_zero = -0.0; +#endif +int main() +{ + int result = 0; + int i; + volatile double x; + double zero = 0.0; +#if HAVE_DECL_ALARM + /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite + number. Let the test fail in this case. */ + signal (SIGALRM, SIG_DFL); + alarm (5); +#endif + /* Test on denormalized numbers. */ + for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) + ; + if (x > 0.0) + { + int exp; + double y = frexp (x, &exp); + /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. + On NetBSD: y = 0.75. Correct: y = 0.5. */ + if (y != 0.5) + result |= 1; + } + /* Test on infinite numbers. */ + x = 1.0 / zero; + { + int exp; + double y = frexp (x, &exp); + if (y != x) + result |= 2; + } + /* Test on negative zero. */ + x = minus_zero; + { + int exp; + double y = frexp (x, &exp); + if (memcmp (&y, &x, sizeof x)) + result |= 4; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexp_works=yes +else + gl_cv_func_frexp_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 +$as_echo "$gl_cv_func_frexp_works" >&6; } + + case "$gl_cv_func_frexp_works" in + *yes) gl_func_frexp_no_libm=yes ;; + *) gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;; + esac + else + gl_func_frexp_no_libm=no + REPLACE_FREXP=1 + fi + if test $gl_func_frexp_no_libm = yes; then + +$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h + + fi + + if test $gl_func_frexp_no_libm != yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext" + + fi + + + + + + GNULIB_FREXP=1 + + + + + +$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h + + + + + + + ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h> +" +if test "x$ac_cv_have_decl_frexpl" = xyes; then : + +else + HAVE_DECL_FREXPL=0 +fi + + if test $HAVE_DECL_FREXPL = 1; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } +if ${gl_cv_func_frexpl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + long double x; +int +main () +{ +int e; return frexpl (x, &e) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_frexpl_no_libm=yes +else + gl_cv_func_frexpl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 +$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } + + if test $gl_cv_func_frexpl_no_libm = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 +$as_echo_n "checking whether frexpl works... " >&6; } +if ${gl_cv_func_frexpl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <math.h> +/* Override the values of <float.h>, like done in float.in.h. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +#if defined __i386__ && defined __FreeBSD__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +#endif +#if defined __sgi && (LDBL_MANT_DIG >= 106) +# if defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +# endif +#endif +extern +#ifdef __cplusplus +"C" +#endif +long double frexpl (long double, int *); +int main() +{ + int result = 0; + volatile long double x; + /* Test on finite numbers that fails on AIX 5.1. */ + x = 16.0L; + { + int exp = -9999; + frexpl (x, &exp); + if (exp != 5) + result |= 1; + } + /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl + function returns an invalid (incorrectly normalized) value: it returns + y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } + but the correct result is + 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ + x = 1.01L; + { + int exp = -9999; + long double y = frexpl (x, &exp); + if (!(exp == 1 && y == 0.505L)) + result |= 2; + } + /* Test on large finite numbers. This fails on BeOS at i = 16322, while + LDBL_MAX_EXP = 16384. + In the loop end test, we test x against Infinity, rather than comparing + i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ + { + int i; + for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) + { + int exp = -9999; + frexpl (x, &exp); + if (exp != i) + { + result |= 4; + break; + } + } + } + /* Test on denormalized numbers. */ + { + int i; + for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) + ; + if (x > 0.0L) + { + int exp; + long double y = frexpl (x, &exp); + /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, + exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ + if (exp != LDBL_MIN_EXP - 1) + result |= 8; + } + } + /* Test on infinite numbers. */ + x = 1.0L / 0.0L; + { + int exp; + long double y = frexpl (x, &exp); + if (y != x) + result |= 16; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexpl_works=yes +else + gl_cv_func_frexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 +$as_echo "$gl_cv_func_frexpl_works" >&6; } + + case "$gl_cv_func_frexpl_works" in + *yes) gl_func_frexpl_no_libm=yes ;; + *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; + esac + else + gl_func_frexpl_no_libm=no + REPLACE_FREXPL=1 + fi + if test $gl_func_frexpl_no_libm = yes; then + +$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h + + fi + fi + + if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext" + + fi + + + + + + GNULIB_FREXPL=1 + + + + + +$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h + + + + + + + if test $ac_cv_func___fseterr = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fseterr.$ac_objext" + + fi + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FSTAT=1 + fi + + + if test $WINDOWS_64_BIT_ST_SIZE = 1; then + REPLACE_FSTAT=1 + fi + + + + if test $REPLACE_FSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" + + : + fi + + + + + + GNULIB_FSTAT=1 + + + + + +$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_getdtablesize = yes; then + # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit + # up to an unchangeable hard limit; all other platforms correctly + # require setrlimit before getdtablesize() can report a larger value. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +$as_echo_n "checking whether getdtablesize works... " >&6; } +if ${gl_cv_func_getdtablesize_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> +int +main () +{ +int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getdtablesize_works=yes +else + gl_cv_func_getdtablesize_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +$as_echo "$gl_cv_func_getdtablesize_works" >&6; } + case "$gl_cv_func_getdtablesize_works" in + *yes) ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi + + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" + + : + fi + + + + + + GNULIB_GETDTABLESIZE=1 + + + + + +$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h + + + + + + + + + if test $REPLACE_GETOPT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + + + + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + +$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h + + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + + if test $REPLACE_GETOPT = 1; then + + GETOPT_H=getopt.h + +$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h + + + + fi + + if test $REPLACE_GETOPT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + + + + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + + + + + + + + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 +$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; } +if ${gl_cv_func_gettimeofday_clobber+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + # When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + #include <sys/time.h> + #include <time.h> + #include <stdlib.h> + +int +main () +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_gettimeofday_clobber=no +else + gl_cv_func_gettimeofday_clobber=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 +$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; } + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + +$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h + + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 +$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } +if ${gl_cv_func_gettimeofday_posix_signature+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + +int +main () +{ +/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_gettimeofday_posix_signature=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_gettimeofday_posix_signature=almost +else + gl_cv_func_gettimeofday_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + + fi + +cat >>confdefs.h <<_ACEOF +#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone +_ACEOF + + + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + + for ac_header in sys/timeb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIMEB_H 1 +_ACEOF + +fi + +done + + for ac_func in _ftime +do : + ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime" +if test "x$ac_cv_func__ftime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE__FTIME 1 +_ACEOF + +fi +done + + + fi + + + + + + GNULIB_GETTIMEOFDAY=1 + + + + + +$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h + + + + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + + + + + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + PRIPTR_PREFIX='"l"' + else + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdint.h> + extern intptr_t foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + PRIPTR_PREFIX='"'$glpfx'"' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -n "$PRIPTR_PREFIX" && break + done + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined INT32_MAX && defined INTMAX_MAX + #define CONDITION (INT32_MAX < INTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (int) < sizeof (long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes +else + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } + if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then + INT32_MAX_LT_INTMAX_MAX=1; + else + INT32_MAX_LT_INTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; } +if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined INT64_MAX + #define CONDITION (INT64_MAX == LONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (long long int) == sizeof (long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes +else + gl_cv_test_INT64_MAX_EQ_LONG_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } + if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then + INT64_MAX_EQ_LONG_MAX=1; + else + INT64_MAX_EQ_LONG_MAX=0; + fi + + + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined UINT32_MAX && defined UINTMAX_MAX + #define CONDITION (UINT32_MAX < UINTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes +else + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } + if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then + UINT32_MAX_LT_UINTMAX_MAX=1; + else + UINT32_MAX_LT_UINTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include <limits.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif + + #if defined UINT64_MAX + #define CONDITION (UINT64_MAX == ULONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +else + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } + if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then + UINT64_MAX_EQ_ULONG_MAX=1; + else + UINT64_MAX_EQ_ULONG_MAX=0; + fi + + + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi + + + + + + + + + + # If we replaced any of the underlying isnan* functions, replace + # the isnan macro; it undoubtedly suffers from the same flaws. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan macro works" >&5 +$as_echo_n "checking whether isnan macro works... " >&6; } + if test $gl_func_isnanf = yes \ + && test $gl_func_isnand = yes \ + && test $gl_func_isnanl = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ISNAN_LIBM= + case " $ISNAN_LIBM " in + *" $ISNANF_LIBM "*) ;; + *) ISNAN_LIBM="$ISNAN_LIBM $ISNANF_LIBM" ;; + esac + case " $ISNAN_LIBM " in + *" $ISNAND_LIBM "*) ;; + *) ISNAN_LIBM="$ISNAN_LIBM $ISNAND_LIBM" ;; + esac + case " $ISNAN_LIBM " in + *" $ISNANL_LIBM "*) ;; + *) ISNAN_LIBM="$ISNAN_LIBM $ISNANL_LIBM" ;; + esac + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + REPLACE_ISNAN=1 + ISNAN_LIBM= + fi + + + + + + + + GNULIB_ISNAN=1 + + + + + +$as_echo "#define GNULIB_TEST_ISNAN 1" >>confdefs.h + + + + + + ISNAND_LIBM= + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnand_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #else + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x; +int +main () +{ +return isnand (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnand_no_libm=yes +else + gl_cv_func_isnand_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5 +$as_echo "$gl_cv_func_isnand_no_libm" >&6; } + + if test $gl_cv_func_isnand_no_libm = no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used with libm" >&5 +$as_echo_n "checking whether isnan(double) can be used with libm... " >&6; } +if ${gl_cv_func_isnand_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #elif defined isnan + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x; +int +main () +{ +return isnand (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnand_in_libm=yes +else + gl_cv_func_isnand_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_in_libm" >&5 +$as_echo "$gl_cv_func_isnand_in_libm" >&6; } + + if test $gl_cv_func_isnand_in_libm = yes; then + ISNAND_LIBM=-lm + fi + fi + if test $gl_cv_func_isnand_no_libm = yes \ + || test $gl_cv_func_isnand_in_libm = yes; then + gl_func_isnand=yes + else + gl_func_isnand=no + HAVE_ISNAND=0 + fi + + + + + + if test $HAVE_ISNAND = 0 || test $REPLACE_ISNAN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext" + + + + + fi + + + + + + GNULIB_ISNAND=1 + + + + + +$as_echo "#define GNULIB_TEST_ISNAND 1" >>confdefs.h + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnand_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #else + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x; +int +main () +{ +return isnand (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnand_no_libm=yes +else + gl_cv_func_isnand_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5 +$as_echo "$gl_cv_func_isnand_no_libm" >&6; } + + gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm + if test $gl_cv_func_isnand_no_libm = yes; then + +$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h + + fi + + if test $gl_func_isnand_no_libm != yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext" + + + + + fi + + + ISNANF_LIBM= + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnanf_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x; +int +main () +{ +return isnanf (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanf_no_libm=yes +else + gl_cv_func_isnanf_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_no_libm" >&5 +$as_echo "$gl_cv_func_isnanf_no_libm" >&6; } + + if test $gl_cv_func_isnanf_no_libm = no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used with libm" >&5 +$as_echo_n "checking whether isnan(float) can be used with libm... " >&6; } +if ${gl_cv_func_isnanf_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x; +int +main () +{ +return isnanf (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanf_in_libm=yes +else + gl_cv_func_isnanf_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_in_libm" >&5 +$as_echo "$gl_cv_func_isnanf_in_libm" >&6; } + + if test $gl_cv_func_isnanf_in_libm = yes; then + ISNANF_LIBM=-lm + fi + fi + if test $gl_cv_func_isnanf_no_libm = yes \ + || test $gl_cv_func_isnanf_in_libm = yes; then + save_LIBS="$LIBS" + LIBS="$LIBS $ISNANF_LIBM" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5 +$as_echo_n "checking whether isnan(float) works... " >&6; } +if ${gl_cv_func_isnanf_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; + *) gl_cv_func_isnanf_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <math.h> +#if __GNUC__ >= 4 +# undef isnanf +# define isnanf(x) __builtin_isnanf ((float)(x)) +#elif defined isnan +# undef isnanf +# define isnanf(x) isnan ((float)(x)) +#endif +/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ +#ifdef __DECC +static float +NaN () +{ + static float zero = 0.0f; + return zero / zero; +} +#else +# define NaN() (0.0f / 0.0f) +#endif +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; float value; } memory_float; +int main() +{ + int result = 0; + + if (isnanf (1.0f / 0.0f)) + result |= 1; + + if (!isnanf (NaN ())) + result |= 2; + +#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT + /* The isnanf function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit. */ + if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0) + { + memory_float m; + + m.value = NaN (); + /* Set the bits below the exponent to 01111...111. */ + m.word[0] &= -1U << FLT_EXPBIT0_BIT; + m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1; + if (!isnanf (m.value)) + result |= 4; + } +#endif + + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanf_works=yes +else + gl_cv_func_isnanf_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_works" >&5 +$as_echo "$gl_cv_func_isnanf_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_isnanf_works" in + *yes) gl_func_isnanf=yes ;; + *) gl_func_isnanf=no; ISNANF_LIBM= ;; + esac + else + gl_func_isnanf=no + fi + if test $gl_func_isnanf != yes; then + HAVE_ISNANF=0 + fi + + + + + + if test $HAVE_ISNANF = 0 || test $REPLACE_ISNAN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnanf.$ac_objext" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if ${gl_cv_cc_float_expbit0+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_cc_float_expbit0="word 0 bit 23" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + fi + + + + + + GNULIB_ISNANF=1 + + + + + +$as_echo "#define GNULIB_TEST_ISNANF 1" >>confdefs.h + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnanf_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x; +int +main () +{ +return isnanf (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanf_no_libm=yes +else + gl_cv_func_isnanf_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_no_libm" >&5 +$as_echo "$gl_cv_func_isnanf_no_libm" >&6; } + + if test $gl_cv_func_isnanf_no_libm = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5 +$as_echo_n "checking whether isnan(float) works... " >&6; } +if ${gl_cv_func_isnanf_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; + *) gl_cv_func_isnanf_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <math.h> +#if __GNUC__ >= 4 +# undef isnanf +# define isnanf(x) __builtin_isnanf ((float)(x)) +#elif defined isnan +# undef isnanf +# define isnanf(x) isnan ((float)(x)) +#endif +/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ +#ifdef __DECC +static float +NaN () +{ + static float zero = 0.0f; + return zero / zero; +} +#else +# define NaN() (0.0f / 0.0f) +#endif +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; float value; } memory_float; +int main() +{ + int result = 0; + + if (isnanf (1.0f / 0.0f)) + result |= 1; + + if (!isnanf (NaN ())) + result |= 2; + +#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT + /* The isnanf function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit. */ + if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0) + { + memory_float m; + + m.value = NaN (); + /* Set the bits below the exponent to 01111...111. */ + m.word[0] &= -1U << FLT_EXPBIT0_BIT; + m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1; + if (!isnanf (m.value)) + result |= 4; + } +#endif + + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanf_works=yes +else + gl_cv_func_isnanf_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_works" >&5 +$as_echo "$gl_cv_func_isnanf_works" >&6; } + + fi + if test $gl_cv_func_isnanf_no_libm = yes \ + && { case "$gl_cv_func_isnanf_works" in + *yes) true;; + *) false;; + esac + }; then + gl_func_isnanf_no_libm=yes + +$as_echo "#define HAVE_ISNANF_IN_LIBC 1" >>confdefs.h + + else + gl_func_isnanf_no_libm=no + fi + + if test $gl_func_isnanf_no_libm != yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnanf.$ac_objext" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if ${gl_cv_cc_float_expbit0+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_cc_float_expbit0="word 0 bit 23" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + fi + + + ISNANL_LIBM= + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnanl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x; +int +main () +{ +return isnanl (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanl_no_libm=yes +else + gl_cv_func_isnanl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5 +$as_echo "$gl_cv_func_isnanl_no_libm" >&6; } + + if test $gl_cv_func_isnanl_no_libm = no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used with libm" >&5 +$as_echo_n "checking whether isnan(long double) can be used with libm... " >&6; } +if ${gl_cv_func_isnanl_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x; +int +main () +{ +return isnanl (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanl_in_libm=yes +else + gl_cv_func_isnanl_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_in_libm" >&5 +$as_echo "$gl_cv_func_isnanl_in_libm" >&6; } + + if test $gl_cv_func_isnanl_in_libm = yes; then + ISNANL_LIBM=-lm + fi + fi + if test $gl_cv_func_isnanl_no_libm = yes \ + || test $gl_cv_func_isnanl_in_libm = yes; then + save_LIBS="$LIBS" + LIBS="$LIBS $ISNANL_LIBM" + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5 +$as_echo_n "checking whether isnanl works... " >&6; } +if ${gl_cv_func_isnanl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; + *) + case "$host_os" in + netbsd*) gl_cv_func_isnanl_works="guessing no";; + *) gl_cv_func_isnanl_works="guessing yes";; + esac + ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <limits.h> +#include <math.h> +#if __GNUC__ >= 4 +# undef isnanl +# define isnanl(x) __builtin_isnanl ((long double)(x)) +#elif defined isnan +# undef isnanl +# define isnanl(x) isnan ((long double)(x)) +#endif +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif +int main () +{ + int result = 0; + + if (!isnanl (NaNl ())) + result |= 1; + + { + memory_long_double m; + unsigned int i; + + /* The isnanl function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (!isnanl (m.value)) + result |= 1; + } + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 2; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 2; + } + /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, + Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in + Intel IA-64 Architecture Software Developer's Manual, Volume 1: + Application Architecture. + Table 5-2 "Floating-Point Register Encodings" + Figure 5-6 "Memory to Floating-Point Register Data Translation" + */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (!isnanl (x.value)) + result |= 4; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + result |= 8; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + result |= 16; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 32; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 64; + } +#endif + + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanl_works=yes +else + gl_cv_func_isnanl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 +$as_echo "$gl_cv_func_isnanl_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_isnanl_works" in + *yes) gl_func_isnanl=yes ;; + *) gl_func_isnanl=no; ISNANL_LIBM= ;; + esac + else + gl_func_isnanl=no + fi + if test $gl_func_isnanl != yes; then + HAVE_ISNANL=0 + fi + + + + + + if test $HAVE_ISNANL = 0 || test $REPLACE_ISNAN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext" + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 +$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } +if ${gl_cv_cc_long_double_expbit0+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_long_double_expbit0="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_long_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (long double x) +{ + memory_long_double m; + size_t i; + /* Clear it first, in case + sizeof (long double) < sizeof (memory_long_double). */ + memset (&m, 0, sizeof (memory_long_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25L); + add_to_ored_words (0.5L); + add_to_ored_words (1.0L); + add_to_ored_words (2.0L); + add_to_ored_words (4.0L); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_long_double_expbit0=`cat conftest.out` +else + gl_cv_cc_long_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 +$as_echo "$gl_cv_cc_long_double_expbit0" >&6; } + case "$gl_cv_cc_long_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + + fi + + + + + + GNULIB_ISNANL=1 + + + + + +$as_echo "#define GNULIB_TEST_ISNANL 1" >>confdefs.h + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } +if ${gl_cv_func_isnanl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x; +int +main () +{ +return isnanl (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanl_no_libm=yes +else + gl_cv_func_isnanl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5 +$as_echo "$gl_cv_func_isnanl_no_libm" >&6; } + + gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm + if test $gl_func_isnanl_no_libm = yes; then + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5 +$as_echo_n "checking whether isnanl works... " >&6; } +if ${gl_cv_func_isnanl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; + *) + case "$host_os" in + netbsd*) gl_cv_func_isnanl_works="guessing no";; + *) gl_cv_func_isnanl_works="guessing yes";; + esac + ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <limits.h> +#include <math.h> +#if __GNUC__ >= 4 +# undef isnanl +# define isnanl(x) __builtin_isnanl ((long double)(x)) +#elif defined isnan +# undef isnanl +# define isnanl(x) isnan ((long double)(x)) +#endif +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif +int main () +{ + int result = 0; + + if (!isnanl (NaNl ())) + result |= 1; + + { + memory_long_double m; + unsigned int i; + + /* The isnanl function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (!isnanl (m.value)) + result |= 1; + } + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 2; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 2; + } + /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, + Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in + Intel IA-64 Architecture Software Developer's Manual, Volume 1: + Application Architecture. + Table 5-2 "Floating-Point Register Encodings" + Figure 5-6 "Memory to Floating-Point Register Data Translation" + */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (!isnanl (x.value)) + result |= 4; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + result |= 8; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + result |= 16; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 32; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + result |= 64; + } +#endif + + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanl_works=yes +else + gl_cv_func_isnanl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 +$as_echo "$gl_cv_func_isnanl_works" >&6; } + + case "$gl_cv_func_isnanl_works" in + *yes) ;; + *) gl_func_isnanl_no_libm=no ;; + esac + fi + if test $gl_func_isnanl_no_libm = yes; then + +$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h + + fi + + if test $gl_func_isnanl_no_libm != yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext" + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 +$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } +if ${gl_cv_cc_long_double_expbit0+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_long_double_expbit0="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_long_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (long double x) +{ + memory_long_double m; + size_t i; + /* Clear it first, in case + sizeof (long double) < sizeof (memory_long_double). */ + memset (&m, 0, sizeof (memory_long_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25L); + add_to_ored_words (0.5L); + add_to_ored_words (1.0L); + add_to_ored_words (2.0L); + add_to_ored_words (4.0L); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_long_double_expbit0=`cat conftest.out` +else + gl_cv_cc_long_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 +$as_echo "$gl_cv_cc_long_double_expbit0" >&6; } + case "$gl_cv_cc_long_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + + fi + # You need to invoke gt_JAVACOMP yourself, possibly with arguments. + ac_config_files="$ac_config_files javacomp.sh:build-aux/javacomp.sh.in" + + # You need to invoke gt_JAVAEXEC yourself, possibly with arguments. + ac_config_files="$ac_config_files javaexec.sh:build-aux/javaexec.sh.in" + + + + + LDEXP_LIBM= + if test $gl_cv_func_ldexp_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used with libm" >&5 +$as_echo_n "checking whether ldexp() can be used with libm... " >&6; } +if ${gl_cv_func_ldexp_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include <math.h> + double (*funcptr) (double, int) = ldexp; + double x; +int +main () +{ +return ldexp (x, -1) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ldexp_in_libm=yes +else + gl_cv_func_ldexp_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_in_libm" >&5 +$as_echo "$gl_cv_func_ldexp_in_libm" >&6; } + if test $gl_cv_func_ldexp_in_libm = yes; then + LDEXP_LIBM=-lm + fi + fi + + + + + + + + + ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include <math.h> +" +if test "x$ac_cv_have_decl_ldexpl" = xyes; then : + +else + HAVE_DECL_LDEXPL=0 +fi + + + LDEXPL_LIBM= + if test $HAVE_DECL_LDEXPL = 1; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexpl() can be used without linking with libm... " >&6; } +if ${gl_cv_func_ldexpl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + long double x; +int +main () +{ +return ldexpl (x, -1) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ldexpl_no_libm=yes +else + gl_cv_func_ldexpl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5 +$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; } + + if test $gl_cv_func_ldexpl_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used with libm" >&5 +$as_echo_n "checking whether ldexpl() can be used with libm... " >&6; } +if ${gl_cv_func_ldexpl_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + long double x; +int +main () +{ +return ldexpl (x, -1) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ldexpl_in_libm=yes +else + gl_cv_func_ldexpl_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_in_libm" >&5 +$as_echo "$gl_cv_func_ldexpl_in_libm" >&6; } + if test $gl_cv_func_ldexpl_in_libm = yes; then + LDEXPL_LIBM=-lm + fi + fi + if test $gl_cv_func_ldexpl_no_libm = yes \ + || test $gl_cv_func_ldexpl_in_libm = yes; then + save_LIBS="$LIBS" + LIBS="$LIBS $LDEXPL_LIBM" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5 +$as_echo_n "checking whether ldexpl works... " >&6; } +if ${gl_cv_func_ldexpl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; + *) gl_cv_func_ldexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <math.h> +extern +#ifdef __cplusplus +"C" +#endif +long double ldexpl (long double, int); +int main() +{ + int result = 0; + { + volatile long double x = 1.0; + volatile long double y = ldexpl (x, -1); + if (y != 0.5L) + result |= 1; + } + { + volatile long double x = 1.73205L; + volatile long double y = ldexpl (x, 0); + if (y != x) + result |= 2; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_ldexpl_works=yes +else + gl_cv_func_ldexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5 +$as_echo "$gl_cv_func_ldexpl_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_ldexpl_works" in + *yes) gl_func_ldexpl=yes ;; + *) gl_func_ldexpl=no; REPLACE_LDEXPL=1 ;; + esac + else + gl_func_ldexpl=no + fi + if test $gl_func_ldexpl = yes; then + +$as_echo "#define HAVE_LDEXPL 1" >>confdefs.h + + fi + fi + if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + + LDEXPL_LIBM="$LDEXP_LIBM" + else + LDEXPL_LIBM="$ISNANL_LIBM" + fi + fi + + + if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS ldexpl.$ac_objext" + + fi + + + + + + GNULIB_LDEXPL=1 + + + + + +$as_echo "#define GNULIB_TEST_LDEXPL 1" >>confdefs.h + + + + + + + + + + + + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + + + + if test "$gl_threads_api" = posix; then + # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the + # pthread_rwlock_* functions. + ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h> +" +if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then : + +$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h + +fi + + # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <pthread.h> +int +main () +{ + +#if __FreeBSD__ == 4 +error "No, in FreeBSD 4.0 recursive mutexes actually don't work." +#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) +error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." +#else +int x = (int)PTHREAD_MUTEX_RECURSIVE; +return !x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + : + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_LOCK 1 +_ACEOF + + + + + + if test $ac_cv_func_lstat = yes; then + + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi + + if test $REPLACE_LSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + + : + fi + + + + + + GNULIB_LSTAT=1 + + + + + +$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h + + + + + + + + + for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ + | hpux* | solaris* | cygwin* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H + # include <stdlib.h> + #else + char *malloc (); + #endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } + if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_MALLOC_GNU 1" >>confdefs.h + +else + $as_echo "#define HAVE_MALLOC_GNU 0" >>confdefs.h + + REPLACE_MALLOC=1 + +fi + + + if test $REPLACE_MALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + fi + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_MALLOC_GNU 1 +_ACEOF + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h + + else + REPLACE_MALLOC=1 + fi + + if test $REPLACE_MALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + fi + + + + + + GNULIB_MALLOC_POSIX=1 + + + + + +$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_math_h='<'math.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5 +$as_echo_n "checking absolute name of <math.h>... " >&6; } +if ${gl_cv_next_math_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_math_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'math.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_math_h + gl_cv_next_math_h='"'$gl_header'"' + else + gl_cv_next_math_h='<'math.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5 +$as_echo "$gl_cv_next_math_h" >&6; } + fi + NEXT_MATH_H=$gl_cv_next_math_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'math.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_math_h + fi + NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5 +$as_echo_n "checking whether NAN macro works... " >&6; } +if ${gl_cv_header_math_nan_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> +int +main () +{ +/* Solaris 10 has a broken definition of NAN. Other platforms + fail to provide NAN, or provide it only in C99 mode; this + test only needs to fail when NAN is provided but wrong. */ + float f = 1.0f; +#ifdef NAN + f = NAN; +#endif + return f == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_math_nan_works=yes +else + gl_cv_header_math_nan_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5 +$as_echo "$gl_cv_header_math_nan_works" >&6; } + if test $gl_cv_header_math_nan_works = no; then + REPLACE_NAN=1 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5 +$as_echo_n "checking whether HUGE_VAL works... " >&6; } +if ${gl_cv_header_math_huge_val_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> +int +main () +{ +/* Solaris 10 has a broken definition of HUGE_VAL. */ + double d = HUGE_VAL; + return d == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_math_huge_val_works=yes +else + gl_cv_header_math_huge_val_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5 +$as_echo "$gl_cv_header_math_huge_val_works" >&6; } + if test $gl_cv_header_math_huge_val_works = no; then + REPLACE_HUGE_VAL=1 + fi + + + for gl_func in acosf acosl asinf asinl atanf atanl cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf expf expl exp2 exp2f exp2l expm1 expm1f expm1l fabsf fabsl floorf floorl fma fmaf fmal fmod fmodf fmodl frexpf frexpl hypotf hypotl ilogb ilogbf ilogbl ldexpf ldexpl log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l logb logbf logbl modf modff modfl powf remainder remainderf remainderl rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl tanf tanl tanhf trunc truncf truncl; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_mbrtowc" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MBRTOWC $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_mbrtowc = yes; then + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if ${gl_cv_func_mbrtowc_null_arg1+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_null_arg1=yes +else + gl_cv_func_mbrtowc_null_arg1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } +if ${gl_cv_func_mbrtowc_null_arg2+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_null_arg2=yes +else + gl_cv_func_mbrtowc_null_arg2=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } +if ${gl_cv_func_mbrtowc_retval+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_retval=yes +else + if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if ${gl_cv_func_mbrtowc_nul_retval+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_nul_retval=yes +else + gl_cv_func_mbrtowc_nul_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +$as_echo_n "checking whether mbrtowc works on empty input... " >&6; } +if ${gl_cv_func_mbrtowc_empty_input+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu*) + gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <wchar.h> + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) == (size_t) -2; + } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_empty_input=no +else + gl_cv_func_mbrtowc_empty_input=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi + + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBRTOWC=1 + + + + + +$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h + + + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + + + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_mbsinit" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MBSINIT $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_mbsinit = yes; then + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi + + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSINIT=1 + + + + + +$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbswidth is declared in <wchar.h>" >&5 +$as_echo_n "checking whether mbswidth is declared in <wchar.h>... " >&6; } +if ${ac_cv_have_decl_mbswidth+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +int +main () +{ + + char *p = (char *) mbswidth; + return !p; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_decl_mbswidth=yes +else + ac_cv_have_decl_mbswidth=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_mbswidth" >&5 +$as_echo "$ac_cv_have_decl_mbswidth" >&6; } + if test $ac_cv_have_decl_mbswidth = yes; then + ac_val=1 + else + ac_val=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MBSWIDTH_IN_WCHAR_H $ac_val +_ACEOF + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +$as_echo_n "checking for mbstate_t... " >&6; } +if ${ac_cv_type_mbstate_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +int +main () +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_mbstate_t=yes +else + ac_cv_type_mbstate_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +$as_echo "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +$as_echo "#define mbstate_t int" >>confdefs.h + + fi + + + + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + for ac_header in bp-sym.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BP_SYM_H 1 +_ACEOF + +fi + +done + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" + + fi + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" + + fi + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for obstacks that work with any size object" >&5 +$as_echo_n "checking for obstacks that work with any size object... " >&6; } +if ${ac_cv_func_obstack+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "obstack.h" + void *obstack_chunk_alloc (size_t n) { return 0; } + void obstack_chunk_free (void *p) { } + /* Check that an internal function returns size_t, not int. */ + size_t _obstack_memory_used (struct obstack *); + +int +main () +{ +struct obstack mem; + obstack_init (&mem); + obstack_free (&mem, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_obstack=yes +else + ac_cv_func_obstack=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_obstack" >&5 +$as_echo "$ac_cv_func_obstack" >&6; } + if test "$ac_cv_func_obstack" = yes; then + +$as_echo "#define HAVE_OBSTACK 1" >>confdefs.h + + else + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS obstack.$ac_objext" + + fi + + + + + + + if test $ac_cv_func_obstack_printf = no ; then + + + if test $ac_cv_func_obstack_printf = yes; then + REPLACE_OBSTACK_PRINTF=1 + fi + + fi + + + + if test $ac_cv_have_decl_obstack_printf = no; then + HAVE_DECL_OBSTACK_PRINTF=0 + fi + + + if test $ac_cv_func_obstack_printf = no || test $REPLACE_OBSTACK_PRINTF = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS obstack_printf.$ac_objext" + + fi + + + + + + GNULIB_OBSTACK_PRINTF=1 + + + + + +$as_echo "#define GNULIB_TEST_OBSTACK_PRINTF 1" >>confdefs.h + + + + + + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +$as_echo_n "checking whether open recognizes a trailing slash... " >&6; } +if ${gl_cv_func_open_slash+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes; then : + + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <fcntl.h> +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_open_slash=yes +else + gl_cv_func_open_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.sl conftest.tmp conftest.lnk + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +$as_echo "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_OPEN=1 + ;; + esac + ;; + esac + + + + if test $REPLACE_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + + + + + + GNULIB_OPEN=1 + + + + + +$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h + + + + + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + REPLACE_PERROR=1 + fi + case ${gl_cv_func_strerror_r_works-unset} in + unset|*yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5 +$as_echo_n "checking whether perror matches strerror... " >&6; } +if ${gl_cv_func_perror_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_perror_works="guessing no" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + +int +main () +{ +char *str = strerror (-1); + if (!getenv("CONFTEST_OUTPUT")) return 0; + if (!str) str = ""; + puts (str); + errno = -1; + perror (""); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \ + && cmp conftest.txt1 conftest.txt2 >/dev/null; then + gl_cv_func_perror_works=yes + else + gl_cv_func_perror_works=no + fi + rm -rf conftest.txt1 conftest.txt2 +else + gl_cv_func_perror_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5 +$as_echo "$gl_cv_func_perror_works" >&6; } + if test "$gl_cv_func_perror_works" != yes; then + REPLACE_PERROR=1 + fi + ;; + *) + REPLACE_PERROR=1 + ;; + esac + + if test $REPLACE_PERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS perror.$ac_objext" + + fi + + + + + + GNULIB_PERROR=1 + + + + + +$as_echo "#define GNULIB_TEST_PERROR 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_func_pipe2 != yes; then + HAVE_PIPE2=0 + fi + + + + + + + GNULIB_PIPE2=1 + + + + + +$as_echo "#define GNULIB_TEST_PIPE2 1" >>confdefs.h + + + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_PIPE2_SAFER 1 +_ACEOF + + + + + + + + + if test $REPLACE_POSIX_SPAWN = 1; then + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_addclose works" >&5 +$as_echo_n "checking whether posix_spawn_file_actions_addclose works... " >&6; } +if ${gl_cv_func_posix_spawn_file_actions_addclose_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + # Guess no on Solaris, yes otherwise. + case "$host_os" in + solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no";; + *) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <spawn.h> +int main () +{ + posix_spawn_file_actions_t actions; + if (posix_spawn_file_actions_init (&actions) != 0) + return 1; + if (posix_spawn_file_actions_addclose (&actions, 10000000) == 0) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_posix_spawn_file_actions_addclose_works=yes +else + gl_cv_func_posix_spawn_file_actions_addclose_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_addclose_works" >&5 +$as_echo "$gl_cv_func_posix_spawn_file_actions_addclose_works" >&6; } + case "$gl_cv_func_posix_spawn_file_actions_addclose_works" in + *yes) ;; + *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 ;; + esac + fi + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawn_faction_addclose.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE 1" >>confdefs.h + + + + + + + + + + if test $REPLACE_POSIX_SPAWN = 1; then + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_adddup2 works" >&5 +$as_echo_n "checking whether posix_spawn_file_actions_adddup2 works... " >&6; } +if ${gl_cv_func_posix_spawn_file_actions_adddup2_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + # Guess no on Solaris, yes otherwise. + case "$host_os" in + solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";; + *) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <spawn.h> +int main () +{ + posix_spawn_file_actions_t actions; + if (posix_spawn_file_actions_init (&actions) != 0) + return 1; + if (posix_spawn_file_actions_adddup2 (&actions, 10000000, 2) == 0) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_posix_spawn_file_actions_adddup2_works=yes +else + gl_cv_func_posix_spawn_file_actions_adddup2_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_adddup2_works" >&5 +$as_echo "$gl_cv_func_posix_spawn_file_actions_adddup2_works" >&6; } + case "$gl_cv_func_posix_spawn_file_actions_adddup2_works" in + *yes) ;; + *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 ;; + esac + fi + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawn_faction_adddup2.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h + + + + + + + + + + if test $REPLACE_POSIX_SPAWN = 1; then + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_addopen works" >&5 +$as_echo_n "checking whether posix_spawn_file_actions_addopen works... " >&6; } +if ${gl_cv_func_posix_spawn_file_actions_addopen_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + # Guess no on Solaris, yes otherwise. + case "$host_os" in + solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";; + *) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <spawn.h> +#include <fcntl.h> +int main () +{ + posix_spawn_file_actions_t actions; + if (posix_spawn_file_actions_init (&actions) != 0) + return 1; + if (posix_spawn_file_actions_addopen (&actions, 10000000, "foo", 0, O_RDONLY) + == 0) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_posix_spawn_file_actions_addopen_works=yes +else + gl_cv_func_posix_spawn_file_actions_addopen_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_addopen_works" >&5 +$as_echo "$gl_cv_func_posix_spawn_file_actions_addopen_works" >&6; } + case "$gl_cv_func_posix_spawn_file_actions_addopen_works" in + *yes) ;; + *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 ;; + esac + fi + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawn_faction_addopen.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN 1" >>confdefs.h + + + + + + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawn_faction_destroy.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_DESTROY 1" >>confdefs.h + + + + + + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawn_faction_init.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_INIT 1" >>confdefs.h + + + + + + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawnattr_destroy.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWNATTR_DESTROY=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWNATTR_DESTROY 1" >>confdefs.h + + + + + + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawnattr_init.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWNATTR_INIT=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWNATTR_INIT 1" >>confdefs.h + + + + + + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawnattr_setflags.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWNATTR_SETFLAGS=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h + + + + + + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawnattr_setsigmask.$ac_objext" + + fi + + + + + + GNULIB_POSIX_SPAWNATTR_SETSIGMASK=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWNATTR_SETSIGMASK 1" >>confdefs.h + + + + + + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawnp.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS spawni.$ac_objext" + + + for ac_header in paths.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "paths.h" "ac_cv_header_paths_h" "$ac_includes_default" +if test "x$ac_cv_header_paths_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PATHS_H 1 +_ACEOF + +fi + +done + + for ac_func in confstr sched_setparam sched_setscheduler setegid seteuid vfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + fi + + + + + + GNULIB_POSIX_SPAWNP=1 + + + + + +$as_echo "#define GNULIB_TEST_POSIX_SPAWNP 1" >>confdefs.h + + + + + + if test $gl_cv_func_frexp_no_libm = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 +$as_echo_n "checking whether frexp works... " >&6; } +if ${gl_cv_func_frexp_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; + *) gl_cv_func_frexp_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <math.h> +#include <string.h> +#if HAVE_DECL_ALARM +# include <signal.h> +# include <unistd.h> +#endif +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + ICC 10.0 has a bug when optimizing the expression -zero. + The expression -DBL_MIN * DBL_MIN does not work when cross-compiling + to PowerPC on Mac OS X 10.5. */ +#if defined __hpux || defined __sgi || defined __ICC +static double +compute_minus_zero (void) +{ + return -DBL_MIN * DBL_MIN; +} +# define minus_zero compute_minus_zero () +#else +double minus_zero = -0.0; +#endif +int main() +{ + int result = 0; + int i; + volatile double x; + double zero = 0.0; +#if HAVE_DECL_ALARM + /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite + number. Let the test fail in this case. */ + signal (SIGALRM, SIG_DFL); + alarm (5); +#endif + /* Test on denormalized numbers. */ + for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) + ; + if (x > 0.0) + { + int exp; + double y = frexp (x, &exp); + /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. + On NetBSD: y = 0.75. Correct: y = 0.5. */ + if (y != 0.5) + result |= 1; + } + /* Test on infinite numbers. */ + x = 1.0 / zero; + { + int exp; + double y = frexp (x, &exp); + if (y != x) + result |= 2; + } + /* Test on negative zero. */ + x = minus_zero; + { + int exp; + double y = frexp (x, &exp); + if (memcmp (&y, &x, sizeof x)) + result |= 4; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexp_works=yes +else + gl_cv_func_frexp_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 +$as_echo "$gl_cv_func_frexp_works" >&6; } + + case "$gl_cv_func_frexp_works" in + *yes) + +$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h + + ;; + esac + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexp can be used without linking with libm... " >&6; } +if ${gl_cv_func_ldexp_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + double x; + int y; +int +main () +{ +return ldexp (x, y) < 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ldexp_no_libm=yes +else + gl_cv_func_ldexp_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5 +$as_echo "$gl_cv_func_ldexp_no_libm" >&6; } + if test $gl_cv_func_ldexp_no_libm = yes; then + +$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h + + fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } +if ${gl_cv_func_frexpl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + long double x; +int +main () +{ +int e; return frexpl (x, &e) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_frexpl_no_libm=yes +else + gl_cv_func_frexpl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 +$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } + + if test $gl_cv_func_frexpl_no_libm = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 +$as_echo_n "checking whether frexpl works... " >&6; } +if ${gl_cv_func_frexpl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <math.h> +/* Override the values of <float.h>, like done in float.in.h. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +#if defined __i386__ && defined __FreeBSD__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +#endif +#if defined __sgi && (LDBL_MANT_DIG >= 106) +# if defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +# endif +#endif +extern +#ifdef __cplusplus +"C" +#endif +long double frexpl (long double, int *); +int main() +{ + int result = 0; + volatile long double x; + /* Test on finite numbers that fails on AIX 5.1. */ + x = 16.0L; + { + int exp = -9999; + frexpl (x, &exp); + if (exp != 5) + result |= 1; + } + /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl + function returns an invalid (incorrectly normalized) value: it returns + y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } + but the correct result is + 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ + x = 1.01L; + { + int exp = -9999; + long double y = frexpl (x, &exp); + if (!(exp == 1 && y == 0.505L)) + result |= 2; + } + /* Test on large finite numbers. This fails on BeOS at i = 16322, while + LDBL_MAX_EXP = 16384. + In the loop end test, we test x against Infinity, rather than comparing + i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ + { + int i; + for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) + { + int exp = -9999; + frexpl (x, &exp); + if (exp != i) + { + result |= 4; + break; + } + } + } + /* Test on denormalized numbers. */ + { + int i; + for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) + ; + if (x > 0.0L) + { + int exp; + long double y = frexpl (x, &exp); + /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, + exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ + if (exp != LDBL_MIN_EXP - 1) + result |= 8; + } + } + /* Test on infinite numbers. */ + x = 1.0L / 0.0L; + { + int exp; + long double y = frexpl (x, &exp); + if (y != x) + result |= 16; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexpl_works=yes +else + gl_cv_func_frexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 +$as_echo "$gl_cv_func_frexpl_works" >&6; } + + case "$gl_cv_func_frexpl_works" in + *yes) gl_func_frexpl_no_libm=yes ;; + *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; + esac + else + gl_func_frexpl_no_libm=no + REPLACE_FREXPL=1 + fi + if test $gl_func_frexpl_no_libm = yes; then + +$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h + + ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h> +" +if test "x$ac_cv_have_decl_frexpl" = xyes; then : + +else + HAVE_DECL_FREXPL=0 +fi + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexpl() can be used without linking with libm... " >&6; } +if ${gl_cv_func_ldexpl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + long double x; +int +main () +{ +return ldexpl (x, -1) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ldexpl_no_libm=yes +else + gl_cv_func_ldexpl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5 +$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; } + + if test $gl_cv_func_ldexpl_no_libm = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5 +$as_echo_n "checking whether ldexpl works... " >&6; } +if ${gl_cv_func_ldexpl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; + *) gl_cv_func_ldexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <math.h> +extern +#ifdef __cplusplus +"C" +#endif +long double ldexpl (long double, int); +int main() +{ + int result = 0; + { + volatile long double x = 1.0; + volatile long double y = ldexpl (x, -1); + if (y != 0.5L) + result |= 1; + } + { + volatile long double x = 1.73205L; + volatile long double y = ldexpl (x, 0); + if (y != x) + result |= 2; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_ldexpl_works=yes +else + gl_cv_func_ldexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5 +$as_echo "$gl_cv_func_ldexpl_works" >&6; } + + case "$gl_cv_func_ldexpl_works" in + *yes) + +$as_echo "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h + + ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include <math.h> +" +if test "x$ac_cv_have_decl_ldexpl" = xyes; then : + +else + HAVE_DECL_LDEXPL=0 +fi + + ;; + esac + fi + + + + if test $gl_cv_func_vfprintf_posix = no; then + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf.$ac_objext" + + REPLACE_PRINTF=1 + +$as_echo "#define REPLACE_PRINTF_POSIX 1" >>confdefs.h + + : + + fi + + + + + + + GNULIB_PRINTF_POSIX=1 + + + + + +$as_echo "#define GNULIB_TEST_PRINTF_POSIX 1" >>confdefs.h + + + + + ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h> +" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl +_ACEOF + + ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> +" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl +_ACEOF + + + : + + + : + + + + + + for ac_func in raise +do : + ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" +if test "x$ac_cv_func_raise" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RAISE 1 +_ACEOF + +fi +done + + if test $ac_cv_func_raise = no; then + HAVE_RAISE=0 + else + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes; then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + : + fi + + fi + + if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext" + + : + fi + + + + + + GNULIB_RAISE=1 + + + + + +$as_echo "#define GNULIB_TEST_RAISE 1" >>confdefs.h + + + + + + + + for ac_func in rawmemchr +do : + ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" +if test "x$ac_cv_func_rawmemchr" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RAWMEMCHR 1 +_ACEOF + +fi +done + + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi + + if test $HAVE_RAWMEMCHR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" + + : + fi + + + + + + GNULIB_RAWMEMCHR=1 + + + + + +$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h + + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h + + else + REPLACE_REALLOC=1 + fi + + if test $REPLACE_REALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" + + fi + + + + + + GNULIB_REALLOC_POSIX=1 + + + + + +$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <sched.h> + struct sched_param a; + int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER }; + pid_t t1; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + SCHED_H='' +else + SCHED_H='sched.h' + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sched_h='<'sched.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sched.h>" >&5 +$as_echo_n "checking absolute name of <sched.h>... " >&6; } +if ${gl_cv_next_sched_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sched_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sched.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sched.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sched_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sched_h + gl_cv_next_sched_h='"'$gl_header'"' + else + gl_cv_next_sched_h='<'sched.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sched_h" >&5 +$as_echo "$gl_cv_next_sched_h" >&6; } + fi + NEXT_SCHED_H=$gl_cv_next_sched_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sched.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sched_h + fi + NEXT_AS_FIRST_DIRECTIVE_SCHED_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_sched_h = yes; then + HAVE_SCHED_H=1 + else + HAVE_SCHED_H=0 + fi + + + if test "$HAVE_SCHED_H" = 1; then + ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include <sched.h> +" +if test "x$ac_cv_type_struct_sched_param" = xyes; then : + HAVE_STRUCT_SCHED_PARAM=1 +else + HAVE_STRUCT_SCHED_PARAM=0 +fi + + else + ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include <spawn.h> +" +if test "x$ac_cv_type_struct_sched_param" = xyes; then : + HAVE_STRUCT_SCHED_PARAM=1 +else + HAVE_STRUCT_SCHED_PARAM=0 +fi + + fi + + + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test -n "$SCHED_H"; then + GL_GENERATE_SCHED_H_TRUE= + GL_GENERATE_SCHED_H_FALSE='#' +else + GL_GENERATE_SCHED_H_TRUE='#' + GL_GENERATE_SCHED_H_FALSE= +fi + + + + + + if test $ac_cv_func_sigaction = yes; then + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h> +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 +_ACEOF + + +fi + + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + fi + + if test $HAVE_SIGACTION = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext" + + + + + + + + ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_siginfo_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T 1 +_ACEOF + + +fi + + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi + + fi + + + + + + GNULIB_SIGACTION=1 + + + + + +$as_echo "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_signal_h='<'signal.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5 +$as_echo_n "checking absolute name of <signal.h>... " >&6; } +if ${gl_cv_next_signal_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <signal.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'signal.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_signal_h + gl_cv_next_signal_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 +$as_echo "$gl_cv_next_signal_h" >&6; } + fi + NEXT_SIGNAL_H=$gl_cv_next_signal_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'signal.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_signal_h + fi + NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive + + + + + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then : + +else + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 +fi + + + + + + + + ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_sighandler_t" = xyes; then : + +else + HAVE_SIGHANDLER_T=0 +fi + + + + for gl_func in pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <signal.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5 +$as_echo_n "checking for signbit macro... " >&6; } +if ${gl_cv_func_signbit+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_signbit="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_signbit="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <math.h> +/* If signbit is defined as a function, don't use it, since calling it for + 'float' or 'long double' arguments would involve conversions. + If signbit is not declared at all but exists as a library function, don't + use it, since the prototype may not match. + If signbit is not declared at all but exists as a compiler built-in, don't + use it, since it's preferable to use __builtin_signbit* (no warnings, + no conversions). */ +#ifndef signbit +# error "signbit should be a macro" +#endif +#include <string.h> + +/* Global variables. + Needed because GCC 4 constant-folds __builtin_signbitl (literal) + but cannot constant-fold __builtin_signbitl (variable). */ +float vf; +double vd; +long double vl; +int main () +{ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -p0f and -p0d instead. */ +float p0f = 0.0f; +float m0f = -p0f; +double p0d = 0.0; +double m0d = -p0d; +/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. + So we use another constant expression instead. + But that expression does not work on other platforms, such as when + cross-compiling to PowerPC on Mac OS X 10.5. */ +long double p0l = 0.0L; +#if defined __hpux || defined __sgi +long double m0l = -LDBL_MIN * LDBL_MIN; +#else +long double m0l = -p0l; +#endif + int result = 0; + if (signbit (vf)) /* link check */ + vf++; + { + float plus_inf = 1.0f / p0f; + float minus_inf = -1.0f / p0f; + if (!(!signbit (255.0f) + && signbit (-255.0f) + && !signbit (p0f) + && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) + && !signbit (plus_inf) + && signbit (minus_inf))) + result |= 1; + } + if (signbit (vd)) /* link check */ + vd++; + { + double plus_inf = 1.0 / p0d; + double minus_inf = -1.0 / p0d; + if (!(!signbit (255.0) + && signbit (-255.0) + && !signbit (p0d) + && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) + && !signbit (plus_inf) + && signbit (minus_inf))) + result |= 2; + } + if (signbit (vl)) /* link check */ + vl++; + { + long double plus_inf = 1.0L / p0l; + long double minus_inf = -1.0L / p0l; + if (signbit (255.0L)) + result |= 4; + if (!signbit (-255.0L)) + result |= 4; + if (signbit (p0l)) + result |= 8; + if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l))) + result |= 16; + if (signbit (plus_inf)) + result |= 32; + if (!signbit (minus_inf)) + result |= 64; + } + return result; +} + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_signbit=yes +else + gl_cv_func_signbit=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit" >&5 +$as_echo "$gl_cv_func_signbit" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5 +$as_echo_n "checking for signbit compiler built-ins... " >&6; } +if ${gl_cv_func_signbit_gcc+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_signbit_gcc="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if __GNUC__ >= 4 +# define signbit(x) \ + (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ + sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ + __builtin_signbitf (x)) +#else +# error "signbit should be three compiler built-ins" +#endif +#include <string.h> + +/* Global variables. + Needed because GCC 4 constant-folds __builtin_signbitl (literal) + but cannot constant-fold __builtin_signbitl (variable). */ +float vf; +double vd; +long double vl; +int main () +{ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -p0f and -p0d instead. */ +float p0f = 0.0f; +float m0f = -p0f; +double p0d = 0.0; +double m0d = -p0d; +/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. + So we use another constant expression instead. + But that expression does not work on other platforms, such as when + cross-compiling to PowerPC on Mac OS X 10.5. */ +long double p0l = 0.0L; +#if defined __hpux || defined __sgi +long double m0l = -LDBL_MIN * LDBL_MIN; +#else +long double m0l = -p0l; +#endif + int result = 0; + if (signbit (vf)) /* link check */ + vf++; + { + float plus_inf = 1.0f / p0f; + float minus_inf = -1.0f / p0f; + if (!(!signbit (255.0f) + && signbit (-255.0f) + && !signbit (p0f) + && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) + && !signbit (plus_inf) + && signbit (minus_inf))) + result |= 1; + } + if (signbit (vd)) /* link check */ + vd++; + { + double plus_inf = 1.0 / p0d; + double minus_inf = -1.0 / p0d; + if (!(!signbit (255.0) + && signbit (-255.0) + && !signbit (p0d) + && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) + && !signbit (plus_inf) + && signbit (minus_inf))) + result |= 2; + } + if (signbit (vl)) /* link check */ + vl++; + { + long double plus_inf = 1.0L / p0l; + long double minus_inf = -1.0L / p0l; + if (signbit (255.0L)) + result |= 4; + if (!signbit (-255.0L)) + result |= 4; + if (signbit (p0l)) + result |= 8; + if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l))) + result |= 16; + if (signbit (plus_inf)) + result |= 32; + if (!signbit (minus_inf)) + result |= 64; + } + return result; +} + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_signbit_gcc=yes +else + gl_cv_func_signbit_gcc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_gcc" >&5 +$as_echo "$gl_cv_func_signbit_gcc" >&6; } + case "$gl_cv_func_signbit_gcc" in + *yes) + REPLACE_SIGNBIT_USING_GCC=1 + ;; + *) + case "$gl_cv_func_signbit" in + *yes) ;; + *) + REPLACE_SIGNBIT=1 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'float'" >&5 +$as_echo_n "checking where to find the sign bit in a 'float'... " >&6; } +if ${gl_cv_cc_float_signbit+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_float_signbit="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdio.h> +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0f }; +static memory_float minus = { -1.0f }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 2; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 3; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 4; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + if (fclose (fp) != 0) + return 5; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_float_signbit=`cat conftest.out` +else + gl_cv_cc_float_signbit="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_signbit" >&5 +$as_echo "$gl_cv_cc_float_signbit" >&6; } + case "$gl_cv_cc_float_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_SIGNBIT_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_SIGNBIT_BIT $bit +_ACEOF + + ;; + esac + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'double'" >&5 +$as_echo_n "checking where to find the sign bit in a 'double'... " >&6; } +if ${gl_cv_cc_double_signbit+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_double_signbit="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdio.h> +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0 }; +static memory_float minus = { -1.0 }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 2; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 3; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 4; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + if (fclose (fp) != 0) + return 5; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_double_signbit=`cat conftest.out` +else + gl_cv_cc_double_signbit="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_signbit" >&5 +$as_echo "$gl_cv_cc_double_signbit" >&6; } + case "$gl_cv_cc_double_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define DBL_SIGNBIT_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBL_SIGNBIT_BIT $bit +_ACEOF + + ;; + esac + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'long double'" >&5 +$as_echo_n "checking where to find the sign bit in a 'long double'... " >&6; } +if ${gl_cv_cc_long_double_signbit+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_long_double_signbit="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdio.h> +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0L }; +static memory_float minus = { -1.0L }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 2; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 3; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 4; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + if (fclose (fp) != 0) + return 5; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_long_double_signbit=`cat conftest.out` +else + gl_cv_cc_long_double_signbit="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_signbit" >&5 +$as_echo "$gl_cv_cc_long_double_signbit" >&6; } + case "$gl_cv_cc_long_double_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define LDBL_SIGNBIT_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LDBL_SIGNBIT_BIT $bit +_ACEOF + + ;; + esac + + + if test "$gl_cv_cc_float_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysignf" "ac_cv_have_decl_copysignf" "#include <math.h> +" +if test "x$ac_cv_have_decl_copysignf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGNF $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_copysignf" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignf can be used without linking with libm" >&5 +$as_echo_n "checking whether copysignf can be used without linking with libm... " >&6; } +if ${gl_cv_func_copysignf_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + float x, y; +int +main () +{ +return copysignf (x, y) < 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_copysignf_no_libm=yes +else + gl_cv_func_copysignf_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignf_no_libm" >&5 +$as_echo "$gl_cv_func_copysignf_no_libm" >&6; } + if test $gl_cv_func_copysignf_no_libm = yes; then + +$as_echo "#define HAVE_COPYSIGNF_IN_LIBC 1" >>confdefs.h + + fi + fi + fi + if test "$gl_cv_cc_double_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysign" "ac_cv_have_decl_copysign" "#include <math.h> +" +if test "x$ac_cv_have_decl_copysign" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGN $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_copysign" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysign can be used without linking with libm" >&5 +$as_echo_n "checking whether copysign can be used without linking with libm... " >&6; } +if ${gl_cv_func_copysign_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + double x, y; +int +main () +{ +return copysign (x, y) < 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_copysign_no_libm=yes +else + gl_cv_func_copysign_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysign_no_libm" >&5 +$as_echo "$gl_cv_func_copysign_no_libm" >&6; } + if test $gl_cv_func_copysign_no_libm = yes; then + +$as_echo "#define HAVE_COPYSIGN_IN_LIBC 1" >>confdefs.h + + fi + fi + fi + if test "$gl_cv_cc_long_double_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysignl" "ac_cv_have_decl_copysignl" "#include <math.h> +" +if test "x$ac_cv_have_decl_copysignl" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGNL $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_copysignl" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignl can be used without linking with libm" >&5 +$as_echo_n "checking whether copysignl can be used without linking with libm... " >&6; } +if ${gl_cv_func_copysignl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + long double x, y; +int +main () +{ +return copysignl (x, y) < 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_copysignl_no_libm=yes +else + gl_cv_func_copysignl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignl_no_libm" >&5 +$as_echo "$gl_cv_func_copysignl_no_libm" >&6; } + if test $gl_cv_func_copysignl_no_libm = yes; then + +$as_echo "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h + + fi + fi + fi + ;; + esac + ;; + esac + + if test $REPLACE_SIGNBIT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS signbitf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS signbitd.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS signbitl.$ac_objext" + + fi + + + + + + GNULIB_SIGNBIT=1 + + + + + +$as_echo "#define GNULIB_TEST_SIGNBIT 1" >>confdefs.h + + + + + + + if test $gl_cv_type_sigset_t = yes; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes; then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + fi + + if test $HAVE_POSIX_SIGNALBLOCKING = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext" + + : + fi + + + + + + GNULIB_SIGPROCMASK=1 + + + + + +$as_echo "#define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h + + + + + for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +$as_echo_n "checking for SIZE_MAX... " >&6; } +if ${gl_cv_size_max+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_size_max= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <limits.h> +#if HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Found it" >/dev/null 2>&1; then : + gl_cv_size_max=yes +fi +rm -f conftest* + + if test -z "$gl_cv_size_max"; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include <stddef.h> +#include <limits.h>"; then : + +else + size_t_bits_minus_1= +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include <stddef.h>"; then : + +else + fits_in_uint= +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + extern size_t foo; + extern unsigned long foo; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +$as_echo "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +cat >>confdefs.h <<_ACEOF +#define SIZE_MAX $gl_cv_size_max +_ACEOF + + fi + + + + + gl_cv_func_snprintf_usable=no + for ac_func in snprintf +do : + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SNPRINTF 1 +_ACEOF + +fi +done + + if test $ac_cv_func_snprintf = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +$as_echo_n "checking whether snprintf respects a size of 1... " >&6; } +if ${gl_cv_func_snprintf_size1+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_func_snprintf_size1="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_size1=yes +else + gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +$as_echo "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if ${gl_cv_func_printf_positions+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_positions=yes +else + gl_cv_func_printf_positions=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +$as_echo "$gl_cv_func_printf_positions" >&6; } + + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + : + + fi + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + + + + + GNULIB_SNPRINTF=1 + + + + + +$as_echo "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h + + + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_SNPRINTF 1 +_ACEOF + + + + + + + + + + + + + + + + + + gl_cv_func_snprintf_posix=no + for ac_func in snprintf +do : + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SNPRINTF 1 +_ACEOF + +fi +done + + if test $ac_cv_func_snprintf = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf truncates the result as in C99" >&5 +$as_echo_n "checking whether snprintf truncates the result as in C99... " >&6; } +if ${gl_cv_func_snprintf_truncation_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_truncation_c99="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + my_snprintf (buf, 3, "%d %d", 4567, 89); + if (memcmp (buf, "45\0DEF", 6) != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_truncation_c99=yes +else + gl_cv_func_snprintf_truncation_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_truncation_c99" >&5 +$as_echo "$gl_cv_func_snprintf_truncation_c99" >&6; } + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf fully supports the 'n' directive" >&5 +$as_echo_n "checking whether snprintf fully supports the 'n' directive... " >&6; } +if ${gl_cv_func_snprintf_directive_n+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_directive_n="guessing no";; + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; + aix*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + osf*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_directive_n="guessing no";; + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_directive_n="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); + if (count != 6) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_directive_n=yes +else + gl_cv_func_snprintf_directive_n=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_directive_n" >&5 +$as_echo "$gl_cv_func_snprintf_directive_n" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +$as_echo_n "checking whether snprintf respects a size of 1... " >&6; } +if ${gl_cv_func_snprintf_size1+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_func_snprintf_size1="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_size1=yes +else + gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +$as_echo "$gl_cv_func_snprintf_size1" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf respects a zero size as in C99" >&5 +$as_echo_n "checking whether vsnprintf respects a zero size as in C99... " >&6; } +if ${gl_cv_func_vsnprintf_zerosize_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on mingw. + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdarg.h> +#include <stdio.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 0, "%d", 12345); + return buf[0] != 'D'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_vsnprintf_zerosize_c99=yes +else + gl_cv_func_vsnprintf_zerosize_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_vsnprintf_zerosize_c99" >&5 +$as_echo "$gl_cv_func_vsnprintf_zerosize_c99" >&6; } + + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + case "$gl_cv_func_snprintf_truncation_c99" in + *yes) + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + case "$gl_cv_func_snprintf_directive_n" in + *yes) + case "$gl_cv_func_snprintf_size1" in + *yes) + case "$gl_cv_func_vsnprintf_zerosize_c99" in + *yes) + # snprintf exists and is + # already POSIX compliant. + gl_cv_func_snprintf_posix=yes + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + : + + fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_spawn_h='<'spawn.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <spawn.h>" >&5 +$as_echo_n "checking absolute name of <spawn.h>... " >&6; } +if ${gl_cv_next_spawn_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_spawn_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <spawn.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'spawn.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_spawn_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_spawn_h + gl_cv_next_spawn_h='"'$gl_header'"' + else + gl_cv_next_spawn_h='<'spawn.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_spawn_h" >&5 +$as_echo "$gl_cv_next_spawn_h" >&6; } + fi + NEXT_SPAWN_H=$gl_cv_next_spawn_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'spawn.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_spawn_h + fi + NEXT_AS_FIRST_DIRECTIVE_SPAWN_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_spawn_h = yes; then + HAVE_SPAWN_H=1 + ac_fn_c_check_type "$LINENO" "posix_spawnattr_t" "ac_cv_type_posix_spawnattr_t" " +#include <spawn.h> + +" +if test "x$ac_cv_type_posix_spawnattr_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_POSIX_SPAWNATTR_T 1 +_ACEOF + + +else + HAVE_POSIX_SPAWNATTR_T=0 +fi + + ac_fn_c_check_type "$LINENO" "posix_spawn_file_actions_t" "ac_cv_type_posix_spawn_file_actions_t" " +#include <spawn.h> + +" +if test "x$ac_cv_type_posix_spawn_file_actions_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_POSIX_SPAWN_FILE_ACTIONS_T 1 +_ACEOF + + +else + HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0 +fi + + else + HAVE_SPAWN_H=0 + HAVE_POSIX_SPAWNATTR_T=0 + HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0 + fi + + + + + + + + + + + + for gl_func in posix_spawn posix_spawnp posix_spawnattr_init posix_spawnattr_destroy posix_spawnattr_getsigdefault posix_spawnattr_setsigdefault posix_spawnattr_getsigmask posix_spawnattr_setsigmask posix_spawnattr_getflags posix_spawnattr_setflags posix_spawnattr_getpgroup posix_spawnattr_setpgroup posix_spawnattr_getschedpolicy posix_spawnattr_setschedpolicy posix_spawnattr_getschedparam posix_spawnattr_setschedparam posix_spawn_file_actions_init posix_spawn_file_actions_destroy posix_spawn_file_actions_addopen posix_spawn_file_actions_addclose posix_spawn_file_actions_adddup2; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <spawn.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + + gl_cv_func_sprintf_posix=no + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + # sprintf exists and is + # already POSIX compliant. + gl_cv_func_sprintf_posix=yes + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + if test $gl_cv_func_sprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sprintf.$ac_objext" + + REPLACE_SPRINTF=1 + : + + fi + + + + + + + GNULIB_SPRINTF_POSIX=1 + + + + + +$as_echo "#define GNULIB_TEST_SPRINTF_POSIX 1" >>confdefs.h + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } +if ${gt_cv_ssize_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main () +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_ssize_t=yes +else + gt_cv_ssize_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +$as_echo "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +$as_echo "#define ssize_t int" >>confdefs.h + + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5 +$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; } +if ${gl_cv_func_stat_dir_slash+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case $host_os in + mingw*) gl_cv_func_stat_dir_slash="guessing no";; + *) gl_cv_func_stat_dir_slash="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main () +{ +struct stat st; return stat (".", &st) != stat ("./", &st); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_stat_dir_slash=yes +else + gl_cv_func_stat_dir_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5 +$as_echo "$gl_cv_func_stat_dir_slash" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } +if ${gl_cv_func_stat_file_slash+:} false; then : + $as_echo_n "(cached) " >&6 +else + touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main () +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_stat_file_slash=yes +else + gl_cv_func_stat_file_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.tmp conftest.lnk +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +$as_echo "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_dir_slash in + *no) REPLACE_STAT=1 + +$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h +;; + esac + case $gl_cv_func_stat_file_slash in + *no) REPLACE_STAT=1 + +$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + : + fi + + + + + + GNULIB_STAT=1 + + + + + +$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h + + + + + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + if test -n "$STDBOOL_H"; then + GL_GENERATE_STDBOOL_H_TRUE= + GL_GENERATE_STDBOOL_H_FALSE='#' +else + GL_GENERATE_STDBOOL_H_TRUE='#' + GL_GENERATE_STDBOOL_H_FALSE= +fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + + + + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h> + +" +if test "x$ac_cv_type_max_align_t" = xyes; then : + +else + HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } +if ${gl_cv_decl_null_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_decl_null_works=yes +else + gl_cv_decl_null_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +$as_echo "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 +$as_echo_n "checking absolute name of <stddef.h>... " >&6; } +if ${gl_cv_next_stddef_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +$as_echo "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5 +$as_echo_n "checking absolute name of <stdio.h>... " >&6; } +if ${gl_cv_next_stdio_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdio_h + gl_cv_next_stdio_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +$as_echo "$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdio.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdio_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inttypes macros match system or gnu printf" >&5 +$as_echo_n "checking whether inttypes macros match system or gnu printf... " >&6; } +if ${gl_cv_func_printf_attribute_flavor+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define __STDC_FORMAT_MACROS 1 + #include <stdio.h> + #include <inttypes.h> + findme PRIdMAX findme + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "findme .(ll|j)d. findme" >/dev/null 2>&1; then : + gl_cv_func_printf_attribute_flavor=gnu +else + gl_cv_func_printf_attribute_flavor=system +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + + GNULIB_FSCANF=1 + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_FSCANF 1 +_ACEOF + + + GNULIB_SCANF=1 + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_SCANF 1 +_ACEOF + + + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + + + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + + + + + for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5 +$as_echo_n "checking absolute name of <stdlib.h>... " >&6; } +if ${gl_cv_next_stdlib_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdlib.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdlib_h + gl_cv_next_stdlib_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +$as_echo "$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdlib.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdlib_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive + + + + + + + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#if HAVE_SYS_LOADAVG_H +# include <sys/loadavg.h> +#endif +#if HAVE_RANDOM_H +# include <random.h> +#endif + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + for ac_func in stpcpy +do : + ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy" +if test "x$ac_cv_func_stpcpy" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STPCPY 1 +_ACEOF + +fi +done + + if test $ac_cv_func_stpcpy = no; then + HAVE_STPCPY=0 + fi + + if test $HAVE_STPCPY = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stpcpy.$ac_objext" + + + : + + fi + + + + + + GNULIB_STPCPY=1 + + + + + +$as_echo "#define GNULIB_TEST_STPCPY 1" >>confdefs.h + + + + + + + + for ac_func in strchrnul +do : + ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul" +if test "x$ac_cv_func_strchrnul" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRCHRNUL 1 +_ACEOF + +fi +done + + if test $ac_cv_func_strchrnul = no; then + HAVE_STRCHRNUL=0 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5 +$as_echo_n "checking whether strchrnul works... " >&6; } +if ${gl_cv_func_strchrnul_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __CYGWIN__ + #include <cygwin/version.h> + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9) + Lucky user + #endif +#else + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky user" >/dev/null 2>&1; then : + gl_cv_func_strchrnul_works="guessing yes" +else + gl_cv_func_strchrnul_works="guessing no" +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> /* for strchrnul */ + +int +main () +{ +const char *buf = "a"; + return strchrnul (buf, 'b') != buf + 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strchrnul_works=yes +else + gl_cv_func_strchrnul_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5 +$as_echo "$gl_cv_func_strchrnul_works" >&6; } + case "$gl_cv_func_strchrnul_works" in + *yes) ;; + *) REPLACE_STRCHRNUL=1 ;; + esac + fi + + if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext" + + : + fi + + + + + + GNULIB_STRCHRNUL=1 + + + + + +$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h + + + + + + + + if test $ac_cv_func_strdup = yes; then + if test $gl_cv_func_malloc_posix != yes; then + REPLACE_STRDUP=1 + fi + fi + + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi + + if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext" + + : + fi + + + + + + GNULIB_STRDUP=1 + + + + + +$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h + + + + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +$as_echo_n "checking for working strerror function... " >&6; } +if ${gl_cv_func_working_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +int +main () +{ +if (!*strerror (-2)) return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_working_strerror=yes +else + gl_cv_func_working_strerror=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +$as_echo "$gl_cv_func_working_strerror" >&6; } + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + REPLACE_STRERROR=1 + ;; + esac + + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac + + else + REPLACE_STRERROR=1 + fi + + if test $REPLACE_STRERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + fi + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_STRERROR 1 +_ACEOF + + + + + + + + GNULIB_STRERROR=1 + + + + + +$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h + + + + + + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + fi + + + + + + + + if test $ac_cv_have_decl_strerror_r = no; then + HAVE_DECL_STRERROR_R=0 + fi + + if test $ac_cv_func_strerror_r = yes; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test $gl_cv_func_strerror_r_posix_signature = yes; then + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR_R=1 ;; + esac + else + REPLACE_STRERROR_R=1 + fi + else + REPLACE_STRERROR_R=1 + fi + fi + + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext" + + + + + + + fi + + + + + + GNULIB_STRERROR_R=1 + + + + + +$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h + + + + + + + + + + + + + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + if test $ac_cv_func_strndup = yes; then + HAVE_STRNDUP=1 + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5 +$as_echo_n "checking for working strndup... " >&6; } +if ${gl_cv_func_strndup_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + + case $host_os in + aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";; + *) gl_cv_func_strndup_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <string.h> + #include <stdlib.h> +int +main () +{ + +#if !HAVE_DECL_STRNDUP + extern + #ifdef __cplusplus + "C" + #endif + char *strndup (const char *, size_t); +#endif + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + return s[13] != '\0'; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strndup_works=yes +else + gl_cv_func_strndup_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5 +$as_echo "$gl_cv_func_strndup_works" >&6; } + case $gl_cv_func_strndup_works in + *no) REPLACE_STRNDUP=1 ;; + esac + else + HAVE_STRNDUP=0 + fi + + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + + fi + + + + + + GNULIB_STRNDUP=1 + + + + + +$as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +$as_echo_n "checking for working strnlen... " >&6; } +if ${ac_cv_func_strnlen_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + # Guess no on AIX systems, yes otherwise. + case "$host_os" in + aix*) ac_cv_func_strnlen_working=no;; + *) ac_cv_func_strnlen_working=yes;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + +#define S "foobar" +#define S_LEN (sizeof S - 1) + + /* At least one implementation is buggy: that of AIX 4.3 would + give strnlen (S, 1) == 3. */ + + int i; + for (i = 0; i < S_LEN + 1; ++i) + { + int expected = i <= S_LEN ? i : S_LEN; + if (strnlen (S, i) != expected) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strnlen_working=yes +else + ac_cv_func_strnlen_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +$as_echo "$ac_cv_func_strnlen_working" >&6; } +test $ac_cv_func_strnlen_working = no && : + + + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi + + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + + : + fi + + + + + + GNULIB_STRNLEN=1 + + + + + +$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h + + + + + + + + for ac_func in strverscmp +do : + ac_fn_c_check_func "$LINENO" "strverscmp" "ac_cv_func_strverscmp" +if test "x$ac_cv_func_strverscmp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRVERSCMP 1 +_ACEOF + +fi +done + + if test $ac_cv_func_strverscmp = no; then + HAVE_STRVERSCMP=0 + fi + + if test $HAVE_STRVERSCMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strverscmp.$ac_objext" + + + : + + fi + + + + + + GNULIB_STRVERSCMP=1 + + + + + +$as_echo "#define GNULIB_TEST_STRVERSCMP 1" >>confdefs.h + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } +if ${gl_cv_next_sys_stat_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_stat_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +$as_echo "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/stat.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_stat_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive + + + + + + + + + + + + if test $WINDOWS_64_BIT_ST_SIZE = 1; then + +$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h + + fi + + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_type_nlink_t" = xyes; then : + +else + +$as_echo "#define nlink_t int" >>confdefs.h + +fi + + + + for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5 +$as_echo_n "checking absolute name of <sys/wait.h>... " >&6; } +if ${gl_cv_next_sys_wait_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_wait_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/wait.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/wait.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_wait_h + gl_cv_next_sys_wait_h='"'$gl_header'"' + else + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5 +$as_echo "$gl_cv_next_sys_wait_h" >&6; } + fi + NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/wait.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_wait_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive + + + + + + + + + for gl_func in waitpid; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/wait.h> +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5 +$as_echo_n "checking absolute name of <unistd.h>... " >&6; } +if ${gl_cv_next_unistd_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_unistd_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'unistd.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_unistd_h + gl_cv_next_unistd_h='"'$gl_header'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +$as_echo "$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'unistd.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_unistd_h + fi + NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + + + + + + + + for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r unlink unlinkat usleep; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +/* Some systems declare various items in the wrong headers. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include <io.h> +# endif +#endif + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNITYPES_H='unitypes.h' + else + LIBUNISTRING_UNITYPES_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + } + } + } + + + + + } + }; then + LIBUNISTRING_UNIWIDTH_H='uniwidth.h' + else + LIBUNISTRING_UNIWIDTH_H= + fi + + + + + if { test "$HAVE_LIBUNISTRING" != yes \ + || { + + + + test $LIBUNISTRING_VERSION_MAJOR -lt 0 \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ + && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ + || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 5 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE= + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#' +else + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#' + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink honors trailing slashes" >&5 +$as_echo_n "checking whether unlink honors trailing slashes... " >&6; } +if ${gl_cv_func_unlink_honors_slashes+:} false; then : + $as_echo_n "(cached) " >&6 +else + touch conftest.file + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.file conftest.lnk + fi + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unlink_honors_slashes="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + # include <unistd.h> + #else /* on Windows with MSVC */ + # include <io.h> + #endif + #include <errno.h> + +int +main () +{ +int result = 0; + if (!unlink ("conftest.file/")) + result |= 1; + else if (errno != ENOTDIR) + result |= 2; +#if HAVE_LSTAT + if (!unlink ("conftest.lnk/")) + result |= 4; + else if (errno != ENOTDIR) + result |= 8; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_unlink_honors_slashes=yes +else + gl_cv_func_unlink_honors_slashes=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.file conftest.lnk +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_honors_slashes" >&5 +$as_echo "$gl_cv_func_unlink_honors_slashes" >&6; } + case "$gl_cv_func_unlink_honors_slashes" in + *no) + REPLACE_UNLINK=1 + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink of a parent directory fails as it should" >&5 +$as_echo_n "checking whether unlink of a parent directory fails as it should... " >&6; } +if ${gl_cv_func_unlink_parent_fails+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$host_os" in + darwin*) + if { + # Use the mktemp program if available. If not available, hide the error + # message. + tmp=`(umask 077 && mktemp -d /tmp/gtXXXXXX) 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" + } || + { + # Use a simple mkdir command. It is guaranteed to fail if the directory + # already exists. $RANDOM is bash specific and expands to empty in shells + # other than bash, ksh and zsh. Its use does not increase security; + # rather, it minimizes the probability of failure in a very cluttered /tmp + # directory. + tmp=/tmp/gt$$-$RANDOM + (umask 077 && mkdir "$tmp") + }; then + mkdir "$tmp/subdir" + GL_SUBDIR_FOR_UNLINK="$tmp/subdir" + export GL_SUBDIR_FOR_UNLINK + if test "$cross_compiling" = yes; then : + # If we don't know, assume the worst. + gl_cv_func_unlink_parent_fails="guessing no" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdlib.h> + #if HAVE_UNISTD_H + # include <unistd.h> + #else /* on Windows with MSVC */ + # include <direct.h> + # include <io.h> + #endif + int main () + { + int result = 0; + if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0) + result |= 1; + else if (unlink ("..") == 0) + result |= 2; + return result; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_unlink_parent_fails=yes +else + gl_cv_func_unlink_parent_fails=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + unset GL_SUBDIR_FOR_UNLINK + rm -rf "$tmp" + else + gl_cv_func_unlink_parent_fails="guessing no" + fi + ;; + *) + gl_cv_func_unlink_parent_fails="guessing yes" + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_parent_fails" >&5 +$as_echo "$gl_cv_func_unlink_parent_fails" >&6; } + case "$gl_cv_func_unlink_parent_fails" in + *no) + REPLACE_UNLINK=1 + +$as_echo "#define UNLINK_PARENT_BUG 1" >>confdefs.h + + ;; + esac + + if test $REPLACE_UNLINK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS unlink.$ac_objext" + + fi + + + + + + GNULIB_UNLINK=1 + + + + + +$as_echo "#define GNULIB_TEST_UNLINK 1" >>confdefs.h + + + + + +$as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h + + + + + + + + + + + + + + + + + + + + + + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + for ac_func in unsetenv +do : + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UNSETENV 1 +_ACEOF + +fi +done + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +$as_echo_n "checking for unsetenv() return type... " >&6; } +if ${gt_cv_func_unsetenv_ret+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */ +#include <stdlib.h> +extern +#ifdef __cplusplus +"C" +#endif +int unsetenv (const char *name); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_func_unsetenv_ret='int' +else + gt_cv_func_unsetenv_ret='void' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +$as_echo "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + +$as_echo "#define VOID_UNSETENV 1" >>confdefs.h + + REPLACE_UNSETENV=1 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 +$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; } +if ${gl_cv_func_unsetenv_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdlib.h> + #include <errno.h> + extern char **environ; + +int +main () +{ + + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; + if (putenv ((char *) "a=1")) return 1; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_unsetenv_works=yes +else + gl_cv_func_unsetenv_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 +$as_echo "$gl_cv_func_unsetenv_works" >&6; } + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac + fi + + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" + + + + + + fi + + + + + + GNULIB_UNSETENV=1 + + + + + +$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h + + + + + + if test $ac_cv_func_vasnprintf = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + fi + + + + + + + + + + + + + + + + + gl_cv_func_vfprintf_posix=no + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + # vfprintf exists and is + # already POSIX compliant. + gl_cv_func_vfprintf_posix=yes + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + if test $gl_cv_func_vfprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vfprintf.$ac_objext" + + REPLACE_VFPRINTF=1 + +$as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h + + : + + fi + + + + + + + GNULIB_VFPRINTF_POSIX=1 + + + + + +$as_echo "#define GNULIB_TEST_VFPRINTF_POSIX 1" >>confdefs.h + + + + + + gl_cv_func_vsnprintf_usable=no + for ac_func in vsnprintf +do : + ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VSNPRINTF 1 +_ACEOF + +fi +done + + if test $ac_cv_func_vsnprintf = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +$as_echo_n "checking whether snprintf respects a size of 1... " >&6; } +if ${gl_cv_func_snprintf_size1+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_func_snprintf_size1="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_size1=yes +else + gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +$as_echo "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if ${gl_cv_func_printf_positions+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_positions=yes +else + gl_cv_func_printf_positions=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +$as_echo "$gl_cv_func_printf_positions" >&6; } + + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_vsnprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_vsnprintf_usable = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vsnprintf.$ac_objext" + + if test $ac_cv_func_vsnprintf = yes; then + REPLACE_VSNPRINTF=1 + fi + : + + fi + + if test $ac_cv_have_decl_vsnprintf = no; then + HAVE_DECL_VSNPRINTF=0 + fi + + + + + + + GNULIB_VSNPRINTF=1 + + + + + +$as_echo "#define GNULIB_TEST_VSNPRINTF 1" >>confdefs.h + + + + + + + + + + + + + + + + + + + gl_cv_func_vsnprintf_posix=no + for ac_func in vsnprintf +do : + ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VSNPRINTF 1 +_ACEOF + +fi +done + + if test $ac_cv_func_vsnprintf = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf truncates the result as in C99" >&5 +$as_echo_n "checking whether snprintf truncates the result as in C99... " >&6; } +if ${gl_cv_func_snprintf_truncation_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_truncation_c99="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + my_snprintf (buf, 3, "%d %d", 4567, 89); + if (memcmp (buf, "45\0DEF", 6) != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_truncation_c99=yes +else + gl_cv_func_snprintf_truncation_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_truncation_c99" >&5 +$as_echo "$gl_cv_func_snprintf_truncation_c99" >&6; } + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf fully supports the 'n' directive" >&5 +$as_echo_n "checking whether snprintf fully supports the 'n' directive... " >&6; } +if ${gl_cv_func_snprintf_directive_n+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_directive_n="guessing no";; + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; + aix*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + osf*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_directive_n="guessing no";; + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_directive_n="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); + if (count != 6) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_directive_n=yes +else + gl_cv_func_snprintf_directive_n=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_directive_n" >&5 +$as_echo "$gl_cv_func_snprintf_directive_n" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +$as_echo_n "checking whether snprintf respects a size of 1... " >&6; } +if ${gl_cv_func_snprintf_size1+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_func_snprintf_size1="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_size1=yes +else + gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +$as_echo "$gl_cv_func_snprintf_size1" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf respects a zero size as in C99" >&5 +$as_echo_n "checking whether vsnprintf respects a zero size as in C99... " >&6; } +if ${gl_cv_func_vsnprintf_zerosize_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on mingw. + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdarg.h> +#include <stdio.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 0, "%d", 12345); + return buf[0] != 'D'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_vsnprintf_zerosize_c99=yes +else + gl_cv_func_vsnprintf_zerosize_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_vsnprintf_zerosize_c99" >&5 +$as_echo "$gl_cv_func_vsnprintf_zerosize_c99" >&6; } + + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + case "$gl_cv_func_snprintf_truncation_c99" in + *yes) + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + case "$gl_cv_func_snprintf_directive_n" in + *yes) + case "$gl_cv_func_snprintf_size1" in + *yes) + case "$gl_cv_func_vsnprintf_zerosize_c99" in + *yes) + # vsnprintf exists and is + # already POSIX compliant. + gl_cv_func_vsnprintf_posix=yes + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_vsnprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vsnprintf.$ac_objext" + + if test $ac_cv_func_vsnprintf = yes; then + REPLACE_VSNPRINTF=1 + fi + : + + fi + + + + + + + + + + + + + + + + + gl_cv_func_vsprintf_posix=no + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + # vsprintf exists and is + # already POSIX compliant. + gl_cv_func_vsprintf_posix=yes + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + if test $gl_cv_func_vsprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vsprintf.$ac_objext" + + REPLACE_VSPRINTF=1 + : + + fi + + + + + + + GNULIB_VSPRINTF_POSIX=1 + + + + + +$as_echo "#define GNULIB_TEST_VSPRINTF_POSIX 1" >>confdefs.h + + + + + + for ac_func in waitid +do : + ac_fn_c_check_func "$LINENO" "waitid" "ac_cv_func_waitid" +if test "x$ac_cv_func_waitid" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WAITID 1 +_ACEOF + +fi +done + + + + + HAVE_WAITPID=1 + case $host_os in + mingw*) HAVE_WAITPID=0 ;; + esac + + if test $HAVE_WAITPID = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS waitpid.$ac_objext" + + fi + + + + + + GNULIB_WAITPID=1 + + + + + +$as_echo "#define GNULIB_TEST_WAITPID 1" >>confdefs.h + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5 +$as_echo_n "checking absolute name of <wchar.h>... " >&6; } +if ${gl_cv_next_wchar_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_wchar_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <wchar.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wchar.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wchar_h + gl_cv_next_wchar_h='"'$gl_header'"' + else + gl_cv_next_wchar_h='<'wchar.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 +$as_echo "$gl_cv_next_wchar_h" >&6; } + fi + NEXT_WCHAR_H=$gl_cv_next_wchar_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wchar.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wchar_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth ; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 +$as_echo_n "checking absolute name of <wctype.h>... " >&6; } +if ${gl_cv_next_wctype_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <wctype.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +$as_echo "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +$as_echo_n "checking whether iswcntrl works... " >&6; } +if ${gl_cv_func_iswcntrl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_iswcntrl_works="guessing yes" +else + gl_cv_func_iswcntrl_works="guessing no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_iswcntrl_works=yes +else + gl_cv_func_iswcntrl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +$as_echo "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi + + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + for ac_func in towlower +do : + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TOWLOWER 1 +_ACEOF + +fi +done + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + +" +if test "x$ac_cv_have_decl_towlower" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TOWLOWER $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +$as_echo_n "checking for wctype_t... " >&6; } +if ${gl_cv_type_wctype_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + wctype_t a; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_wctype_t=yes +else + gl_cv_type_wctype_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +$as_echo "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +$as_echo_n "checking for wctrans_t... " >&6; } +if ${gl_cv_type_wctrans_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be + included before <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> + must be included before <wchar.h>. */ + #include <stddef.h> + #include <stdio.h> + #include <time.h> + #include <wchar.h> + #include <wctype.h> + wctrans_t a; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_wctrans_t=yes +else + gl_cv_type_wctrans_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +$as_echo "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# include <wchar.h> +#endif +#include <wctype.h> + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + + + + + ac_fn_c_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" " +/* AIX 3.2.5 declares wcwidth in <string.h>. */ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_wcwidth" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_WCWIDTH $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = yes; then + HAVE_WCWIDTH=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 +$as_echo_n "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } +if ${gl_cv_func_wcwidth_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +/* AIX 3.2.5 declares wcwidth in <string.h>. */ +#include <string.h> +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); +#endif +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_wcwidth_works=yes +else + gl_cv_func_wcwidth_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5 +$as_echo "$gl_cv_func_wcwidth_works" >&6; } + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + else + HAVE_WCWIDTH=0 + fi + + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext" + + fi + + + + + + GNULIB_WCWIDTH=1 + + + + + +$as_echo "#define GNULIB_TEST_WCWIDTH 1" >>confdefs.h + + + + : + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xmemdup0.$ac_objext" + + + + for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + + + + + : + + + # End of code from modules + + + + + + + + + + gltests_libdeps= + gltests_ltlibdeps= + + + + + + + + + + gl_source_base='tests' + gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS + + gl_module_indicator_condition=$gltests_WITNESS + + + + + + + + + + LIBBISON_LIBDEPS="$gl_libdeps" + + LIBBISON_LTLIBDEPS="$gl_ltlibdeps" + + + +# Checks for library functions. + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if malloc debugging is wanted" >&5 +$as_echo_n "checking if malloc debugging is wanted... " >&6; } + +# Check whether --with-dmalloc was given. +if test "${with_dmalloc+set}" = set; then : + withval=$with_dmalloc; if test "$withval" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WITH_DMALLOC 1" >>confdefs.h + + LIBS="$LIBS -ldmalloc" + LDFLAGS="$LDFLAGS -g" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +for ac_header in sys/time.h sys/times.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + for ac_header in sys/resource.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#ifdef HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif + +" +if test "x$ac_cv_header_sys_resource_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_RESOURCE_H 1 +_ACEOF + +fi + +done + +for ac_func in times +do : + ac_fn_c_check_func "$LINENO" "times" "ac_cv_func_times" +if test "x$ac_cv_func_times" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TIMES 1 +_ACEOF + +fi +done + + +ac_fn_c_check_decl "$LINENO" "getrusage" "ac_cv_have_decl_getrusage" "$ac_includes_default +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#if HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +" +if test "x$ac_cv_have_decl_getrusage" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETRUSAGE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "times" "ac_cv_have_decl_times" "$ac_includes_default +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#if HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +" +if test "x$ac_cv_have_decl_times" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TIMES $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "clock" "ac_cv_have_decl_clock" "$ac_includes_default +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#if HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +" +if test "x$ac_cv_have_decl_clock" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CLOCK $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "sysconf" "ac_cv_have_decl_sysconf" "$ac_includes_default +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#if HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +" +if test "x$ac_cv_have_decl_sysconf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SYSCONF $ac_have_decl +_ACEOF + + +ac_fn_c_check_type "$LINENO" "clock_t" "ac_cv_type_clock_t" "$ac_includes_default +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#if HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +" +if test "x$ac_cv_type_clock_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_CLOCK_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct tms" "ac_cv_type_struct_tms" "$ac_includes_default +#if HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#if HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +" +if test "x$ac_cv_type_struct_tms" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TMS 1 +_ACEOF + + +fi + + + +# Gettext. +# We use gnulib, which is only guaranteed to work properly with the +# latest Gettext. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.18 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GMSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_XGETTEXT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGMERGE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } +if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <CoreFoundation/CFPreferences.h> +int +main () +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else + gt_cv_func_CFPreferencesCopyAppValue=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } +if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <CoreFoundation/CFLocale.h> +int +main () +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFLocaleCopyCurrent=yes +else + gt_cv_func_CFLocaleCopyCurrent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +$as_echo_n "checking for GNU gettext in libc... " >&6; } +if eval \${$gt_func_gnugettext_libc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; + +int +main () +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$gt_func_gnugettext_libc=yes" +else + eval "$gt_func_gnugettext_libc=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$gt_func_gnugettext_libc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } +if ${am_cv_func_iconv+:} false; then : + $as_echo_n "(cached) " >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> + +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +$as_echo "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +$as_echo_n "checking for working iconv... " >&6; } +if ${am_cv_func_iconv_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <iconv.h> +#include <string.h> + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main () +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + result |= 16; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +$as_echo "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +$as_echo_n "checking how to link with libiconv... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +$as_echo "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test "${with_libintl_prefix+set}" = set; then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +$as_echo_n "checking for GNU gettext in libintl... " >&6; } +if eval \${$gt_func_gnugettext_libintl+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main () +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$gt_func_gnugettext_libintl=yes" +else + eval "$gt_func_gnugettext_libintl=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); + +int +main () +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +$as_echo_n "checking whether to use NLS... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +$as_echo_n "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +$as_echo "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +$as_echo_n "checking how to link with libintl... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +$as_echo "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + +$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + + + if test -z "$USE_NLS"; then + echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2 + exit 1 + fi + BISON_LOCALEDIR= + BISON_USE_NLS=no + if test "$USE_NLS" = yes; then + if (${YACC-${BISON-:}} --print-localedir) >/dev/null 2>&1; then + BISON_LOCALEDIR=`${YACC-${BISON-:}} --print-localedir` + fi + + if test -n "$BISON_LOCALEDIR"; then + USER_LINGUAS="${LINGUAS-%UNSET%}" + if test -n "$USER_LINGUAS"; then + BISON_USE_NLS=yes + fi + fi + fi + if test $BISON_USE_NLS = yes; then + +$as_echo "#define YYENABLE_NLS 1" >>confdefs.h + + fi + + +# Internationalized parsers. +ac_config_files="$ac_config_files runtime-po/Makefile.in" + +# Autoconf macros for packages using internationalized parsers. +aclocaldir='${datadir}/aclocal' + + +# Create the benchmark script. +ac_config_files="$ac_config_files etc/bench.pl" + + +# Initialize the test suite. +ac_config_commands="$ac_config_commands tests/atconfig" + +ac_config_files="$ac_config_files tests/atlocal" + +ac_config_files="$ac_config_files tests/bison" + +for ac_prog in valgrind +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_VALGRIND+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$VALGRIND"; then + ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_VALGRIND="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +VALGRIND=$ac_cv_prog_VALGRIND +if test -n "$VALGRIND"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 +$as_echo "$VALGRIND" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$VALGRIND" && break +done + +case $VALGRIND:$host_os in + '':*) ;; + *:darwin*) + # See README-hacking. + # VALGRIND+='-q --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind' + VALGRIND=;; + *:*) + suppfile=build-aux/$host_os.valgrind + if test -f "$srcdir/$suppfile"; then + VALGRIND="$VALGRIND --gen-suppressions=all" + VALGRIND="$VALGRIND --suppressions=\$(abs_top_srcdir)/$suppfile" + fi + VALGRIND_PREBISON="$VALGRIND -q" + + ;; +esac + +# Whether we cannot run the compiled bison. + if test "$cross_compiling" = yes; then + CROSS_COMPILING_TRUE= + CROSS_COMPILING_FALSE='#' +else + CROSS_COMPILING_TRUE='#' + CROSS_COMPILING_FALSE= +fi + + + +AUTOM4TE=${AUTOM4TE-"${am_missing_run}autom4te"} + +# Needed by tests/atlocal.in. + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + CLASSPATH_SEPARATOR=';' +else + CLASSPATH_SEPARATOR=':' +fi +rm -f conftest* + + source_version=1.3 + test -n "$source_version" || { + as_fn_error $? "missing source-version argument to gt_JAVACOMP" "$LINENO" 5 + } + target_version=1.4 + case "$source_version" in + 1.3) goodcode='class conftest {}' + failcode='class conftestfail { static { assert(true); } }' ;; + 1.4) goodcode='class conftest { static { assert(true); } }' + failcode='class conftestfail<T> { T foo() { return null; } }' ;; + 1.5) goodcode='class conftest<T> { T foo() { return null; } }' + failcode='class conftestfail syntax error' ;; + *) as_fn_error $? "invalid source-version argument to gt_JAVACOMP: $source_version" "$LINENO" 5 ;; + esac + case "$target_version" in + 1.1) cfversion=45 ;; + 1.2) cfversion=46 ;; + 1.3) cfversion=47 ;; + 1.4) cfversion=48 ;; + 1.5) cfversion=49 ;; + 1.6) cfversion=50 ;; + *) as_fn_error $? "invalid target-version argument to gt_JAVACOMP: $target_version" "$LINENO" 5 ;; + esac + # Function to output the classfile version of a file (8th byte) in decimal. + if od -A x < /dev/null >/dev/null 2>/dev/null; then + # Use POSIX od. + func_classfile_version () + { + od -A n -t d1 -j 7 -N 1 "$1" + } + else + # Use BSD hexdump. + func_classfile_version () + { + dd if="$1" bs=1 count=1 skip=7 2>/dev/null | hexdump -e '1/1 "%3d "' + echo + } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Java compiler" >&5 +$as_echo_n "checking for Java compiler... " >&6; } + CONF_JAVAC= + HAVE_JAVAC_ENVVAR= + HAVE_GCJ_C= + HAVE_JAVAC= + HAVE_JIKES= + HAVE_JAVACOMP= + cat > conftestlib.java <<EOF +public class conftestlib { + public static void main (String[] args) { + } +} +EOF + echo "$goodcode" > conftest.java + echo "$failcode" > conftestfail.java + if test -n "$JAVAC"; then + if $JAVAC --version 2>/dev/null | sed -e 1q | grep gcj > /dev/null; then + if $JAVAC --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^4\.[012]/d' | grep '^[4-9]' >/dev/null; then + rm -f conftest.class + if { echo "$as_me:37296: $JAVAC -d . conftest.java" >&5 + $JAVAC -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + rm -f conftest.class + rm -f conftestfail.class + if { echo "$as_me:37303: $JAVAC -fsource=$source_version -d . conftest.java" >&5 + $JAVAC -fsource="$source_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ + && { echo "$as_me:37308: $JAVAC -d . conftestfail.java" >&5 + $JAVAC -d . conftestfail.java >&5 2>&1 + } \ + && test -f conftestfail.class \ + && ! { echo "$as_me:37312: $JAVAC -fsource=$source_version -d . conftestfail.java" >&5 + $JAVAC -fsource="$source_version" -d . conftestfail.java >&5 2>&1 + }; then + CONF_JAVAC="$JAVAC -fsource=$source_version" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + else + CONF_JAVAC="$JAVAC" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + else + rm -f conftest.class + rm -f conftestfail.class + if { echo "$as_me:37326: $JAVAC -fsource=$source_version -ftarget=$target_version -d . conftest.java" >&5 + $JAVAC -fsource="$source_version" -ftarget="$target_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + CONF_JAVAC="$JAVAC -fsource=$source_version -ftarget=$target_version" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + fi + else + if test "$target_version" = 1.4 && test "$source_version" = 1.4; then + rm -f conftest.class + if { echo "$as_me:37339: $JAVAC -d . conftest.java" >&5 + $JAVAC -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class; then + CONF_JAVAC="$JAVAC" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + else + if test "$target_version" = 1.4 && test "$source_version" = 1.3; then + javac_works= + rm -f conftest.class + if { echo "$as_me:37351: $JAVAC -d . conftest.java" >&5 + $JAVAC -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class; then + javac_works=1 + fi + javac_noassert_works= + rm -f conftest.class + if { echo "$as_me:37359: $JAVAC -fno-assert -d . conftest.java" >&5 + $JAVAC -fno-assert -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class; then + javac_noassert_works=1 + fi + if test -n "$javac_works" && test -n "$javac_noassert_works"; then + rm -f conftestfail.class + if { echo "$as_me:37367: $JAVAC -d . conftestfail.java" >&5 + $JAVAC -d . conftestfail.java >&5 2>&1 + } \ + && test -f conftestfail.class \ + && ! { echo "$as_me:37371: $JAVAC -fno-assert -d . conftestfail.java" >&5 + $JAVAC -fno-assert -d . conftestfail.java >&5 2>&1 + }; then + javac_works= + fi + fi + if test -n "$javac_works"; then + CONF_JAVAC="$JAVAC" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + else + if test -n "$javac_noassert_works"; then + CONF_JAVAC="$JAVAC -fno-assert" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + fi + fi + fi + fi + else + rm -f conftest.class + if { echo "$as_me:37393: $JAVAC -d . conftest.java" >&5 + $JAVAC -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + rm -f conftest.class + rm -f conftestfail.class + if { echo "$as_me:37400: $JAVAC -source $source_version -d . conftest.java" >&5 + $JAVAC -source "$source_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ + && { echo "$as_me:37405: $JAVAC -d . conftestfail.java" >&5 + $JAVAC -d . conftestfail.java >&5 2>&1 + } \ + && test -f conftestfail.class \ + && ! { echo "$as_me:37409: $JAVAC -source $source_version -d . conftestfail.java" >&5 + $JAVAC -source "$source_version" -d . conftestfail.java >&5 2>&1 + }; then + CONF_JAVAC="$JAVAC -source $source_version" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + else + CONF_JAVAC="$JAVAC" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + else + rm -f conftest.class + if { echo "$as_me:37422: $JAVAC -target $target_version -d . conftest.java" >&5 + $JAVAC -target "$target_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + rm -f conftest.class + rm -f conftestfail.class + if { echo "$as_me:37429: $JAVAC -target $target_version -source $source_version -d . conftest.java" >&5 + $JAVAC -target "$target_version" -source "$source_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ + && { echo "$as_me:37434: $JAVAC -target $target_version -d . conftestfail.java" >&5 + $JAVAC -target "$target_version" -d . conftestfail.java >&5 2>&1 + } \ + && test -f conftestfail.class \ + && ! { echo "$as_me:37438: $JAVAC -target $target_version -source $source_version -d . conftestfail.java" >&5 + $JAVAC -target "$target_version" -source "$source_version" -d . conftestfail.java >&5 2>&1 + }; then + CONF_JAVAC="$JAVAC -target $target_version -source $source_version" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + else + CONF_JAVAC="$JAVAC -target $target_version" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + else + rm -f conftest.class + if { echo "$as_me:37451: $JAVAC -target $target_version -source $source_version -d . conftest.java" >&5 + $JAVAC -target "$target_version" -source "$source_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + CONF_JAVAC="$JAVAC -target $target_version -source $source_version" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + fi + fi + fi + fi + if test -z "$HAVE_JAVACOMP"; then + # Extract the first word of "gcj", so it can be a program name with args. +set dummy gcj; ac_word=$2 +: +if ${ac_cv_prog_HAVE_GCJ_IN_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_GCJ_IN_PATH"; then + ac_cv_prog_HAVE_GCJ_IN_PATH="$HAVE_GCJ_IN_PATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_GCJ_IN_PATH="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +HAVE_GCJ_IN_PATH=$ac_cv_prog_HAVE_GCJ_IN_PATH +if test -n "$HAVE_GCJ_IN_PATH"; then + : +else + : +fi + + + # Extract the first word of "javac", so it can be a program name with args. +set dummy javac; ac_word=$2 +: +if ${ac_cv_prog_HAVE_JAVAC_IN_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_JAVAC_IN_PATH"; then + ac_cv_prog_HAVE_JAVAC_IN_PATH="$HAVE_JAVAC_IN_PATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_JAVAC_IN_PATH="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +HAVE_JAVAC_IN_PATH=$ac_cv_prog_HAVE_JAVAC_IN_PATH +if test -n "$HAVE_JAVAC_IN_PATH"; then + : +else + : +fi + + + # Extract the first word of "jikes", so it can be a program name with args. +set dummy jikes; ac_word=$2 +: +if ${ac_cv_prog_HAVE_JIKES_IN_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_JIKES_IN_PATH"; then + ac_cv_prog_HAVE_JIKES_IN_PATH="$HAVE_JIKES_IN_PATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_JIKES_IN_PATH="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +HAVE_JIKES_IN_PATH=$ac_cv_prog_HAVE_JIKES_IN_PATH +if test -n "$HAVE_JIKES_IN_PATH"; then + : +else + : +fi + + + if test -z "$HAVE_JAVACOMP" && test -n "$HAVE_GCJ_IN_PATH"; then + if gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^3\.[01]/d' | grep '^[3-9]' >/dev/null; then + if { echo "$as_me:37569: gcj -C -d . conftestlib.java" >&5 + gcj -C -d . conftestlib.java >&5 2>&1 + }; then + if gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^4\.[012]/d' | grep '^[4-9]' >/dev/null; then + rm -f conftest.class + if { echo "$as_me:37574: gcj -C -d . conftest.java" >&5 + gcj -C -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + rm -f conftest.class + rm -f conftestfail.class + if { echo "$as_me:37581: gcj -C -fsource=$source_version -d . conftest.java" >&5 + gcj -C -fsource="$source_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ + && { echo "$as_me:37586: gcj -C -d . conftestfail.java" >&5 + gcj -C -d . conftestfail.java >&5 2>&1 + } \ + && test -f conftestfail.class \ + && ! { echo "$as_me:37590: gcj -C -fsource=$source_version -d . conftestfail.java" >&5 + gcj -C -fsource="$source_version" -d . conftestfail.java >&5 2>&1 + }; then + CONF_JAVAC="gcj -C -fsource=$source_version" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + else + CONF_JAVAC="gcj -C" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + else + rm -f conftest.class + rm -f conftestfail.class + if { echo "$as_me:37604: gcj -C -fsource=$source_version -ftarget=$target_version -d . conftest.java" >&5 + gcj -C -fsource="$source_version" -ftarget="$target_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + CONF_JAVAC="gcj -C -fsource=$source_version -ftarget=$target_version" + HAVE_JAVAC_ENVVAR=1 + HAVE_JAVACOMP=1 + fi + fi + else + if test "$target_version" = 1.4 && test "$source_version" = 1.4; then + rm -f conftest.class + if { echo "$as_me:37617: gcj -C -d . conftest.java" >&5 + gcj -C -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class; then + CONF_JAVAC="gcj -C" + HAVE_GCJ_C=1 + HAVE_JAVACOMP=1 + fi + else + if test "$target_version" = 1.4 && test "$source_version" = 1.3; then + rm -f conftest.class + if { echo "$as_me:37628: gcj -C -fno-assert -d . conftest.java" >&5 + gcj -C -fno-assert -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class; then + CONF_JAVAC="gcj -C -fno-assert" + HAVE_GCJ_C=1 + HAVE_JAVACOMP=1 + else + rm -f conftest.class + if { echo "$as_me:37637: gcj -C -d . conftest.java" >&5 + gcj -C -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class; then + CONF_JAVAC="gcj -C" + HAVE_GCJ_C=1 + HAVE_JAVACOMP=1 + fi + fi + fi + fi + fi + fi + fi + fi + if test -z "$HAVE_JAVACOMP" && test -n "$HAVE_JAVAC_IN_PATH"; then + if { javac -version >/dev/null 2>/dev/null || test $? -le 2; } \ + && ( if javac -help 2>&1 >/dev/null | grep at.dms.kjc.Main >/dev/null && javac -help 2>/dev/null | grep 'released.*2000' >/dev/null ; then exit 1; else exit 0; fi ); then + rm -f conftest.class + if { echo "$as_me:37656: javac -d . conftest.java" >&5 + javac -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + rm -f conftest.class + rm -f conftestfail.class + if { echo "$as_me:37663: javac -source $source_version -d . conftest.java" >&5 + javac -source "$source_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ + && { echo "$as_me:37668: javac -d . conftestfail.java" >&5 + javac -d . conftestfail.java >&5 2>&1 + } \ + && test -f conftestfail.class \ + && ! { echo "$as_me:37672: javac -source $source_version -d . conftestfail.java" >&5 + javac -source "$source_version" -d . conftestfail.java >&5 2>&1 + }; then + CONF_JAVAC="javac -source $source_version" + HAVE_JAVAC=1 + HAVE_JAVACOMP=1 + else + CONF_JAVAC="javac" + HAVE_JAVAC=1 + HAVE_JAVACOMP=1 + fi + else + rm -f conftest.class + if { echo "$as_me:37685: javac -target $target_version -d . conftest.java" >&5 + javac -target "$target_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + rm -f conftest.class + rm -f conftestfail.class + if { echo "$as_me:37692: javac -target $target_version -source $source_version -d . conftest.java" >&5 + javac -target "$target_version" -source "$source_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ + && { echo "$as_me:37697: javac -target $target_version -d . conftestfail.java" >&5 + javac -target "$target_version" -d . conftestfail.java >&5 2>&1 + } \ + && test -f conftestfail.class \ + && ! { echo "$as_me:37701: javac -target $target_version -source $source_version -d . conftestfail.java" >&5 + javac -target "$target_version" -source "$source_version" -d . conftestfail.java >&5 2>&1 + }; then + CONF_JAVAC="javac -target $target_version -source $source_version" + HAVE_JAVAC=1 + HAVE_JAVACOMP=1 + else + CONF_JAVAC="javac -target $target_version" + HAVE_JAVAC=1 + HAVE_JAVACOMP=1 + fi + else + rm -f conftest.class + if { echo "$as_me:37714: javac -target $target_version -source $source_version -d . conftest.java" >&5 + javac -target "$target_version" -source "$source_version" -d . conftest.java >&5 2>&1 + } \ + && test -f conftest.class \ + && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then + CONF_JAVAC="javac -target $target_version -source $source_version" + HAVE_JAVAC=1 + HAVE_JAVACOMP=1 + fi + fi + fi + fi + fi + if test -z "$HAVE_JAVACOMP" && test -n "$HAVE_JIKES_IN_PATH"; then + if { jikes >/dev/null 2>/dev/null || test $? = 1; } \ + && ( + # See if the existing CLASSPATH is sufficient to make jikes work. + unset JAVA_HOME + jikes conftestlib.java >&5 2>&1 + error=$? + rm -f conftestlib.class + exit $error + ); then + if test "$source_version" = 1.3; then + CONF_JAVAC="jikes" + HAVE_JIKES=1 + HAVE_JAVACOMP=1 + fi + fi + fi + fi + rm -f conftest*.java conftest*.class + if test -n "$HAVE_JAVACOMP"; then + ac_result="$CONF_JAVAC" + else + ac_result="no" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_result" >&5 +$as_echo "$ac_result" >&6; } + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Java virtual machine" >&5 +$as_echo_n "checking for Java virtual machine... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + CLASSPATH_SEPARATOR=';' +else + CLASSPATH_SEPARATOR=':' +fi +rm -f conftest* + + CONF_JAVA= + HAVE_JAVA_ENVVAR= + HAVE_GIJ= + HAVE_JAVA= + HAVE_JRE= + HAVE_JVIEW= + HAVE_JAVAEXEC=1 + if test -n "$JAVA"; then + HAVE_JAVA_ENVVAR=1 + CONF_JAVA="$JAVA" + else + # Extract the first word of "gij", so it can be a program name with args. +set dummy gij; ac_word=$2 +: +if ${ac_cv_prog_HAVE_GIJ_IN_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_GIJ_IN_PATH"; then + ac_cv_prog_HAVE_GIJ_IN_PATH="$HAVE_GIJ_IN_PATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_GIJ_IN_PATH="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +HAVE_GIJ_IN_PATH=$ac_cv_prog_HAVE_GIJ_IN_PATH +if test -n "$HAVE_GIJ_IN_PATH"; then + : +else + : +fi + + + # Extract the first word of "java", so it can be a program name with args. +set dummy java; ac_word=$2 +: +if ${ac_cv_prog_HAVE_JAVA_IN_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_JAVA_IN_PATH"; then + ac_cv_prog_HAVE_JAVA_IN_PATH="$HAVE_JAVA_IN_PATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_JAVA_IN_PATH="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +HAVE_JAVA_IN_PATH=$ac_cv_prog_HAVE_JAVA_IN_PATH +if test -n "$HAVE_JAVA_IN_PATH"; then + : +else + : +fi + + + # Extract the first word of "jre", so it can be a program name with args. +set dummy jre; ac_word=$2 +: +if ${ac_cv_prog_HAVE_JRE_IN_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_JRE_IN_PATH"; then + ac_cv_prog_HAVE_JRE_IN_PATH="$HAVE_JRE_IN_PATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_JRE_IN_PATH="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +HAVE_JRE_IN_PATH=$ac_cv_prog_HAVE_JRE_IN_PATH +if test -n "$HAVE_JRE_IN_PATH"; then + : +else + : +fi + + + # Extract the first word of "jview", so it can be a program name with args. +set dummy jview; ac_word=$2 +: +if ${ac_cv_prog_HAVE_JVIEW_IN_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_JVIEW_IN_PATH"; then + ac_cv_prog_HAVE_JVIEW_IN_PATH="$HAVE_JVIEW_IN_PATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_JVIEW_IN_PATH="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +HAVE_JVIEW_IN_PATH=$ac_cv_prog_HAVE_JVIEW_IN_PATH +if test -n "$HAVE_JVIEW_IN_PATH"; then + : +else + : +fi + + + + export CLASSPATH + if test -n "$HAVE_GIJ_IN_PATH" \ + && gij --version >/dev/null 2>/dev/null \ + ; then + HAVE_GIJ=1 + CONF_JAVA="gij" + else + if test -n "$HAVE_JAVA_IN_PATH" \ + && java -version >/dev/null 2>/dev/null \ + ; then + HAVE_JAVA=1 + CONF_JAVA="java" + else + if test -n "$HAVE_JRE_IN_PATH" \ + && (jre >/dev/null 2>/dev/null || test $? = 1) \ + ; then + HAVE_JRE=1 + CONF_JAVA="jre" + else + if test -n "$HAVE_JVIEW_IN_PATH" \ + && (jview -? >/dev/null 2>/dev/null || test $? = 1) \ + ; then + HAVE_JVIEW=1 + CONF_JAVA="jview" + else + HAVE_JAVAEXEC= + fi + fi + fi + fi + + fi + if test -n "$HAVE_JAVAEXEC"; then + ac_result="$CONF_JAVA" + else + ac_result="no" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_result" >&5 +$as_echo "$ac_result" >&6; } + + + + + + + + + + +ac_config_files="$ac_config_files Makefile po/Makefile.in doc/yacc.1" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GCC_WARNINGS_TRUE}" && test -z "${ENABLE_GCC_WARNINGS_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GCC_WARNINGS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BISON_CXX_WORKS_TRUE}" && test -z "${BISON_CXX_WORKS_FALSE}"; then + as_fn_error $? "conditional \"BISON_CXX_WORKS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_YACC_TRUE}" && test -z "${ENABLE_YACC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_YACC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FLEX_CXX_WORKS_TRUE}" && test -z "${FLEX_CXX_WORKS_FALSE}"; then + as_fn_error $? "conditional \"FLEX_CXX_WORKS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= +if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + +if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +CONFIG_INCLUDE=lib/config.h + + + + + # Tell AC_LIBSOURCES where to find source files like alloca.c. + + + # This hack originated in bison. It is required when using non-recursive + # automake rules to build from gnulib-provided lib/ sources. Hence, LIB_DIR + # is usually simply "lib". Those rules use the list of names like "fchdir.o" + # and "strstr.o" in gl_LIBOBJS. With non-recursive make, we must prefix each + # such file name with the "lib/" prefix. See also build-aux/prefix-gnulib-mk. + gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, , lib/,g'` + + # Listing the names of the variables to prefix is error-prone. + # Rather, adjust each AC_SUBST'd variable whose name ends in '_H' + # and whose value ends in '.h'. + for ac_var in $ac_subst_vars + do + eval "ac_val=\$$ac_var" + case $ac_var:$ac_val in + (*_H:*.h) eval "$ac_var=lib/\$$ac_var";; + esac + done + + +if test -z "${GL_GENERATE_SCHED_H_TRUE}" && test -z "${GL_GENERATE_SCHED_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_SCHED_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + gl_LIBOBJS=$gl_libobjs + + gl_LTLIBOBJS=$gl_ltlibobjs + + + + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + gltests_LIBOBJS=$gltests_libobjs + + gltests_LTLIBOBJS=$gltests_ltlibobjs + + +if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then + as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GNU Bison $as_me 3.0.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration links: +$config_links + +Configuration commands: +$config_commands + +Report bugs to <bug-bison@gnu.org>. +GNU Bison home page: <http://www.gnu.org/software/bison/>. +General help using GNU software: <http://www.gnu.org/gethelp/>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +GNU Bison config.status 3.0.4 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +GNUmakefile=$GNUmakefile +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.in.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; + "javacomp.sh") CONFIG_FILES="$CONFIG_FILES javacomp.sh:build-aux/javacomp.sh.in" ;; + "javaexec.sh") CONFIG_FILES="$CONFIG_FILES javaexec.sh:build-aux/javaexec.sh.in" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "runtime-po/Makefile.in") CONFIG_FILES="$CONFIG_FILES runtime-po/Makefile.in" ;; + "etc/bench.pl") CONFIG_FILES="$CONFIG_FILES etc/bench.pl" ;; + "tests/atconfig") CONFIG_COMMANDS="$CONFIG_COMMANDS tests/atconfig" ;; + "tests/atlocal") CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;; + "tests/bison") CONFIG_FILES="$CONFIG_FILES tests/bison" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "doc/yacc.1") CONFIG_FILES="$CONFIG_FILES doc/yacc.1" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + :L) + # + # CONFIG_LINK + # + + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "po-directories":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + "etc/bench.pl":F) chmod +x etc/bench.pl ;; + "tests/atconfig":C) cat >tests/atconfig <<ATEOF +# Configurable variable values for building test suites. +# Generated by $0. +# Copyright (C) 2012 Free Software Foundation, Inc. + +# The test suite will define top_srcdir=$at_top_srcdir/../.. etc. +at_testdir='tests' +abs_builddir='$ac_abs_builddir' +at_srcdir='$ac_srcdir' +abs_srcdir='$ac_abs_srcdir' +at_top_srcdir='$ac_top_srcdir' +abs_top_srcdir='$ac_abs_top_srcdir' +at_top_build_prefix='$ac_top_build_prefix' +abs_top_builddir='$ac_abs_top_builddir' + +# Backward compatibility with Autotest <= 2.59b: +at_top_builddir=\$at_top_build_prefix + +AUTOTEST_PATH='tests' + +SHELL=\${CONFIG_SHELL-'$SHELL'} +ATEOF + ;; + "tests/bison":F) chmod +x tests/bison ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..6f20040 --- /dev/null +++ b/configure.ac @@ -0,0 +1,253 @@ +# Configure template for GNU Bison. -*-Autoconf-*- +# +# Copyright (C) 2001-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# In order for some versions of Sun Studio to compile our C++ test cases +# correctly, we need Autoconf 2.64 or better to handle the restrict +# keyword in at least string.h from gnulib. We need Autoconf 2.68 or +# better to avoid a typo in the 'configure --help' entry for the YACC +# environment variable. +AC_PREREQ([2.68]) +m4_pattern_forbid([^gl_[A-Z]]) + +AC_INIT([GNU Bison], + m4_esyscmd([build-aux/git-version-gen .tarball-version]), + [bug-bison@gnu.org]) +AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2015]) +AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR], + [The copyright year for this package]) + +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([m4]) + +# We use Automake 1.14's %D% and %C%. +# +# We want gnits strictness only when rolling a stable release. For +# release candidates, we use version strings like 2.4.3_rc1, but gnits +# doesn't like that, so we let the underscore disable gnits. Between +# releases, we want to be able run make dist without being required to +# add a bogus NEWS entry. In that case, the version string +# automatically contains a dash, which we also let disable gnits. +AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc + color-tests parallel-tests + silent-rules] + m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]], + [gnu], [gnits])) +AM_SILENT_RULES([yes]) +AC_CONFIG_HEADERS([lib/config.h:lib/config.in.h]) + +# Checks for the compiler. +AC_PROG_CC_STDC +AC_PROG_CXX + +# Gnulib (early checks). +gl_EARLY + +# Gnulib uses '#pragma GCC diagnostic push' to silence some +# warnings, but older gcc doesn't support this. +AC_CACHE_CHECK([whether pragma GCC diagnostic push works], + [lv_cv_gcc_pragma_push_works], [ + save_CFLAGS=$CFLAGS + CFLAGS='-Wunknown-pragmas -Werror' + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #pragma GCC diagnostic push + #pragma GCC diagnostic pop + ]])], + [lv_cv_gcc_pragma_push_works=yes], + [lv_cv_gcc_pragma_push_works=no]) + CFLAGS=$save_CFLAGS]) + +AC_ARG_ENABLE([gcc-warnings], +[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended). + Also, issue synclines from the examples/ to + the corresponding source in the Texinfo doc.], +[case $enable_gcc_warnings in + yes|no) ;; + *) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);; + esac], + [enable_gcc_warnings=no]) +AM_CONDITIONAL([ENABLE_GCC_WARNINGS], [test "$enable_gcc_warnings" = yes]) +if test "$enable_gcc_warnings" = yes; then + warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align -Wdocumentation + -Wformat -Wpointer-arith -Wwrite-strings' + warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes' + warn_cxx='-Wnoexcept' + # Warnings for the test suite only. + # + # -fno-color-diagnostics: Clang's use of colors in the error + # messages is confusing the tests looking at the compiler's output + # (e.g., synclines.at). + warn_tests='-Wundef -pedantic -Wsign-compare -fno-color-diagnostics' + + AC_LANG_PUSH([C]) + # Clang supports many of GCC's -W options, but only issues warnings + # on the ones it does not recognize. In that case, gl_WARN_ADD + # thinks the option is supported, and unknown options are then added + # to CFLAGS. But then, when -Werror is added in the test suite for + # instance, the warning about the unknown option turns into an + # error. + # + # This should be addressed by gnulib's gl_WARN_ADD, but in the + # meanwhile, turn warnings about unknown options into errors in + # CFLAGS, and restore CFLAGS after the tests. + save_CFLAGS=$CFLAGS + gl_WARN_ADD([-Werror=unknown-warning-option], [CFLAGS]) + for i in $warn_common $warn_c; + do + gl_WARN_ADD([$i], [WARN_CFLAGS]) + done + gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) + + # Warnings for the test suite, and maybe for bison if GCC is modern + # enough. + gl_WARN_ADD([-Wmissing-declarations], [WARN_CFLAGS_TEST]) + gl_WARN_ADD([-Wmissing-prototypes], [WARN_CFLAGS_TEST]) + test $lv_cv_gcc_pragma_push_works = yes && + AS_VAR_APPEND([WARN_CFLAGS], [" $WARN_CFLAGS_TEST"]) + + # Warnings for the test suite only. + for i in $warn_tests; + do + gl_WARN_ADD([$i], [WARN_CFLAGS_TEST]) + done + CFLAGS=$save_CFLAGS + AC_LANG_POP([C]) + + AC_LANG_PUSH([C++]) + save_CXXFLAGS=$CXXFLAGS + gl_WARN_ADD([-Werror=unknown-warning-option], [CXXFLAGS]) + for i in $warn_common $warn_cxx; + do + gl_WARN_ADD([$i], [WARN_CXXFLAGS]) + done + gl_WARN_ADD([-Wzero-as-null-pointer-constant], [WARN_CXXFLAGS], + [AC_LANG_PROGRAM([], [nullptr])]) + gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS]) + # Warnings for the test suite only. + for i in $warn_tests; + do + gl_WARN_ADD([$i], [WARN_CXXFLAGS_TEST]) + done + # Clang++ 3.2+ reject C code generated by Flex. + gl_WARN_ADD([-Wno-null-conversion], [FLEX_SCANNER_CXXFLAGS]) + # So does G++ 4.8... + gl_WARN_ADD([-Wno-sign-compare], [FLEX_SCANNER_CXXFLAGS]) + # ... possiby in std=c++11 mode. + gl_WARN_ADD([-Wno-zero-as-null-pointer-constant], [FLEX_SCANNER_CXXFLAGS]) + CXXFLAGS=$save_CXXFLAGS + AC_LANG_POP([C++]) +fi + +BISON_TEST_FOR_WORKING_C_COMPILER +BISON_C_COMPILER_POSIXLY_CORRECT +BISON_TEST_FOR_WORKING_CXX_COMPILER +BISON_CXX_COMPILER_POSIXLY_CORRECT + +AC_ARG_ENABLE([yacc], + [AC_HELP_STRING([--disable-yacc], + [do not build a yacc command or an -ly library])], + , [enable_yacc=yes]) +AM_CONDITIONAL([ENABLE_YACC], [test "$enable_yacc" = yes]) + +# Checks for programs. +AM_MISSING_PROG([DOT], [dot]) +AC_PROG_LEX +$LEX_IS_FLEX || test "X$LEX" = X: || { + AC_MSG_WARN([bypassing lex because flex is required]) + LEX=: +} +AM_CONDITIONAL([FLEX_CXX_WORKS], + [$LEX_IS_FLEX && test $bison_cv_cxx_works = yes]) +AC_PROG_YACC +AC_PROG_RANLIB +AC_PROG_GNU_M4 +AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.]) +AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define to "-g" if GNU M4 +supports -g, otherwise to "".]) +AC_PATH_PROG([PERL], [perl]) +if test -z "$PERL"; then + AC_MSG_ERROR([perl not found]) +fi +AM_MISSING_PROG([HELP2MAN], [help2man]) +AC_PATH_PROG([XSLTPROC], [xsltproc]) +AC_SUBST([XSLTPROC]) + +# Checks for header files. +AC_CHECK_HEADERS_ONCE([locale.h]) + +# Checks for compiler characteristics. +AC_C_INLINE + +# Gnulib (later checks). Putting them here rather than right after +# gl_EARLY avoids some redundant checks. +gl_INIT + +# Checks for library functions. +AC_CHECK_FUNCS_ONCE([setlocale]) +AM_WITH_DMALLOC +BISON_PREREQ_TIMEVAR + +# Gettext. +# We use gnulib, which is only guaranteed to work properly with the +# latest Gettext. +AM_GNU_GETTEXT([external], [need-ngettext]) +AM_GNU_GETTEXT_VERSION([0.18]) +BISON_I18N + +# Internationalized parsers. +AC_CONFIG_FILES([runtime-po/Makefile.in]) +# Autoconf macros for packages using internationalized parsers. +aclocaldir='${datadir}/aclocal' +AC_SUBST([aclocaldir]) + +# Create the benchmark script. +AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl]) + +# Initialize the test suite. +AC_CONFIG_TESTDIR(tests) +AC_CONFIG_FILES([tests/atlocal]) +AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison]) +AC_CHECK_PROGS([VALGRIND], [valgrind]) +case $VALGRIND:$host_os in + '':*) ;; + *:darwin*) + # See README-hacking. + # VALGRIND+='-q --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind' + VALGRIND=;; + *:*) + suppfile=build-aux/$host_os.valgrind + if test -f "$srcdir/$suppfile"; then + VALGRIND="$VALGRIND --gen-suppressions=all" + VALGRIND="$VALGRIND --suppressions=\$(abs_top_srcdir)/$suppfile" + fi + AC_SUBST([VALGRIND_PREBISON], ["$VALGRIND -q"]) + ;; +esac + +# Whether we cannot run the compiled bison. +AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes]) + +AM_MISSING_PROG([AUTOM4TE], [autom4te]) +# Needed by tests/atlocal.in. +AC_SUBST([GCC]) + +gt_JAVACOMP([1.3], [1.4]) +gt_JAVAEXEC + +AC_CONFIG_FILES([Makefile + po/Makefile.in + doc/yacc.1]) +AC_OUTPUT diff --git a/data/README b/data/README new file mode 100644 index 0000000..4b3e556 --- /dev/null +++ b/data/README @@ -0,0 +1,70 @@ +-*- outline -*- + +This directory contains data needed by Bison. + +* Skeletons +Bison skeletons: the general shapes of the different parser kinds, +that are specialized for specific grammars by the bison program. + +Currently, the supported skeletons are: + +- yacc.c + It used to be named bison.simple: it corresponds to C Yacc + compatible LALR(1) parsers. + +- lalr1.cc + Produces a C++ parser class. + +- lalr1.java + Produces a Java parser class. + +- glr.c + A Generalized LR C parser based on Bison's LALR(1) tables. + +- glr.cc + A Generalized LR C++ parser. Actually a C++ wrapper around glr.c. + +These skeletons are the only ones supported by the Bison team. +Because the interface between skeletons and the bison program is not +finished, *we are not bound to it*. In particular, Bison is not +mature enough for us to consider that "foreign skeletons" are +supported. + +* m4sugar +This directory contains M4sugar, sort of an extended library for M4, +which is used by Bison to instantiate the skeletons. + +* xslt +This directory contains XSLT programs that transform Bison's XML output +into various formats. + +- bison.xsl + A library of routines used by the other XSLT programs. + +- xml2dot.xsl + Conversion into GraphViz's dot format. + +- xml2text.xsl + Conversion into text. + +- xml2xhtml.xsl + Conversion into XHTML. + +----- + +Copyright (C) 2002, 2008-2015 Free Software Foundation, Inc. + +This file is part of GNU Bison. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. diff --git a/data/bison.m4 b/data/bison.m4 new file mode 100644 index 0000000..2000d0f --- /dev/null +++ b/data/bison.m4 @@ -0,0 +1,1065 @@ + -*- Autoconf -*- + +# Language-independent M4 Macros for Bison. + +# Copyright (C) 2002, 2004-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +## ---------------- ## +## Identification. ## +## ---------------- ## + +# b4_copyright(TITLE, [YEARS]) +# ---------------------------- +# If YEARS are not defined, use b4_copyright_years. +m4_define([b4_copyright], +[b4_comment([A Bison parser, made by GNU Bison b4_version.]) + +b4_comment([$1 + +]m4_dquote(m4_text_wrap([Copyright (C) +]m4_ifval([$2], [[$2]], [m4_defn([b4_copyright_years])])[ +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 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>.]) + +b4_comment([As a special exception, you may create a larger work that contains +part or all of the Bison parser skeleton and distribute that work +under terms of your choice, so long as that work isn't itself a +parser generator using the skeleton or a modified version thereof +as a parser skeleton. Alternatively, if you modify or redistribute +the parser skeleton itself, you may (at your option) remove this +special exception, which will cause the skeleton and the resulting +Bison output files to be licensed under the GNU General Public +License without this special exception. + +This special exception was added by the Free Software Foundation in +version 2.2 of Bison.])]) + + +## -------- ## +## Output. ## +## -------- ## + +# b4_output_begin(FILE) +# --------------------- +# Enable output, i.e., send to diversion 0, expand after "#", and +# generate the tag to output into FILE. Must be followed by EOL. +m4_define([b4_output_begin], +[m4_changecom() +m4_divert_push(0)dnl +@output(m4_unquote([$1])@)@dnl +]) + + +# b4_output_end() +# --------------- +# Output nothing, restore # as comment character (no expansions after #). +m4_define([b4_output_end], +[m4_divert_pop(0) +m4_changecom([#]) +]) + + +# b4_divert_kill(CODE) +# -------------------- +# Expand CODE for its side effects, discard its output. +m4_define([b4_divert_kill], +[m4_divert_text([KILL], [$1])]) + + +# b4_define_silent(MACRO, CODE) +# ----------------------------- +# Same as m4_define, but throw away the expansion of CODE. +m4_define([b4_define_silent], +[m4_define([$1], [b4_divert_kill([$2])])]) + + +## ---------------- ## +## Error handling. ## +## ---------------- ## + +# The following error handling macros print error directives that should not +# become arguments of other macro invocations since they would likely then be +# mangled. Thus, they print to stdout directly. + +# b4_cat(TEXT) +# ------------ +# Write TEXT to stdout. Precede the final newline with an @ so that it's +# escaped. For example: +# +# b4_cat([[@complain(invalid input@)]]) +m4_define([b4_cat], +[m4_syscmd([cat <<'_m4eof' +]m4_bpatsubst(m4_dquote($1), [_m4eof], [_m4@`eof])[@ +_m4eof +])dnl +m4_if(m4_sysval, [0], [], [m4_fatal([$0: cannot write to stdout])])]) + +# b4_error(KIND, START, END, FORMAT, [ARG1], [ARG2], ...) +# ------------------------------------------------------- +# Write @KIND(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout. +# +# For example: +# +# b4_error([[complain]], [[input.y:2.3]], [[input.y:5.4]], +# [[invalid %s]], [[foo]]) +m4_define([b4_error], +[b4_cat([[@complain][(]$1[@,]$2[@,]$3[@,]$4[]]dnl +[m4_if([$#], [4], [], + [m4_foreach([b4_arg], + m4_dquote(m4_shift(m4_shift(m4_shift(m4_shift($@))))), + [[@,]b4_arg])])[@)]])]) + +# b4_warn(FORMAT, [ARG1], [ARG2], ...) +# ------------------------------------ +# Write @warn(FORMAT@,ARG1@,ARG2@,...@) to stdout. +# +# For example: +# +# b4_warn([[invalid value for '%s': %s]], [[foo]], [[3]]) +# +# As a simple test suite, this: +# +# m4_divert(-1) +# m4_define([asdf], [ASDF]) +# m4_define([fsa], [FSA]) +# m4_define([fdsa], [FDSA]) +# b4_warn_at([[[asdf), asdf]]], [[[fsa), fsa]]], [[[fdsa), fdsa]]]) +# b4_warn_at([[asdf), asdf]], [[fsa), fsa]], [[fdsa), fdsa]]) +# b4_warn_at() +# b4_warn_at(1) +# b4_warn_at(1, 2) +# +# Should produce this without newlines: +# +# @warn_at([asdf), asdf]@,@,@,[fsa), fsa]@,[fdsa), fdsa]@) +# @warn(asdf), asdf@,@,@,fsa), fsa@,fdsa), fdsa@) +# @warn(@) +# @warn(1@) +# @warn(1@,2@) +m4_define([b4_warn], +[b4_error([[warn]], [], [], $@)]) + +# b4_warn_at(START, END, FORMAT, [ARG1], [ARG2], ...) +# --------------------------------------------------- +# Write @warn(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout. +# +# For example: +# +# b4_warn_at([[input.y:2.3]], [[input.y:5.4]], [[invalid %s]], [[foo]]) +m4_define([b4_warn_at], +[b4_error([[warn]], $@)]) + +# b4_complain(FORMAT, [ARG1], [ARG2], ...) +# ---------------------------------------- +# Bounce to b4_complain_at. +# +# See b4_warn example. +m4_define([b4_complain], +[b4_error([[complain]], [], [], $@)]) + +# b4_complain_at(START, END, FORMAT, [ARG1], [ARG2], ...) +# ------------------------------------------------------- +# Write @complain(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout. +# +# See b4_warn_at example. +m4_define([b4_complain_at], +[b4_error([[complain]], $@)]) + +# b4_fatal(FORMAT, [ARG1], [ARG2], ...) +# ------------------------------------- +# Bounce to b4_fatal_at. +# +# See b4_warn example. +m4_define([b4_fatal], +[b4_error([[fatal]], [], [], $@)dnl +m4_exit(1)]) + +# b4_fatal_at(START, END, FORMAT, [ARG1], [ARG2], ...) +# ---------------------------------------------------- +# Write @fatal(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout and exit. +# +# See b4_warn_at example. +m4_define([b4_fatal_at], +[b4_error([[fatal]], $@)dnl +m4_exit(1)]) + + +## ------------ ## +## Data Types. ## +## ------------ ## + +# b4_ints_in(INT1, INT2, LOW, HIGH) +# --------------------------------- +# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise. +m4_define([b4_ints_in], +[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])]) + + +# b4_subtract(LHS, RHS) +# --------------------- +# Evaluate LHS - RHS if they are integer literals, otherwise expand +# to (LHS) - (RHS). +m4_define([b4_subtract], +[m4_bmatch([$1$2], [^[0123456789]*$], + [m4_eval([$1 - $2])], + [($1) - ($2)])]) + +# b4_join(ARG1, ...) +# _b4_join(ARG1, ...) +# ------------------- +# Join with comma, skipping empty arguments. +# b4_join calls itself recursively until it sees the first non-empty +# argument, then calls _b4_join which prepends each non-empty argument +# with a comma. +m4_define([b4_join], +[m4_if([$#$1], + [1], [], + [m4_ifval([$1], + [$1[]_$0(m4_shift($@))], + [$0(m4_shift($@))])])]) + +# _b4_join(ARGS1, ...) +# -------------------- +m4_define([_b4_join], +[m4_if([$#$1], + [1], [], + [m4_ifval([$1], [, $1])[]$0(m4_shift($@))])]) + + + + +# b4_integral_parser_tables_map(MACRO) +# ------------------------------------- +# Map MACRO on all the integral tables. MACRO is expected to have +# the signature MACRO(TABLE-NAME, CONTENT, COMMENT). +m4_define([b4_integral_parser_tables_map], +[$1([pact], [b4_pact], + [[YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing +STATE-NUM.]]) + +$1([defact], [b4_defact], + [[YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. +Performed when YYTABLE does not specify something else to do. Zero +means the default is an error.]]) + +$1([pgoto], [b4_pgoto], [[YYPGOTO[NTERM-NUM].]]) + +$1([defgoto], [b4_defgoto], [[YYDEFGOTO[NTERM-NUM].]]) + +$1([table], [b4_table], + [[YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If +positive, shift that token. If negative, reduce the rule whose +number is the opposite. If YYTABLE_NINF, syntax error.]]) + +$1([check], [b4_check]) + +$1([stos], [b4_stos], + [[YYSTOS[STATE-NUM] -- The (internal number of the) accessing +symbol of state STATE-NUM.]]) + +$1([r1], [b4_r1], + [[YYR1[YYN] -- Symbol number of symbol that rule YYN derives.]]) + +$1([r2], [b4_r2], + [[YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.]]) +]) + + +# b4_parser_tables_declare +# b4_parser_tables_define +# ------------------------ +# Define/declare the (deterministic) parser tables. +m4_define([b4_parser_tables_declare], +[b4_integral_parser_tables_map([b4_integral_parser_table_declare])]) + +m4_define([b4_parser_tables_define], +[b4_integral_parser_tables_map([b4_integral_parser_table_define])]) + + + +## ------------------ ## +## Decoding options. ## +## ------------------ ## + +# b4_flag_if(FLAG, IF-TRUE, IF-FALSE) +# ----------------------------------- +# Run IF-TRUE if b4_FLAG_flag is 1, IF-FALSE if FLAG is 0, otherwise fail. +m4_define([b4_flag_if], +[m4_case(b4_$1_flag, + [0], [$3], + [1], [$2], + [m4_fatal([invalid $1 value: ]b4_$1_flag)])]) + + +# b4_define_flag_if(FLAG) +# ----------------------- +# Define "b4_FLAG_if(IF-TRUE, IF-FALSE)" that depends on the +# value of the Boolean FLAG. +m4_define([b4_define_flag_if], +[_b4_define_flag_if($[1], $[2], [$1])]) + +# _b4_define_flag_if($1, $2, FLAG) +# -------------------------------- +# Work around the impossibility to define macros inside macros, +# because issuing '[$1]' is not possible in M4. GNU M4 should provide +# $$1 a la M5/TeX. +m4_define([_b4_define_flag_if], +[m4_if([$1$2], $[1]$[2], [], + [m4_fatal([$0: Invalid arguments: $@])])dnl +m4_define([b4_$3_if], + [b4_flag_if([$3], [$1], [$2])])]) + + +# b4_FLAG_if(IF-TRUE, IF-FALSE) +# ----------------------------- +# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise. +b4_define_flag_if([defines]) # Whether headers are requested. +b4_define_flag_if([glr]) # Whether a GLR parser is requested. +b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled. +b4_define_flag_if([token_table]) # Whether yytoken_table is demanded. +b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated. + + +## --------- ## +## Symbols. ## +## --------- ## + +# In order to unify the handling of the various aspects of symbols +# (tag, type_name, whether terminal, etc.), bison.exe defines one +# macro per (token, field), where field can has_id, id, etc.: see +# src/output.c:prepare_symbols_definitions(). +# +# The various FIELDS are: +# +# - has_id: 0 or 1. +# Whether the symbol has an id. +# - id: string +# If has_id, the id. Guaranteed to be usable as a C identifier. +# Prefixed by api.token.prefix if defined. +# - tag: string. +# A representat of the symbol. Can be 'foo', 'foo.id', '"foo"' etc. +# - user_number: integer +# The assigned (external) number as used by yylex. +# - is_token: 0 or 1 +# Whether this is a terminal symbol. +# - number: integer +# The internalized number (used after yytranslate). +# - has_type: 0, 1 +# Whether has a semantic value. +# - type_tag: string +# When api.value.type=union, the generated name for the union member. +# yytype_INT etc. for symbols that has_id, otherwise yytype_1 etc. +# - type +# If it has a semantic value, its type tag, or, if variant are used, +# its type. +# In the case of api.value.type=union, type is the real type (e.g. int). +# - has_printer: 0, 1 +# - printer: string +# - printer_file: string +# - printer_line: integer +# If the symbol has a printer, everything about it. +# - has_destructor, destructor, destructor_file, destructor_line +# Likewise. +# +# The following macros provide access to these values. + +# b4_symbol_(NUM, FIELD) +# ---------------------- +# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if +# undefined. +m4_define([b4_symbol_], +[m4_indir([b4_symbol($1, $2)])]) + + +# b4_symbol(NUM, FIELD) +# --------------------- +# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if +# undefined. If FIELD = id, prepend the token prefix. +m4_define([b4_symbol], +[m4_case([$2], + [id], [m4_do([b4_percent_define_get([api.token.prefix])], + [b4_symbol_([$1], [id])])], + [b4_symbol_($@)])]) + + +# b4_symbol_if(NUM, FIELD, IF-TRUE, IF-FALSE) +# ------------------------------------------- +# If FIELD about symbol #NUM is 1 expand IF-TRUE, if is 0, expand IF-FALSE. +# Otherwise an error. +m4_define([b4_symbol_if], +[m4_case(b4_symbol([$1], [$2]), + [1], [$3], + [0], [$4], + [m4_fatal([$0: field $2 of $1 is not a Boolean:] b4_symbol([$1], [$2]))])]) + + +# b4_symbol_tag_comment(SYMBOL-NUM) +# --------------------------------- +# Issue a comment giving the tag of symbol NUM. +m4_define([b4_symbol_tag_comment], +[b4_comment([b4_symbol([$1], [tag])]) +]) + + +# b4_symbol_action_location(SYMBOL-NUM, KIND) +# ------------------------------------------- +# Report the location of the KIND action as FILE:LINE. +m4_define([b4_symbol_action_location], +[b4_symbol([$1], [$2_file]):b4_syncline([b4_symbol([$1], [$2_line])])]) + + +# b4_symbol_action(SYMBOL-NUM, KIND) +# ---------------------------------- +# Run the action KIND (destructor or printer) for SYMBOL-NUM. +m4_define([b4_symbol_action], +[b4_symbol_if([$1], [has_$2], +[b4_dollar_pushdef([(*yyvaluep)], + b4_symbol_if([$1], [has_type], + [m4_dquote(b4_symbol([$1], [type]))]), + [(*yylocationp)])dnl + b4_symbol_case_([$1])[]dnl +b4_syncline([b4_symbol([$1], [$2_line])], ["b4_symbol([$1], [$2_file])"]) + b4_symbol([$1], [$2]) +b4_syncline([@oline@], [@ofile@]) + break; + +b4_dollar_popdef[]dnl +])]) + + +# b4_symbol_destructor(SYMBOL-NUM) +# b4_symbol_printer(SYMBOL-NUM) +# -------------------------------- +m4_define([b4_symbol_destructor], [b4_symbol_action([$1], [destructor])]) +m4_define([b4_symbol_printer], [b4_symbol_action([$1], [printer])]) + + +# b4_symbol_actions(KIND, [TYPE = yytype]) +# ---------------------------------------- +# Emit the symbol actions for KIND ("printer" or "destructor"). +# Dispatch on TYPE. +m4_define([b4_symbol_actions], +[m4_pushdef([b4_actions_], m4_expand([b4_symbol_foreach([b4_symbol_$1])]))dnl +m4_ifval(m4_defn([b4_actions_]), +[switch (m4_default([$2], [yytype])) + { + m4_defn([b4_actions_]) + default: + break; + }dnl +], +[YYUSE (m4_default([$2], [yytype]));])dnl +m4_popdef([b4_actions_])dnl +]) + +# b4_symbol_case_(SYMBOL-NUM) +# --------------------------- +# Issue a "case NUM" for SYMBOL-NUM. +m4_define([b4_symbol_case_], +[case b4_symbol([$1], [number]): b4_symbol_tag_comment([$1])]) +]) + + +# b4_symbol_foreach(MACRO) +# ------------------------ +# Invoke MACRO(SYMBOL-NUM) for each SYMBOL-NUM. +m4_define([b4_symbol_foreach], + [m4_map([$1], m4_defn([b4_symbol_numbers]))]) + +# b4_symbol_map(MACRO) +# -------------------- +# Return a list (possibly empty elements) of MACRO invoked for each +# SYMBOL-NUM. +m4_define([b4_symbol_map], +[m4_map_args_sep([$1(], [)], [,], b4_symbol_numbers)]) + + +# b4_token_visible_if(NUM, IF-TRUE, IF-FALSE) +# ------------------------------------------- +# Whether NUM denotes a token that has an exported definition (i.e., +# shows in enum yytokentype). +m4_define([b4_token_visible_if], +[b4_symbol_if([$1], [is_token], + [b4_symbol_if([$1], [has_id], [$2], [$3])], + [$3])]) + +# b4_token_has_definition(NUM) +# ---------------------------- +# 1 if NUM is visible, nothing otherwise. +m4_define([b4_token_has_definition], +[b4_token_visible_if([$1], [1])]) + +# b4_any_token_visible_if([IF-TRUE], [IF-FALSE]) +# ---------------------------------------------- +# Whether there is a token that needs to be defined. +m4_define([b4_any_token_visible_if], +[m4_ifval(b4_symbol_foreach([b4_token_has_definition]), + [$1], [$2])]) + + +# b4_token_format(FORMAT, NUM) +# ---------------------------- +m4_define([b4_token_format], +[b4_token_visible_if([$2], +[m4_quote(m4_format([$1], + [b4_symbol([$2], [id])], + [b4_symbol([$2], [user_number])]))])]) + + +## ------- ## +## Types. ## +## ------- ## + +# b4_type_action_(NUMS) +# --------------------- +# Run actions for the symbol NUMS that all have the same type-name. +# Skip NUMS that have no type-name. +# +# To specify the action to run, define b4_dollar_dollar(NUMBER, +# TAG, TYPE). +m4_define([b4_type_action_], +[b4_symbol_if([$1], [has_type], +[m4_map([ b4_symbol_case_], [$@])[]dnl + b4_dollar_dollar([b4_symbol([$1], [number])], + [b4_symbol([$1], [tag])], + [b4_symbol([$1], [type])]); + break; + +])]) + +# b4_type_foreach(MACRO) +# ---------------------- +# Invoke MACRO(SYMBOL-NUMS) for each set of SYMBOL-NUMS for each type set. +m4_define([b4_type_foreach], + [m4_map([$1], m4_defn([b4_type_names]))]) + + + +## ----------- ## +## Synclines. ## +## ----------- ## + +# b4_basename(NAME) +# ----------------- +# Similar to POSIX basename; the differences don't matter here. +# Beware that NAME is not evaluated. +m4_define([b4_basename], +[m4_bpatsubst([$1], [^.*/\([^/]+\)/*$], [\1])]) + + +# b4_syncline(LINE, FILE) +# ----------------------- +m4_define([b4_syncline], +[b4_flag_if([synclines], +[b4_sync_start([$1], [$2]) b4_sync_end([__line__], + [b4_basename(m4_quote(__file__))])[]dnl +])]) + +# b4_sync_start(LINE, FILE) +# ----------------------- +# Syncline for the new place. Typically a directive for the compiler. +m4_define([b4_sync_start], [b4_comment([$2:$1])]) + +# b4_sync_end(LINE, FILE) +# ----------------------- +# Syncline for the current place, which ends. Typically a comment +# left for the reader. +m4_define([b4_sync_end], [b4_comment([$2:$1])]) + + +# b4_user_code(USER-CODE) +# ----------------------- +# Emit code from the user, ending it with synclines. +m4_define([b4_user_code], +[$1 +b4_syncline([@oline@], [@ofile@])]) + + +# b4_define_user_code(MACRO) +# -------------------------- +# From b4_MACRO, build b4_user_MACRO that includes the synclines. +m4_define([b4_define_user_code], +[m4_define([b4_user_$1], +[b4_user_code([b4_$1])])]) + + +# b4_user_actions +# b4_user_initial_action +# b4_user_post_prologue +# b4_user_pre_prologue +# b4_user_union_members +# ---------------------- +# Macros that issue user code, ending with synclines. +b4_define_user_code([actions]) +b4_define_user_code([initial_action]) +b4_define_user_code([post_prologue]) +b4_define_user_code([pre_prologue]) +b4_define_user_code([union_members]) + + +# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE) +# ----------------------------------------------------- +# Complain if any name of type WHAT is used by the user (as recorded in +# USER-LIST) but is not used by Bison (as recorded by macros in the +# namespace BISON-NAMESPACE). +# +# USER-LIST must expand to a list specifying all user occurrences of all names +# of type WHAT. Each item in the list must be a triplet specifying one +# occurrence: name, start boundary, and end boundary. Empty string names are +# fine. An empty list is fine. +# +# For example, to define b4_foo_user_names to be used for USER-LIST with three +# name occurrences and with correct quoting: +# +# m4_define([b4_foo_user_names], +# [[[[[[bar]], [[parser.y:1.7]], [[parser.y:1.16]]]], +# [[[[bar]], [[parser.y:5.7]], [[parser.y:5.16]]]], +# [[[[baz]], [[parser.y:8.7]], [[parser.y:8.16]]]]]]) +# +# The macro BISON-NAMESPACE(bar) must be defined iff the name bar of type WHAT +# is used by Bison (in the front-end or in the skeleton). Empty string names +# are fine, but it would be ugly for Bison to actually use one. +# +# For example, to use b4_foo_bison_names for BISON-NAMESPACE and define that +# the names bar and baz are used by Bison: +# +# m4_define([b4_foo_bison_names(bar)]) +# m4_define([b4_foo_bison_names(baz)]) +# +# To invoke b4_check_user_names with TYPE foo, with USER-LIST +# b4_foo_user_names, with BISON-NAMESPACE b4_foo_bison_names, and with correct +# quoting: +# +# b4_check_user_names([[foo]], [b4_foo_user_names], +# [[b4_foo_bison_names]]) +m4_define([b4_check_user_names], +[m4_foreach([b4_occurrence], $2, +[m4_pushdef([b4_occurrence], b4_occurrence)dnl +m4_pushdef([b4_user_name], m4_car(b4_occurrence))dnl +m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl +m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl +m4_ifndef($3[(]m4_quote(b4_user_name)[)], + [b4_complain_at([b4_start], [b4_end], + [[%s '%s' is not used]], + [$1], [b4_user_name])])[]dnl +m4_popdef([b4_occurrence])dnl +m4_popdef([b4_user_name])dnl +m4_popdef([b4_start])dnl +m4_popdef([b4_end])dnl +])]) + + + +## --------------------- ## +## b4_percent_define_*. ## +## --------------------- ## + + +# b4_percent_define_use(VARIABLE) +# ------------------------------- +# Declare that VARIABLE was used. +m4_define([b4_percent_define_use], +[m4_define([b4_percent_define_bison_variables(]$1[)])dnl +]) + +# b4_percent_define_get(VARIABLE, [DEFAULT]) +# ------------------------------------------ +# Mimic muscle_percent_define_get in ../src/muscle-tab.h. That is, if +# the %define variable VARIABLE is defined, emit its value. Contrary +# to its C counterpart, return DEFAULT otherwise. Also, record +# Bison's usage of VARIABLE by defining +# b4_percent_define_bison_variables(VARIABLE). +# +# For example: +# +# b4_percent_define_get([[foo]]) +m4_define([b4_percent_define_get], +[b4_percent_define_use([$1])dnl +b4_percent_define_ifdef_([$1], + [m4_indir([b4_percent_define(]$1[)])], + [$2])]) + +# b4_percent_define_get_loc(VARIABLE) +# ----------------------------------- +# Mimic muscle_percent_define_get_loc in ../src/muscle-tab.h exactly. That is, +# if the %define variable VARIABLE is undefined, complain fatally since that's +# a Bison or skeleton error. Otherwise, return its definition location in a +# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or +# b4_fatal_at. Don't record this as a Bison usage of VARIABLE as there's no +# reason to suspect that the user-supplied value has yet influenced the output. +# +# For example: +# +# b4_complain_at(b4_percent_define_get_loc([[foo]]), [[invalid foo]]) +m4_define([b4_percent_define_get_loc], +[m4_ifdef([b4_percent_define_loc(]$1[)], + [m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl +b4_loc[]dnl +m4_popdef([b4_loc])], + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) + +# b4_percent_define_get_kind(VARIABLE) +# ------------------------------------ +# Get the kind (code, keyword, string) of VARIABLE, i.e., how its +# value was defined (braces, not delimiters, quotes). +# +# If the %define variable VARIABLE is undefined, complain fatally +# since that's a Bison or skeleton error. Don't record this as a +# Bison usage of VARIABLE as there's no reason to suspect that the +# user-supplied value has yet influenced the output. +m4_define([b4_percent_define_get_kind], +[m4_ifdef([b4_percent_define_kind(]$1[)], + [m4_indir([b4_percent_define_kind(]$1[)])], + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) + +# b4_percent_define_get_syncline(VARIABLE) +# ---------------------------------------- +# Mimic muscle_percent_define_get_syncline in ../src/muscle-tab.h exactly. +# That is, if the %define variable VARIABLE is undefined, complain fatally +# since that's a Bison or skeleton error. Otherwise, return its definition +# location as a b4_syncline invocation. Don't record this as a Bison usage of +# VARIABLE as there's no reason to suspect that the user-supplied value has yet +# influenced the output. +# +# For example: +# +# b4_percent_define_get_syncline([[foo]]) +m4_define([b4_percent_define_get_syncline], +[m4_ifdef([b4_percent_define_syncline(]$1[)], + [m4_indir([b4_percent_define_syncline(]$1[)])], + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) + +# b4_percent_define_ifdef_(VARIABLE, IF-TRUE, [IF-FALSE]) +# ------------------------------------------------------ +# If the %define variable VARIABLE is defined, expand IF-TRUE, else expand +# IF-FALSE. Don't record usage of VARIABLE. +# +# For example: +# +# b4_percent_define_ifdef_([[foo]], [[it's defined]], [[it's undefined]]) +m4_define([b4_percent_define_ifdef_], +[m4_ifdef([b4_percent_define(]$1[)], + [$2], + [$3])]) + +# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE]) +# ------------------------------------------------------ +# Mimic muscle_percent_define_ifdef in ../src/muscle-tab.h exactly. That is, +# if the %define variable VARIABLE is defined, expand IF-TRUE, else expand +# IF-FALSE. Also, record Bison's usage of VARIABLE by defining +# b4_percent_define_bison_variables(VARIABLE). +# +# For example: +# +# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]]) +m4_define([b4_percent_define_ifdef], +[b4_percent_define_ifdef_([$1], + [b4_percent_define_use([$1])$2], + [$3])]) + + +## --------- ## +## Options. ## +## --------- ## + + +# b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE]) +# -------------------------------------------------------- +# Mimic muscle_percent_define_flag_if in ../src/muscle-tab.h exactly. That is, +# if the %define variable VARIABLE is defined to "" or "true", expand IF-TRUE. +# If it is defined to "false", expand IF-FALSE. Complain if it is undefined +# (a Bison or skeleton error since the default value should have been set +# already) or defined to any other value (possibly a user error). Also, record +# Bison's usage of VARIABLE by defining +# b4_percent_define_bison_variables(VARIABLE). +# +# For example: +# +# b4_percent_define_flag_if([[foo]], [[it's true]], [[it's false]]) +m4_define([b4_percent_define_flag_if], +[b4_percent_define_ifdef([$1], + [m4_case(b4_percent_define_get([$1]), + [], [$2], [true], [$2], [false], [$3], + [m4_expand_once([b4_complain_at(b4_percent_define_get_loc([$1]), + [[invalid value for %%define Boolean variable '%s']], + [$1])], + [[b4_percent_define_flag_if($1)]])])], + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) + + +# b4_percent_define_default(VARIABLE, DEFAULT, [KIND = keyword]) +# -------------------------------------------------------------- +# Mimic muscle_percent_define_default in ../src/muscle-tab.h exactly. That is, +# if the %define variable VARIABLE is undefined, set its value to DEFAULT. +# Don't record this as a Bison usage of VARIABLE as there's no reason to +# suspect that the value has yet influenced the output. +# +# For example: +# +# b4_percent_define_default([[foo]], [[default value]]) +m4_define([b4_percent_define_default], +[b4_percent_define_ifdef_([$1], [], + [m4_define([b4_percent_define(]$1[)], [$2])dnl + m4_define([b4_percent_define_kind(]$1[)], + [m4_default([$3], [keyword])])dnl + m4_define([b4_percent_define_loc(]$1[)], + [[[[<skeleton default value>:-1.-1]], + [[<skeleton default value>:-1.-1]]]])dnl + m4_define([b4_percent_define_syncline(]$1[)], [[]])])]) + + +# b4_percent_define_if_define(NAME, [VARIABLE = NAME]) +# ---------------------------------------------------- +# Define b4_NAME_if that executes its $1 or $2 depending whether +# VARIABLE was %defined. The characters '.' and `-' in VARIABLE are mapped +# to '_'. +m4_define([b4_percent_define_if_define_], +[m4_define(m4_bpatsubst([b4_$1_if], [[-.]], [_]), + [b4_percent_define_flag_if(m4_default([$2], [$1]), + [$3], [$4])])]) +m4_define([b4_percent_define_if_define], +[b4_percent_define_default([m4_default([$2], [$1])], [[false]]) +b4_percent_define_if_define_([$1], [$2], $[1], $[2])]) + + +# b4_percent_define_check_kind(VARIABLE, KIND, [DIAGNOSTIC = complain]) +# --------------------------------------------------------------------- +m4_define([b4_percent_define_check_kind], +[b4_percent_define_ifdef_([$1], + [m4_if(b4_percent_define_get_kind([$1]), [$2], [], + [b4_error([m4_default([$3], [complain])], + b4_percent_define_get_loc([$1]), + [m4_case([$2], + [code], [[%%define variable '%s' requires '{...}' values]], + [keyword], [[%%define variable '%s' requires keyword values]], + [string], [[%%define variable '%s' requires '"..."' values]])], + [$1])])])dnl +]) + + +# b4_percent_define_check_values(VALUES) +# -------------------------------------- +# Mimic muscle_percent_define_check_values in ../src/muscle-tab.h exactly +# except that the VALUES structure is more appropriate for M4. That is, VALUES +# is a list of sublists of strings. For each sublist, the first string is the +# name of a %define variable, and all remaining strings in that sublist are the +# valid values for that variable. Complain if such a variable is undefined (a +# Bison error since the default value should have been set already) or defined +# to any other value (possibly a user error). Don't record this as a Bison +# usage of the variable as there's no reason to suspect that the value has yet +# influenced the output. +# +# For example: +# +# b4_percent_define_check_values([[[[foo]], [[foo-value1]], [[foo-value2]]]], +# [[[[bar]], [[bar-value1]]]]) +m4_define([b4_percent_define_check_values], +[m4_foreach([b4_sublist], m4_quote($@), + [_b4_percent_define_check_values(b4_sublist)])]) + +m4_define([_b4_percent_define_check_values], +[b4_percent_define_ifdef_([$1], + [b4_percent_define_check_kind(]$1[, [keyword], [deprecated])dnl + m4_pushdef([b4_good_value], [0])dnl + m4_if($#, 1, [], + [m4_foreach([b4_value], m4_dquote(m4_shift($@)), + [m4_if(m4_indir([b4_percent_define(]$1[)]), b4_value, + [m4_define([b4_good_value], [1])])])])dnl + m4_if(b4_good_value, [0], + [b4_complain_at(b4_percent_define_get_loc([$1]), + [[invalid value for %%define variable '%s': '%s']], + [$1], + m4_dquote(m4_indir([b4_percent_define(]$1[)]))) + m4_foreach([b4_value], m4_dquote(m4_shift($@)), + [b4_error([[note]], b4_percent_define_get_loc([$1]), [] + [[accepted value: '%s']], + m4_dquote(b4_value))])])dnl + m4_popdef([b4_good_value])], + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) + +# b4_percent_code_get([QUALIFIER]) +# -------------------------------- +# If any %code blocks for QUALIFIER are defined, emit them beginning with a +# comment and ending with synclines and a newline. If QUALIFIER is not +# specified or empty, do this for the unqualified %code blocks. Also, record +# Bison's usage of QUALIFIER (if specified) by defining +# b4_percent_code_bison_qualifiers(QUALIFIER). +# +# For example, to emit any unqualified %code blocks followed by any %code +# blocks for the qualifier foo: +# +# b4_percent_code_get +# b4_percent_code_get([[foo]]) +m4_define([b4_percent_code_get], +[m4_pushdef([b4_macro_name], [[b4_percent_code(]$1[)]])dnl +m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl +m4_ifdef(b4_macro_name, +[b4_comment([m4_if([$#], [0], [[Unqualified %code]], + [["%code ]$1["]])[ blocks.]]) +b4_user_code([m4_indir(b4_macro_name)]) +])dnl +m4_popdef([b4_macro_name])]) + +# b4_percent_code_ifdef(QUALIFIER, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------- +# If any %code blocks for QUALIFIER (or unqualified %code blocks if +# QUALIFIER is empty) are defined, expand IF-TRUE, else expand IF-FALSE. +# Also, record Bison's usage of QUALIFIER (if specified) by defining +# b4_percent_code_bison_qualifiers(QUALIFIER). +m4_define([b4_percent_code_ifdef], +[m4_ifdef([b4_percent_code(]$1[)], + [m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])$2], + [$3])]) + + +## ------------------ ## +## Common variables. ## +## ------------------ ## + + +# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT]) +# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT]) +# b4_token_ctor_if([IF-YYLEX-RETURNS-A-TOKEN], [IF-NOT]) +# ---------------------------------------------- +b4_percent_define_if_define([token_ctor], [api.token.constructor]) +b4_percent_define_if_define([locations]) # Whether locations are tracked. +b4_percent_define_if_define([parse.assert]) +b4_percent_define_if_define([parse.trace]) + + +# b4_bison_locations_if([IF-TRUE]) +# -------------------------------- +# Expand IF-TRUE if using locations, and using the default location +# type. +m4_define([b4_bison_locations_if], +[b4_locations_if([b4_percent_define_ifdef([[api.location.type]], [], [$1])])]) + + +# b4_error_verbose_if([IF-ERRORS-ARE-VERBOSE], [IF-NOT]) +# ------------------------------------------------------ +# Map %define parse.error "(simple|verbose)" to b4_error_verbose_if and +# b4_error_verbose_flag. +b4_percent_define_default([[parse.error]], [[simple]]) +b4_percent_define_check_values([[[[parse.error]], + [[simple]], [[verbose]]]]) +m4_define([b4_error_verbose_flag], + [m4_case(b4_percent_define_get([[parse.error]]), + [simple], [[0]], + [verbose], [[1]])]) +b4_define_flag_if([error_verbose]) + +# yytoken_table is needed to support verbose errors. +b4_error_verbose_if([m4_define([b4_token_table_flag], [1])]) + + +# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT]) +# ---------------------------------------------- +b4_percent_define_if_define([variant]) +m4_define([b4_variant_flag], [[0]]) +b4_percent_define_ifdef([[api.value.type]], + [m4_case(b4_percent_define_get_kind([[api.value.type]]), [keyword], + [m4_case(b4_percent_define_get([[api.value.type]]), [variant], + [m4_define([b4_variant_flag], [[1]])])])]) +b4_define_flag_if([variant]) + + +## ----------------------------------------------------------- ## +## After processing the skeletons, check that all the user's ## +## %define variables and %code qualifiers were used by Bison. ## +## ----------------------------------------------------------- ## + +m4_define([b4_check_user_names_wrap], +[m4_ifdef([b4_percent_]$1[_user_]$2[s], + [b4_check_user_names([[%]$1 $2], + [b4_percent_]$1[_user_]$2[s], + [[b4_percent_]$1[_bison_]$2[s]])])]) + +m4_wrap_lifo([ +b4_check_user_names_wrap([[define]], [[variable]]) +b4_check_user_names_wrap([[code]], [[qualifier]]) +]) + + +## ---------------- ## +## Default values. ## +## ---------------- ## + +# m4_define_default([b4_lex_param], []) dnl breaks other skeletons +m4_define_default([b4_pre_prologue], []) +m4_define_default([b4_post_prologue], []) +m4_define_default([b4_epilogue], []) +m4_define_default([b4_parse_param], []) + +# The initial column and line. +m4_define_default([b4_location_initial_column], [1]) +m4_define_default([b4_location_initial_line], [1]) + + +## --------------- ## +## Sanity checks. ## +## --------------- ## + +# api.location.prefix={...} (Java and C++). +b4_percent_define_check_kind([api.location.type], [code], [deprecated]) + +# api.position.prefix={...} (Java). +b4_percent_define_check_kind([api.position.type], [code], [deprecated]) + +# api.prefix >< %name-prefix. +b4_percent_define_check_kind([api.prefix], [code], [deprecated]) +b4_percent_define_ifdef([api.prefix], +[m4_ifdef([b4_prefix], +[b4_complain_at(b4_percent_define_get_loc([api.prefix]), + [['%s' and '%s' cannot be used together]], + [%name-prefix], + [%define api.prefix])])]) + +# api.token.prefix={...} +# Make it a warning for those who used betas of Bison 3.0. +b4_percent_define_check_kind([api.token.prefix], [code], [deprecated]) + +# api.value.type >< %union. +b4_percent_define_ifdef([api.value.type], +[m4_ifdef([b4_union_members], +[b4_complain_at(b4_percent_define_get_loc([api.value.type]), + [['%s' and '%s' cannot be used together]], + [%union], + [%define api.value.type])])]) + +# api.value.type=union >< %yacc. +b4_percent_define_ifdef([api.value.type], +[m4_if(b4_percent_define_get([api.value.type]), [union], +[b4_yacc_if(dnl +[b4_complain_at(b4_percent_define_get_loc([api.value.type]), + [['%s' and '%s' cannot be used together]], + [%yacc], + [%define api.value.type "union"])])])]) + +# api.value.union.name. +b4_percent_define_check_kind([api.value.union.name], [keyword]) diff --git a/data/c++-skel.m4 b/data/c++-skel.m4 new file mode 100644 index 0000000..9117262 --- /dev/null +++ b/data/c++-skel.m4 @@ -0,0 +1,26 @@ + -*- Autoconf -*- + +# C++ skeleton dispatching for Bison. + +# Copyright (C) 2006-2007, 2009-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])]) +b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])]) + +m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.cc]]) +m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) + +m4_include(b4_used_skeleton) diff --git a/data/c++.m4 b/data/c++.m4 new file mode 100644 index 0000000..d176e1a --- /dev/null +++ b/data/c++.m4 @@ -0,0 +1,587 @@ + -*- Autoconf -*- + +# C++ skeleton for Bison + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Sanity checks, before defaults installed by c.m4. +b4_percent_define_ifdef([[api.value.union.name]], + [b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]), + [named %union is invalid in C++])]) + +m4_include(b4_pkgdatadir/[c.m4]) + +# b4_comment(TEXT, [PREFIX]) +# -------------------------- +# Put TEXT in comment. Prefix all the output lines with PREFIX. +m4_define([b4_comment], +[b4_comment_([$1], [$2// ], [$2// ])]) + +## -------- ## +## Checks. ## +## -------- ## + +b4_percent_define_check_kind([api.namespace], [code], [deprecated]) +b4_percent_define_check_kind([parser_class_name], [code], [deprecated]) + +## ---------------- ## +## Default values. ## +## ---------------- ## + +b4_percent_define_default([[parser_class_name]], [[parser]]) + +# Don't do that so that we remember whether we're using a user +# request, or the default value. +# +# b4_percent_define_default([[api.location.type]], [[location]]) + +b4_percent_define_default([[filename_type]], [[std::string]]) +# Make it a warning for those who used betas of Bison 3.0. +b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix])) + +b4_percent_define_default([[global_tokens_and_yystype]], [[false]]) +b4_percent_define_default([[define_location_comparison]], + [m4_if(b4_percent_define_get([[filename_type]]), + [std::string], [[true]], [[false]])]) + + + +## ----------- ## +## Namespace. ## +## ----------- ## + +m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])]) + + +# Don't permit an empty b4_namespace_ref. Any '::parser::foo' appended to it +# would compile as an absolute reference with 'parser' in the global namespace. +# b4_namespace_open would open an anonymous namespace and thus establish +# internal linkage. This would compile. However, it's cryptic, and internal +# linkage for the parser would be specified in all translation units that +# include the header, which is always generated. If we ever need to permit +# internal linkage somehow, surely we can find a cleaner approach. +m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [], +[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]), + [[namespace reference is empty]])]) + +# Instead of assuming the C++ compiler will do it, Bison should reject any +# invalid b4_namepsace_ref that would be converted to a valid +# b4_namespace_open. The problem is that Bison doesn't always output +# b4_namespace_ref to uncommented code but should reserve the ability to do so +# in future releases without risking breaking any existing user grammars. +# Specifically, don't allow empty names as b4_namespace_open would just convert +# those into anonymous namespaces, and that might tempt some users. +m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [], +[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]), + [[namespace reference has consecutive "::"]])]) +m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [], +[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]), + [[namespace reference has a trailing "::"]])]) + +m4_define([b4_namespace_open], +[b4_user_code([b4_percent_define_get_syncline([[api.namespace]]) +[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref), + [^\(.\)[ ]*::], [\1])), + [::], [ { namespace ])[ {]])]) + +m4_define([b4_namespace_close], +[b4_user_code([b4_percent_define_get_syncline([[api.namespace]]) +m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]), + [^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*], + [\1])), + [::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])]) + + +# b4_token_enums +# -------------- +# Output the definition of the tokens as enums. +m4_define([b4_token_enums], +[[enum yytokentype + { + ]m4_join([, + ], + b4_symbol_map([b4_token_enum]))[ + };]dnl +]) + + + + +## ----------------- ## +## Semantic Values. ## +## ----------------- ## + + + +# b4_value_type_declare +# --------------------- +# Declare semantic_type. +m4_define([b4_value_type_declare], +[b4_value_type_setup[]dnl +[ /// Symbol semantic values. +]m4_bmatch(b4_percent_define_get_kind([[api.value.type]]), +[code], +[[ typedef ]b4_percent_define_get([[api.value.type]])[ semantic_type;]], +[m4_bmatch(b4_percent_define_get([[api.value.type]]), +[union\|union-directive], +[[ union semantic_type + { + ]b4_user_union_members[ + };]])])dnl +]) + + +# b4_public_types_declare +# ----------------------- +# Define the public types: token, semantic value, location, and so forth. +# Depending on %define token_lex, may be output in the header or source file. +m4_define([b4_public_types_declare], +[[#ifndef ]b4_api_PREFIX[STYPE +]b4_value_type_declare[ +#else + typedef ]b4_api_PREFIX[STYPE semantic_type; +#endif]b4_locations_if([ + /// Symbol locations. + typedef b4_percent_define_get([[api.location.type]], + [[location]]) location_type;])[ + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m);]b4_locations_if([ + location_type location;])[ + }; + + /// Tokens. + struct token + { + ]b4_token_enums[ + }; + + /// (External) token type, as returned by yylex. + typedef token::yytokentype token_type; + + /// Symbol type: an internal symbol number. + typedef int symbol_number_type; + + /// The symbol type number to denote an empty symbol. + enum { empty_symbol = -2 }; + + /// Internal symbol number for tokens (subsumed by symbol_number_type). + typedef ]b4_int_type_for([b4_translate])[ token_number_type; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol type + /// via type_get(). + /// + /// Provide access to semantic value]b4_locations_if([ and location])[. + template <typename Base> + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol (); + + /// Copy constructor. + basic_symbol (const basic_symbol& other); +]b4_variant_if([[ + /// Constructor for valueless symbols, and symbols from each type. +]b4_type_foreach([b4_basic_symbol_constructor_declare])], [[ + /// Constructor for valueless symbols. + basic_symbol (typename Base::kind_type t]b4_locations_if([, + const location_type& l])[);]])[ + + /// Constructor for symbols with semantic value. + basic_symbol (typename Base::kind_type t, + const semantic_type& v]b4_locations_if([, + const location_type& l])[); + + /// Destroy the symbol. + ~basic_symbol (); + + /// Destroy contents, and record that is empty. + void clear (); + + /// Whether empty. + bool empty () const; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value;]b4_locations_if([ + + /// The location. + location_type location;])[ + + private: + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& other); + }; + + /// Type access provider for token (enum) based symbols. + struct by_type + { + /// Default constructor. + by_type (); + + /// Copy constructor. + by_type (const by_type& other); + + /// The symbol type as needed by the constructor. + typedef token_type kind_type; + + /// Constructor from (external) token numbers. + by_type (kind_type t); + + /// Record that this symbol is empty. + void clear (); + + /// Steal the symbol type from \a that. + void move (by_type& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_number_type type_get () const; + + /// The token. + token_type token () const; + + /// The symbol type. + /// \a empty_symbol when empty. + /// An int, not token_number_type, to be able to store empty_symbol. + int type; + }; + + /// "External" symbols: returned by the scanner. + typedef basic_symbol<by_type> symbol_type; + +]b4_symbol_constructor_declare]) + + +# b4_public_types_define +# ---------------------- +# Provide the implementation needed by the public types. +m4_define([b4_public_types_define], +[[ inline + ]b4_parser_class_name[::syntax_error::syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m) + : std::runtime_error (m)]b4_locations_if([ + , location (l)])[ + {} + + // basic_symbol. + template <typename Base> + inline + ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol () + : value () + {} + + template <typename Base> + inline + ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& other) + : Base (other) + , value ()]b4_locations_if([ + , location (other.location)])[ + { + ]b4_variant_if([b4_symbol_variant([other.type_get ()], [value], [copy], + [other.value])], + [value = other.value;])[ + } + + + template <typename Base> + inline + ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join( + [typename Base::kind_type t], + [const semantic_type& v], + b4_locations_if([const location_type& l]))[) + : Base (t) + , value (]b4_variant_if([], [v])[)]b4_locations_if([ + , location (l)])[ + {]b4_variant_if([[ + (void) v; + ]b4_symbol_variant([this->type_get ()], [value], [copy], [v])])[} + +]b4_variant_if([[ + // Implementation of basic_symbol constructor for each type. +]b4_type_foreach([b4_basic_symbol_constructor_define])], [[ + /// Constructor for valueless symbols. + template <typename Base> + inline + ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join( + [typename Base::kind_type t], + b4_locations_if([const location_type& l]))[) + : Base (t) + , value ()]b4_locations_if([ + , location (l)])[ + {}]])[ + + template <typename Base> + inline + ]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol () + { + clear (); + } + + template <typename Base> + inline + void + ]b4_parser_class_name[::basic_symbol<Base>::clear () + {]b4_variant_if([[ + // User destructor. + symbol_number_type yytype = this->type_get (); + basic_symbol<Base>& yysym = *this; + (void) yysym; + switch (yytype) + { +]b4_symbol_foreach([b4_symbol_destructor])dnl +[ default: + break; + } + + // Type destructor. + ]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[ + Base::clear (); + } + + template <typename Base> + inline + bool + ]b4_parser_class_name[::basic_symbol<Base>::empty () const + { + return Base::type_get () == empty_symbol; + } + + template <typename Base> + inline + void + ]b4_parser_class_name[::basic_symbol<Base>::move (basic_symbol& s) + { + super_type::move(s); + ]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [move], + [s.value])], + [value = s.value;])[]b4_locations_if([ + location = s.location;])[ + } + + // by_type. + inline + ]b4_parser_class_name[::by_type::by_type () + : type (empty_symbol) + {} + + inline + ]b4_parser_class_name[::by_type::by_type (const by_type& other) + : type (other.type) + {} + + inline + ]b4_parser_class_name[::by_type::by_type (token_type t) + : type (yytranslate_ (t)) + {} + + inline + void + ]b4_parser_class_name[::by_type::clear () + { + type = empty_symbol; + } + + inline + void + ]b4_parser_class_name[::by_type::move (by_type& that) + { + type = that.type; + that.clear (); + } + + inline + int + ]b4_parser_class_name[::by_type::type_get () const + { + return type; + } +]b4_token_ctor_if([[ + inline + ]b4_parser_class_name[::token_type + ]b4_parser_class_name[::by_type::token () const + { + // YYTOKNUM[NUM] -- (External) token number corresponding to the + // (internal) symbol number NUM (which must be that of a token). */ + static + const ]b4_int_type_for([b4_toknum])[ + yytoken_number_[] = + { + ]b4_toknum[ + }; + return static_cast<token_type> (yytoken_number_[type]); + } +]])[]dnl +b4_symbol_constructor_define]) + + +# b4_symbol_constructor_declare +# b4_symbol_constructor_define +# ----------------------------- +# Declare/define symbol constructors for all the value types. +# Use at class-level. Redefined in variant.hh. +m4_define([b4_symbol_constructor_declare], []) +m4_define([b4_symbol_constructor_define], []) + + +# b4_yytranslate_define +# --------------------- +# Define yytranslate_. Sometimes used in the header file, +# sometimes in the cc file. +m4_define([b4_yytranslate_define], +[[ // Symbol number corresponding to token number t. + inline + ]b4_parser_class_name[::token_number_type + ]b4_parser_class_name[::yytranslate_ (]b4_token_ctor_if([token_type], + [int])[ t) + { + static + const token_number_type + translate_table[] = + { +]b4_translate[ + }; + const unsigned int user_token_number_max_ = ]b4_user_token_number_max[; + const token_number_type undef_token_ = ]b4_undef_token_number[; + + if (static_cast<int>(t) <= yyeof_) + return yyeof_; + else if (static_cast<unsigned int> (t) <= user_token_number_max_) + return translate_table[t]; + else + return undef_token_; + } +]]) + + +# b4_lhs_value([TYPE]) +# -------------------- +# Expansion of $<TYPE>$. +m4_define([b4_lhs_value], +[b4_symbol_value([yyval], [$1])]) + + +# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) +# -------------------------------------- +# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH +# symbols on RHS. +m4_define([b4_rhs_value], +[b4_symbol_value([yysemantic_stack_@{($1) - ($2)@}], [$3])]) + + +# b4_lhs_location() +# ----------------- +# Expansion of @$. +m4_define([b4_lhs_location], +[(yyloc)]) + + +# b4_rhs_location(RULE-LENGTH, NUM) +# --------------------------------- +# Expansion of @NUM, where the current rule has RULE-LENGTH symbols +# on RHS. +m4_define([b4_rhs_location], +[(yylocation_stack_@{($1) - ($2)@})]) + + +# b4_parse_param_decl +# ------------------- +# Extra formal arguments of the constructor. +# Change the parameter names from "foo" into "foo_yyarg", so that +# there is no collision bw the user chosen attribute name, and the +# argument name in the constructor. +m4_define([b4_parse_param_decl], +[m4_ifset([b4_parse_param], + [m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])]) + +m4_define([b4_parse_param_decl_1], +[$1_yyarg]) + + + +# b4_parse_param_cons +# ------------------- +# Extra initialisations of the constructor. +m4_define([b4_parse_param_cons], + [m4_ifset([b4_parse_param], + [ + b4_cc_constructor_calls(b4_parse_param)])]) +m4_define([b4_cc_constructor_calls], + [m4_map_sep([b4_cc_constructor_call], [, + ], [$@])]) +m4_define([b4_cc_constructor_call], + [$2 ($2_yyarg)]) + +# b4_parse_param_vars +# ------------------- +# Extra instance variables. +m4_define([b4_parse_param_vars], + [m4_ifset([b4_parse_param], + [ + // User arguments. +b4_cc_var_decls(b4_parse_param)])]) +m4_define([b4_cc_var_decls], + [m4_map_sep([b4_cc_var_decl], [ +], [$@])]) +m4_define([b4_cc_var_decl], + [ $1;]) + + +## ---------## +## Values. ## +## ---------## + +# b4_yylloc_default_define +# ------------------------ +# Define YYLLOC_DEFAULT. +m4_define([b4_yylloc_default_define], +[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (/*CONSTCOND*/ false) +# endif +]]) + +## -------- ## +## Checks. ## +## -------- ## + +b4_token_ctor_if([b4_variant_if([], + [b4_fatal_at(b4_percent_define_get_loc(api.token.constructor), + [cannot use '%s' without '%s'], + [%define api.token.constructor], + [%define api.value.type variant]))])]) diff --git a/data/c-like.m4 b/data/c-like.m4 new file mode 100644 index 0000000..ff648a7 --- /dev/null +++ b/data/c-like.m4 @@ -0,0 +1,65 @@ + -*- Autoconf -*- + +# Common code for C-like languages (C, C++, Java, etc.) + +# Copyright (C) 2012-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# b4_comment_(TEXT, OPEN, CONTINUE, END) +# -------------------------------------- +# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines. +# Avoid adding indentation to the first line, as the indentation comes +# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]). +# +# Prefix all the output lines with PREFIX. +m4_define([b4_comment_], +[$2[]m4_bpatsubst(m4_expand([[$1]]), [ +\(.\)], [ +$3\1])$4]) + + +# b4_comment(TEXT, [PREFIX]) +# -------------------------- +# Put TEXT in comment. Prefix all the output lines with PREFIX. +m4_define([b4_comment], +[b4_comment_([$1], [$2/* ], [$2 ], [ */])]) + + + + +# b4_dollar_dollar_(VALUE, FIELD, DEFAULT-FIELD) +# ---------------------------------------------- +# If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD", +# otherwise just VALUE. Be sure to pass "(VALUE)" is VALUE is a +# pointer. +m4_define([b4_dollar_dollar_], +[b4_symbol_value([$1], + m4_if([$2], [[]], + [[$3]], [[$2]]))]) + +# b4_dollar_pushdef(VALUE-POINTER, DEFAULT-FIELD, LOCATION) +# b4_dollar_popdef +# --------------------------------------------------------- +# Define b4_dollar_dollar for VALUE and DEFAULT-FIELD, +# and b4_at_dollar for LOCATION. +m4_define([b4_dollar_pushdef], +[m4_pushdef([b4_dollar_dollar], + [b4_dollar_dollar_([$1], m4_dquote($][1), [$2])])dnl +m4_pushdef([b4_at_dollar], [$3])dnl +]) +m4_define([b4_dollar_popdef], +[m4_popdef([b4_at_dollar])dnl +m4_popdef([b4_dollar_dollar])dnl +]) diff --git a/data/c-skel.m4 b/data/c-skel.m4 new file mode 100644 index 0000000..51fad17 --- /dev/null +++ b/data/c-skel.m4 @@ -0,0 +1,26 @@ + -*- Autoconf -*- + +# C skeleton dispatching for Bison. + +# Copyright (C) 2006-2007, 2009-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])]) +b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])]) + +m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[yacc.c]]) +m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) + +m4_include(b4_used_skeleton) diff --git a/data/c.m4 b/data/c.m4 new file mode 100644 index 0000000..738244d --- /dev/null +++ b/data/c.m4 @@ -0,0 +1,860 @@ + -*- Autoconf -*- + +# C M4 Macros for Bison. + +# Copyright (C) 2002, 2004-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +m4_include(b4_pkgdatadir/[c-like.m4]) + +# b4_tocpp(STRING) +# ---------------- +# Convert STRING into a valid C macro name. +m4_define([b4_tocpp], +[m4_toupper(m4_bpatsubst(m4_quote($1), [[^a-zA-Z0-9]+], [_]))]) + + +# b4_cpp_guard(FILE) +# ------------------ +# A valid C macro name to use as a CPP header guard for FILE. +m4_define([b4_cpp_guard], +[[YY_]b4_tocpp(m4_defn([b4_prefix])/[$1])[_INCLUDED]]) + + +# b4_cpp_guard_open(FILE) +# b4_cpp_guard_close(FILE) +# ------------------------ +# If FILE does not expand to nothing, open/close CPP inclusion guards for FILE. +m4_define([b4_cpp_guard_open], +[m4_ifval(m4_quote($1), +[#ifndef b4_cpp_guard([$1]) +# define b4_cpp_guard([$1])])]) + +m4_define([b4_cpp_guard_close], +[m4_ifval(m4_quote($1), +[#endif b4_comment([!b4_cpp_guard([$1])])])]) + + +## ---------------- ## +## Identification. ## +## ---------------- ## + +# b4_identification +# ----------------- +# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or +# b4_pull_flag if they use the values of the %define variables api.pure or +# api.push-pull. +m4_define([b4_identification], +[[/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "]b4_version[" + +/* Skeleton name. */ +#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[ + +/* Pure parsers. */ +#define YYPURE ]b4_pure_flag])[]m4_ifdef([b4_push_flag], [[ + +/* Push parsers. */ +#define YYPUSH ]b4_push_flag])[]m4_ifdef([b4_pull_flag], [[ + +/* Pull parsers. */ +#define YYPULL ]b4_pull_flag])[ +]]) + + +## ---------------- ## +## Default values. ## +## ---------------- ## + +# b4_api_prefix, b4_api_PREFIX +# ---------------------------- +# Corresponds to %define api.prefix +b4_percent_define_default([[api.prefix]], [[yy]]) +m4_define([b4_api_prefix], +[b4_percent_define_get([[api.prefix]])]) +m4_define([b4_api_PREFIX], +[m4_toupper(b4_api_prefix)]) + + +# b4_prefix +# --------- +# If the %name-prefix is not given, it is api.prefix. +m4_define_default([b4_prefix], [b4_api_prefix]) + +# If the %union is not named, its name is YYSTYPE. +b4_percent_define_default([[api.value.union.name]], + [b4_api_PREFIX[][STYPE]]) + + +## ------------------------ ## +## Pure/impure interfaces. ## +## ------------------------ ## + +# b4_lex_formals +# -------------- +# All the yylex formal arguments. +# b4_lex_param arrives quoted twice, but we want to keep only one level. +m4_define([b4_lex_formals], +[b4_pure_if([[[[YYSTYPE *yylvalp]], [[&yylval]]][]dnl +b4_locations_if([, [[YYLTYPE *yyllocp], [&yylloc]]])])dnl +m4_ifdef([b4_lex_param], [, ]b4_lex_param)]) + + +# b4_lex +# ------ +# Call yylex. +m4_define([b4_lex], +[b4_function_call([yylex], [int], b4_lex_formals)]) + + +# b4_user_args +# ------------ +m4_define([b4_user_args], +[m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])]) + + +# b4_parse_param +# -------------- +# If defined, b4_parse_param arrives double quoted, but below we prefer +# it to be single quoted. +m4_define([b4_parse_param], +b4_parse_param) + + +# b4_parse_param_for(DECL, FORMAL, BODY) +# --------------------------------------- +# Iterate over the user parameters, binding the declaration to DECL, +# the formal name to FORMAL, and evaluating the BODY. +m4_define([b4_parse_param_for], +[m4_foreach([$1_$2], m4_defn([b4_parse_param]), +[m4_pushdef([$1], m4_unquote(m4_car($1_$2)))dnl +m4_pushdef([$2], m4_shift($1_$2))dnl +$3[]dnl +m4_popdef([$2])dnl +m4_popdef([$1])dnl +])]) + +# b4_parse_param_use([VAL], [LOC]) +# -------------------------------- +# 'YYUSE' VAL, LOC if locations are enabled, and all the parse-params. +m4_define([b4_parse_param_use], +[m4_ifvaln([$1], [ YYUSE ([$1]);])dnl +b4_locations_if([m4_ifvaln([$2], [ YYUSE ([$2]);])])dnl +b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal); +])dnl +]) + + +## ------------ ## +## Data Types. ## +## ------------ ## + +# b4_int_type(MIN, MAX) +# --------------------- +# Return the smallest int type able to handle numbers ranging from +# MIN to MAX (included). +m4_define([b4_int_type], +[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char], + b4_ints_in($@, [-128], [127]), [1], [signed char], + + b4_ints_in($@, [0], [65535]), [1], [unsigned short int], + b4_ints_in($@, [-32768], [32767]), [1], [short int], + + m4_eval([0 <= $1]), [1], [unsigned int], + + [int])]) + + +# b4_int_type_for(NAME) +# --------------------- +# Return the smallest int type able to handle numbers ranging from +# 'NAME_min' to 'NAME_max' (included). +m4_define([b4_int_type_for], +[b4_int_type($1_min, $1_max)]) + + +# b4_table_value_equals(TABLE, VALUE, LITERAL) +# -------------------------------------------- +# Without inducing a comparison warning from the compiler, check if the +# literal value LITERAL equals VALUE from table TABLE, which must have +# TABLE_min and TABLE_max defined. +m4_define([b4_table_value_equals], +[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min]) + || m4_indir([b4_]$1[_max]) < $3), [1], + [[0]], + [(!!(($2) == ($3)))])]) + + +## ----------------- ## +## Compiler issues. ## +## ----------------- ## + +# b4_attribute_define +# ------------------- +# Provide portable compiler "attributes". +m4_define([b4_attribute_define], +[#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif +]) + + +## ---------## +## Values. ## +## ---------## + + +# b4_null_define +# -------------- +# Portability issues: define a YY_NULLPTR appropriate for the current +# language (C, C++98, or C++11). +m4_define([b4_null_define], +[# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif[]dnl +]) + + +# b4_null +# ------- +# Return a null pointer constant. +m4_define([b4_null], [YY_NULLPTR]) + +# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT) +# ------------------------------------------------------------- +# Define "yy<TABLE-NAME>" whose contents is CONTENT. +m4_define([b4_integral_parser_table_define], +[m4_ifvaln([$3], [b4_comment([$3], [ ])])dnl +static const b4_int_type_for([$2]) yy$1[[]] = +{ + $2 +};dnl +]) + + +## ------------------------- ## +## Assigning token numbers. ## +## ------------------------- ## + +# b4_token_define(TOKEN-NUM) +# -------------------------- +# Output the definition of this token as #define. +m4_define([b4_token_define], +[b4_token_format([#define %s %s], [$1])]) + +# b4_token_defines +# ---------------- +# Output the definition of the tokens. +m4_define([b4_token_defines], +[b4_any_token_visible_if([/* Tokens. */ +m4_join([ +], b4_symbol_map([b4_token_define])) +])]) + + +# b4_token_enum(TOKEN-NUM) +# ------------------------ +# Output the definition of this token as an enum. +m4_define([b4_token_enum], +[b4_token_format([%s = %s], [$1])]) + + +# b4_token_enums +# -------------- +# Output the definition of the tokens (if there are) as enums. +m4_define([b4_token_enums], +[b4_any_token_visible_if([[/* Token type. */ +#ifndef ]b4_api_PREFIX[TOKENTYPE +# define ]b4_api_PREFIX[TOKENTYPE + enum ]b4_api_prefix[tokentype + { + ]m4_join([, + ], + b4_symbol_map([b4_token_enum]))[ + }; +#endif +]])]) + + +# b4_token_enums_defines +# ---------------------- +# Output the definition of the tokens (if there are any) as enums and, +# if POSIX Yacc is enabled, as #defines. +m4_define([b4_token_enums_defines], +[b4_token_enums[]b4_yacc_if([b4_token_defines])]) + + +## ----------------- ## +## Semantic Values. ## +## ----------------- ## + + +# b4_symbol_value(VAL, [TYPE]) +# ---------------------------- +# Given a semantic value VAL ($$, $1 etc.), extract its value of type +# TYPE if TYPE is given, otherwise just return VAL. The result can be +# used safetly, it is put in parens to avoid nasty precedence issues. +# TYPE is *not* put in braces, provide some if needed. +m4_define([b4_symbol_value], +[($1[]m4_ifval([$2], [.$2]))]) + + + +## ---------------------- ## +## Defining C functions. ## +## ---------------------- ## + + +# b4_function_define(NAME, RETURN-VALUE, [DECL1, NAME1], ...) +# ----------------------------------------------------------- +# Declare the function NAME in C. +m4_define([b4_function_define], +[$2 +$1 (b4_formals(m4_shift2($@)))[]dnl +]) + + +# b4_formals([DECL1, NAME1], ...) +# ------------------------------- +# The formal arguments of a C function definition. +m4_define([b4_formals], +[m4_if([$#], [0], [void], + [$#$1], [1], [void], + [m4_map_sep([b4_formal], [, ], [$@])])]) + +m4_define([b4_formal], +[$1]) + + + +## ----------------------- ## +## Declaring C functions. ## +## ----------------------- ## + + +# b4_function_declare(NAME, RETURN-VALUE, [DECL1, NAME1], ...) +# ------------------------------------------------------------ +# Declare the function NAME. +m4_define([b4_function_declare], +[$2 $1 (b4_formals(m4_shift2($@)));[]dnl +]) + + + + +## --------------------- ## +## Calling C functions. ## +## --------------------- ## + + +# b4_function_call(NAME, RETURN-VALUE, [DECL1, NAME1], ...) +# ----------------------------------------------------------- +# Call the function NAME with arguments NAME1, NAME2 etc. +m4_define([b4_function_call], +[$1 (b4_args(m4_shift2($@)))[]dnl +]) + + +# b4_args([DECL1, NAME1], ...) +# ---------------------------- +# Output the arguments NAME1, NAME2... +m4_define([b4_args], +[m4_map_sep([b4_arg], [, ], [$@])]) + +m4_define([b4_arg], +[$2]) + + +## ----------- ## +## Synclines. ## +## ----------- ## + +# b4_sync_start(LINE, FILE) +# ------------------------- +m4_define([b4_sync_start], [[#]line $1 $2]) + + +## -------------- ## +## User actions. ## +## -------------- ## + +# b4_case(LABEL, STATEMENTS) +# -------------------------- +m4_define([b4_case], +[ case $1: +$2 +b4_syncline([@oline@], [@ofile@]) + break;]) + + +# b4_predicate_case(LABEL, CONDITIONS) +# ------------------------------------ +m4_define([b4_predicate_case], +[ case $1: + if (! ($2)) YYERROR; +b4_syncline([@oline@], [@ofile@]) + break;]) + + +# b4_yydestruct_define +# -------------------- +# Define the "yydestruct" function. +m4_define_default([b4_yydestruct_define], +[[/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +]b4_function_define([yydestruct], + [static void], + [[const char *yymsg], [yymsg]], + [[int yytype], [yytype]], + [[YYSTYPE *yyvaluep], [yyvaluep]][]dnl +b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl +m4_ifset([b4_parse_param], [, b4_parse_param]))[ +{ +]b4_parse_param_use([yyvaluep], [yylocationp])dnl +[ if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + ]b4_symbol_actions([destructor])[ + YY_IGNORE_MAYBE_UNINITIALIZED_END +}]dnl +]) + + +# b4_yy_symbol_print_define +# ------------------------- +# Define the "yy_symbol_print" function. +m4_define_default([b4_yy_symbol_print_define], +[[ +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +]b4_function_define([yy_symbol_value_print], + [static void], + [[FILE *yyoutput], [yyoutput]], + [[int yytype], [yytype]], + [[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl +b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl +m4_ifset([b4_parse_param], [, b4_parse_param]))[ +{ + FILE *yyo = yyoutput; +]b4_parse_param_use([yyo], [yylocationp])dnl +[ if (!yyvaluep) + return;] +dnl glr.c does not feature yytoknum. +m4_if(b4_skeleton, ["yacc.c"], +[[# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif +]])dnl + b4_symbol_actions([printer])[ +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +]b4_function_define([yy_symbol_print], + [static void], + [[FILE *yyoutput], [yyoutput]], + [[int yytype], [yytype]], + [[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl +b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl +m4_ifset([b4_parse_param], [, b4_parse_param]))[ +{ + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + +]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp); + YYFPRINTF (yyoutput, ": "); +])dnl +[ yy_symbol_value_print (yyoutput, yytype, yyvaluep]dnl +b4_locations_if([, yylocationp])[]b4_user_args[); + YYFPRINTF (yyoutput, ")"); +}]dnl +]) + + +## ---------------- ## +## api.value.type. ## +## ---------------- ## + + +# ---------------------- # +# api.value.type=union. # +# ---------------------- # + +# b4_symbol_type_register(SYMBOL-NUM) +# ----------------------------------- +# Symbol SYMBOL-NUM has a type (for variant) instead of a type-tag. +# Extend the definition of %union's body (b4_union_members) with a +# field of that type, and extend the symbol's "type" field to point to +# the field name, instead of the type name. +m4_define([b4_symbol_type_register], +[m4_define([b4_symbol($1, type_tag)], + [b4_symbol_if([$1], [has_id], + [b4_symbol([$1], [id])], + [yytype_[]b4_symbol([$1], [number])])])dnl +m4_append([b4_union_members], +m4_expand([ + b4_symbol_tag_comment([$1])dnl + b4_symbol([$1], [type]) b4_symbol([$1], [type_tag]);])) +]) + + +# b4_type_define_tag(SYMBOL1-NUM, ...) +# ------------------------------------ +# For the batch of symbols SYMBOL1-NUM... (which all have the same +# type), enhance the %union definition for each of them, and set +# there "type" field to the field tag name, instead of the type name. +m4_define([b4_type_define_tag], +[b4_symbol_if([$1], [has_type], + [m4_map([b4_symbol_type_register], [$@])]) +]) + + +# b4_symbol_value_union(VAL, [TYPE]) +# ---------------------------------- +# Same of b4_symbol_value, but when api.value.type=union. +m4_define([b4_symbol_value_union], +[m4_ifval([$2], + [(*($2*)(&$1))], + [$1])]) +]) + + +# b4_value_type_setup_union +# ------------------------- +# Setup support for api.value.type=union. Symbols are defined with a +# type instead of a union member name: build the corresponding union, +# and give the symbols their tag. +m4_define([b4_value_type_setup_union], +[m4_define([b4_union_members]) +b4_type_foreach([b4_type_define_tag]) +m4_copy_force([b4_symbol_value_union], [b4_symbol_value]) +]) + + +# -------------------------- # +# api.value.type = variant. # +# -------------------------- # + +# b4_value_type_setup_variant +# --------------------------- +# Setup support for api.value.type=variant. By default, fail, specialized +# by other skeletons. +m4_define([b4_value_type_setup_variant], +[b4_complain_at(b4_percent_define_get_loc([[api.value.type]]), + [['%s' does not support '%s']], + [b4_skeleton], + [%define api.value.type variant])]) + + +# _b4_value_type_setup_keyword +# ---------------------------- +# api.value.type is defined with a keyword/string syntax. Check if +# that is properly defined, and prepare its use. +m4_define([_b4_value_type_setup_keyword], +[b4_percent_define_check_values([[[[api.value.type]], + [[none]], + [[union]], + [[union-directive]], + [[variant]], + [[yystype]]]])dnl +m4_case(b4_percent_define_get([[api.value.type]]), + [union], [b4_value_type_setup_union], + [variant], [b4_value_type_setup_variant])]) + + +# b4_value_type_setup +# ------------------- +# Check if api.value.type is properly defined, and possibly prepare +# its use. +b4_define_silent([b4_value_type_setup], +[# Define default value. +b4_percent_define_ifdef([[api.value.type]], [], +[# %union => api.value.type=union-directive +m4_ifdef([b4_union_members], +[m4_define([b4_percent_define_kind(api.value.type)], [keyword]) +m4_define([b4_percent_define(api.value.type)], [union-directive])], +[# no tag seen => api.value.type={int} +m4_if(b4_tag_seen_flag, 0, +[m4_define([b4_percent_define_kind(api.value.type)], [code]) +m4_define([b4_percent_define(api.value.type)], [int])], +[# otherwise api.value.type=yystype +m4_define([b4_percent_define_kind(api.value.type)], [keyword]) +m4_define([b4_percent_define(api.value.type)], [yystype])])])]) + +# Set up. +m4_bmatch(b4_percent_define_get_kind([[api.value.type]]), + [keyword\|string], [_b4_value_type_setup_keyword]) +]) + + +## -------------- ## +## Declarations. ## +## -------------- ## + + +# b4_value_type_define +# -------------------- +m4_define([b4_value_type_define], +[b4_value_type_setup[]dnl +/* Value type. */ +m4_bmatch(b4_percent_define_get_kind([[api.value.type]]), +[code], +[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED +typedef ]b4_percent_define_get([[api.value.type]])[ ]b4_api_PREFIX[STYPE; +# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1 +# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1 +#endif +]], +[m4_bmatch(b4_percent_define_get([[api.value.type]]), +[union\|union-directive], +[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED +]b4_percent_define_get_syncline([[api.value.union.name]])[ +union ]b4_percent_define_get([[api.value.union.name]])[ +{ +]b4_user_union_members[ +}; +]b4_percent_define_get_syncline([[api.value.union.name]])[ +typedef union ]b4_percent_define_get([[api.value.union.name]])[ ]b4_api_PREFIX[STYPE; +# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1 +# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1 +#endif +]])])]) + + +# b4_location_type_define +# ----------------------- +m4_define([b4_location_type_define], +[[/* Location type. */ +#if ! defined ]b4_api_PREFIX[LTYPE && ! defined ]b4_api_PREFIX[LTYPE_IS_DECLARED +typedef struct ]b4_api_PREFIX[LTYPE ]b4_api_PREFIX[LTYPE; +struct ]b4_api_PREFIX[LTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +}; +# define ]b4_api_PREFIX[LTYPE_IS_DECLARED 1 +# define ]b4_api_PREFIX[LTYPE_IS_TRIVIAL 1 +#endif +]]) + + +# b4_declare_yylstype +# ------------------- +# Declarations that might either go into the header (if --defines) or +# in the parser body. Declare YYSTYPE/YYLTYPE, and yylval/yylloc. +m4_define([b4_declare_yylstype], +[b4_value_type_define[]b4_locations_if([ +b4_location_type_define]) + +b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval; +]b4_locations_if([[extern ]b4_api_PREFIX[LTYPE ]b4_prefix[lloc;]])])[]dnl +]) + + +# b4_YYDEBUG_define +# ----------------- +m4_define([b4_YYDEBUG_define], +[[/* Debug traces. */ +]m4_if(b4_api_prefix, [yy], +[[#ifndef YYDEBUG +# define YYDEBUG ]b4_parse_trace_if([1], [0])[ +#endif]], +[[#ifndef ]b4_api_PREFIX[DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define ]b4_api_PREFIX[DEBUG 1 +# else +# define ]b4_api_PREFIX[DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define ]b4_api_PREFIX[DEBUG ]b4_parse_trace_if([1], [0])[ +# endif /* ! defined YYDEBUG */ +#endif /* ! defined ]b4_api_PREFIX[DEBUG */]])[]dnl +]) + +# b4_declare_yydebug +# ------------------ +m4_define([b4_declare_yydebug], +[b4_YYDEBUG_define[ +#if ]b4_api_PREFIX[DEBUG +extern int ]b4_prefix[debug; +#endif][]dnl +]) + +# b4_yylloc_default_define +# ------------------------ +# Define YYLLOC_DEFAULT. +m4_define([b4_yylloc_default_define], +[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) +#endif +]]) + +# b4_yy_location_print_define +# --------------------------- +# Define YY_LOCATION_PRINT. +m4_define([b4_yy_location_print_define], +[b4_locations_if([[ +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL + +/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ + +YY_ATTRIBUTE_UNUSED +]b4_function_define([yy_location_print_], + [static unsigned], + [[FILE *yyo], [yyo]], + [[YYLTYPE const * const yylocp], [yylocp]])[ +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); + } + return res; + } + +# define YY_LOCATION_PRINT(File, Loc) \ + yy_location_print_ (File, &(Loc)) + +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif]], +[[/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif]]) +]) + +# b4_yyloc_default +# ---------------- +# Expand to a possible default value for yylloc. +m4_define([b4_yyloc_default], +[[ +# if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL + = { ]m4_join([, ], + m4_defn([b4_location_initial_line]), + m4_defn([b4_location_initial_column]), + m4_defn([b4_location_initial_line]), + m4_defn([b4_location_initial_column]))[ } +# endif +]]) diff --git a/data/glr.c b/data/glr.c new file mode 100644 index 0000000..2b074cd --- /dev/null +++ b/data/glr.c @@ -0,0 +1,2585 @@ + -*- C -*- + +# GLR skeleton for Bison + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# If we are loaded by glr.cc, do not override c++.m4 definitions by +# those of c.m4. +m4_if(b4_skeleton, ["glr.c"], + [m4_include(b4_pkgdatadir/[c.m4])]) + +## ---------------- ## +## Default values. ## +## ---------------- ## + +# Stack parameters. +m4_define_default([b4_stack_depth_max], [10000]) +m4_define_default([b4_stack_depth_init], [200]) + + + +## ------------------------ ## +## Pure/impure interfaces. ## +## ------------------------ ## + +b4_define_flag_if([pure]) +# If glr.cc is including this file and thus has already set b4_pure_flag, +# do not change the value of b4_pure_flag, and do not record a use of api.pure. +m4_ifndef([b4_pure_flag], +[b4_percent_define_default([[api.pure]], [[false]]) + m4_define([b4_pure_flag], + [b4_percent_define_flag_if([[api.pure]], [[1]], [[0]])])]) + +# b4_user_formals +# --------------- +# The possible parse-params formal arguments preceded by a comma. +# +# This is not shared with yacc.c in c.m4 because GLR relies on ISO C +# formal argument declarations. +m4_define([b4_user_formals], +[m4_ifset([b4_parse_param], [, b4_formals(b4_parse_param)])]) + + +# b4_yyerror_args +# --------------- +# Optional effective arguments passed to yyerror: user args plus yylloc, and +# a trailing comma. +m4_define([b4_yyerror_args], +[b4_pure_if([b4_locations_if([yylocp, ])])dnl +m4_ifset([b4_parse_param], [b4_args(b4_parse_param), ])]) + + +# b4_lyyerror_args +# ---------------- +# Same as above, but on the lookahead, hence &yylloc instead of yylocp. +m4_define([b4_lyyerror_args], +[b4_pure_if([b4_locations_if([&yylloc, ])])dnl +m4_ifset([b4_parse_param], [b4_args(b4_parse_param), ])]) + + +# b4_pure_args +# ------------ +# Same as b4_yyerror_args, but with a leading comma. +m4_define([b4_pure_args], +[b4_pure_if([b4_locations_if([, yylocp])])[]b4_user_args]) + + +# b4_lpure_args +# ------------- +# Same as above, but on the lookahead, hence &yylloc instead of yylocp. +m4_define([b4_lpure_args], +[b4_pure_if([b4_locations_if([, &yylloc])])[]b4_user_args]) + + + +# b4_pure_formals +# --------------- +# Arguments passed to yyerror: user formals plus yylocp with leading comma. +m4_define([b4_pure_formals], +[b4_pure_if([b4_locations_if([, YYLTYPE *yylocp])])[]b4_user_formals]) + + +# b4_locuser_formals(LOC = yylocp) +# -------------------------------- +m4_define([b4_locuser_formals], +[b4_locations_if([, YYLTYPE *m4_default([$1], [yylocp])])[]b4_user_formals]) + + +# b4_locuser_args(LOC = yylocp) +# ----------------------------- +m4_define([b4_locuser_args], +[b4_locations_if([, m4_default([$1], [yylocp])])[]b4_user_args]) + + + +## ----------------- ## +## Semantic Values. ## +## ----------------- ## + + +# b4_lhs_value([TYPE]) +# -------------------- +# Expansion of $<TYPE>$. +m4_define([b4_lhs_value], +[b4_symbol_value([(*yyvalp)], [$1])]) + + +# b4_rhs_data(RULE-LENGTH, NUM) +# ----------------------------- +# Expand to the semantic stack place that contains value and location +# of symbol number NUM in a rule of length RULE-LENGTH. +m4_define([b4_rhs_data], +[((yyGLRStackItem const *)yyvsp)@{YYFILL (b4_subtract([$2], [$1]))@}.yystate]) + + +# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) +# -------------------------------------- +# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH +# symbols on RHS. +m4_define([b4_rhs_value], +[b4_symbol_value([b4_rhs_data([$1], [$2]).yysemantics.yysval], [$3])]) + + + +## ----------- ## +## Locations. ## +## ----------- ## + +# b4_lhs_location() +# ----------------- +# Expansion of @$. +m4_define([b4_lhs_location], +[(*yylocp)]) + + +# b4_rhs_location(RULE-LENGTH, NUM) +# --------------------------------- +# Expansion of @NUM, where the current rule has RULE-LENGTH symbols +# on RHS. +m4_define([b4_rhs_location], +[(b4_rhs_data([$1], [$2]).yyloc)]) + + +## -------------- ## +## Declarations. ## +## -------------- ## + +# b4_shared_declarations +# ---------------------- +# Declaration that might either go into the header (if --defines) +# or open coded in the parser body. glr.cc has its own definition. +m4_if(b4_skeleton, ["glr.c"], +[m4_define([b4_shared_declarations], +[b4_declare_yydebug[ +]b4_percent_code_get([[requires]])[ +]b4_token_enums[ +]b4_declare_yylstype[ +]b4_function_declare(b4_prefix[parse], [int], b4_parse_param)[ +]b4_percent_code_get([[provides]])[]dnl +]) +]) + +## -------------- ## +## Output files. ## +## -------------- ## + +# Unfortunately the order of generation between the header and the +# implementation file matters (for glr.c) because of the current +# implementation of api.value.type=union. In that case we still use a +# union for YYSTYPE, but we generate the contents of this union when +# setting up YYSTYPE. This is needed for other aspects, such as +# defining yy_symbol_value_print, since we need to now the name of the +# members of this union. +# +# To avoid this issue, just generate the header before the +# implementation file. But we should also make them more independant. + +# ----------------- # +# The header file. # +# ----------------- # + +# glr.cc produces its own header. +m4_if(b4_skeleton, ["glr.c"], +[b4_defines_if( +[b4_output_begin([b4_spec_defines_file]) +b4_copyright([Skeleton interface for Bison GLR parsers in C], + [2002-2015])[ + +]b4_cpp_guard_open([b4_spec_defines_file])[ +]b4_shared_declarations[ +]b4_cpp_guard_close([b4_spec_defines_file])[ +]b4_output_end() +])]) + + +# ------------------------- # +# The implementation file. # +# ------------------------- # + +b4_output_begin([b4_parser_file_name]) +b4_copyright([Skeleton implementation for Bison GLR parsers in C], + [2002-2015])[ + +/* C GLR parser skeleton written by Paul Hilfinger. */ + +]b4_identification + +b4_percent_code_get([[top]])[ +]m4_if(b4_api_prefix, [yy], [], +[[/* Substitute the type names. */ +#define YYSTYPE ]b4_api_PREFIX[STYPE]b4_locations_if([[ +#define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[ +]m4_if(b4_prefix, [yy], [], +[[/* Substitute the variable and function names. */ +#define yyparse ]b4_prefix[parse +#define yylex ]b4_prefix[lex +#define yyerror ]b4_prefix[error +#define yydebug ]b4_prefix[debug +]]b4_pure_if([], [[ +#define yylval ]b4_prefix[lval +#define yychar ]b4_prefix[char +#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ +#define yylloc ]b4_prefix[lloc]])]))[ + +/* First part of user declarations. */ +]b4_user_pre_prologue[ + +]b4_null_define[ + +]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]], + [b4_shared_declarations])[ + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE ]b4_error_verbose_if([1], [0])[ +#endif + +/* Default (constant) value used for initialization for null + right-hand sides. Unlike the standard yacc.c template, here we set + the default value of $$ to a zeroed-out value. Since the default + value is undefined, this behavior is technically correct. */ +static YYSTYPE yyval_default;]b4_locations_if([[ +static YYLTYPE yyloc_default][]b4_yyloc_default;])[ + +/* Copy the second part of user declarations. */ +]b4_user_post_prologue +b4_percent_code_get[]dnl + +[#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YYFREE +# define YYFREE free +#endif +#ifndef YYMALLOC +# define YYMALLOC malloc +#endif +#ifndef YYREALLOC +# define YYREALLOC realloc +#endif + +#define YYSIZEMAX ((size_t) -1) + +#ifdef __cplusplus + typedef bool yybool; +#else + typedef unsigned char yybool; +#endif +#define yytrue 1 +#define yyfalse 0 + +#ifndef YYSETJMP +# include <setjmp.h> +# define YYJMP_BUF jmp_buf +# define YYSETJMP(Env) setjmp (Env) +/* Pacify clang. */ +# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0)) +#endif + +]b4_attribute_define[ + +#ifndef YYASSERT +# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0))) +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL ]b4_final_state_number[ +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST ]b4_last[ + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS ]b4_tokens_number[ +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS ]b4_nterms_number[ +/* YYNRULES -- Number of rules. */ +#define YYNRULES ]b4_rules_number[ +/* YYNRULES -- Number of states. */ +#define YYNSTATES ]b4_states_number[ +/* YYMAXRHS -- Maximum number of symbols on right-hand side of rule. */ +#define YYMAXRHS ]b4_r2_max[ +/* YYMAXLEFT -- Maximum number of symbols to the left of a handle + accessed by $0, $-1, etc., in any rule. */ +#define YYMAXLEFT ]b4_max_left_semantic_context[ + +/* YYTRANSLATE(X) -- Bison symbol number corresponding to X. */ +#define YYUNDEFTOK ]b4_undef_token_number[ +#define YYMAXUTOK ]b4_user_token_number_max[ + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const ]b4_int_type_for([b4_translate])[ yytranslate[] = +{ + ]b4_translate[ +}; + +#if ]b4_api_PREFIX[DEBUG +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const ]b4_int_type_for([b4_rline])[ yyrline[] = +{ + ]b4_rline[ +}; +#endif + +#if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[ +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + ]b4_tname[ +}; +#endif + +#define YYPACT_NINF ]b4_pact_ninf[ +#define YYTABLE_NINF ]b4_table_ninf[ + +]b4_parser_tables_define[ + +/* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none). */ +static const ]b4_int_type_for([b4_dprec])[ yydprec[] = +{ + ]b4_dprec[ +}; + +/* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM. */ +static const ]b4_int_type_for([b4_merger])[ yymerger[] = +{ + ]b4_merger[ +}; + +/* YYIMMEDIATE[RULE-NUM] -- True iff rule #RULE-NUM is not to be deferred, as + in the case of predicates. */ +static const yybool yyimmediate[] = +{ + ]b4_immediate[ +}; + +/* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of + list of conflicting reductions corresponding to action entry for + state STATE-NUM in yytable. 0 means no conflicts. The list in + yyconfl is terminated by a rule number of 0. */ +static const ]b4_int_type_for([b4_conflict_list_heads])[ yyconflp[] = +{ + ]b4_conflict_list_heads[ +}; + +/* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by + 0, pointed into by YYCONFLP. */ +]dnl Do not use b4_int_type_for here, since there are places where +dnl pointers onto yyconfl are taken, whose type is "short int *". +dnl We probably ought to introduce a type for confl. +[static const short int yyconfl[] = +{ + ]b4_conflicting_rules[ +}; + +/* Error token number */ +#define YYTERROR 1 + +]b4_locations_if([[ +]b4_yylloc_default_define[ +# define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc) +]])[ + +]b4_pure_if( +[ +#undef yynerrs +#define yynerrs (yystackp->yyerrcnt) +#undef yychar +#define yychar (yystackp->yyrawchar) +#undef yylval +#define yylval (yystackp->yyval) +#undef yylloc +#define yylloc (yystackp->yyloc) +m4_if(b4_prefix[], [yy], [], +[#define b4_prefix[]nerrs yynerrs +#define b4_prefix[]char yychar +#define b4_prefix[]lval yylval +#define b4_prefix[]lloc yylloc])], +[YYSTYPE yylval;]b4_locations_if([[ +YYLTYPE yylloc;]])[ + +int yynerrs; +int yychar;])[ + +static const int YYEOF = 0; +static const int YYEMPTY = -2; + +typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG; + +#define YYCHK(YYE) \ + do { \ + YYRESULTTAG yychk_flag = YYE; \ + if (yychk_flag != yyok) \ + return yychk_flag; \ + } while (0) + +#if ]b4_api_PREFIX[DEBUG + +# ifndef YYFPRINTF +# define YYFPRINTF fprintf +# endif + +]b4_yy_location_print_define[ + +# define YYDPRINTF(Args) \ + do { \ + if (yydebug) \ + YYFPRINTF Args; \ + } while (0) + +]b4_yy_symbol_print_define[ + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \ + YYFPRINTF (stderr, "\n"); \ + } \ + } while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; + +struct yyGLRStack; +static void yypstack (struct yyGLRStack* yystackp, size_t yyk) + YY_ATTRIBUTE_UNUSED; +static void yypdumpstack (struct yyGLRStack* yystackp) + YY_ATTRIBUTE_UNUSED; + +#else /* !]b4_api_PREFIX[DEBUG */ + +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) + +#endif /* !]b4_api_PREFIX[DEBUG */ + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH ]b4_stack_depth_init[ +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYMAXDEPTH * sizeof (GLRStackItem) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH ]b4_stack_depth_max[ +#endif + +/* Minimum number of free items on the stack allowed after an + allocation. This is to allow allocation and initialization + to be completed by functions that call yyexpandGLRStack before the + stack is expanded, thus insuring that all necessary pointers get + properly redirected to new data. */ +#define YYHEADROOM 2 + +#ifndef YYSTACKEXPANDABLE +# define YYSTACKEXPANDABLE 1 +#endif + +#if YYSTACKEXPANDABLE +# define YY_RESERVE_GLRSTACK(Yystack) \ + do { \ + if (Yystack->yyspaceLeft < YYHEADROOM) \ + yyexpandGLRStack (Yystack); \ + } while (0) +#else +# define YY_RESERVE_GLRSTACK(Yystack) \ + do { \ + if (Yystack->yyspaceLeft < YYHEADROOM) \ + yyMemoryExhausted (Yystack); \ + } while (0) +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static size_t +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return strlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +#endif /* !YYERROR_VERBOSE */ + +/** State numbers, as in LALR(1) machine */ +typedef int yyStateNum; + +/** Rule numbers, as in LALR(1) machine */ +typedef int yyRuleNum; + +/** Grammar symbol */ +typedef int yySymbol; + +/** Item references, as in LALR(1) machine */ +typedef short int yyItemNum; + +typedef struct yyGLRState yyGLRState; +typedef struct yyGLRStateSet yyGLRStateSet; +typedef struct yySemanticOption yySemanticOption; +typedef union yyGLRStackItem yyGLRStackItem; +typedef struct yyGLRStack yyGLRStack; + +struct yyGLRState { + /** Type tag: always true. */ + yybool yyisState; + /** Type tag for yysemantics. If true, yysval applies, otherwise + * yyfirstVal applies. */ + yybool yyresolved; + /** Number of corresponding LALR(1) machine state. */ + yyStateNum yylrState; + /** Preceding state in this stack */ + yyGLRState* yypred; + /** Source position of the last token produced by my symbol */ + size_t yyposn; + union { + /** First in a chain of alternative reductions producing the + * non-terminal corresponding to this state, threaded through + * yynext. */ + yySemanticOption* yyfirstVal; + /** Semantic value for this state. */ + YYSTYPE yysval; + } yysemantics;]b4_locations_if([[ + /** Source location for this state. */ + YYLTYPE yyloc;]])[ +}; + +struct yyGLRStateSet { + yyGLRState** yystates; + /** During nondeterministic operation, yylookaheadNeeds tracks which + * stacks have actually needed the current lookahead. During deterministic + * operation, yylookaheadNeeds[0] is not maintained since it would merely + * duplicate yychar != YYEMPTY. */ + yybool* yylookaheadNeeds; + size_t yysize, yycapacity; +}; + +struct yySemanticOption { + /** Type tag: always false. */ + yybool yyisState; + /** Rule number for this reduction */ + yyRuleNum yyrule; + /** The last RHS state in the list of states to be reduced. */ + yyGLRState* yystate; + /** The lookahead for this reduction. */ + int yyrawchar; + YYSTYPE yyval;]b4_locations_if([[ + YYLTYPE yyloc;]])[ + /** Next sibling in chain of options. To facilitate merging, + * options are chained in decreasing order by address. */ + yySemanticOption* yynext; +}; + +/** Type of the items in the GLR stack. The yyisState field + * indicates which item of the union is valid. */ +union yyGLRStackItem { + yyGLRState yystate; + yySemanticOption yyoption; +}; + +struct yyGLRStack { + int yyerrState; +]b4_locations_if([[ /* To compute the location of the error token. */ + yyGLRStackItem yyerror_range[3];]])[ +]b4_pure_if( +[ + int yyerrcnt; + int yyrawchar; + YYSTYPE yyval;]b4_locations_if([[ + YYLTYPE yyloc;]])[ +])[ + YYJMP_BUF yyexception_buffer; + yyGLRStackItem* yyitems; + yyGLRStackItem* yynextFree; + size_t yyspaceLeft; + yyGLRState* yysplitPoint; + yyGLRState* yylastDeleted; + yyGLRStateSet yytops; +}; + +#if YYSTACKEXPANDABLE +static void yyexpandGLRStack (yyGLRStack* yystackp); +#endif + +static _Noreturn void +yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg) +{ + if (yymsg != YY_NULLPTR) + yyerror (]b4_yyerror_args[yymsg); + YYLONGJMP (yystackp->yyexception_buffer, 1); +} + +static _Noreturn void +yyMemoryExhausted (yyGLRStack* yystackp) +{ + YYLONGJMP (yystackp->yyexception_buffer, 2); +} + +#if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE +/** A printable representation of TOKEN. */ +static inline const char* +yytokenName (yySymbol yytoken) +{ + if (yytoken == YYEMPTY) + return ""; + + return yytname[yytoken]; +} +#endif + +/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting + * at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred + * containing the pointer to the next state in the chain. */ +static void yyfillin (yyGLRStackItem *, int, int) YY_ATTRIBUTE_UNUSED; +static void +yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1) +{ + int i; + yyGLRState *s = yyvsp[yylow0].yystate.yypred; + for (i = yylow0-1; i >= yylow1; i -= 1) + { +#if ]b4_api_PREFIX[DEBUG + yyvsp[i].yystate.yylrState = s->yylrState; +#endif + yyvsp[i].yystate.yyresolved = s->yyresolved; + if (s->yyresolved) + yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval; + else + /* The effect of using yysval or yyloc (in an immediate rule) is + * undefined. */ + yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULLPTR;]b4_locations_if([[ + yyvsp[i].yystate.yyloc = s->yyloc;]])[ + s = yyvsp[i].yystate.yypred = s->yypred; + } +} + +/* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in + * YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1. + * For convenience, always return YYLOW1. */ +static inline int yyfill (yyGLRStackItem *, int *, int, yybool) + YY_ATTRIBUTE_UNUSED; +static inline int +yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal) +{ + if (!yynormal && yylow1 < *yylow) + { + yyfillin (yyvsp, *yylow, yylow1); + *yylow = yylow1; + } + return yylow1; +} + +/** Perform user action for rule number YYN, with RHS length YYRHSLEN, + * and top stack item YYVSP. YYLVALP points to place to put semantic + * value ($$), and yylocp points to place for location information + * (@@$). Returns yyok for normal return, yyaccept for YYACCEPT, + * yyerr for YYERROR, yyabort for YYABORT. */ +static YYRESULTTAG +yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, + yyGLRStack* yystackp, + YYSTYPE* yyvalp]b4_locuser_formals[) +{ + yybool yynormal YY_ATTRIBUTE_UNUSED = (yystackp->yysplitPoint == YY_NULLPTR); + int yylow; +]b4_parse_param_use([yyvalp], [yylocp])dnl +[ YYUSE (yyrhslen); +# undef yyerrok +# define yyerrok (yystackp->yyerrState = 0) +# undef YYACCEPT +# define YYACCEPT return yyaccept +# undef YYABORT +# define YYABORT return yyabort +# undef YYERROR +# define YYERROR return yyerrok, yyerr +# undef YYRECOVERING +# define YYRECOVERING() (yystackp->yyerrState != 0) +# undef yyclearin +# define yyclearin (yychar = YYEMPTY) +# undef YYFILL +# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal) +# undef YYBACKUP +# define YYBACKUP(Token, Value) \ + return yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")), \ + yyerrok, yyerr + + yylow = 1; + if (yyrhslen == 0) + *yyvalp = yyval_default; + else + *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;]b4_locations_if([[ + YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen); + yystackp->yyerror_range[1].yystate.yyloc = *yylocp; +]])[ + switch (yyn) + { + ]b4_user_actions[ + default: break; + } + + return yyok; +# undef yyerrok +# undef YYABORT +# undef YYACCEPT +# undef YYERROR +# undef YYBACKUP +# undef yyclearin +# undef YYRECOVERING +} + + +static void +yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1) +{ + YYUSE (yy0); + YYUSE (yy1); + + switch (yyn) + { +]b4_mergers[ + default: break; + } +} + + /* Bison grammar-table manipulation. */ + +]b4_yydestruct_define[ + +/** Number of symbols composing the right hand side of rule #RULE. */ +static inline int +yyrhsLength (yyRuleNum yyrule) +{ + return yyr2[yyrule]; +} + +static void +yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[) +{ + if (yys->yyresolved) + yydestruct (yymsg, yystos[yys->yylrState], + &yys->yysemantics.yysval]b4_locuser_args([&yys->yyloc])[); + else + { +#if ]b4_api_PREFIX[DEBUG + if (yydebug) + { + if (yys->yysemantics.yyfirstVal) + YYFPRINTF (stderr, "%s unresolved", yymsg); + else + YYFPRINTF (stderr, "%s incomplete", yymsg); + YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc); + } +#endif + + if (yys->yysemantics.yyfirstVal) + { + yySemanticOption *yyoption = yys->yysemantics.yyfirstVal; + yyGLRState *yyrh; + int yyn; + for (yyrh = yyoption->yystate, yyn = yyrhsLength (yyoption->yyrule); + yyn > 0; + yyrh = yyrh->yypred, yyn -= 1) + yydestroyGLRState (yymsg, yyrh]b4_user_args[); + } + } +} + +/** Left-hand-side symbol for rule #YYRULE. */ +static inline yySymbol +yylhsNonterm (yyRuleNum yyrule) +{ + return yyr1[yyrule]; +} + +#define yypact_value_is_default(Yystate) \ + ]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[ + +/** True iff LR state YYSTATE has only a default reduction (regardless + * of token). */ +static inline yybool +yyisDefaultedState (yyStateNum yystate) +{ + return yypact_value_is_default (yypact[yystate]); +} + +/** The default reduction for YYSTATE, assuming it has one. */ +static inline yyRuleNum +yydefaultAction (yyStateNum yystate) +{ + return yydefact[yystate]; +} + +#define yytable_value_is_error(Yytable_value) \ + ]b4_table_value_equals([[table]], [[Yytable_value]], [b4_table_ninf])[ + +/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN. + * Result R means + * R < 0: Reduce on rule -R. + * R = 0: Error. + * R > 0: Shift to state R. + * Set *YYCONFLICTS to a pointer into yyconfl to a 0-terminated list + * of conflicting reductions. + */ +static inline void +yygetLRActions (yyStateNum yystate, int yytoken, + int* yyaction, const short int** yyconflicts) +{ + int yyindex = yypact[yystate] + yytoken; + if (yypact_value_is_default (yypact[yystate]) + || yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken) + { + *yyaction = -yydefact[yystate]; + *yyconflicts = yyconfl; + } + else if (! yytable_value_is_error (yytable[yyindex])) + { + *yyaction = yytable[yyindex]; + *yyconflicts = yyconfl + yyconflp[yyindex]; + } + else + { + *yyaction = 0; + *yyconflicts = yyconfl + yyconflp[yyindex]; + } +} + +/** Compute post-reduction state. + * \param yystate the current state + * \param yysym the nonterminal to push on the stack + */ +static inline yyStateNum +yyLRgotoState (yyStateNum yystate, yySymbol yysym) +{ + int yyr = yypgoto[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate) + return yytable[yyr]; + else + return yydefgoto[yysym - YYNTOKENS]; +} + +static inline yybool +yyisShiftAction (int yyaction) +{ + return 0 < yyaction; +} + +static inline yybool +yyisErrorAction (int yyaction) +{ + return yyaction == 0; +} + + /* GLRStates */ + +/** Return a fresh GLRStackItem in YYSTACKP. The item is an LR state + * if YYISSTATE, and otherwise a semantic option. Callers should call + * YY_RESERVE_GLRSTACK afterwards to make sure there is sufficient + * headroom. */ + +static inline yyGLRStackItem* +yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState) +{ + yyGLRStackItem* yynewItem = yystackp->yynextFree; + yystackp->yyspaceLeft -= 1; + yystackp->yynextFree += 1; + yynewItem->yystate.yyisState = yyisState; + return yynewItem; +} + +/** Add a new semantic action that will execute the action for rule + * YYRULE on the semantic values in YYRHS to the list of + * alternative actions for YYSTATE. Assumes that YYRHS comes from + * stack #YYK of *YYSTACKP. */ +static void +yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate, + yyGLRState* yyrhs, yyRuleNum yyrule) +{ + yySemanticOption* yynewOption = + &yynewGLRStackItem (yystackp, yyfalse)->yyoption; + YYASSERT (!yynewOption->yyisState); + yynewOption->yystate = yyrhs; + yynewOption->yyrule = yyrule; + if (yystackp->yytops.yylookaheadNeeds[yyk]) + { + yynewOption->yyrawchar = yychar; + yynewOption->yyval = yylval;]b4_locations_if([ + yynewOption->yyloc = yylloc;])[ + } + else + yynewOption->yyrawchar = YYEMPTY; + yynewOption->yynext = yystate->yysemantics.yyfirstVal; + yystate->yysemantics.yyfirstVal = yynewOption; + + YY_RESERVE_GLRSTACK (yystackp); +} + + /* GLRStacks */ + +/** Initialize YYSET to a singleton set containing an empty stack. */ +static yybool +yyinitStateSet (yyGLRStateSet* yyset) +{ + yyset->yysize = 1; + yyset->yycapacity = 16; + yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]); + if (! yyset->yystates) + return yyfalse; + yyset->yystates[0] = YY_NULLPTR; + yyset->yylookaheadNeeds = + (yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]); + if (! yyset->yylookaheadNeeds) + { + YYFREE (yyset->yystates); + return yyfalse; + } + return yytrue; +} + +static void yyfreeStateSet (yyGLRStateSet* yyset) +{ + YYFREE (yyset->yystates); + YYFREE (yyset->yylookaheadNeeds); +} + +/** Initialize *YYSTACKP to a single empty stack, with total maximum + * capacity for all stacks of YYSIZE. */ +static yybool +yyinitGLRStack (yyGLRStack* yystackp, size_t yysize) +{ + yystackp->yyerrState = 0; + yynerrs = 0; + yystackp->yyspaceLeft = yysize; + yystackp->yyitems = + (yyGLRStackItem*) YYMALLOC (yysize * sizeof yystackp->yynextFree[0]); + if (!yystackp->yyitems) + return yyfalse; + yystackp->yynextFree = yystackp->yyitems; + yystackp->yysplitPoint = YY_NULLPTR; + yystackp->yylastDeleted = YY_NULLPTR; + return yyinitStateSet (&yystackp->yytops); +} + + +#if YYSTACKEXPANDABLE +# define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \ + &((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE + +/** If *YYSTACKP is expandable, extend it. WARNING: Pointers into the + stack from outside should be considered invalid after this call. + We always expand when there are 1 or fewer items left AFTER an + allocation, so that we can avoid having external pointers exist + across an allocation. */ +static void +yyexpandGLRStack (yyGLRStack* yystackp) +{ + yyGLRStackItem* yynewItems; + yyGLRStackItem* yyp0, *yyp1; + size_t yynewSize; + size_t yyn; + size_t yysize = yystackp->yynextFree - yystackp->yyitems; + if (YYMAXDEPTH - YYHEADROOM < yysize) + yyMemoryExhausted (yystackp); + yynewSize = 2*yysize; + if (YYMAXDEPTH < yynewSize) + yynewSize = YYMAXDEPTH; + yynewItems = (yyGLRStackItem*) YYMALLOC (yynewSize * sizeof yynewItems[0]); + if (! yynewItems) + yyMemoryExhausted (yystackp); + for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize; + 0 < yyn; + yyn -= 1, yyp0 += 1, yyp1 += 1) + { + *yyp1 = *yyp0; + if (*(yybool *) yyp0) + { + yyGLRState* yys0 = &yyp0->yystate; + yyGLRState* yys1 = &yyp1->yystate; + if (yys0->yypred != YY_NULLPTR) + yys1->yypred = + YYRELOC (yyp0, yyp1, yys0->yypred, yystate); + if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULLPTR) + yys1->yysemantics.yyfirstVal = + YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption); + } + else + { + yySemanticOption* yyv0 = &yyp0->yyoption; + yySemanticOption* yyv1 = &yyp1->yyoption; + if (yyv0->yystate != YY_NULLPTR) + yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate); + if (yyv0->yynext != YY_NULLPTR) + yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption); + } + } + if (yystackp->yysplitPoint != YY_NULLPTR) + yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems, + yystackp->yysplitPoint, yystate); + + for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1) + if (yystackp->yytops.yystates[yyn] != YY_NULLPTR) + yystackp->yytops.yystates[yyn] = + YYRELOC (yystackp->yyitems, yynewItems, + yystackp->yytops.yystates[yyn], yystate); + YYFREE (yystackp->yyitems); + yystackp->yyitems = yynewItems; + yystackp->yynextFree = yynewItems + yysize; + yystackp->yyspaceLeft = yynewSize - yysize; +} +#endif + +static void +yyfreeGLRStack (yyGLRStack* yystackp) +{ + YYFREE (yystackp->yyitems); + yyfreeStateSet (&yystackp->yytops); +} + +/** Assuming that YYS is a GLRState somewhere on *YYSTACKP, update the + * splitpoint of *YYSTACKP, if needed, so that it is at least as deep as + * YYS. */ +static inline void +yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys) +{ + if (yystackp->yysplitPoint != YY_NULLPTR && yystackp->yysplitPoint > yys) + yystackp->yysplitPoint = yys; +} + +/** Invalidate stack #YYK in *YYSTACKP. */ +static inline void +yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk) +{ + if (yystackp->yytops.yystates[yyk] != YY_NULLPTR) + yystackp->yylastDeleted = yystackp->yytops.yystates[yyk]; + yystackp->yytops.yystates[yyk] = YY_NULLPTR; +} + +/** Undelete the last stack in *YYSTACKP that was marked as deleted. Can + only be done once after a deletion, and only when all other stacks have + been deleted. */ +static void +yyundeleteLastStack (yyGLRStack* yystackp) +{ + if (yystackp->yylastDeleted == YY_NULLPTR || yystackp->yytops.yysize != 0) + return; + yystackp->yytops.yystates[0] = yystackp->yylastDeleted; + yystackp->yytops.yysize = 1; + YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n")); + yystackp->yylastDeleted = YY_NULLPTR; +} + +static inline void +yyremoveDeletes (yyGLRStack* yystackp) +{ + size_t yyi, yyj; + yyi = yyj = 0; + while (yyj < yystackp->yytops.yysize) + { + if (yystackp->yytops.yystates[yyi] == YY_NULLPTR) + { + if (yyi == yyj) + { + YYDPRINTF ((stderr, "Removing dead stacks.\n")); + } + yystackp->yytops.yysize -= 1; + } + else + { + yystackp->yytops.yystates[yyj] = yystackp->yytops.yystates[yyi]; + /* In the current implementation, it's unnecessary to copy + yystackp->yytops.yylookaheadNeeds[yyi] since, after + yyremoveDeletes returns, the parser immediately either enters + deterministic operation or shifts a token. However, it doesn't + hurt, and the code might evolve to need it. */ + yystackp->yytops.yylookaheadNeeds[yyj] = + yystackp->yytops.yylookaheadNeeds[yyi]; + if (yyj != yyi) + { + YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n", + (unsigned long int) yyi, (unsigned long int) yyj)); + } + yyj += 1; + } + yyi += 1; + } +} + +/** Shift to a new state on stack #YYK of *YYSTACKP, corresponding to LR + * state YYLRSTATE, at input position YYPOSN, with (resolved) semantic + * value *YYVALP and source location *YYLOCP. */ +static inline void +yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, + size_t yyposn, + YYSTYPE* yyvalp]b4_locations_if([, YYLTYPE* yylocp])[) +{ + yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate; + + yynewState->yylrState = yylrState; + yynewState->yyposn = yyposn; + yynewState->yyresolved = yytrue; + yynewState->yypred = yystackp->yytops.yystates[yyk]; + yynewState->yysemantics.yysval = *yyvalp;]b4_locations_if([ + yynewState->yyloc = *yylocp;])[ + yystackp->yytops.yystates[yyk] = yynewState; + + YY_RESERVE_GLRSTACK (yystackp); +} + +/** Shift stack #YYK of *YYSTACKP, to a new state corresponding to LR + * state YYLRSTATE, at input position YYPOSN, with the (unresolved) + * semantic value of YYRHS under the action for YYRULE. */ +static inline void +yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, + size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule) +{ + yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate; + YYASSERT (yynewState->yyisState); + + yynewState->yylrState = yylrState; + yynewState->yyposn = yyposn; + yynewState->yyresolved = yyfalse; + yynewState->yypred = yystackp->yytops.yystates[yyk]; + yynewState->yysemantics.yyfirstVal = YY_NULLPTR; + yystackp->yytops.yystates[yyk] = yynewState; + + /* Invokes YY_RESERVE_GLRSTACK. */ + yyaddDeferredAction (yystackp, yyk, yynewState, yyrhs, yyrule); +} + +#if !]b4_api_PREFIX[DEBUG +# define YY_REDUCE_PRINT(Args) +#else +# define YY_REDUCE_PRINT(Args) \ +do { \ + if (yydebug) \ + yy_reduce_print Args; \ +} while (0) + +/*----------------------------------------------------------------------. +| Report that stack #YYK of *YYSTACKP is going to be reduced by YYRULE. | +`----------------------------------------------------------------------*/ + +static inline void +yy_reduce_print (int yynormal, yyGLRStackItem* yyvsp, size_t yyk, + yyRuleNum yyrule]b4_user_formals[) +{ + int yynrhs = yyrhsLength (yyrule);]b4_locations_if([ + int yylow = 1;])[ + int yyi; + YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n", + (unsigned long int) yyk, yyrule - 1, + (unsigned long int) yyrline[yyrule]); + if (! yynormal) + yyfillin (yyvsp, 1, -yynrhs); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyvsp[yyi - yynrhs + 1].yystate.yylrState], + &yyvsp[yyi - yynrhs + 1].yystate.yysemantics.yysval + ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl + b4_user_args[); + if (!yyvsp[yyi - yynrhs + 1].yystate.yyresolved) + YYFPRINTF (stderr, " (unresolved)"); + YYFPRINTF (stderr, "\n"); + } +} +#endif + +/** Pop the symbols consumed by reduction #YYRULE from the top of stack + * #YYK of *YYSTACKP, and perform the appropriate semantic action on their + * semantic values. Assumes that all ambiguities in semantic values + * have been previously resolved. Set *YYVALP to the resulting value, + * and *YYLOCP to the computed location (if any). Return value is as + * for userAction. */ +static inline YYRESULTTAG +yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, + YYSTYPE* yyvalp]b4_locuser_formals[) +{ + int yynrhs = yyrhsLength (yyrule); + + if (yystackp->yysplitPoint == YY_NULLPTR) + { + /* Standard special case: single stack. */ + yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; + YYASSERT (yyk == 0); + yystackp->yynextFree -= yynrhs; + yystackp->yyspaceLeft += yynrhs; + yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate; + YY_REDUCE_PRINT ((1, yyrhs, yyk, yyrule]b4_user_args[)); + return yyuserAction (yyrule, yynrhs, yyrhs, yystackp, + yyvalp]b4_locuser_args[); + } + else + { + int yyi; + yyGLRState* yys; + yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1]; + yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred + = yystackp->yytops.yystates[yyk];]b4_locations_if([[ + if (yynrhs == 0) + /* Set default location. */ + yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yys->yyloc;]])[ + for (yyi = 0; yyi < yynrhs; yyi += 1) + { + yys = yys->yypred; + YYASSERT (yys); + } + yyupdateSplit (yystackp, yys); + yystackp->yytops.yystates[yyk] = yys; + YY_REDUCE_PRINT ((0, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, yyk, yyrule]b4_user_args[)); + return yyuserAction (yyrule, yynrhs, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, + yystackp, yyvalp]b4_locuser_args[); + } +} + +/** Pop items off stack #YYK of *YYSTACKP according to grammar rule YYRULE, + * and push back on the resulting nonterminal symbol. Perform the + * semantic action associated with YYRULE and store its value with the + * newly pushed state, if YYFORCEEVAL or if *YYSTACKP is currently + * unambiguous. Otherwise, store the deferred semantic action with + * the new state. If the new state would have an identical input + * position, LR state, and predecessor to an existing state on the stack, + * it is identified with that existing state, eliminating stack #YYK from + * *YYSTACKP. In this case, the semantic value is + * added to the options for the existing state's semantic value. + */ +static inline YYRESULTTAG +yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, + yybool yyforceEval]b4_user_formals[) +{ + size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn; + + if (yyforceEval || yystackp->yysplitPoint == YY_NULLPTR) + { + YYSTYPE yysval;]b4_locations_if([[ + YYLTYPE yyloc;]])[ + + YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[); + if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR) + { + YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n", + (unsigned long int) yyk, yyrule - 1)); + } + if (yyflag != yyok) + return yyflag; + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc); + yyglrShift (yystackp, yyk, + yyLRgotoState (yystackp->yytops.yystates[yyk]->yylrState, + yylhsNonterm (yyrule)), + yyposn, &yysval]b4_locations_if([, &yyloc])[); + } + else + { + size_t yyi; + int yyn; + yyGLRState* yys, *yys0 = yystackp->yytops.yystates[yyk]; + yyStateNum yynewLRState; + + for (yys = yystackp->yytops.yystates[yyk], yyn = yyrhsLength (yyrule); + 0 < yyn; yyn -= 1) + { + yys = yys->yypred; + YYASSERT (yys); + } + yyupdateSplit (yystackp, yys); + yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule)); + YYDPRINTF ((stderr, + "Reduced stack %lu by rule #%d; action deferred. " + "Now in state %d.\n", + (unsigned long int) yyk, yyrule - 1, yynewLRState)); + for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) + if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR) + { + yyGLRState *yysplit = yystackp->yysplitPoint; + yyGLRState *yyp = yystackp->yytops.yystates[yyi]; + while (yyp != yys && yyp != yysplit && yyp->yyposn >= yyposn) + { + if (yyp->yylrState == yynewLRState && yyp->yypred == yys) + { + yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule); + yymarkStackDeleted (yystackp, yyk); + YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n", + (unsigned long int) yyk, + (unsigned long int) yyi)); + return yyok; + } + yyp = yyp->yypred; + } + } + yystackp->yytops.yystates[yyk] = yys; + yyglrShiftDefer (yystackp, yyk, yynewLRState, yyposn, yys0, yyrule); + } + return yyok; +} + +static size_t +yysplitStack (yyGLRStack* yystackp, size_t yyk) +{ + if (yystackp->yysplitPoint == YY_NULLPTR) + { + YYASSERT (yyk == 0); + yystackp->yysplitPoint = yystackp->yytops.yystates[yyk]; + } + if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity) + { + yyGLRState** yynewStates; + yybool* yynewLookaheadNeeds; + + yynewStates = YY_NULLPTR; + + if (yystackp->yytops.yycapacity + > (YYSIZEMAX / (2 * sizeof yynewStates[0]))) + yyMemoryExhausted (yystackp); + yystackp->yytops.yycapacity *= 2; + + yynewStates = + (yyGLRState**) YYREALLOC (yystackp->yytops.yystates, + (yystackp->yytops.yycapacity + * sizeof yynewStates[0])); + if (yynewStates == YY_NULLPTR) + yyMemoryExhausted (yystackp); + yystackp->yytops.yystates = yynewStates; + + yynewLookaheadNeeds = + (yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds, + (yystackp->yytops.yycapacity + * sizeof yynewLookaheadNeeds[0])); + if (yynewLookaheadNeeds == YY_NULLPTR) + yyMemoryExhausted (yystackp); + yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds; + } + yystackp->yytops.yystates[yystackp->yytops.yysize] + = yystackp->yytops.yystates[yyk]; + yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize] + = yystackp->yytops.yylookaheadNeeds[yyk]; + yystackp->yytops.yysize += 1; + return yystackp->yytops.yysize-1; +} + +/** True iff YYY0 and YYY1 represent identical options at the top level. + * That is, they represent the same rule applied to RHS symbols + * that produce the same terminal symbols. */ +static yybool +yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1) +{ + if (yyy0->yyrule == yyy1->yyrule) + { + yyGLRState *yys0, *yys1; + int yyn; + for (yys0 = yyy0->yystate, yys1 = yyy1->yystate, + yyn = yyrhsLength (yyy0->yyrule); + yyn > 0; + yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1) + if (yys0->yyposn != yys1->yyposn) + return yyfalse; + return yytrue; + } + else + return yyfalse; +} + +/** Assuming identicalOptions (YYY0,YYY1), destructively merge the + * alternative semantic values for the RHS-symbols of YYY1 and YYY0. */ +static void +yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1) +{ + yyGLRState *yys0, *yys1; + int yyn; + for (yys0 = yyy0->yystate, yys1 = yyy1->yystate, + yyn = yyrhsLength (yyy0->yyrule); + yyn > 0; + yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1) + { + if (yys0 == yys1) + break; + else if (yys0->yyresolved) + { + yys1->yyresolved = yytrue; + yys1->yysemantics.yysval = yys0->yysemantics.yysval; + } + else if (yys1->yyresolved) + { + yys0->yyresolved = yytrue; + yys0->yysemantics.yysval = yys1->yysemantics.yysval; + } + else + { + yySemanticOption** yyz0p = &yys0->yysemantics.yyfirstVal; + yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal; + while (yytrue) + { + if (yyz1 == *yyz0p || yyz1 == YY_NULLPTR) + break; + else if (*yyz0p == YY_NULLPTR) + { + *yyz0p = yyz1; + break; + } + else if (*yyz0p < yyz1) + { + yySemanticOption* yyz = *yyz0p; + *yyz0p = yyz1; + yyz1 = yyz1->yynext; + (*yyz0p)->yynext = yyz; + } + yyz0p = &(*yyz0p)->yynext; + } + yys1->yysemantics.yyfirstVal = yys0->yysemantics.yyfirstVal; + } + } +} + +/** Y0 and Y1 represent two possible actions to take in a given + * parsing state; return 0 if no combination is possible, + * 1 if user-mergeable, 2 if Y0 is preferred, 3 if Y1 is preferred. */ +static int +yypreference (yySemanticOption* y0, yySemanticOption* y1) +{ + yyRuleNum r0 = y0->yyrule, r1 = y1->yyrule; + int p0 = yydprec[r0], p1 = yydprec[r1]; + + if (p0 == p1) + { + if (yymerger[r0] == 0 || yymerger[r0] != yymerger[r1]) + return 0; + else + return 1; + } + if (p0 == 0 || p1 == 0) + return 0; + if (p0 < p1) + return 3; + if (p1 < p0) + return 2; + return 0; +} + +static YYRESULTTAG yyresolveValue (yyGLRState* yys, + yyGLRStack* yystackp]b4_user_formals[); + + +/** Resolve the previous YYN states starting at and including state YYS + * on *YYSTACKP. If result != yyok, some states may have been left + * unresolved possibly with empty semantic option chains. Regardless + * of whether result = yyok, each state has been left with consistent + * data so that yydestroyGLRState can be invoked if necessary. */ +static YYRESULTTAG +yyresolveStates (yyGLRState* yys, int yyn, + yyGLRStack* yystackp]b4_user_formals[) +{ + if (0 < yyn) + { + YYASSERT (yys->yypred); + YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp]b4_user_args[)); + if (! yys->yyresolved) + YYCHK (yyresolveValue (yys, yystackp]b4_user_args[)); + } + return yyok; +} + +/** Resolve the states for the RHS of YYOPT on *YYSTACKP, perform its + * user action, and return the semantic value and location in *YYVALP + * and *YYLOCP. Regardless of whether result = yyok, all RHS states + * have been destroyed (assuming the user action destroys all RHS + * semantic values if invoked). */ +static YYRESULTTAG +yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystackp, + YYSTYPE* yyvalp]b4_locuser_formals[) +{ + yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1]; + int yynrhs = yyrhsLength (yyopt->yyrule); + YYRESULTTAG yyflag = + yyresolveStates (yyopt->yystate, yynrhs, yystackp]b4_user_args[); + if (yyflag != yyok) + { + yyGLRState *yys; + for (yys = yyopt->yystate; yynrhs > 0; yys = yys->yypred, yynrhs -= 1) + yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[); + return yyflag; + } + + yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred = yyopt->yystate;]b4_locations_if([[ + if (yynrhs == 0) + /* Set default location. */ + yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yyopt->yystate->yyloc;]])[ + { + int yychar_current = yychar; + YYSTYPE yylval_current = yylval;]b4_locations_if([ + YYLTYPE yylloc_current = yylloc;])[ + yychar = yyopt->yyrawchar; + yylval = yyopt->yyval;]b4_locations_if([ + yylloc = yyopt->yyloc;])[ + yyflag = yyuserAction (yyopt->yyrule, yynrhs, + yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, + yystackp, yyvalp]b4_locuser_args[); + yychar = yychar_current; + yylval = yylval_current;]b4_locations_if([ + yylloc = yylloc_current;])[ + } + return yyflag; +} + +#if ]b4_api_PREFIX[DEBUG +static void +yyreportTree (yySemanticOption* yyx, int yyindent) +{ + int yynrhs = yyrhsLength (yyx->yyrule); + int yyi; + yyGLRState* yys; + yyGLRState* yystates[1 + YYMAXRHS]; + yyGLRState yyleftmost_state; + + for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred) + yystates[yyi] = yys; + if (yys == YY_NULLPTR) + { + yyleftmost_state.yyposn = 0; + yystates[0] = &yyleftmost_state; + } + else + yystates[0] = yys; + + if (yyx->yystate->yyposn < yys->yyposn + 1) + YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n", + yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)), + yyx->yyrule - 1); + else + YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n", + yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)), + yyx->yyrule - 1, (unsigned long int) (yys->yyposn + 1), + (unsigned long int) yyx->yystate->yyposn); + for (yyi = 1; yyi <= yynrhs; yyi += 1) + { + if (yystates[yyi]->yyresolved) + { + if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn) + YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "", + yytokenName (yystos[yystates[yyi]->yylrState])); + else + YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "", + yytokenName (yystos[yystates[yyi]->yylrState]), + (unsigned long int) (yystates[yyi-1]->yyposn + 1), + (unsigned long int) yystates[yyi]->yyposn); + } + else + yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2); + } +} +#endif + +static YYRESULTTAG +yyreportAmbiguity (yySemanticOption* yyx0, + yySemanticOption* yyx1]b4_pure_formals[) +{ + YYUSE (yyx0); + YYUSE (yyx1); + +#if ]b4_api_PREFIX[DEBUG + YYFPRINTF (stderr, "Ambiguity detected.\n"); + YYFPRINTF (stderr, "Option 1,\n"); + yyreportTree (yyx0, 2); + YYFPRINTF (stderr, "\nOption 2,\n"); + yyreportTree (yyx1, 2); + YYFPRINTF (stderr, "\n"); +#endif + + yyerror (]b4_yyerror_args[YY_("syntax is ambiguous")); + return yyabort; +}]b4_locations_if([[ + +/** Resolve the locations for each of the YYN1 states in *YYSTACKP, + * ending at YYS1. Has no effect on previously resolved states. + * The first semantic option of a state is always chosen. */ +static void +yyresolveLocations (yyGLRState* yys1, int yyn1, + yyGLRStack *yystackp]b4_user_formals[) +{ + if (0 < yyn1) + { + yyresolveLocations (yys1->yypred, yyn1 - 1, yystackp]b4_user_args[); + if (!yys1->yyresolved) + { + yyGLRStackItem yyrhsloc[1 + YYMAXRHS]; + int yynrhs; + yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal; + YYASSERT (yyoption != YY_NULLPTR); + yynrhs = yyrhsLength (yyoption->yyrule); + if (yynrhs > 0) + { + yyGLRState *yys; + int yyn; + yyresolveLocations (yyoption->yystate, yynrhs, + yystackp]b4_user_args[); + for (yys = yyoption->yystate, yyn = yynrhs; + yyn > 0; + yys = yys->yypred, yyn -= 1) + yyrhsloc[yyn].yystate.yyloc = yys->yyloc; + } + else + { + /* Both yyresolveAction and yyresolveLocations traverse the GSS + in reverse rightmost order. It is only necessary to invoke + yyresolveLocations on a subforest for which yyresolveAction + would have been invoked next had an ambiguity not been + detected. Thus the location of the previous state (but not + necessarily the previous state itself) is guaranteed to be + resolved already. */ + yyGLRState *yyprevious = yyoption->yystate; + yyrhsloc[0].yystate.yyloc = yyprevious->yyloc; + } + { + int yychar_current = yychar; + YYSTYPE yylval_current = yylval; + YYLTYPE yylloc_current = yylloc; + yychar = yyoption->yyrawchar; + yylval = yyoption->yyval; + yylloc = yyoption->yyloc; + YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs); + yychar = yychar_current; + yylval = yylval_current; + yylloc = yylloc_current; + } + } + } +}]])[ + +/** Resolve the ambiguity represented in state YYS in *YYSTACKP, + * perform the indicated actions, and set the semantic value of YYS. + * If result != yyok, the chain of semantic options in YYS has been + * cleared instead or it has been left unmodified except that + * redundant options may have been removed. Regardless of whether + * result = yyok, YYS has been left with consistent data so that + * yydestroyGLRState can be invoked if necessary. */ +static YYRESULTTAG +yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[) +{ + yySemanticOption* yyoptionList = yys->yysemantics.yyfirstVal; + yySemanticOption* yybest = yyoptionList; + yySemanticOption** yypp; + yybool yymerge = yyfalse; + YYSTYPE yysval; + YYRESULTTAG yyflag;]b4_locations_if([ + YYLTYPE *yylocp = &yys->yyloc;])[ + + for (yypp = &yyoptionList->yynext; *yypp != YY_NULLPTR; ) + { + yySemanticOption* yyp = *yypp; + + if (yyidenticalOptions (yybest, yyp)) + { + yymergeOptionSets (yybest, yyp); + *yypp = yyp->yynext; + } + else + { + switch (yypreference (yybest, yyp)) + { + case 0:]b4_locations_if([[ + yyresolveLocations (yys, 1, yystackp]b4_user_args[);]])[ + return yyreportAmbiguity (yybest, yyp]b4_pure_args[); + break; + case 1: + yymerge = yytrue; + break; + case 2: + break; + case 3: + yybest = yyp; + yymerge = yyfalse; + break; + default: + /* This cannot happen so it is not worth a YYASSERT (yyfalse), + but some compilers complain if the default case is + omitted. */ + break; + } + yypp = &yyp->yynext; + } + } + + if (yymerge) + { + yySemanticOption* yyp; + int yyprec = yydprec[yybest->yyrule]; + yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[); + if (yyflag == yyok) + for (yyp = yybest->yynext; yyp != YY_NULLPTR; yyp = yyp->yynext) + { + if (yyprec == yydprec[yyp->yyrule]) + { + YYSTYPE yysval_other;]b4_locations_if([ + YYLTYPE yydummy;])[ + yyflag = yyresolveAction (yyp, yystackp, &yysval_other]b4_locuser_args([&yydummy])[); + if (yyflag != yyok) + { + yydestruct ("Cleanup: discarding incompletely merged value for", + yystos[yys->yylrState], + &yysval]b4_locuser_args[); + break; + } + yyuserMerge (yymerger[yyp->yyrule], &yysval, &yysval_other); + } + } + } + else + yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args([yylocp])[); + + if (yyflag == yyok) + { + yys->yyresolved = yytrue; + yys->yysemantics.yysval = yysval; + } + else + yys->yysemantics.yyfirstVal = YY_NULLPTR; + return yyflag; +} + +static YYRESULTTAG +yyresolveStack (yyGLRStack* yystackp]b4_user_formals[) +{ + if (yystackp->yysplitPoint != YY_NULLPTR) + { + yyGLRState* yys; + int yyn; + + for (yyn = 0, yys = yystackp->yytops.yystates[0]; + yys != yystackp->yysplitPoint; + yys = yys->yypred, yyn += 1) + continue; + YYCHK (yyresolveStates (yystackp->yytops.yystates[0], yyn, yystackp + ]b4_user_args[)); + } + return yyok; +} + +static void +yycompressStack (yyGLRStack* yystackp) +{ + yyGLRState* yyp, *yyq, *yyr; + + if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULLPTR) + return; + + for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULLPTR; + yyp != yystackp->yysplitPoint; + yyr = yyp, yyp = yyq, yyq = yyp->yypred) + yyp->yypred = yyr; + + yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems; + yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1; + yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems; + yystackp->yysplitPoint = YY_NULLPTR; + yystackp->yylastDeleted = YY_NULLPTR; + + while (yyr != YY_NULLPTR) + { + yystackp->yynextFree->yystate = *yyr; + yyr = yyr->yypred; + yystackp->yynextFree->yystate.yypred = &yystackp->yynextFree[-1].yystate; + yystackp->yytops.yystates[0] = &yystackp->yynextFree->yystate; + yystackp->yynextFree += 1; + yystackp->yyspaceLeft -= 1; + } +} + +static YYRESULTTAG +yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, + size_t yyposn]b4_pure_formals[) +{ + while (yystackp->yytops.yystates[yyk] != YY_NULLPTR) + { + yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState; + YYDPRINTF ((stderr, "Stack %lu Entering state %d\n", + (unsigned long int) yyk, yystate)); + + YYASSERT (yystate != YYFINAL); + + if (yyisDefaultedState (yystate)) + { + YYRESULTTAG yyflag; + yyRuleNum yyrule = yydefaultAction (yystate); + if (yyrule == 0) + { + YYDPRINTF ((stderr, "Stack %lu dies.\n", + (unsigned long int) yyk)); + yymarkStackDeleted (yystackp, yyk); + return yyok; + } + yyflag = yyglrReduce (yystackp, yyk, yyrule, yyimmediate[yyrule]]b4_user_args[); + if (yyflag == yyerr) + { + YYDPRINTF ((stderr, + "Stack %lu dies " + "(predicate failure or explicit user error).\n", + (unsigned long int) yyk)); + yymarkStackDeleted (yystackp, yyk); + return yyok; + } + if (yyflag != yyok) + return yyflag; + } + else + { + yySymbol yytoken; + int yyaction; + const short int* yyconflicts; + + yystackp->yytops.yylookaheadNeeds[yyk] = yytrue; + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = ]b4_lex[; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts); + + while (*yyconflicts != 0) + { + YYRESULTTAG yyflag; + size_t yynewStack = yysplitStack (yystackp, yyk); + YYDPRINTF ((stderr, "Splitting off stack %lu from %lu.\n", + (unsigned long int) yynewStack, + (unsigned long int) yyk)); + yyflag = yyglrReduce (yystackp, yynewStack, + *yyconflicts, + yyimmediate[*yyconflicts]]b4_user_args[); + if (yyflag == yyok) + YYCHK (yyprocessOneStack (yystackp, yynewStack, + yyposn]b4_pure_args[)); + else if (yyflag == yyerr) + { + YYDPRINTF ((stderr, "Stack %lu dies.\n", + (unsigned long int) yynewStack)); + yymarkStackDeleted (yystackp, yynewStack); + } + else + return yyflag; + yyconflicts += 1; + } + + if (yyisShiftAction (yyaction)) + break; + else if (yyisErrorAction (yyaction)) + { + YYDPRINTF ((stderr, "Stack %lu dies.\n", + (unsigned long int) yyk)); + yymarkStackDeleted (yystackp, yyk); + break; + } + else + { + YYRESULTTAG yyflag = yyglrReduce (yystackp, yyk, -yyaction, + yyimmediate[-yyaction]]b4_user_args[); + if (yyflag == yyerr) + { + YYDPRINTF ((stderr, + "Stack %lu dies " + "(predicate failure or explicit user error).\n", + (unsigned long int) yyk)); + yymarkStackDeleted (yystackp, yyk); + break; + } + else if (yyflag != yyok) + return yyflag; + } + } + } + return yyok; +} + +static void +yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) +{ + if (yystackp->yyerrState != 0) + return; +#if ! YYERROR_VERBOSE + yyerror (]b4_lyyerror_args[YY_("syntax error")); +#else + { + yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + size_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken)); + size_t yysize = yysize0; + yybool yysize_overflow = yyfalse; + char* yymsg = YY_NULLPTR; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[yystackp->yytops.yystates[0]->yylrState]; + yyarg[yycount++] = yytokenName (yytoken); + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for this + state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytokenName (yyx); + { + size_t yysz = yysize + yytnamerr (YY_NULLPTR, yytokenName (yyx)); + yysize_overflow |= yysz < yysize; + yysize = yysz; + } + } + } + } + + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + { + size_t yysz = yysize + strlen (yyformat); + yysize_overflow |= yysz < yysize; + yysize = yysz; + } + + if (!yysize_overflow) + yymsg = (char *) YYMALLOC (yysize); + + if (yymsg) + { + char *yyp = yymsg; + int yyi = 0; + while ((*yyp = *yyformat)) + { + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + yyerror (]b4_lyyerror_args[yymsg); + YYFREE (yymsg); + } + else + { + yyerror (]b4_lyyerror_args[YY_("syntax error")); + yyMemoryExhausted (yystackp); + } + } +#endif /* YYERROR_VERBOSE */ + yynerrs += 1; +} + +/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP, + yylval, and yylloc are the syntactic category, semantic value, and location + of the lookahead. */ +static void +yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) +{ + size_t yyk; + int yyj; + + if (yystackp->yyerrState == 3) + /* We just shifted the error token and (perhaps) took some + reductions. Skip tokens until we can proceed. */ + while (yytrue) + { + yySymbol yytoken; + if (yychar == YYEOF) + yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR); + if (yychar != YYEMPTY) + {]b4_locations_if([[ + /* We throw away the lookahead, but the error range + of the shifted error token must take it into account. */ + yyGLRState *yys = yystackp->yytops.yystates[0]; + yyGLRStackItem yyerror_range[3]; + yyerror_range[1].yystate.yyloc = yys->yyloc; + yyerror_range[2].yystate.yyloc = yylloc; + YYLLOC_DEFAULT ((yys->yyloc), yyerror_range, 2);]])[ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Error: discarding", + yytoken, &yylval]b4_locuser_args([&yylloc])[); + } + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = ]b4_lex[; + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + yyj = yypact[yystackp->yytops.yystates[0]->yylrState]; + if (yypact_value_is_default (yyj)) + return; + yyj += yytoken; + if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken) + { + if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0) + return; + } + else if (! yytable_value_is_error (yytable[yyj])) + return; + } + + /* Reduce to one stack. */ + for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1) + if (yystackp->yytops.yystates[yyk] != YY_NULLPTR) + break; + if (yyk >= yystackp->yytops.yysize) + yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR); + for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1) + yymarkStackDeleted (yystackp, yyk); + yyremoveDeletes (yystackp); + yycompressStack (yystackp); + + /* Now pop stack until we find a state that shifts the error token. */ + yystackp->yyerrState = 3; + while (yystackp->yytops.yystates[0] != YY_NULLPTR) + { + yyGLRState *yys = yystackp->yytops.yystates[0]; + yyj = yypact[yys->yylrState]; + if (! yypact_value_is_default (yyj)) + { + yyj += YYTERROR; + if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR + && yyisShiftAction (yytable[yyj])) + { + /* Shift the error token. */]b4_locations_if([[ + /* First adjust its location.*/ + YYLTYPE yyerrloc; + yystackp->yyerror_range[2].yystate.yyloc = yylloc; + YYLLOC_DEFAULT (yyerrloc, (yystackp->yyerror_range), 2);]])[ + YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]], + &yylval, &yyerrloc); + yyglrShift (yystackp, 0, yytable[yyj], + yys->yyposn, &yylval]b4_locations_if([, &yyerrloc])[); + yys = yystackp->yytops.yystates[0]; + break; + } + }]b4_locations_if([[ + yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[ + if (yys->yypred != YY_NULLPTR) + yydestroyGLRState ("Error: popping", yys]b4_user_args[); + yystackp->yytops.yystates[0] = yys->yypred; + yystackp->yynextFree -= 1; + yystackp->yyspaceLeft += 1; + } + if (yystackp->yytops.yystates[0] == YY_NULLPTR) + yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR); +} + +#define YYCHK1(YYE) \ + do { \ + switch (YYE) { \ + case yyok: \ + break; \ + case yyabort: \ + goto yyabortlab; \ + case yyaccept: \ + goto yyacceptlab; \ + case yyerr: \ + goto yyuser_error; \ + default: \ + goto yybuglab; \ + } \ + } while (0) + +/*----------. +| yyparse. | +`----------*/ + +]b4_function_define([yyparse], [int], b4_parse_param)[ +{ + int yyresult; + yyGLRStack yystack; + yyGLRStack* const yystackp = &yystack; + size_t yyposn; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = YYEMPTY; + yylval = yyval_default;]b4_locations_if([ + yylloc = yyloc_default;])[ +]m4_ifdef([b4_initial_action], [ +b4_dollar_pushdef([yylval], [], [yylloc])dnl + /* User initialization code. */ + b4_user_initial_action +b4_dollar_popdef])[]dnl +[ + if (! yyinitGLRStack (yystackp, YYINITDEPTH)) + goto yyexhaustedlab; + switch (YYSETJMP (yystack.yyexception_buffer)) + { + case 0: break; + case 1: goto yyabortlab; + case 2: goto yyexhaustedlab; + default: goto yybuglab; + } + yyglrShift (&yystack, 0, 0, 0, &yylval]b4_locations_if([, &yylloc])[); + yyposn = 0; + + while (yytrue) + { + /* For efficiency, we have two loops, the first of which is + specialized to deterministic operation (single stack, no + potential ambiguity). */ + /* Standard mode */ + while (yytrue) + { + yyRuleNum yyrule; + int yyaction; + const short int* yyconflicts; + + yyStateNum yystate = yystack.yytops.yystates[0]->yylrState; + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + goto yyacceptlab; + if (yyisDefaultedState (yystate)) + { + yyrule = yydefaultAction (yystate); + if (yyrule == 0) + { +]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ + yyreportSyntaxError (&yystack]b4_user_args[); + goto yyuser_error; + } + YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue]b4_user_args[)); + } + else + { + yySymbol yytoken; + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = ]b4_lex[; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts); + if (*yyconflicts != 0) + break; + if (yyisShiftAction (yyaction)) + { + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yychar = YYEMPTY; + yyposn += 1; + yyglrShift (&yystack, 0, yyaction, yyposn, &yylval]b4_locations_if([, &yylloc])[); + if (0 < yystack.yyerrState) + yystack.yyerrState -= 1; + } + else if (yyisErrorAction (yyaction)) + { +]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ + yyreportSyntaxError (&yystack]b4_user_args[); + goto yyuser_error; + } + else + YYCHK1 (yyglrReduce (&yystack, 0, -yyaction, yytrue]b4_user_args[)); + } + } + + while (yytrue) + { + yySymbol yytoken_to_shift; + size_t yys; + + for (yys = 0; yys < yystack.yytops.yysize; yys += 1) + yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY; + + /* yyprocessOneStack returns one of three things: + + - An error flag. If the caller is yyprocessOneStack, it + immediately returns as well. When the caller is finally + yyparse, it jumps to an error label via YYCHK1. + + - yyok, but yyprocessOneStack has invoked yymarkStackDeleted + (&yystack, yys), which sets the top state of yys to NULL. Thus, + yyparse's following invocation of yyremoveDeletes will remove + the stack. + + - yyok, when ready to shift a token. + + Except in the first case, yyparse will invoke yyremoveDeletes and + then shift the next token onto all remaining stacks. This + synchronization of the shift (that is, after all preceding + reductions on all stacks) helps prevent double destructor calls + on yylval in the event of memory exhaustion. */ + + for (yys = 0; yys < yystack.yytops.yysize; yys += 1) + YYCHK1 (yyprocessOneStack (&yystack, yys, yyposn]b4_lpure_args[)); + yyremoveDeletes (&yystack); + if (yystack.yytops.yysize == 0) + { + yyundeleteLastStack (&yystack); + if (yystack.yytops.yysize == 0) + yyFail (&yystack][]b4_lpure_args[, YY_("syntax error")); + YYCHK1 (yyresolveStack (&yystack]b4_user_args[)); + YYDPRINTF ((stderr, "Returning to deterministic operation.\n")); +]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ + yyreportSyntaxError (&yystack]b4_user_args[); + goto yyuser_error; + } + + /* If any yyglrShift call fails, it will fail after shifting. Thus, + a copy of yylval will already be on stack 0 in the event of a + failure in the following loop. Thus, yychar is set to YYEMPTY + before the loop to make sure the user destructor for yylval isn't + called twice. */ + yytoken_to_shift = YYTRANSLATE (yychar); + yychar = YYEMPTY; + yyposn += 1; + for (yys = 0; yys < yystack.yytops.yysize; yys += 1) + { + int yyaction; + const short int* yyconflicts; + yyStateNum yystate = yystack.yytops.yystates[yys]->yylrState; + yygetLRActions (yystate, yytoken_to_shift, &yyaction, + &yyconflicts); + /* Note that yyconflicts were handled by yyprocessOneStack. */ + YYDPRINTF ((stderr, "On stack %lu, ", (unsigned long int) yys)); + YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc); + yyglrShift (&yystack, yys, yyaction, yyposn, + &yylval]b4_locations_if([, &yylloc])[); + YYDPRINTF ((stderr, "Stack %lu now in state #%d\n", + (unsigned long int) yys, + yystack.yytops.yystates[yys]->yylrState)); + } + + if (yystack.yytops.yysize == 1) + { + YYCHK1 (yyresolveStack (&yystack]b4_user_args[)); + YYDPRINTF ((stderr, "Returning to deterministic operation.\n")); + yycompressStack (&yystack); + break; + } + } + continue; + yyuser_error: + yyrecoverSyntaxError (&yystack]b4_user_args[); + yyposn = yystack.yytops.yystates[0]->yyposn; + } + + yyacceptlab: + yyresult = 0; + goto yyreturn; + + yybuglab: + YYASSERT (yyfalse); + goto yyabortlab; + + yyabortlab: + yyresult = 1; + goto yyreturn; + + yyexhaustedlab: + yyerror (]b4_lyyerror_args[YY_("memory exhausted")); + yyresult = 2; + goto yyreturn; + + yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + YYTRANSLATE (yychar), &yylval]b4_locuser_args([&yylloc])[); + + /* If the stack is well-formed, pop the stack until it is empty, + destroying its entries as we go. But free the stack regardless + of whether it is well-formed. */ + if (yystack.yyitems) + { + yyGLRState** yystates = yystack.yytops.yystates; + if (yystates) + { + size_t yysize = yystack.yytops.yysize; + size_t yyk; + for (yyk = 0; yyk < yysize; yyk += 1) + if (yystates[yyk]) + { + while (yystates[yyk]) + { + yyGLRState *yys = yystates[yyk]; +]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]] +)[ if (yys->yypred != YY_NULLPTR) + yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[); + yystates[yyk] = yys->yypred; + yystack.yynextFree -= 1; + yystack.yyspaceLeft += 1; + } + break; + } + } + yyfreeGLRStack (&yystack); + } + + return yyresult; +} + +/* DEBUGGING ONLY */ +#if ]b4_api_PREFIX[DEBUG +static void +yy_yypstack (yyGLRState* yys) +{ + if (yys->yypred) + { + yy_yypstack (yys->yypred); + YYFPRINTF (stderr, " -> "); + } + YYFPRINTF (stderr, "%d@@%lu", yys->yylrState, + (unsigned long int) yys->yyposn); +} + +static void +yypstates (yyGLRState* yyst) +{ + if (yyst == YY_NULLPTR) + YYFPRINTF (stderr, "<null>"); + else + yy_yypstack (yyst); + YYFPRINTF (stderr, "\n"); +} + +static void +yypstack (yyGLRStack* yystackp, size_t yyk) +{ + yypstates (yystackp->yytops.yystates[yyk]); +} + +#define YYINDEX(YYX) \ + ((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems) + + +static void +yypdumpstack (yyGLRStack* yystackp) +{ + yyGLRStackItem* yyp; + size_t yyi; + for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1) + { + YYFPRINTF (stderr, "%3lu. ", + (unsigned long int) (yyp - yystackp->yyitems)); + if (*(yybool *) yyp) + { + YYASSERT (yyp->yystate.yyisState); + YYASSERT (yyp->yyoption.yyisState); + YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld", + yyp->yystate.yyresolved, yyp->yystate.yylrState, + (unsigned long int) yyp->yystate.yyposn, + (long int) YYINDEX (yyp->yystate.yypred)); + if (! yyp->yystate.yyresolved) + YYFPRINTF (stderr, ", firstVal: %ld", + (long int) YYINDEX (yyp->yystate + .yysemantics.yyfirstVal)); + } + else + { + YYASSERT (!yyp->yystate.yyisState); + YYASSERT (!yyp->yyoption.yyisState); + YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld", + yyp->yyoption.yyrule - 1, + (long int) YYINDEX (yyp->yyoption.yystate), + (long int) YYINDEX (yyp->yyoption.yynext)); + } + YYFPRINTF (stderr, "\n"); + } + YYFPRINTF (stderr, "Tops:"); + for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) + YYFPRINTF (stderr, "%lu: %ld; ", (unsigned long int) yyi, + (long int) YYINDEX (yystackp->yytops.yystates[yyi])); + YYFPRINTF (stderr, "\n"); +} +#endif + +#undef yylval +#undef yychar +#undef yynerrs]b4_locations_if([ +#undef yylloc]) + +m4_if(b4_prefix, [yy], [], +[[/* Substitute the variable and function names. */ +#define yyparse ]b4_prefix[parse +#define yylex ]b4_prefix[lex +#define yyerror ]b4_prefix[error +#define yylval ]b4_prefix[lval +#define yychar ]b4_prefix[char +#define yydebug ]b4_prefix[debug +#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ +#define yylloc ]b4_prefix[lloc]])])[ + +]b4_epilogue[]dnl +b4_output_end() diff --git a/data/glr.cc b/data/glr.cc new file mode 100644 index 0000000..fbb6de7 --- /dev/null +++ b/data/glr.cc @@ -0,0 +1,345 @@ +# C++ GLR skeleton for Bison + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# This skeleton produces a C++ class that encapsulates a C glr parser. +# This is in order to reduce the maintenance burden. The glr.c +# skeleton is clean and pure enough so that there are no real +# problems. The C++ interface is the same as that of lalr1.cc. In +# fact, glr.c can replace yacc.c without the user noticing any +# difference, and similarly for glr.cc replacing lalr1.cc. +# +# The passing of parse-params +# +# The additional arguments are stored as members of the parser +# object, yyparser. The C routines need to carry yyparser +# throughout the C parser; that's easy: make yyparser an +# additional parse-param. But because the C++ skeleton needs to +# know the "real" original parse-param, we save them +# (b4_parse_param_orig). Note that b4_parse_param is overquoted +# (and c.m4 strips one level of quotes). This is a PITA, and +# explains why there are so many levels of quotes. +# +# The locations +# +# We use location.cc just like lalr1.cc, but because glr.c stores +# the locations in a union, the position and location classes +# must not have a constructor. Therefore, contrary to lalr1.cc, we +# must not define "b4_location_constructors". As a consequence the +# user must initialize the first positions (in particular the +# filename member). + +# We require a pure interface. +m4_define([b4_pure_flag], [1]) + +m4_include(b4_pkgdatadir/[c++.m4]) +b4_bison_locations_if([m4_include(b4_pkgdatadir/[location.cc])]) + +m4_define([b4_parser_class_name], + [b4_percent_define_get([[parser_class_name]])]) + +# Save the parse parameters. +m4_define([b4_parse_param_orig], m4_defn([b4_parse_param])) + +# b4_parse_param_wrap +# ------------------- +# New ones. +m4_ifset([b4_parse_param], +[m4_define([b4_parse_param_wrap], + [[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],] +m4_defn([b4_parse_param]))], +[m4_define([b4_parse_param_wrap], + [[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]]) +]) + + +# b4_yy_symbol_print_define +# ------------------------- +# Bypass the default implementation to generate the "yy_symbol_print" +# and "yy_symbol_value_print" functions. +m4_define([b4_yy_symbol_print_define], +[[ +/*--------------------. +| Print this symbol. | +`--------------------*/ + +]b4_function_define([yy_symbol_print], + [static void], + [[FILE *], []], + [[int yytype], [yytype]], + [[const ]b4_namespace_ref::b4_parser_class_name[::semantic_type *yyvaluep], + [yyvaluep]][]dnl +b4_locations_if([, + [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], + [yylocationp]]]), + b4_parse_param)[ +{ +]b4_parse_param_use[]dnl +[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[); +} +]])[ + +# Hijack the initial action to initialize the locations. +]b4_bison_locations_if([m4_define([b4_initial_action], +[yylloc.initialize ();]m4_ifdef([b4_initial_action], [ +m4_defn([b4_initial_action])]))])[ + +# Hijack the post prologue to insert early definition of YYLLOC_DEFAULT +# and declaration of yyerror. +]m4_append([b4_post_prologue], +[b4_syncline([@oline@], [@ofile@])[ +]b4_yylloc_default_define[ +#define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc) +]b4_function_declare([yyerror], + [static void],b4_locations_if([ + [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], + [yylocationp]],]) + b4_parse_param, + [[const char* msg], [msg]])]) + + +#undef yynerrs +#undef yychar +#undef yylval]b4_locations_if([ +#undef yylloc]) + +m4_if(b4_prefix, [yy], [], +[[/* Substitute the variable and function names. */ +#define yyparse ]b4_prefix[parse +#define yylex ]b4_prefix[lex +#define yyerror ]b4_prefix[error +#define yydebug ]b4_prefix[debug +]]b4_pure_if([], [[ +#define yylval ]b4_prefix[lval +#define yychar ]b4_prefix[char +#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ +#define yylloc ]b4_prefix[lloc]])])) + +# Hijack the epilogue to define implementations (yyerror, parser member +# functions etc.). +m4_append([b4_epilogue], +[b4_syncline([@oline@], [@ofile@])[ + +/*------------------. +| Report an error. | +`------------------*/ + +]b4_function_define([yyerror], + [static void],b4_locations_if([ + [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], + [yylocationp]],]) + b4_parse_param, + [[const char* msg], [msg]])[ +{ +]b4_parse_param_use[]dnl +[ yyparser.error (]b4_locations_if([[*yylocationp, ]])[msg); +} + + +]b4_namespace_open[ +]dnl In this section, the parse params are the original parse_params. +m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl +[ /// Build a parser object. + ]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ + :])[ +#if ]b4_api_PREFIX[DEBUG + ]m4_ifset([b4_parse_param], [ ], [ :])[yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ +#endif]b4_parse_param_cons[ + { + } + + ]b4_parser_class_name::~b4_parser_class_name[ () + { + } + + int + ]b4_parser_class_name[::parse () + { + return ::yyparse (*this]b4_user_args[); + } + +#if ]b4_api_PREFIX[DEBUG + /*--------------------. + | Print this symbol. | + `--------------------*/ + + inline void + ]b4_parser_class_name[::yy_symbol_value_print_ (int yytype, + const semantic_type* yyvaluep]b4_locations_if([[, + const location_type* yylocationp]])[) + {]b4_locations_if([[ + YYUSE (yylocationp);]])[ + YYUSE (yyvaluep); + std::ostream& yyoutput = debug_stream (); + std::ostream& yyo = yyoutput; + YYUSE (yyo); + ]b4_symbol_actions([printer])[ + } + + + void + ]b4_parser_class_name[::yy_symbol_print_ (int yytype, + const semantic_type* yyvaluep]b4_locations_if([[, + const location_type* yylocationp]])[) + { + *yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm") + << ' ' << yytname[yytype] << " ("]b4_locations_if([[ + << *yylocationp << ": "]])[; + yy_symbol_value_print_ (yytype, yyvaluep]b4_locations_if([[, yylocationp]])[); + *yycdebug_ << ')'; + } + + std::ostream& + ]b4_parser_class_name[::debug_stream () const + { + return *yycdebug_; + } + + void + ]b4_parser_class_name[::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + ]b4_parser_class_name[::debug_level_type + ]b4_parser_class_name[::debug_level () const + { + return yydebug; + } + + void + ]b4_parser_class_name[::set_debug_level (debug_level_type l) + { + // Actually, it is yydebug which is really used. + yydebug = l; + } + +#endif +]m4_popdef([b4_parse_param])dnl +b4_namespace_close +]) + +# b4_shared_declarations +# ---------------------- +# Declaration that might either go into the header (if --defines) +# or open coded in the parser body. +m4_define([b4_shared_declarations], +[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl +b4_percent_code_get([[requires]])[ + +#include <stdexcept> +#include <string> +#include <iostream>]b4_defines_if([ +b4_bison_locations_if([[#include "location.hh"]])])[ + +]b4_YYDEBUG_define[ + +]b4_namespace_open[ +]b4_defines_if([], +[b4_bison_locations_if([b4_position_define +b4_location_define])])[ + + /// A Bison parser. + class ]b4_parser_class_name[ + { + public: +]b4_public_types_declare[ + + /// Build a parser object. + ]b4_parser_class_name[ (]b4_parse_param_decl[); + virtual ~]b4_parser_class_name[ (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + + /// The current debugging stream. + std::ostream& debug_stream () const; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); + + public: + /// Report a syntax error.]b4_locations_if([[ + /// \param loc where the syntax error is found.]])[ + /// \param msg a description of the syntax error. + virtual void error (]b4_locations_if([[const location_type& loc, ]])[const std::string& msg); + +# if ]b4_api_PREFIX[DEBUG + public: + /// \brief Report a symbol value on the debug stream. + /// \param yytype The token type. + /// \param yyvaluep Its semantic value.]b4_locations_if([[ + /// \param yylocationp Its location.]])[ + virtual void yy_symbol_value_print_ (int yytype, + const semantic_type* yyvaluep]b4_locations_if([[, + const location_type* yylocationp]])[); + /// \brief Report a symbol on the debug stream. + /// \param yytype The token type. + /// \param yyvaluep Its semantic value.]b4_locations_if([[ + /// \param yylocationp Its location.]])[ + virtual void yy_symbol_print_ (int yytype, + const semantic_type* yyvaluep]b4_locations_if([[, + const location_type* yylocationp]])[); + private: + // Debugging. + std::ostream* yycdebug_; +#endif + +]b4_parse_param_vars[ + }; + +]dnl Redirections for glr.c. +b4_percent_define_flag_if([[global_tokens_and_yystype]], +[b4_token_defines]) +[ +#ifndef ]b4_api_PREFIX[STYPE +# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type +#endif +#ifndef ]b4_api_PREFIX[LTYPE +# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type +#endif + +]b4_namespace_close[ +]b4_percent_code_get([[provides]])[ +]m4_popdef([b4_parse_param])dnl +]) + +b4_defines_if( +[b4_output_begin([b4_spec_defines_file]) +b4_copyright([Skeleton interface for Bison GLR parsers in C++], + [2002-2015])[ + +// C++ GLR parser skeleton written by Akim Demaille. + +]b4_cpp_guard_open([b4_spec_defines_file])[ +]b4_shared_declarations[ +]b4_cpp_guard_close([b4_spec_defines_file])[ +]b4_output_end()]) + +# Let glr.c (and b4_shared_declarations) believe that the user +# arguments include the parser itself. +m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_wrap])) +m4_include(b4_pkgdatadir/[glr.c]) +m4_popdef([b4_parse_param]) diff --git a/data/java-skel.m4 b/data/java-skel.m4 new file mode 100644 index 0000000..9b5cb24 --- /dev/null +++ b/data/java-skel.m4 @@ -0,0 +1,26 @@ + -*- Autoconf -*- + +# Java skeleton dispatching for Bison. + +# Copyright (C) 2007, 2009-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +b4_glr_if( [b4_complain([%%glr-parser not supported for Java])]) +b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for Java])]) + +m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.java]]) +m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) + +m4_include(b4_used_skeleton) diff --git a/data/java.m4 b/data/java.m4 new file mode 100644 index 0000000..b319626 --- /dev/null +++ b/data/java.m4 @@ -0,0 +1,342 @@ + -*- Autoconf -*- + +# Java language support for Bison + +# Copyright (C) 2007-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +m4_include(b4_pkgdatadir/[c-like.m4]) + + +# b4_list2(LIST1, LIST2) +# ---------------------- +# Join two lists with a comma if necessary. +m4_define([b4_list2], + [$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2]) + + +# b4_percent_define_get3(DEF, PRE, POST, NOT) +# ------------------------------------------- +# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed, +# otherwise NOT. +m4_define([b4_percent_define_get3], + [m4_ifval(m4_quote(b4_percent_define_get([$1])), + [$2[]b4_percent_define_get([$1])[]$3], [$4])]) + + + +# b4_flag_value(BOOLEAN-FLAG) +# --------------------------- +m4_define([b4_flag_value], [b4_flag_if([$1], [true], [false])]) + + +# b4_public_if(TRUE, FALSE) +# ------------------------- +b4_percent_define_default([[public]], [[false]]) +m4_define([b4_public_if], +[b4_percent_define_flag_if([public], [$1], [$2])]) + + +# b4_abstract_if(TRUE, FALSE) +# --------------------------- +b4_percent_define_default([[abstract]], [[false]]) +m4_define([b4_abstract_if], +[b4_percent_define_flag_if([abstract], [$1], [$2])]) + + +# b4_final_if(TRUE, FALSE) +# --------------------------- +b4_percent_define_default([[final]], [[false]]) +m4_define([b4_final_if], +[b4_percent_define_flag_if([final], [$1], [$2])]) + + +# b4_strictfp_if(TRUE, FALSE) +# --------------------------- +b4_percent_define_default([[strictfp]], [[false]]) +m4_define([b4_strictfp_if], +[b4_percent_define_flag_if([strictfp], [$1], [$2])]) + + +# b4_lexer_if(TRUE, FALSE) +# ------------------------ +m4_define([b4_lexer_if], +[b4_percent_code_ifdef([[lexer]], [$1], [$2])]) + + +# b4_identification +# ----------------- +m4_define([b4_identification], +[ /** Version number for the Bison executable that generated this parser. */ + public static final String bisonVersion = "b4_version"; + + /** Name of the skeleton that generated this parser. */ + public static final String bisonSkeleton = b4_skeleton; +]) + + +## ------------ ## +## Data types. ## +## ------------ ## + +# b4_int_type(MIN, MAX) +# --------------------- +# Return the smallest int type able to handle numbers ranging from +# MIN to MAX (included). +m4_define([b4_int_type], +[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte], + b4_ints_in($@, [-32768], [32767]), [1], [short], + [int])]) + +# b4_int_type_for(NAME) +# --------------------- +# Return the smallest int type able to handle numbers ranging from +# 'NAME_min' to 'NAME_max' (included). +m4_define([b4_int_type_for], +[b4_int_type($1_min, $1_max)]) + +# b4_null +# ------- +m4_define([b4_null], [null]) + + +# b4_typed_parser_table_define(TYPE, NAME, DATA, COMMENT) +# ------------------------------------------------------- +m4_define([b4_typed_parser_table_define], +[m4_ifval([$4], [b4_comment([$4]) + ])dnl +[private static final ]$1[ yy$2_[] = yy$2_init(); + private static final ]$1[[] yy$2_init() + { + return new ]$1[[] + { + ]$3[ + }; + }]]) + + +# b4_integral_parser_table_define(NAME, DATA, COMMENT) +#----------------------------------------------------- +m4_define([b4_integral_parser_table_define], +[b4_typed_parser_table_define([b4_int_type_for([$2])], [$1], [$2], [$3])]) + + +## ------------------------- ## +## Assigning token numbers. ## +## ------------------------- ## + +# b4_token_enum(TOKEN-NUM) +# ------------------------ +# Output the definition of this token as an enum. +m4_define([b4_token_enum], +[b4_token_format([ /** Token number, to be returned by the scanner. */ + static final int %s = %s; +], [$1])]) + +# b4_token_enums +# -------------- +# Output the definition of the tokens (if there are) as enums. +m4_define([b4_token_enums], +[b4_any_token_visible_if([/* Tokens. */ +b4_symbol_foreach([b4_token_enum])])]) + +# b4-case(ID, CODE) +# ----------------- +# We need to fool Java's stupid unreachable code detection. +m4_define([b4_case], [ case $1: + if (yyn == $1) + $2; + break; + ]) + +# b4_predicate_case(LABEL, CONDITIONS) +# ------------------------------------ +m4_define([b4_predicate_case], [ case $1: + if (! ($2)) YYERROR; + break; + ]) + + +## -------- ## +## Checks. ## +## -------- ## + +b4_percent_define_check_kind([[api.value.type]], [code], [deprecated]) + +b4_percent_define_check_kind([[annotations]], [code], [deprecated]) +b4_percent_define_check_kind([[extends]], [code], [deprecated]) +b4_percent_define_check_kind([[implements]], [code], [deprecated]) +b4_percent_define_check_kind([[init_throws]], [code], [deprecated]) +b4_percent_define_check_kind([[lex_throws]], [code], [deprecated]) +b4_percent_define_check_kind([[parser_class_name]], [code], [deprecated]) +b4_percent_define_check_kind([[throws]], [code], [deprecated]) + + + +## ---------------- ## +## Default values. ## +## ---------------- ## + +m4_define([b4_yystype], [b4_percent_define_get([[api.value.type]])]) +b4_percent_define_default([[api.value.type]], [[Object]]) + +# %name-prefix +m4_define_default([b4_prefix], [[YY]]) + +b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser]) +m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])]) + +b4_percent_define_default([[lex_throws]], [[java.io.IOException]]) +m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])]) + +b4_percent_define_default([[throws]], []) +m4_define([b4_throws], [b4_percent_define_get([[throws]])]) + +b4_percent_define_default([[init_throws]], []) +m4_define([b4_init_throws], [b4_percent_define_get([[init_throws]])]) + +b4_percent_define_default([[api.location.type]], [Location]) +m4_define([b4_location_type], [b4_percent_define_get([[api.location.type]])]) + +b4_percent_define_default([[api.position.type]], [Position]) +m4_define([b4_position_type], [b4_percent_define_get([[api.position.type]])]) + + +## ----------------- ## +## Semantic Values. ## +## ----------------- ## + + +# b4_lhs_value([TYPE]) +# -------------------- +# Expansion of $<TYPE>$. +m4_define([b4_lhs_value], [yyval]) + + +# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) +# -------------------------------------- +# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH +# symbols on RHS. +# +# In this simple implementation, %token and %type have class names +# between the angle brackets. +m4_define([b4_rhs_value], +[(m4_ifval($3, [($3)])[](yystack.valueAt ($1-($2))))]) + +# b4_lhs_location() +# ----------------- +# Expansion of @$. +m4_define([b4_lhs_location], +[(yyloc)]) + + +# b4_rhs_location(RULE-LENGTH, NUM) +# --------------------------------- +# Expansion of @NUM, where the current rule has RULE-LENGTH symbols +# on RHS. +m4_define([b4_rhs_location], +[yystack.locationAt ($1-($2))]) + + +# b4_lex_param +# b4_parse_param +# -------------- +# If defined, b4_lex_param arrives double quoted, but below we prefer +# it to be single quoted. Same for b4_parse_param. + +# TODO: should be in bison.m4 +m4_define_default([b4_lex_param], [[]]) +m4_define([b4_lex_param], b4_lex_param) +m4_define([b4_parse_param], b4_parse_param) + +# b4_lex_param_decl +# ----------------- +# Extra formal arguments of the constructor. +m4_define([b4_lex_param_decl], +[m4_ifset([b4_lex_param], + [b4_remove_comma([$1], + b4_param_decls(b4_lex_param))], + [$1])]) + +m4_define([b4_param_decls], + [m4_map([b4_param_decl], [$@])]) +m4_define([b4_param_decl], [, $1]) + +m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)]) + + + +# b4_parse_param_decl +# ------------------- +# Extra formal arguments of the constructor. +m4_define([b4_parse_param_decl], +[m4_ifset([b4_parse_param], + [b4_remove_comma([$1], + b4_param_decls(b4_parse_param))], + [$1])]) + + + +# b4_lex_param_call +# ----------------- +# Delegating the lexer parameters to the lexer constructor. +m4_define([b4_lex_param_call], + [m4_ifset([b4_lex_param], + [b4_remove_comma([$1], + b4_param_calls(b4_lex_param))], + [$1])]) +m4_define([b4_param_calls], + [m4_map([b4_param_call], [$@])]) +m4_define([b4_param_call], [, $2]) + + + +# b4_parse_param_cons +# ------------------- +# Extra initialisations of the constructor. +m4_define([b4_parse_param_cons], + [m4_ifset([b4_parse_param], + [b4_constructor_calls(b4_parse_param)])]) + +m4_define([b4_constructor_calls], + [m4_map([b4_constructor_call], [$@])]) +m4_define([b4_constructor_call], + [this.$2 = $2; + ]) + + + +# b4_parse_param_vars +# ------------------- +# Extra instance variables. +m4_define([b4_parse_param_vars], + [m4_ifset([b4_parse_param], + [ + /* User arguments. */ +b4_var_decls(b4_parse_param)])]) + +m4_define([b4_var_decls], + [m4_map_sep([b4_var_decl], [ +], [$@])]) +m4_define([b4_var_decl], + [ protected final $1;]) + + + +# b4_maybe_throws(THROWS) +# ----------------------- +# Expand to either an empty string or "throws THROWS". +m4_define([b4_maybe_throws], + [m4_ifval($1, [throws $1])]) diff --git a/data/lalr1.cc b/data/lalr1.cc new file mode 100644 index 0000000..3773257 --- /dev/null +++ b/data/lalr1.cc @@ -0,0 +1,1172 @@ +# C++ skeleton for Bison + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +m4_include(b4_pkgdatadir/[c++.m4]) + +# api.value.type=variant is valid. +m4_define([b4_value_type_setup_variant]) + +# b4_integral_parser_table_declare(TABLE-NAME, CONTENT, COMMENT) +# -------------------------------------------------------------- +# Declare "parser::yy<TABLE-NAME>_" whose contents is CONTENT. +m4_define([b4_integral_parser_table_declare], +[m4_ifval([$3], [b4_comment([$3], [ ]) +])dnl + static const b4_int_type_for([$2]) yy$1_[[]];dnl +]) + +# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT) +# ------------------------------------------------------------- +# Define "parser::yy<TABLE-NAME>_" whose contents is CONTENT. +m4_define([b4_integral_parser_table_define], +[ const b4_int_type_for([$2]) + b4_parser_class_name::yy$1_[[]] = + { + $2 + };dnl +]) + +# b4_symbol_value_template(VAL, [TYPE]) +# ------------------------------------- +# Same as b4_symbol_value, but used in a template method. It makes +# a difference when using variants. Note that b4_value_type_setup_union +# overrides b4_symbol_value, so we must override it again. +m4_copy([b4_symbol_value], [b4_symbol_value_template]) +m4_append([b4_value_type_setup_union], + [m4_copy_force([b4_symbol_value_union], [b4_symbol_value_template])]) + +# b4_lhs_value([TYPE]) +# -------------------- +# Expansion of $<TYPE>$. +m4_define([b4_lhs_value], + [b4_symbol_value([yylhs.value], [$1])]) + + +# b4_lhs_location() +# ----------------- +# Expansion of @$. +m4_define([b4_lhs_location], + [yylhs.location]) + + +# b4_rhs_data(RULE-LENGTH, NUM) +# ----------------------------- +# Return the data corresponding to the symbol #NUM, where the current +# rule has RULE-LENGTH symbols on RHS. +m4_define([b4_rhs_data], + [yystack_@{b4_subtract($@)@}]) + + +# b4_rhs_state(RULE-LENGTH, NUM) +# ------------------------------ +# The state corresponding to the symbol #NUM, where the current +# rule has RULE-LENGTH symbols on RHS. +m4_define([b4_rhs_state], + [b4_rhs_data([$1], [$2]).state]) + + +# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) +# -------------------------------------- +# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH +# symbols on RHS. +m4_define([b4_rhs_value], + [b4_symbol_value([b4_rhs_data([$1], [$2]).value], [$3])]) + + +# b4_rhs_location(RULE-LENGTH, NUM) +# --------------------------------- +# Expansion of @NUM, where the current rule has RULE-LENGTH symbols +# on RHS. +m4_define([b4_rhs_location], + [b4_rhs_data([$1], [$2]).location]) + + +# b4_symbol_action(SYMBOL-NUM, KIND) +# ---------------------------------- +# Run the action KIND (destructor or printer) for SYMBOL-NUM. +# Same as in C, but using references instead of pointers. +m4_define([b4_symbol_action], +[b4_symbol_if([$1], [has_$2], +[m4_pushdef([b4_symbol_value], m4_defn([b4_symbol_value_template]))[]dnl +b4_dollar_pushdef([yysym.value], + b4_symbol_if([$1], [has_type], + [m4_dquote(b4_symbol([$1], [type]))]), + [yysym.location])dnl + b4_symbol_case_([$1]) +b4_syncline([b4_symbol([$1], [$2_line])], ["b4_symbol([$1], [$2_file])"]) + b4_symbol([$1], [$2]) +b4_syncline([@oline@], [@ofile@]) + break; + +m4_popdef([b4_symbol_value])[]dnl +b4_dollar_popdef[]dnl +])]) + + +# b4_lex +# ------ +# Call yylex. +m4_define([b4_lex], +[b4_token_ctor_if( +[b4_function_call([yylex], + [symbol_type], m4_ifdef([b4_lex_param], b4_lex_param))], +[b4_function_call([yylex], [int], + [b4_api_PREFIX[STYPE*], [&yyla.value]][]dnl +b4_locations_if([, [[location*], [&yyla.location]]])dnl +m4_ifdef([b4_lex_param], [, ]b4_lex_param))])]) + + +m4_pushdef([b4_copyright_years], + [2002-2015]) + +m4_define([b4_parser_class_name], + [b4_percent_define_get([[parser_class_name]])]) + +b4_bison_locations_if([# Backward compatibility. + m4_define([b4_location_constructors]) + m4_include(b4_pkgdatadir/[location.cc])]) +m4_include(b4_pkgdatadir/[stack.hh]) +b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])]) + +# b4_shared_declarations +# ---------------------- +# Declaration that might either go into the header (if --defines) +# or open coded in the parser body. +m4_define([b4_shared_declarations], +[b4_percent_code_get([[requires]])[ +]b4_parse_assert_if([# include <cassert>])[ +# include <cstdlib> // std::abort +# include <iostream> +# include <stdexcept> +# include <string> +# include <vector>]b4_defines_if([[ +# include "stack.hh" +]b4_bison_locations_if([[# include "location.hh"]])])[ +]b4_variant_if([b4_variant_includes])[ + +]b4_attribute_define[ +]b4_YYDEBUG_define[ + +]b4_namespace_open[ + +]b4_defines_if([], +[b4_stack_define +b4_bison_locations_if([b4_position_define +b4_location_define])])[ + +]b4_variant_if([b4_variant_define])[ + + /// A Bison parser. + class ]b4_parser_class_name[ + { + public: +]b4_public_types_declare[ + /// Build a parser object. + ]b4_parser_class_name[ (]b4_parse_param_decl[); + virtual ~]b4_parser_class_name[ (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if ]b4_api_PREFIX[DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error.]b4_locations_if([[ + /// \param loc where the syntax error is found.]])[ + /// \param msg a description of the syntax error. + virtual void error (]b4_locations_if([[const location_type& loc, ]])[const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + private: + /// This class is not copyable. + ]b4_parser_class_name[ (const ]b4_parser_class_name[&); + ]b4_parser_class_name[& operator= (const ]b4_parser_class_name[&); + + /// State numbers. + typedef int state_type; + + /// Generate an error message. + /// \param yystate the state where the error occurred. + /// \param yyla the lookahead token. + virtual std::string yysyntax_error_ (state_type yystate, + const symbol_type& yyla) const; + + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_; + static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_; + + /// Convert a scanner token number \a t to a symbol number. + static token_number_type yytranslate_ (]b4_token_ctor_if([token_type], [int])[ t); + + // Tables. +]b4_parser_tables_declare[]b4_error_verbose_if([ + + /// Convert the symbol name \a n to a form suitable for a diagnostic. + static std::string yytnamerr_ (const char *n);])[ + +]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[ + /// For a symbol, its name in clear. + static const char* const yytname_[]; +]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[ +]b4_integral_parser_table_declare([rline], [b4_rline], + [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[ + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r); + /// Print the state stack on the debug stream. + virtual void yystack_print_ (); + + // Debugging. + int yydebug_; + std::ostream* yycdebug_; + + /// \brief Display a symbol type, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template <typename Base> + void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template <typename Base> + void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state (); + + /// The symbol type as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s); + + /// Copy constructor. + by_state (const by_state& other); + + /// Record that this symbol is empty. + void clear (); + + /// Steal the symbol type from \a that. + void move (by_state& that); + + /// The (internal) type number (corresponding to \a state). + /// \a empty_symbol when empty. + symbol_number_type type_get () const; + + /// The state number used to denote an empty symbol. + enum { empty_state = -1 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol<by_state> + { + /// Superclass. + typedef basic_symbol<by_state> super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, symbol_type& sym); + /// Assignment, needed by push_back. + stack_symbol_type& operator= (const stack_symbol_type& that); + }; + + /// Stack type. + typedef stack<stack_symbol_type> stack_type; + + /// The stack. + stack_type yystack_; + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, stack_symbol_type& s); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, state_type s, symbol_type& sym); + + /// Pop \a n symbols the three stacks. + void yypop_ (unsigned int n = 1); + + /// Constants. + enum + { + yyeof_ = 0, + yylast_ = ]b4_last[, ///< Last index in yytable_. + yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols. + yyfinal_ = ]b4_final_state_number[, ///< Termination state number. + yyterror_ = 1, + yyerrcode_ = 256, + yyntokens_ = ]b4_tokens_number[ ///< Number of tokens. + }; + +]b4_parse_param_vars[ + }; + +]b4_token_ctor_if([b4_yytranslate_define +b4_public_types_define])[ +]b4_namespace_close[ + +]b4_percent_define_flag_if([[global_tokens_and_yystype]], +[b4_token_defines + +#ifndef ]b4_api_PREFIX[STYPE + // Redirection for backward compatibility. +# define ]b4_api_PREFIX[STYPE b4_namespace_ref::b4_parser_class_name::semantic_type +#endif +])[ +]b4_percent_code_get([[provides]])[ +]]) + +b4_defines_if( +[b4_output_begin([b4_spec_defines_file]) +b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++]) +[ +/** + ** \file ]b4_spec_defines_file[ + ** Define the ]b4_namespace_ref[::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +]b4_cpp_guard_open([b4_spec_defines_file])[ +]b4_shared_declarations[ +]b4_cpp_guard_close([b4_spec_defines_file]) +b4_output_end() +]) + + +b4_output_begin([b4_parser_file_name]) +b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++]) +b4_percent_code_get([[top]])[]dnl +m4_if(b4_prefix, [yy], [], +[ +// Take the name prefix into account. +#define yylex b4_prefix[]lex])[ + +// First part of user declarations. +]b4_user_pre_prologue[ + +]b4_null_define[ + +]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]], + [b4_shared_declarations])[ + +// User implementation prologue. +]b4_user_post_prologue[ +]b4_percent_code_get[ + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +]b4_locations_if([dnl +[#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +]b4_yylloc_default_define])[ + +// Suppress unused-variable warnings by "using" E. +#define YYUSE(E) ((void) (E)) + +// Enable debugging if requested. +#if ]b4_api_PREFIX[DEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << std::endl; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yystack_print_ (); \ + } while (false) + +#else // !]b4_api_PREFIX[DEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast<void>(0) +# define YY_STACK_PRINT() static_cast<void>(0) + +#endif // !]b4_api_PREFIX[DEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +]b4_namespace_open[]b4_error_verbose_if([[ + + /* Return YYSTR after stripping away unnecessary quotes and + backslashes, so that it's suitable for yyerror. The heuristic is + that double-quoting is unnecessary unless the string contains an + apostrophe, a comma, or backslash (other than backslash-backslash). + YYSTR is taken from yytname. */ + std::string + ]b4_parser_class_name[::yytnamerr_ (const char *yystr) + { + if (*yystr == '"') + { + std::string yyr = ""; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + // Fall through. + default: + yyr += *yyp; + break; + + case '"': + return yyr; + } + do_not_strip_quotes: ; + } + + return yystr; + } +]])[ + + /// Build a parser object. + ]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ + :])[ +#if ]b4_api_PREFIX[DEBUG + ]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false), + yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ +#endif]b4_parse_param_cons[ + {} + + ]b4_parser_class_name::~b4_parser_class_name[ () + {} + + + /*---------------. + | Symbol types. | + `---------------*/ + +]b4_token_ctor_if([], [b4_public_types_define])[ + + // by_state. + inline + ]b4_parser_class_name[::by_state::by_state () + : state (empty_state) + {} + + inline + ]b4_parser_class_name[::by_state::by_state (const by_state& other) + : state (other.state) + {} + + inline + void + ]b4_parser_class_name[::by_state::clear () + { + state = empty_state; + } + + inline + void + ]b4_parser_class_name[::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + inline + ]b4_parser_class_name[::by_state::by_state (state_type s) + : state (s) + {} + + inline + ]b4_parser_class_name[::symbol_number_type + ]b4_parser_class_name[::by_state::type_get () const + { + if (state == empty_state) + return empty_symbol; + else + return yystos_[state]; + } + + inline + ]b4_parser_class_name[::stack_symbol_type::stack_symbol_type () + {} + + + inline + ]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that) + : super_type (s]b4_locations_if([, that.location])[) + { + ]b4_variant_if([b4_symbol_variant([that.type_get ()], + [value], [move], [that.value])], + [[value = that.value;]])[ + // that is emptied. + that.type = empty_symbol; + } + + inline + ]b4_parser_class_name[::stack_symbol_type& + ]b4_parser_class_name[::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + ]b4_variant_if([b4_symbol_variant([that.type_get ()], + [value], [copy], [that.value])], + [[value = that.value;]])[]b4_locations_if([ + location = that.location;])[ + return *this; + } + + + template <typename Base> + inline + void + ]b4_parser_class_name[::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym);]b4_variant_if([], [ + + // User destructor. + b4_symbol_actions([destructor], [yysym.type_get ()])])[ + } + +#if ]b4_api_PREFIX[DEBUG + template <typename Base> + void + ]b4_parser_class_name[::yy_print_ (std::ostream& yyo, + const basic_symbol<Base>& yysym) const + { + std::ostream& yyoutput = yyo; + YYUSE (yyoutput); + symbol_number_type yytype = yysym.type_get (); + // Avoid a (spurious) G++ 4.8 warning about "array subscript is + // below array bounds". + if (yysym.empty ()) + std::abort (); + yyo << (yytype < yyntokens_ ? "token" : "nterm") + << ' ' << yytname_[yytype] << " ("]b4_locations_if([ + << yysym.location << ": "])[; + ]b4_symbol_actions([printer])[ + yyo << ')'; + } +#endif + + inline + void + ]b4_parser_class_name[::yypush_ (const char* m, state_type s, symbol_type& sym) + { + stack_symbol_type t (s, sym); + yypush_ (m, t); + } + + inline + void + ]b4_parser_class_name[::yypush_ (const char* m, stack_symbol_type& s) + { + if (m) + YY_SYMBOL_PRINT (m, s); + yystack_.push (s); + } + + inline + void + ]b4_parser_class_name[::yypop_ (unsigned int n) + { + yystack_.pop (n); + } + +#if ]b4_api_PREFIX[DEBUG + std::ostream& + ]b4_parser_class_name[::debug_stream () const + { + return *yycdebug_; + } + + void + ]b4_parser_class_name[::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + ]b4_parser_class_name[::debug_level_type + ]b4_parser_class_name[::debug_level () const + { + return yydebug_; + } + + void + ]b4_parser_class_name[::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // ]b4_api_PREFIX[DEBUG + + inline ]b4_parser_class_name[::state_type + ]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - yyntokens_] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - yyntokens_]; + } + + inline bool + ]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + inline bool + ]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + ]b4_parser_class_name[::parse () + { + // State. + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla;]b4_locations_if([[ + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3];]])[ + + /// The return value of parse (). + int yyresult; + + // FIXME: This shoud be completely indented. It is not yet to + // avoid gratuitous conflicts when merging into the master branch. + try + { + YYCDEBUG << "Starting parse" << std::endl; + +]m4_ifdef([b4_initial_action], [ +b4_dollar_pushdef([yyla.value], [], [yyla.location])dnl + // User initialization code. + b4_user_initial_action +b4_dollar_popdef])[]dnl + + [ /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, yyla); + + // A new symbol was pushed on the stack. + yynewstate: + YYCDEBUG << "Entering state " << yystack_[0].state << std::endl; + + // Accept? + if (yystack_[0].state == yyfinal_) + goto yyacceptlab; + + goto yybackup; + + // Backup. + yybackup: + + // Try to take a decision without lookahead. + yyn = yypact_[yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token: "; + try + {]b4_token_ctor_if([[ + symbol_type yylookahead (]b4_lex[); + yyla.move (yylookahead);]], [[ + yyla.type = yytranslate_ (]b4_lex[);]])[ + } + catch (const syntax_error& yyexc) + { + error (yyexc); + goto yyerrlab1; + } + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.type_get (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ()) + goto yydefault; + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", yyn, yyla); + goto yynewstate; + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + /*-----------------------------. + | yyreduce -- Do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([ + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [build])], [ + /* If YYLEN is nonzero, implement the default value of the + action: '$$ = $1'. Otherwise, use the top of the stack. + + Otherwise, the following line sets YYLHS.VALUE to garbage. + This behavior is undocumented and Bison users should not rely + upon it. */ + if (yylen) + yylhs.value = yystack_@{yylen - 1@}.value; + else + yylhs.value = yystack_@{0@}.value;])[ +]b4_locations_if([dnl +[ + // Compute the default @@$. + { + slice<stack_symbol_type, stack_type> slice (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, slice, yylen); + }]])[ + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); + try + { + switch (yyn) + { +]b4_user_actions[ + default: + break; + } + } + catch (const syntax_error& yyexc) + { + error (yyexc); + YYERROR; + } + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, yylhs); + } + goto yynewstate; + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + error (]b4_join(b4_locations_if([yyla.location]), + [[yysyntax_error_ (yystack_[0].state, yyla)]])[); + } + +]b4_locations_if([[ + yyerror_range[1].location = yyla.location;]])[ + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.type_get () == yyeof_) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (false) + goto yyerrorlab;]b4_locations_if([[ + yyerror_range[1].location = yystack_[yylen - 1].location;]])[ + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + goto yyerrlab1; + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + { + stack_symbol_type error_token; + for (;;) + { + yyn = yypact_[yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += yyterror_; + if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; +]b4_locations_if([[ + yyerror_range[1].location = yystack_[0].location;]])[ + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } +]b4_locations_if([[ + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);]])[ + + // Shift the error token. + error_token.state = yyn; + yypush_ ("Shifting", error_token); + } + goto yynewstate; + + // Accept. + yyacceptlab: + yyresult = 0; + goto yyreturn; + + // Abort. + yyabortlab: + yyresult = 1; + goto yyreturn; + + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack" + << std::endl; + // Do not try to display the values of the reclaimed symbols, + // as their printer might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } + } + + void + ]b4_parser_class_name[::error (const syntax_error& yyexc) + { + error (]b4_join(b4_locations_if([yyexc.location]), + [[yyexc.what()]])[); + } + + // Generate an error message. + std::string + ]b4_parser_class_name[::yysyntax_error_ (]dnl +b4_error_verbose_if([state_type yystate, const symbol_type& yyla], + [state_type, const symbol_type&])[) const + {]b4_error_verbose_if([[ + // Number of reported tokens (one for the "unexpected", one per + // "expected"). + size_t yycount = 0; + // Its maximum. + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + // Arguments of yyformat. + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state + merging (from LALR or IELR) and default reductions corrupt the + expected token list. However, the list is correct for + canonical LR with one exception: it will still contain any + token that will not be accepted due to an error action in a + later state. + */ + if (!yyla.empty ()) + { + int yytoken = yyla.type_get (); + yyarg[yycount++] = yytname_[yytoken]; + int yyn = yypact_[yystate]; + if (!yy_pact_value_is_default_ (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + // Stay within bounds of both yycheck and yytname. + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; + for (int yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ + && !yy_table_value_is_error_ (yytable_[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + break; + } + else + yyarg[yycount++] = yytname_[yyx]; + } + } + } + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + size_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += yytnamerr_ (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres;]], [[ + return YY_("syntax error");]])[ + } + + + const ]b4_int_type(b4_pact_ninf, b4_pact_ninf) b4_parser_class_name::yypact_ninf_ = b4_pact_ninf[; + + const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[; + +]b4_parser_tables_define[ + +]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[ + // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + // First, the terminals, then, starting at \a yyntokens_, nonterminals. + const char* + const ]b4_parser_class_name[::yytname_[] = + { + ]b4_tname[ + }; + +]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[ +]b4_integral_parser_table_define([rline], [b4_rline])[ + + // Print the state stack on the debug stream. + void + ]b4_parser_class_name[::yystack_print_ () + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << i->state; + *yycdebug_ << std::endl; + } + + // Report on the debug stream that the rule \a yyrule is going to be reduced. + void + ]b4_parser_class_name[::yy_reduce_print_ (int yyrule) + { + unsigned int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):" << std::endl; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + ]b4_rhs_data(yynrhs, yyi + 1)[); + } +#endif // ]b4_api_PREFIX[DEBUG + +]b4_token_ctor_if([], [b4_yytranslate_define])[ +]b4_namespace_close[ +]b4_epilogue[]dnl +b4_output_end() + + +m4_popdef([b4_copyright_years])dnl diff --git a/data/lalr1.java b/data/lalr1.java new file mode 100644 index 0000000..670ea01 --- /dev/null +++ b/data/lalr1.java @@ -0,0 +1,1071 @@ +# Java skeleton for Bison -*- autoconf -*- + +# Copyright (C) 2007-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +m4_include(b4_pkgdatadir/[java.m4]) + +b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], + [b4_skeleton])]) + +# We do not depend on %debug in Java, but pacify warnings about +# non-used flags. +b4_parse_trace_if([0], [0]) + +m4_define([b4_symbol_no_destructor_assert], +[b4_symbol_if([$1], [has_destructor], + [b4_fatal([%s: %s: %%destructor does not make sense in Java], + [b4_skeleton], + [b4_symbol_action_location([$1], [destructor])])])]) +b4_symbol_foreach([b4_symbol_no_destructor_assert]) + +# Setup some macros for api.push-pull. +b4_percent_define_default([[api.push-pull]], [[pull]]) +b4_percent_define_check_values([[[[api.push-pull]], + [[pull]], [[push]], [[both]]]]) + +# Define m4 conditional macros that encode the value +# of the api.push-pull flag. +b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]]) +b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]]) +m4_case(b4_percent_define_get([[api.push-pull]]), + [pull], [m4_define([b4_push_flag], [[0]])], + [push], [m4_define([b4_pull_flag], [[0]])]) + +# Define a macro to be true when api.push-pull has the value "both". +m4_define([b4_both_if],[b4_push_if([b4_pull_if([$1],[$2])],[$2])]) + +# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing +# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the +# behavior of Bison at all when push parsing is already requested. +b4_define_flag_if([use_push_for_pull]) +b4_use_push_for_pull_if([ + b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])], + [m4_define([b4_push_flag], [[1]])])]) + +# Define a macro to encapsulate the parse state variables. +# This allows them to be defined either in parse() when doing +# pull parsing, or as class instance variable when doing push parsing. +m4_define([b4_define_state],[[ + /* Lookahead and lookahead in internal form. */ + int yychar = yyempty_; + int yytoken = 0; + + /* State. */ + int yyn = 0; + int yylen = 0; + int yystate = 0; + YYStack yystack = new YYStack (); + int label = YYNEWSTATE; + + /* Error handling. */ + int yynerrs_ = 0; + ]b4_locations_if([/* The location where the error started. */ + b4_location_type yyerrloc = null; + + /* Location. */ + b4_location_type yylloc = new b4_location_type (null, null);])[ + + /* Semantic value of the lookahead. */ + ]b4_yystype[ yylval = null; +]]) + +b4_output_begin([b4_parser_file_name]) +b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java], + [2007-2015]) + +b4_percent_define_ifdef([package], [package b4_percent_define_get([package]); +])[/* First part of user declarations. */ +]b4_user_pre_prologue +b4_user_post_prologue +b4_percent_code_get([[imports]]) +[/** + * A Bison parser, automatically generated from <tt>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>. + * + * @@author LALR (1) parser skeleton written by Paolo Bonzini. + */ +]b4_percent_define_get3([annotations], [], [ ])dnl +b4_public_if([public ])dnl +b4_abstract_if([abstract ])dnl +b4_final_if([final ])dnl +b4_strictfp_if([strictfp ])dnl +[class ]b4_parser_class_name[]dnl +b4_percent_define_get3([extends], [ extends ])dnl +b4_percent_define_get3([implements], [ implements ])[ +{ + ]b4_identification[ +]b4_error_verbose_if([[ + /** + * True if verbose error messages are enabled. + */ + private boolean yyErrorVerbose = true; + + /** + * Return whether verbose error messages are enabled. + */ + public final boolean getErrorVerbose() { return yyErrorVerbose; } + + /** + * Set the verbosity of error messages. + * @@param verbose True to request verbose error messages. + */ + public final void setErrorVerbose(boolean verbose) + { yyErrorVerbose = verbose; } +]]) + +b4_locations_if([[ + /** + * A class defining a pair of positions. Positions, defined by the + * <code>]b4_position_type[</code> class, denote a point in the input. + * Locations represent a part of the input through the beginning + * and ending positions. + */ + public class ]b4_location_type[ { + /** + * The first, inclusive, position in the range. + */ + public ]b4_position_type[ begin; + + /** + * The first position beyond the range. + */ + public ]b4_position_type[ end; + + /** + * Create a <code>]b4_location_type[</code> denoting an empty range located at + * a given point. + * @@param loc The position at which the range is anchored. + */ + public ]b4_location_type[ (]b4_position_type[ loc) { + this.begin = this.end = loc; + } + + /** + * Create a <code>]b4_location_type[</code> from the endpoints of the range. + * @@param begin The first position included in the range. + * @@param end The first position beyond the range. + */ + public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) { + this.begin = begin; + this.end = end; + } + + /** + * Print a representation of the location. For this to be correct, + * <code>]b4_position_type[</code> should override the <code>equals</code> + * method. + */ + public String toString () { + if (begin.equals (end)) + return begin.toString (); + else + return begin.toString () + "-" + end.toString (); + } + } + +]]) + + b4_locations_if([[ + private ]b4_location_type[ yylloc (YYStack rhs, int n) + { + if (n > 0) + return new ]b4_location_type[ (rhs.locationAt (n-1).begin, rhs.locationAt (0).end); + else + return new ]b4_location_type[ (rhs.locationAt (0).end); + }]])[ + + /** + * Communication interface between the scanner and the Bison-generated + * parser <tt>]b4_parser_class_name[</tt>. + */ + public interface Lexer { + /** Token returned by the scanner to signal the end of its input. */ + public static final int EOF = 0; + +]b4_token_enums[ + + ]b4_locations_if([[/** + * Method to retrieve the beginning position of the last scanned token. + * @@return the position at which the last scanned token starts. + */ + ]b4_position_type[ getStartPos (); + + /** + * Method to retrieve the ending position of the last scanned token. + * @@return the first position beyond the last scanned token. + */ + ]b4_position_type[ getEndPos ();]])[ + + /** + * Method to retrieve the semantic value of the last scanned token. + * @@return the semantic value of the last scanned token. + */ + ]b4_yystype[ getLVal (); + + /** + * Entry point for the scanner. Returns the token identifier corresponding + * to the next token and prepares to return the semantic value + * ]b4_locations_if([and beginning/ending positions ])[of the token. + * @@return the token identifier corresponding to the next token. + */ + int yylex () ]b4_maybe_throws([b4_lex_throws])[; + + /** + * Entry point for error reporting. Emits an error + * ]b4_locations_if([referring to the given location ])[in a user-defined way. + * + * ]b4_locations_if([[@@param loc The location of the element to which the + * error message is related]])[ + * @@param msg The string for the error message. + */ + void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String msg);] + } + + b4_lexer_if([[private class YYLexer implements Lexer { +]b4_percent_code_get([[lexer]])[ + } + + ]])[/** + * The object doing lexical analysis for us. + */ + private Lexer yylexer; + ] + b4_parse_param_vars + +b4_lexer_if([[ + /** + * Instantiates the Bison-generated parser. + */ + public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) ]b4_maybe_throws([b4_init_throws])[ + { + ]b4_percent_code_get([[init]])[ + this.yylexer = new YYLexer(]b4_lex_param_call[); + ]b4_parse_param_cons[ + } +]]) + + /** + * Instantiates the Bison-generated parser. + * @@param yylexer The scanner that will supply tokens to the parser. + */ + b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) ]b4_maybe_throws([b4_init_throws])[ + { + ]b4_percent_code_get([[init]])[ + this.yylexer = yylexer; + ]b4_parse_param_cons[ + } + + private java.io.PrintStream yyDebugStream = System.err; + + /** + * Return the <tt>PrintStream</tt> on which the debugging output is + * printed. + */ + public final java.io.PrintStream getDebugStream () { return yyDebugStream; } + + /** + * Set the <tt>PrintStream</tt> on which the debug output is printed. + * @@param s The stream that is used for debugging output. + */ + public final void setDebugStream(java.io.PrintStream s) { yyDebugStream = s; } + + private int yydebug = 0; + + /** + * Answer the verbosity of the debugging output; 0 means that all kinds of + * output from the parser are suppressed. + */ + public final int getDebugLevel() { return yydebug; } + + /** + * Set the verbosity of the debugging output; 0 means that all kinds of + * output from the parser are suppressed. + * @@param level The verbosity level for debugging output. + */ + public final void setDebugLevel(int level) { yydebug = level; } + + /** + * Print an error message via the lexer. + *]b4_locations_if([[ Use a <code>null</code> location.]])[ + * @@param msg The error message. + */ + public final void yyerror (String msg) + { + yylexer.yyerror (]b4_locations_if([[(]b4_location_type[)null, ]])[msg); + } +]b4_locations_if([[ + /** + * Print an error message via the lexer. + * @@param loc The location associated with the message. + * @@param msg The error message. + */ + public final void yyerror (]b4_location_type[ loc, String msg) + { + yylexer.yyerror (loc, msg); + } + + /** + * Print an error message via the lexer. + * @@param pos The position associated with the message. + * @@param msg The error message. + */ + public final void yyerror (]b4_position_type[ pos, String msg) + { + yylexer.yyerror (new ]b4_location_type[ (pos), msg); + }]]) + + [protected final void yycdebug (String s) { + if (yydebug > 0) + yyDebugStream.println (s); + } + + private final class YYStack { + private int[] stateStack = new int[16]; + ]b4_locations_if([[private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[ + private ]b4_yystype[[] valueStack = new ]b4_yystype[[16]; + + public int size = 16; + public int height = -1; + + public final void push (int state, ]b4_yystype[ value]dnl + b4_locations_if([, ]b4_location_type[ loc])[) { + height++; + if (size == height) + { + int[] newStateStack = new int[size * 2]; + System.arraycopy (stateStack, 0, newStateStack, 0, height); + stateStack = newStateStack; + ]b4_locations_if([[ + ]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2]; + System.arraycopy (locStack, 0, newLocStack, 0, height); + locStack = newLocStack;]]) + + b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2]; + System.arraycopy (valueStack, 0, newValueStack, 0, height); + valueStack = newValueStack; + + size *= 2; + } + + stateStack[height] = state; + ]b4_locations_if([[locStack[height] = loc;]])[ + valueStack[height] = value; + } + + public final void pop () { + pop (1); + } + + public final void pop (int num) { + // Avoid memory leaks... garbage collection is a white lie! + if (num > 0) { + java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null); + ]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[ + } + height -= num; + } + + public final int stateAt (int i) { + return stateStack[height - i]; + } + + ]b4_locations_if([[public final ]b4_location_type[ locationAt (int i) { + return locStack[height - i]; + } + + ]])[public final ]b4_yystype[ valueAt (int i) { + return valueStack[height - i]; + } + + // Print the state stack on the debug stream. + public void print (java.io.PrintStream out) + { + out.print ("Stack now"); + + for (int i = 0; i <= height; i++) + { + out.print (' '); + out.print (stateStack[i]); + } + out.println (); + } + } + + /** + * Returned by a Bison action in order to stop the parsing process and + * return success (<tt>true</tt>). + */ + public static final int YYACCEPT = 0; + + /** + * Returned by a Bison action in order to stop the parsing process and + * return failure (<tt>false</tt>). + */ + public static final int YYABORT = 1; + +]b4_push_if([ + /** + * Returned by a Bison action in order to request a new token. + */ + public static final int YYPUSH_MORE = 4;])[ + + /** + * Returned by a Bison action in order to start error recovery without + * printing an error message. + */ + public static final int YYERROR = 2; + + /** + * Internal return codes that are not supported for user semantic + * actions. + */ + private static final int YYERRLAB = 3; + private static final int YYNEWSTATE = 4; + private static final int YYDEFAULT = 5; + private static final int YYREDUCE = 6; + private static final int YYERRLAB1 = 7; + private static final int YYRETURN = 8; +]b4_push_if([[ private static final int YYGETTOKEN = 9; /* Signify that a new token is expected when doing push-parsing. */]])[ + + private int yyerrstatus_ = 0; + +]b4_push_if([dnl +b4_define_state])[ + /** + * Return whether error recovery is being done. In this state, the parser + * reads token until it reaches a known state, and then restarts normal + * operation. + */ + public final boolean recovering () + { + return yyerrstatus_ == 0; + } + + /** Compute post-reduction state. + * @@param yystate the current state + * @@param yysym the nonterminal to push on the stack + */ + private int yy_lr_goto_state_ (int yystate, int yysym) + { + int yyr = yypgoto_[yysym - yyntokens_] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - yyntokens_]; + } + + private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[ + { + ]b4_yystype[ yyval; + ]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[ + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. Otherwise, use the top of the stack. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. */ + if (yylen > 0) + yyval = yystack.valueAt (yylen - 1); + else + yyval = yystack.valueAt (0); + + yy_reduce_print (yyn, yystack); + + switch (yyn) + { + ]b4_user_actions[ + default: break; + } + + yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[); + + yystack.pop (yylen); + yylen = 0; + + /* Shift the result of the reduction. */ + int yystate = yy_lr_goto_state_ (yystack.stateAt (0), yyr1_[yyn]); + yystack.push (yystate, yyval]b4_locations_if([, yyloc])[); + return YYNEWSTATE; + } + +]b4_error_verbose_if([[ + /* Return YYSTR after stripping away unnecessary quotes and + backslashes, so that it's suitable for yyerror. The heuristic is + that double-quoting is unnecessary unless the string contains an + apostrophe, a comma, or backslash (other than backslash-backslash). + YYSTR is taken from yytname. */ + private final String yytnamerr_ (String yystr) + { + if (yystr.charAt (0) == '"') + { + StringBuffer yyr = new StringBuffer (); + strip_quotes: for (int i = 1; i < yystr.length (); i++) + switch (yystr.charAt (i)) + { + case '\'': + case ',': + break strip_quotes; + + case '\\': + if (yystr.charAt(++i) != '\\') + break strip_quotes; + /* Fall through. */ + default: + yyr.append (yystr.charAt (i)); + break; + + case '"': + return yyr.toString (); + } + } + else if (yystr.equals ("$end")) + return "end of input"; + + return yystr; + } +]])[ + + /*--------------------------------. + | Print this symbol on YYOUTPUT. | + `--------------------------------*/ + + private void yy_symbol_print (String s, int yytype, + ]b4_yystype[ yyvaluep]dnl + b4_locations_if([, Object yylocationp])[) + { + if (yydebug > 0) + yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ") + + yytname_[yytype] + " ("]b4_locations_if([ + + yylocationp + ": "])[ + + (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")"); + } + +]b4_push_if([],[[ + /** + * Parse input from the scanner that was specified at object construction + * time. Return whether the end of the input was reached successfully. + * + * @@return <tt>true</tt> if the parsing succeeds. Note that this does not + * imply that there were no syntax errors. + */ + public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[]])[ +]b4_push_if([ + /** + * Push Parse input from external lexer + * + * @@param yylextoken current token + * @@param yylexval current lval +]b4_locations_if([ * @@param yylexloc current position])[ + * + * @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt> + */ + public int push_parse (int yylextoken, b4_yystype yylexval[]b4_locations_if([, b4_location_type yylexloc])) + b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[ + { + ]b4_locations_if([/* @@$. */ + b4_location_type yyloc;])[ +]b4_push_if([],[[ +]b4_define_state[ + yycdebug ("Starting parse\n"); + yyerrstatus_ = 0; + + /* Initialize the stack. */ + yystack.push (yystate, yylval ]b4_locations_if([, yylloc])[); +]m4_ifdef([b4_initial_action], [ +b4_dollar_pushdef([yylval], [], [yylloc])dnl + /* User initialization code. */ + b4_user_initial_action +b4_dollar_popdef[]dnl +])[ +]])[ +]b4_push_if([[ + if (!this.push_parse_initialized) + { + push_parse_initialize (); +]m4_ifdef([b4_initial_action], [ +b4_dollar_pushdef([yylval], [], [yylloc])dnl + /* User initialization code. */ + b4_user_initial_action +b4_dollar_popdef[]dnl +])[ + yycdebug ("Starting parse\n"); + yyerrstatus_ = 0; + } else + label = YYGETTOKEN; + + boolean push_token_consumed = true; +]])[ + for (;;) + switch (label) + { + /* New state. Unlike in the C/C++ skeletons, the state is already + pushed when we come here. */ + case YYNEWSTATE: + yycdebug ("Entering state " + yystate + "\n"); + if (yydebug > 0) + yystack.print (yyDebugStream); + + /* Accept? */ + if (yystate == yyfinal_) + ]b4_push_if([{label = YYACCEPT; break;}], + [return true;])[ + + /* Take a decision. First try without lookahead. */ + yyn = yypact_[yystate]; + if (yy_pact_value_is_default_ (yyn)) + { + label = YYDEFAULT; + break; + } +]b4_push_if([ /* Fall Through */ + + case YYGETTOKEN:])[ + /* Read a lookahead token. */ + if (yychar == yyempty_) + { +]b4_push_if([[ + if (!push_token_consumed) + return YYPUSH_MORE; + yycdebug ("Reading a token: "); + yychar = yylextoken; + yylval = yylexval;]b4_locations_if([ + yylloc = yylexloc;])[ + push_token_consumed = false;]])[ +]b4_push_if([],[[ + yycdebug ("Reading a token: "); + yychar = yylexer.yylex (); + yylval = yylexer.getLVal ();]b4_locations_if([ + yylloc = new b4_location_type (yylexer.getStartPos (), + yylexer.getEndPos ());])[ +]])[ + } + + /* Convert token to internal form. */ + if (yychar <= Lexer.EOF) + { + yychar = yytoken = Lexer.EOF; + yycdebug ("Now at end of input.\n"); + } + else + { + yytoken = yytranslate_ (yychar); + yy_symbol_print ("Next token is", yytoken, + yylval]b4_locations_if([, yylloc])[); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) + label = YYDEFAULT; + + /* <= 0 means reduce or error. */ + else if ((yyn = yytable_[yyn]) <= 0) + { + if (yy_table_value_is_error_ (yyn)) + label = YYERRLAB; + else + { + yyn = -yyn; + label = YYREDUCE; + } + } + + else + { + /* Shift the lookahead token. */ + yy_symbol_print ("Shifting", yytoken, + yylval]b4_locations_if([, yylloc])[); + + /* Discard the token being shifted. */ + yychar = yyempty_; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus_ > 0) + --yyerrstatus_; + + yystate = yyn; + yystack.push (yystate, yylval]b4_locations_if([, yylloc])[); + label = YYNEWSTATE; + } + break; + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + case YYDEFAULT: + yyn = yydefact_[yystate]; + if (yyn == 0) + label = YYERRLAB; + else + label = YYREDUCE; + break; + + /*-----------------------------. + | yyreduce -- Do a reduction. | + `-----------------------------*/ + case YYREDUCE: + yylen = yyr2_[yyn]; + label = yyaction (yyn, yystack, yylen); + yystate = yystack.stateAt (0); + break; + + /*------------------------------------. + | yyerrlab -- here on detecting error | + `------------------------------------*/ + case YYERRLAB: + /* If not already recovering from an error, report this error. */ + if (yyerrstatus_ == 0) + { + ++yynerrs_; + if (yychar == yyempty_) + yytoken = yyempty_; + yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken)); + } + + ]b4_locations_if([yyerrloc = yylloc;])[ + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= Lexer.EOF) + { + /* Return failure if at end of input. */ + if (yychar == Lexer.EOF) + ]b4_push_if([{label = YYABORT; break;}],[return false;])[ + } + else + yychar = yyempty_; + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + label = YYERRLAB1; + break; + + /*-------------------------------------------------. + | errorlab -- error raised explicitly by YYERROR. | + `-------------------------------------------------*/ + case YYERROR: + + ]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[ + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + yystack.pop (yylen); + yylen = 0; + yystate = yystack.stateAt (0); + label = YYERRLAB1; + break; + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + case YYERRLAB1: + yyerrstatus_ = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact_[yystate]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += yyterror_; + if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the + * error token. */ + if (yystack.height == 0) + ]b4_push_if([{label = YYABORT; break;}],[return false;])[ + + ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[ + yystack.pop (); + yystate = yystack.stateAt (0); + if (yydebug > 0) + yystack.print (yyDebugStream); + } + + if (label == YYABORT) + /* Leave the switch. */ + break; + +]b4_locations_if([ + /* Muck with the stack to setup for yylloc. */ + yystack.push (0, null, yylloc); + yystack.push (0, null, yyerrloc); + yyloc = yylloc (yystack, 2); + yystack.pop (2);])[ + + /* Shift the error token. */ + yy_symbol_print ("Shifting", yystos_[yyn], + yylval]b4_locations_if([, yyloc])[); + + yystate = yyn; + yystack.push (yyn, yylval]b4_locations_if([, yyloc])[); + label = YYNEWSTATE; + break; + + /* Accept. */ + case YYACCEPT: + ]b4_push_if([this.push_parse_initialized = false; return YYACCEPT;], + [return true;])[ + + /* Abort. */ + case YYABORT: + ]b4_push_if([this.push_parse_initialized = false; return YYABORT;], + [return false;])[ + } +} +]b4_push_if([[ + boolean push_parse_initialized = false; + + /** + * (Re-)Initialize the state of the push parser. + */ + public void push_parse_initialize() + { + /* Lookahead and lookahead in internal form. */ + this.yychar = yyempty_; + this.yytoken = 0; + + /* State. */ + this.yyn = 0; + this.yylen = 0; + this.yystate = 0; + this.yystack = new YYStack (); + this.label = YYNEWSTATE; + + /* Error handling. */ + this.yynerrs_ = 0; + ]b4_locations_if([/* The location where the error started. */ + this.yyerrloc = null; + this.yylloc = new b4_location_type (null, null);])[ + + /* Semantic value of the lookahead. */ + this.yylval = null; + + yystack.push (this.yystate, this.yylval]b4_locations_if([, this.yylloc])[); + + this.push_parse_initialized = true; + + } +]b4_locations_if([ + /** + * Push parse given input from an external lexer. + * + * @@param yylextoken current token + * @@param yylexval current lval + * @@param yyylexpos current position + * + * @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt> + */ + public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type yylexpos) + b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])]) + { + return push_parse (yylextoken, yylexval, new b4_location_type (yylexpos)); + } +])[]]) + +b4_both_if([[ + /** + * Parse input from the scanner that was specified at object construction + * time. Return whether the end of the input was reached successfully. + * This version of parse () is defined only when api.push-push=both. + * + * @@return <tt>true</tt> if the parsing succeeds. Note that this does not + * imply that there were no syntax errors. + */ + public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[ + { + if (yylexer == null) + throw new NullPointerException("Null Lexer"); + int status; + do { + int token = yylexer.yylex(); + ]b4_yystype[ lval = yylexer.getLVal(); +]b4_locations_if([dnl + b4_location_type yyloc = new b4_location_type (yylexer.getStartPos (), + yylexer.getEndPos ());])[ + ]b4_locations_if([status = push_parse(token,lval,yyloc);],[ + status = push_parse(token,lval);])[ + } while (status == YYPUSH_MORE); + return (status == YYACCEPT); + } +]])[ + + // Generate an error message. + private String yysyntax_error (int yystate, int tok) + {]b4_error_verbose_if([[ + if (yyErrorVerbose) + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, + then the only way this function was invoked is if the + default action is an error action. In that case, don't + check for expected tokens because there are none. + - The only way there can be no lookahead present (in tok) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this + state is a consistent state with a default action. There + might have been a previous inconsistent state, consistent + state with a non-default action, or user semantic action + that manipulated yychar. (However, yychar is currently out + of scope during semantic actions.) + - Of course, the expected token list depends on states to + have correct lookahead information, and it depends on the + parser not to perform extra reductions after fetching a + lookahead from the scanner and before detecting a syntax + error. Thus, state merging (from LALR or IELR) and default + reductions corrupt the expected token list. However, the + list is correct for canonical LR with one exception: it + will still contain any token that will not be accepted due + to an error action in a later state. + */ + if (tok != yyempty_) + { + /* FIXME: This method of building the message is not compatible + with internationalization. */ + StringBuffer res = + new StringBuffer ("syntax error, unexpected "); + res.append (yytnamerr_ (yytname_[tok])); + int yyn = yypact_[yystate]; + if (!yy_pact_value_is_default_ (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative + indexes in YYCHECK. In other words, skip the first + -YYN actions for this state because they are default + actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; + int count = 0; + for (int x = yyxbegin; x < yyxend; ++x) + if (yycheck_[x + yyn] == x && x != yyterror_ + && !yy_table_value_is_error_ (yytable_[x + yyn])) + ++count; + if (count < 5) + { + count = 0; + for (int x = yyxbegin; x < yyxend; ++x) + if (yycheck_[x + yyn] == x && x != yyterror_ + && !yy_table_value_is_error_ (yytable_[x + yyn])) + { + res.append (count++ == 0 ? ", expecting " : " or "); + res.append (yytnamerr_ (yytname_[x])); + } + } + } + return res.toString (); + } + } +]])[ + return "syntax error"; + } + + /** + * Whether the given <code>yypact_</code> value indicates a defaulted state. + * @@param yyvalue the value to check + */ + private static boolean yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + /** + * Whether the given <code>yytable_</code> + * value indicates a syntax error. + * @@param yyvalue the value to check + */ + private static boolean yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[; + private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[; + + ]b4_parser_tables_define[ + ]b4_integral_parser_table_define([token_number], [b4_toknum], + [[YYTOKEN_NUMBER[YYLEX-NUM] -- Internal symbol number corresponding + to YYLEX-NUM.]])[ + + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at \a yyntokens_, nonterminals. */ + ]b4_typed_parser_table_define([String], [tname], [b4_tname])[ + + ]b4_integral_parser_table_define([rline], [b4_rline], + [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[ + + + // Report on the debug stream that the rule yyrule is going to be reduced. + private void yy_reduce_print (int yyrule, YYStack yystack) + { + if (yydebug == 0) + return; + + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + /* Print the symbols being reduced, and their result. */ + yycdebug ("Reducing stack by rule " + (yyrule - 1) + + " (line " + yylno + "), "); + + /* The symbols being reduced. */ + for (int yyi = 0; yyi < yynrhs; yyi++) + yy_symbol_print (" $" + (yyi + 1) + " =", + yystos_[yystack.stateAt(yynrhs - (yyi + 1))], + ]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([, + b4_rhs_location(yynrhs, yyi + 1)])[); + } + + /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ + ]b4_integral_parser_table_define([translate_table], [b4_translate])[ + + private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t) + { + if (t >= 0 && t <= yyuser_token_number_max_) + return yytranslate_table_[t]; + else + return yyundef_token_; + } + + private static final int yylast_ = ]b4_last[; + private static final int yynnts_ = ]b4_nterms_number[; + private static final int yyempty_ = -2; + private static final int yyfinal_ = ]b4_final_state_number[; + private static final int yyterror_ = 1; + private static final int yyerrcode_ = 256; + private static final int yyntokens_ = ]b4_tokens_number[; + + private static final int yyuser_token_number_max_ = ]b4_user_token_number_max[; + private static final int yyundef_token_ = ]b4_undef_token_number[; + +]/* User implementation code. */ +b4_percent_code_get[]dnl + +} + +b4_epilogue[]dnl +b4_output_end() diff --git a/data/local.mk b/data/local.mk new file mode 100644 index 0000000..9b0b068 --- /dev/null +++ b/data/local.mk @@ -0,0 +1,45 @@ +## Copyright (C) 2002, 2005-2015 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 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see <http://www.gnu.org/licenses/>. + +dist_pkgdata_DATA = \ + data/README \ + data/bison.m4 \ + data/c++-skel.m4 \ + data/c++.m4 \ + data/c-like.m4 \ + data/c-skel.m4 \ + data/c.m4 \ + data/glr.c \ + data/glr.cc \ + data/java-skel.m4 \ + data/java.m4 \ + data/lalr1.cc \ + data/lalr1.java \ + data/location.cc \ + data/stack.hh \ + data/variant.hh \ + data/yacc.c + +m4sugardir = $(pkgdatadir)/m4sugar +dist_m4sugar_DATA = \ + data/m4sugar/foreach.m4 \ + data/m4sugar/m4sugar.m4 + +xsltdir = $(pkgdatadir)/xslt +dist_xslt_DATA = \ + data/xslt/bison.xsl \ + data/xslt/xml2dot.xsl \ + data/xslt/xml2text.xsl \ + data/xslt/xml2xhtml.xsl diff --git a/data/location.cc b/data/location.cc new file mode 100644 index 0000000..53fddd4 --- /dev/null +++ b/data/location.cc @@ -0,0 +1,340 @@ +# C++ skeleton for Bison + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +m4_pushdef([b4_copyright_years], + [2002-2015]) + +# b4_position_define +# ------------------ +# Define class position. +m4_define([b4_position_define], +[[ /// Abstract a position. + class position + { + public:]m4_ifdef([b4_location_constructors], [[ + /// Construct a position. + explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR, + unsigned int l = ]b4_location_initial_line[u, + unsigned int c = ]b4_location_initial_column[u) + : filename (f) + , line (l) + , column (c) + { + } + +]])[ + /// Initialization. + void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR, + unsigned int l = ]b4_location_initial_line[u, + unsigned int c = ]b4_location_initial_column[u) + { + filename = fn; + line = l; + column = c; + } + + /** \name Line and Column related manipulators + ** \{ */ + /// (line related) Advance to the COUNT next lines. + void lines (int count = 1) + { + if (count) + { + column = ]b4_location_initial_column[u; + line = add_ (line, count, ]b4_location_initial_line[); + } + } + + /// (column related) Advance to the COUNT next columns. + void columns (int count = 1) + { + column = add_ (column, count, ]b4_location_initial_column[); + } + /** \} */ + + /// File name to which this position refers. + ]b4_percent_define_get([[filename_type]])[* filename; + /// Current line number. + unsigned int line; + /// Current column number. + unsigned int column; + + private: + /// Compute max(min, lhs+rhs) (provided min <= lhs). + static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min) + { + return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs + ? rhs + lhs + : min); + } + }; + + /// Add \a width columns, in place. + inline position& + operator+= (position& res, int width) + { + res.columns (width); + return res; + } + + /// Add \a width columns. + inline position + operator+ (position res, int width) + { + return res += width; + } + + /// Subtract \a width columns, in place. + inline position& + operator-= (position& res, int width) + { + return res += -width; + } + + /// Subtract \a width columns. + inline position + operator- (position res, int width) + { + return res -= width; + } +]b4_percent_define_flag_if([[define_location_comparison]], [[ + /// Compare two position objects. + inline bool + operator== (const position& pos1, const position& pos2) + { + return (pos1.line == pos2.line + && pos1.column == pos2.column + && (pos1.filename == pos2.filename + || (pos1.filename && pos2.filename + && *pos1.filename == *pos2.filename))); + } + + /// Compare two position objects. + inline bool + operator!= (const position& pos1, const position& pos2) + { + return !(pos1 == pos2); + } +]])[ + /** \brief Intercept output stream redirection. + ** \param ostr the destination output stream + ** \param pos a reference to the position to redirect + */ + template <typename YYChar> + inline std::basic_ostream<YYChar>& + operator<< (std::basic_ostream<YYChar>& ostr, const position& pos) + { + if (pos.filename) + ostr << *pos.filename << ':'; + return ostr << pos.line << '.' << pos.column; + } +]]) + + +# b4_location_define +# ------------------ +m4_define([b4_location_define], +[[ /// Abstract a location. + class location + { + public: +]m4_ifdef([b4_location_constructors], [ + /// Construct a location from \a b to \a e. + location (const position& b, const position& e) + : begin (b) + , end (e) + { + } + + /// Construct a 0-width location in \a p. + explicit location (const position& p = position ()) + : begin (p) + , end (p) + { + } + + /// Construct a 0-width location in \a f, \a l, \a c. + explicit location (]b4_percent_define_get([[filename_type]])[* f, + unsigned int l = ]b4_location_initial_line[u, + unsigned int c = ]b4_location_initial_column[u) + : begin (f, l, c) + , end (f, l, c) + { + } + +])[ + /// Initialization. + void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR, + unsigned int l = ]b4_location_initial_line[u, + unsigned int c = ]b4_location_initial_column[u) + { + begin.initialize (f, l, c); + end = begin; + } + + /** \name Line and Column related manipulators + ** \{ */ + public: + /// Reset initial location to final location. + void step () + { + begin = end; + } + + /// Extend the current location to the COUNT next columns. + void columns (int count = 1) + { + end += count; + } + + /// Extend the current location to the COUNT next lines. + void lines (int count = 1) + { + end.lines (count); + } + /** \} */ + + + public: + /// Beginning of the located region. + position begin; + /// End of the located region. + position end; + }; + + /// Join two locations, in place. + inline location& operator+= (location& res, const location& end) + { + res.end = end.end; + return res; + } + + /// Join two locations. + inline location operator+ (location res, const location& end) + { + return res += end; + } + + /// Add \a width columns to the end position, in place. + inline location& operator+= (location& res, int width) + { + res.columns (width); + return res; + } + + /// Add \a width columns to the end position. + inline location operator+ (location res, int width) + { + return res += width; + } + + /// Subtract \a width columns to the end position, in place. + inline location& operator-= (location& res, int width) + { + return res += -width; + } + + /// Subtract \a width columns to the end position. + inline location operator- (location res, int width) + { + return res -= width; + } +]b4_percent_define_flag_if([[define_location_comparison]], [[ + /// Compare two location objects. + inline bool + operator== (const location& loc1, const location& loc2) + { + return loc1.begin == loc2.begin && loc1.end == loc2.end; + } + + /// Compare two location objects. + inline bool + operator!= (const location& loc1, const location& loc2) + { + return !(loc1 == loc2); + } +]])[ + /** \brief Intercept output stream redirection. + ** \param ostr the destination output stream + ** \param loc a reference to the location to redirect + ** + ** Avoid duplicate information. + */ + template <typename YYChar> + inline std::basic_ostream<YYChar>& + operator<< (std::basic_ostream<YYChar>& ostr, const location& loc) + { + unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; + ostr << loc.begin; + if (loc.end.filename + && (!loc.begin.filename + || *loc.begin.filename != *loc.end.filename)) + ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col; + else if (loc.begin.line < loc.end.line) + ostr << '-' << loc.end.line << '.' << end_col; + else if (loc.begin.column < end_col) + ostr << '-' << end_col; + return ostr; + } +]]) + + +b4_defines_if([ +b4_output_begin([b4_dir_prefix[]position.hh]) +b4_copyright([Positions for Bison parsers in C++])[ + +/** + ** \file ]b4_dir_prefix[position.hh + ** Define the ]b4_namespace_ref[::position class. + */ + +]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[ + +# include <algorithm> // std::max +# include <iostream> +# include <string> + +]b4_null_define[ + +]b4_namespace_open[ +]b4_position_define[ +]b4_namespace_close[ +]b4_cpp_guard_close([b4_dir_prefix[]position.hh]) +b4_output_end() + + +b4_output_begin([b4_dir_prefix[]location.hh]) +b4_copyright([Locations for Bison parsers in C++])[ + +/** + ** \file ]b4_dir_prefix[location.hh + ** Define the ]b4_namespace_ref[::location class. + */ + +]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[ + +# include "position.hh" + +]b4_namespace_open[ +]b4_location_define[ +]b4_namespace_close[ +]b4_cpp_guard_close([b4_dir_prefix[]location.hh]) +b4_output_end() +]) + + +m4_popdef([b4_copyright_years]) diff --git a/data/m4sugar/foreach.m4 b/data/m4sugar/foreach.m4 new file mode 100644 index 0000000..f6a6394 --- /dev/null +++ b/data/m4sugar/foreach.m4 @@ -0,0 +1,362 @@ +# -*- Autoconf -*- +# This file is part of Autoconf. +# foreach-based replacements for recursive functions. +# Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes +# GNU M4 1.6 by requiring more memory and macro expansions. +# +# Copyright (C) 2008-2013 Free Software Foundation, Inc. + +# This file is part of Autoconf. This program is free +# software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# Under Section 7 of GPL version 3, you are granted additional +# permissions described in the Autoconf Configure Script Exception, +# version 3.0, as published by the Free Software Foundation. +# +# You should have received a copy of the GNU General Public License +# and a copy of the Autoconf Configure Script Exception along with +# this program; see the files COPYINGv3 and COPYING.EXCEPTION +# respectively. If not, see <http://www.gnu.org/licenses/>. + +# Written by Eric Blake. + +# In M4 1.4.x, every byte of $@ is rescanned. This means that an +# algorithm on n arguments that recurses with one less argument each +# iteration will scan n * (n + 1) / 2 arguments, for O(n^2) time. In +# M4 1.6, this was fixed so that $@ is only scanned once, then +# back-references are made to information stored about the scan. +# Thus, n iterations need only scan n arguments, for O(n) time. +# Additionally, in M4 1.4.x, recursive algorithms did not clean up +# memory very well, requiring O(n^2) memory rather than O(n) for n +# iterations. +# +# This file is designed to overcome the quadratic nature of $@ +# recursion by writing a variant of m4_foreach that uses m4_for rather +# than $@ recursion to operate on the list. This involves more macro +# expansions, but avoids the need to rescan a quadratic number of +# arguments, making these replacements very attractive for M4 1.4.x. +# On the other hand, in any version of M4, expanding additional macros +# costs additional time; therefore, in M4 1.6, where $@ recursion uses +# fewer macros, these replacements actually pessimize performance. +# Additionally, the use of $10 to mean the tenth argument violates +# POSIX; although all versions of m4 1.4.x support this meaning, a +# future m4 version may switch to take it as the first argument +# concatenated with a literal 0, so the implementations in this file +# are not future-proof. Thus, this file is conditionally included as +# part of m4_init(), only when it is detected that M4 probably has +# quadratic behavior (ie. it lacks the macro __m4_version__). +# +# Please keep this file in sync with m4sugar.m4. + +# _m4_foreach(PRE, POST, IGNORED, ARG...) +# --------------------------------------- +# Form the common basis of the m4_foreach and m4_map macros. For each +# ARG, expand PRE[ARG]POST[]. The IGNORED argument makes recursion +# easier, and must be supplied rather than implicit. +# +# This version minimizes the number of times that $@ is evaluated by +# using m4_for to generate a boilerplate into _m4_f then passing $@ to +# that temporary macro. Thus, the recursion is done in m4_for without +# reparsing any user input, and is not quadratic. For an idea of how +# this works, note that m4_foreach(i,[1,2],[i]) calls +# _m4_foreach([m4_define([i],],[)i],[],[1],[2]) +# which defines _m4_f: +# $1[$4]$2[]$1[$5]$2[]_m4_popdef([_m4_f]) +# then calls _m4_f([m4_define([i],],[)i],[],[1],[2]) for a net result: +# m4_define([i],[1])i[]m4_define([i],[2])i[]_m4_popdef([_m4_f]). +m4_define([_m4_foreach], +[m4_if([$#], [3], [], + [m4_pushdef([_m4_f], _m4_for([4], [$#], [1], + [$0_([1], [2],], [)])[_m4_popdef([_m4_f])])_m4_f($@)])]) + +m4_define([_m4_foreach_], +[[$$1[$$3]$$2[]]]) + +# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT) +# ----------------------------------------------------------- +# Find the first VAL that SWITCH matches, and expand the corresponding +# IF-VAL. If there are no matches, expand DEFAULT. +# +# Use m4_for to create a temporary macro in terms of a boilerplate +# m4_if with final cleanup. If $# is even, we have DEFAULT; if it is +# odd, then rounding the last $# up in the temporary macro is +# harmless. For example, both m4_case(1,2,3,4,5) and +# m4_case(1,2,3,4,5,6) result in the intermediate _m4_case being +# m4_if([$1],[$2],[$3],[$1],[$4],[$5],_m4_popdef([_m4_case])[$6]) +m4_define([m4_case], +[m4_if(m4_eval([$# <= 2]), [1], [$2], +[m4_pushdef([_$0], [m4_if(]_m4_for([2], m4_eval([($# - 1) / 2 * 2]), [2], + [_$0_(], [)])[_m4_popdef( + [_$0])]m4_dquote($m4_eval([($# + 1) & ~1]))[)])_$0($@)])]) + +m4_define([_m4_case_], +[$0_([1], [$1], m4_incr([$1]))]) + +m4_define([_m4_case__], +[[[$$1],[$$2],[$$3],]]) + +# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT) +# ----------------------------------------------------- +# m4 equivalent of +# +# if (SWITCH =~ RE1) +# VAL1; +# elif (SWITCH =~ RE2) +# VAL2; +# elif ... +# ... +# else +# DEFAULT +# +# We build the temporary macro _m4_b: +# m4_define([_m4_b], _m4_defn([_m4_bmatch]))_m4_b([$1], [$2], [$3])... +# _m4_b([$1], [$m-1], [$m])_m4_b([], [], [$m+1]_m4_popdef([_m4_b])) +# then invoke m4_unquote(_m4_b($@)), for concatenation with later text. +m4_define([m4_bmatch], +[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])], + [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])], + [$#], 2, [$2], + [m4_pushdef([_m4_b], [m4_define([_m4_b], + _m4_defn([_$0]))]_m4_for([3], m4_eval([($# + 1) / 2 * 2 - 1]), + [2], [_$0_(], [)])[_m4_b([], [],]m4_dquote([$]m4_eval( + [($# + 1) / 2 * 2]))[_m4_popdef([_m4_b]))])m4_unquote(_m4_b($@))])]) + +m4_define([_m4_bmatch], +[m4_if(m4_bregexp([$1], [$2]), [-1], [], [[$3]m4_define([$0])])]) + +m4_define([_m4_bmatch_], +[$0_([1], m4_decr([$1]), [$1])]) + +m4_define([_m4_bmatch__], +[[_m4_b([$$1], [$$2], [$$3])]]) + + +# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT]) +# ------------------------------------------------------------------- +# Similar to m4_if, except that each TEST is expanded when encountered. +# If the expansion of TESTn matches the string VALn, the result is IF-VALn. +# The result is DEFAULT if no tests passed. This macro allows +# short-circuiting of expensive tests, where it pays to arrange quick +# filter tests to run first. +# +# m4_cond already guarantees either 3*n or 3*n + 1 arguments, 1 <= n. +# We only have to speed up _m4_cond, by building the temporary _m4_c: +# m4_define([_m4_c], _m4_defn([m4_unquote]))_m4_c([m4_if(($1), [($2)], +# [[$3]m4_define([_m4_c])])])_m4_c([m4_if(($4), [($5)], +# [[$6]m4_define([_m4_c])])])..._m4_c([m4_if(($m-2), [($m-1)], +# [[$m]m4_define([_m4_c])])])_m4_c([[$m+1]]_m4_popdef([_m4_c])) +# We invoke m4_unquote(_m4_c($@)), for concatenation with later text. +m4_define([_m4_cond], +[m4_pushdef([_m4_c], [m4_define([_m4_c], + _m4_defn([m4_unquote]))]_m4_for([2], m4_eval([$# / 3 * 3 - 1]), [3], + [$0_(], [)])[_m4_c(]m4_dquote(m4_dquote( + [$]m4_eval([$# / 3 * 3 + 1])))[_m4_popdef([_m4_c]))])m4_unquote(_m4_c($@))]) + +m4_define([_m4_cond_], +[$0_(m4_decr([$1]), [$1], m4_incr([$1]))]) + +m4_define([_m4_cond__], +[[_m4_c([m4_if(($$1), [($$2)], [[$$3]m4_define([_m4_c])])])]]) + +# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...) +# ---------------------------------------------------- +# m4 equivalent of +# +# $_ = STRING; +# s/RE1/SUBST1/g; +# s/RE2/SUBST2/g; +# ... +# +# m4_bpatsubsts already validated an odd number of arguments; we only +# need to speed up _m4_bpatsubsts. To avoid nesting, we build the +# temporary _m4_p: +# m4_define([_m4_p], [$1])m4_define([_m4_p], +# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$2], [$3]))m4_define([_m4_p], +# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$4], [$5]))m4_define([_m4_p],... +# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$m-1], [$m]))m4_unquote( +# _m4_defn([_m4_p])_m4_popdef([_m4_p])) +m4_define([_m4_bpatsubsts], +[m4_pushdef([_m4_p], [m4_define([_m4_p], + ]m4_dquote([$]1)[)]_m4_for([3], [$#], [2], [$0_(], + [)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)]) + +m4_define([_m4_bpatsubsts_], +[$0_(m4_decr([$1]), [$1])]) + +m4_define([_m4_bpatsubsts__], +[[m4_define([_m4_p], +m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]]) + +# m4_shiftn(N, ...) +# ----------------- +# Returns ... shifted N times. Useful for recursive "varargs" constructs. +# +# m4_shiftn already validated arguments; we only need to speed up +# _m4_shiftn. If N is 3, then we build the temporary _m4_s, defined as +# ,[$5],[$6],...,[$m]_m4_popdef([_m4_s]) +# before calling m4_shift(_m4_s($@)). +m4_define([_m4_shiftn], +[m4_if(m4_incr([$1]), [$#], [], [m4_pushdef([_m4_s], + _m4_for(m4_eval([$1 + 2]), [$#], [1], + [[,]m4_dquote($], [)])[_m4_popdef([_m4_s])])m4_shift(_m4_s($@))])]) + +# m4_do(STRING, ...) +# ------------------ +# This macro invokes all its arguments (in sequence, of course). It is +# useful for making your macros more structured and readable by dropping +# unnecessary dnl's and have the macros indented properly. +# +# Here, we use the temporary macro _m4_do, defined as +# $1[]$2[]...[]$n[]_m4_popdef([_m4_do]) +m4_define([m4_do], +[m4_if([$#], [0], [], + [m4_pushdef([_$0], _m4_for([1], [$#], [1], + [$], [[[]]])[_m4_popdef([_$0])])_$0($@)])]) + +# m4_dquote_elt(ARGS) +# ------------------- +# Return ARGS as an unquoted list of double-quoted arguments. +# +# _m4_foreach to the rescue. +m4_define([m4_dquote_elt], +[m4_if([$#], [0], [], [[[$1]]_m4_foreach([,m4_dquote(], [)], $@)])]) + +# m4_reverse(ARGS) +# ---------------- +# Output ARGS in reverse order. +# +# Invoke _m4_r($@) with the temporary _m4_r built as +# [$m], [$m-1], ..., [$2], [$1]_m4_popdef([_m4_r]) +m4_define([m4_reverse], +[m4_if([$#], [0], [], [$#], [1], [[$1]], +[m4_pushdef([_m4_r], [[$$#]]_m4_for(m4_decr([$#]), [1], [-1], + [[, ]m4_dquote($], [)])[_m4_popdef([_m4_r])])_m4_r($@)])]) + + +# m4_map_args_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...) +# ------------------------------------------------------------- +# Perform a pairwise grouping of consecutive ARGs, by expanding +# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the +# final argument is expanded with END-EXPR([ARGn]). +# +# Build the temporary macro _m4_map_args_pair, with the $2([$m+1]) +# only output if $# is odd: +# $1([$3], [$4])[]$1([$5], [$6])[]...$1([$m-1], +# [$m])[]m4_default([$2], [$1])([$m+1])[]_m4_popdef([_m4_map_args_pair]) +m4_define([m4_map_args_pair], +[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], + [$#], [1], [m4_fatal([$0: too few arguments: $#: $1])], + [$#], [2], [], + [$#], [3], [m4_default([$2], [$1])([$3])[]], + [m4_pushdef([_$0], _m4_for([3], + m4_eval([$# / 2 * 2 - 1]), [2], [_$0_(], [)])_$0_end( + [1], [2], [$#])[_m4_popdef([_$0])])_$0($@)])]) + +m4_define([_m4_map_args_pair_], +[$0_([1], [$1], m4_incr([$1]))]) + +m4_define([_m4_map_args_pair__], +[[$$1([$$2], [$$3])[]]]) + +m4_define([_m4_map_args_pair_end], +[m4_if(m4_eval([$3 & 1]), [1], [[m4_default([$$2], [$$1])([$$3])[]]])]) + +# m4_join(SEP, ARG1, ARG2...) +# --------------------------- +# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG +# is the empty string. No expansion is performed on SEP or ARGs. +# +# Use a self-modifying separator, since we don't know how many +# arguments might be skipped before a separator is first printed, but +# be careful if the separator contains $. _m4_foreach to the rescue. +m4_define([m4_join], +[m4_pushdef([_m4_sep], [m4_define([_m4_sep], _m4_defn([m4_echo]))])]dnl +[_m4_foreach([_$0([$1],], [)], $@)_m4_popdef([_m4_sep])]) + +m4_define([_m4_join], +[m4_if([$2], [], [], [_m4_sep([$1])[$2]])]) + +# m4_joinall(SEP, ARG1, ARG2...) +# ------------------------------ +# Produce ARG1SEPARG2...SEPARGn. An empty ARG results in back-to-back SEP. +# No expansion is performed on SEP or ARGs. +# +# A bit easier than m4_join. _m4_foreach to the rescue. +m4_define([m4_joinall], +[[$2]m4_if(m4_eval([$# <= 2]), [1], [], + [_m4_foreach([$1], [], m4_shift($@))])]) + +# m4_list_cmp(A, B) +# ----------------- +# Compare the two lists of integer expressions A and B. +# +# m4_list_cmp takes care of any side effects; we only override +# _m4_list_cmp_raw, where we can safely expand lists multiple times. +# First, insert padding so that both lists are the same length; the +# trailing +0 is necessary to handle a missing list. Next, create a +# temporary macro to perform pairwise comparisons until an inequality +# is found. For example, m4_list_cmp([1], [1,2]) creates _m4_cmp as +# m4_if(m4_eval([($1) != ($3)]), [1], [m4_cmp([$1], [$3])], +# m4_eval([($2) != ($4)]), [1], [m4_cmp([$2], [$4])], +# [0]_m4_popdef([_m4_cmp])) +# then calls _m4_cmp([1+0], [0*2], [1], [2+0]) +m4_define([_m4_list_cmp_raw], +[m4_if([$1], [$2], 0, + [_m4_list_cmp($1+0_m4_list_pad(m4_count($1), m4_count($2)), + $2+0_m4_list_pad(m4_count($2), m4_count($1)))])]) + +m4_define([_m4_list_pad], +[m4_if(m4_eval($1 < $2), [1], + [_m4_for(m4_incr([$1]), [$2], [1], [,0*])])]) + +m4_define([_m4_list_cmp], +[m4_pushdef([_m4_cmp], [m4_if(]_m4_for( + [1], m4_eval([$# >> 1]), [1], [$0_(], [,]m4_eval([$# >> 1])[)])[ + [0]_m4_popdef([_m4_cmp]))])_m4_cmp($@)]) + +m4_define([_m4_list_cmp_], +[$0_([$1], m4_eval([$1 + $2]))]) + +m4_define([_m4_list_cmp__], +[[m4_eval([($$1) != ($$2)]), [1], [m4_cmp([$$1], [$$2])], +]]) + +# m4_max(EXPR, ...) +# m4_min(EXPR, ...) +# ----------------- +# Return the decimal value of the maximum (or minimum) in a series of +# integer expressions. +# +# _m4_foreach to the rescue; we only need to replace _m4_minmax. Here, +# we need a temporary macro to track the best answer so far, so that +# the foreach expression is tractable. +m4_define([_m4_minmax], +[m4_pushdef([_m4_best], m4_eval([$2]))_m4_foreach( + [m4_define([_m4_best], $1(_m4_best,], [))], m4_shift($@))]dnl +[_m4_best[]_m4_popdef([_m4_best])]) + +# m4_set_add_all(SET, VALUE...) +# ----------------------------- +# Add each VALUE into SET. This is O(n) in the number of VALUEs, and +# can be faster than calling m4_set_add for each VALUE. +# +# _m4_foreach to the rescue. If no deletions have occurred, then +# avoid the speed penalty of m4_set_add. +m4_define([m4_set_add_all], +[m4_if([$#], [0], [], [$#], [1], [], + [m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1]) + + m4_len(_m4_foreach(m4_ifdef([_m4_set_cleanup($1)], + [[m4_set_add]], [[_$0]])[([$1],], [)], $@))))])]) + +m4_define([_m4_set_add_all], +[m4_ifdef([_m4_set([$1],$2)], [], + [m4_define([_m4_set([$1],$2)], + [1])m4_pushdef([_m4_set([$1])], [$2])-])]) diff --git a/data/m4sugar/m4sugar.m4 b/data/m4sugar/m4sugar.m4 new file mode 100644 index 0000000..b732abc --- /dev/null +++ b/data/m4sugar/m4sugar.m4 @@ -0,0 +1,3307 @@ +divert(-1)# -*- Autoconf -*- +# This file is part of Autoconf. +# Base M4 layer. +# Requires GNU M4. +# +# Copyright (C) 1999-2013 Free Software Foundation, Inc. + +# This file is part of Autoconf. This program is free +# software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# Under Section 7 of GPL version 3, you are granted additional +# permissions described in the Autoconf Configure Script Exception, +# version 3.0, as published by the Free Software Foundation. +# +# You should have received a copy of the GNU General Public License +# and a copy of the Autoconf Configure Script Exception along with +# this program; see the files COPYINGv3 and COPYING.EXCEPTION +# respectively. If not, see <http://www.gnu.org/licenses/>. + +# Written by Akim Demaille. + +# Set the quotes, whatever the current quoting system. +changequote() +changequote([, ]) + +# Some old m4's don't support m4exit. But they provide +# equivalent functionality by core dumping because of the +# long macros we define. +ifdef([__gnu__], , +[errprint(M4sugar requires GNU M4. Install it before installing M4sugar or +set the M4 environment variable to its absolute file name.) +m4exit(2)]) + + +## ------------------------------- ## +## 1. Simulate --prefix-builtins. ## +## ------------------------------- ## + +# m4_define +# m4_defn +# m4_undefine +define([m4_define], defn([define])) +define([m4_defn], defn([defn])) +define([m4_undefine], defn([undefine])) + +m4_undefine([define]) +m4_undefine([defn]) +m4_undefine([undefine]) + + +# m4_copy(SRC, DST) +# ----------------- +# Define DST as the definition of SRC. +# What's the difference between: +# 1. m4_copy([from], [to]) +# 2. m4_define([to], [from($@)]) +# Well, obviously 1 is more expensive in space. Maybe 2 is more expensive +# in time, but because of the space cost of 1, it's not that obvious. +# Nevertheless, one huge difference is the handling of `$0'. If `from' +# uses `$0', then with 1, `to''s `$0' is `to', while it is `from' in 2. +# The user would certainly prefer to see `to'. +# +# This definition is in effect during m4sugar initialization, when +# there are no pushdef stacks; later on, we redefine it to something +# more powerful for all other clients to use. +m4_define([m4_copy], +[m4_define([$2], m4_defn([$1]))]) + + +# m4_rename(SRC, DST) +# ------------------- +# Rename the macro SRC to DST. +m4_define([m4_rename], +[m4_copy([$1], [$2])m4_undefine([$1])]) + + +# m4_rename_m4(MACRO-NAME) +# ------------------------ +# Rename MACRO-NAME to m4_MACRO-NAME. +m4_define([m4_rename_m4], +[m4_rename([$1], [m4_$1])]) + + +# m4_copy_unm4(m4_MACRO-NAME) +# --------------------------- +# Copy m4_MACRO-NAME to MACRO-NAME. +m4_define([m4_copy_unm4], +[m4_copy([$1], m4_bpatsubst([$1], [^m4_\(.*\)], [[\1]]))]) + + +# Some m4 internals have names colliding with tokens we might use. +# Rename them a` la `m4 --prefix-builtins'. Conditionals first, since +# some subsequent renames are conditional. +m4_rename_m4([ifdef]) +m4_rename([ifelse], [m4_if]) + +m4_rename_m4([builtin]) +m4_rename_m4([changecom]) +m4_rename_m4([changequote]) +m4_ifdef([changeword],dnl conditionally available in 1.4.x +[m4_undefine([changeword])]) +m4_rename_m4([debugfile]) +m4_rename_m4([debugmode]) +m4_rename_m4([decr]) +m4_rename_m4([divnum]) +m4_rename_m4([dumpdef]) +m4_rename_m4([errprint]) +m4_rename_m4([esyscmd]) +m4_rename_m4([eval]) +m4_rename_m4([format]) +m4_undefine([include]) +m4_rename_m4([incr]) +m4_rename_m4([index]) +m4_rename_m4([indir]) +m4_rename_m4([len]) +m4_rename([m4exit], [m4_exit]) +m4_undefine([m4wrap]) +m4_ifdef([mkstemp],dnl added in M4 1.4.8 +[m4_rename_m4([mkstemp]) +m4_copy([m4_mkstemp], [m4_maketemp]) +m4_undefine([maketemp])], +[m4_rename_m4([maketemp]) +m4_copy([m4_maketemp], [m4_mkstemp])]) +m4_rename([patsubst], [m4_bpatsubst]) +m4_rename_m4([popdef]) +m4_rename_m4([pushdef]) +m4_rename([regexp], [m4_bregexp]) +m4_rename_m4([shift]) +m4_undefine([sinclude]) +m4_rename_m4([substr]) +m4_ifdef([symbols],dnl present only in alpha-quality 1.4o +[m4_rename_m4([symbols])]) +m4_rename_m4([syscmd]) +m4_rename_m4([sysval]) +m4_rename_m4([traceoff]) +m4_rename_m4([traceon]) +m4_rename_m4([translit]) + +# _m4_defn(ARG) +# ------------- +# _m4_defn is for internal use only - it bypasses the wrapper, so it +# must only be used on one argument at a time, and only on macros +# known to be defined. Make sure this still works if the user renames +# m4_defn but not _m4_defn. +m4_copy([m4_defn], [_m4_defn]) + +# _m4_divert_raw(NUM) +# ------------------- +# _m4_divert_raw is for internal use only. Use this instead of +# m4_builtin([divert], NUM), so that tracing diversion flow is easier. +m4_rename([divert], [_m4_divert_raw]) + +# _m4_popdef(ARG...) +# ------------------ +# _m4_popdef is for internal use only - it bypasses the wrapper, so it +# must only be used on macros known to be defined. Make sure this +# still works if the user renames m4_popdef but not _m4_popdef. +m4_copy([m4_popdef], [_m4_popdef]) + +# _m4_undefine(ARG...) +# -------------------- +# _m4_undefine is for internal use only - it bypasses the wrapper, so +# it must only be used on macros known to be defined. Make sure this +# still works if the user renames m4_undefine but not _m4_undefine. +m4_copy([m4_undefine], [_m4_undefine]) + +# _m4_undivert(NUM...) +# -------------------- +# _m4_undivert is for internal use only, and should always be given +# arguments. Use this instead of m4_builtin([undivert], NUM...), so +# that tracing diversion flow is easier. +m4_rename([undivert], [_m4_undivert]) + + +## ------------------- ## +## 2. Error messages. ## +## ------------------- ## + + +# m4_location +# ----------- +# Output the current file, colon, and the current line number. +m4_define([m4_location], +[__file__:__line__]) + + +# m4_errprintn(MSG) +# ----------------- +# Same as `errprint', but with the missing end of line. +m4_define([m4_errprintn], +[m4_errprint([$1 +])]) + + +# m4_warning(MSG) +# --------------- +# Warn the user. +m4_define([m4_warning], +[m4_errprintn(m4_location[: warning: $1])]) + + +# m4_fatal(MSG, [EXIT-STATUS]) +# ---------------------------- +# Fatal the user. :) +m4_define([m4_fatal], +[m4_errprintn(m4_location[: error: $1] +m4_expansion_stack)m4_exit(m4_if([$2],, 1, [$2]))]) + + +# m4_assert(EXPRESSION, [EXIT-STATUS = 1]) +# ---------------------------------------- +# This macro ensures that EXPRESSION evaluates to true, and exits if +# EXPRESSION evaluates to false. +m4_define([m4_assert], +[m4_if(m4_eval([$1]), 0, + [m4_fatal([assert failed: $1], [$2])])]) + + + +## ------------- ## +## 3. Warnings. ## +## ------------- ## + + +# _m4_warn(CATEGORY, MESSAGE, [STACK-TRACE]) +# ------------------------------------------ +# Report a MESSAGE to the user if the CATEGORY of warnings is enabled. +# This is for traces only. +# If present, STACK-TRACE is a \n-separated list of "LOCATION: MESSAGE", +# where the last line (and no other) ends with "the top level". +# +# Within m4, the macro is a no-op. This macro really matters +# when autom4te post-processes the trace output. +m4_define([_m4_warn], []) + + +# m4_warn(CATEGORY, MESSAGE) +# -------------------------- +# Report a MESSAGE to the user if the CATEGORY of warnings is enabled. +m4_define([m4_warn], +[_m4_warn([$1], [$2], +m4_ifdef([_m4_expansion_stack], [m4_expansion_stack]))]) + + + +## ------------------- ## +## 4. File inclusion. ## +## ------------------- ## + + +# We also want to neutralize include (and sinclude for symmetry), +# but we want to extend them slightly: warn when a file is included +# several times. This is, in general, a dangerous operation, because +# too many people forget to quote the first argument of m4_define. +# +# For instance in the following case: +# m4_define(foo, [bar]) +# then a second reading will turn into +# m4_define(bar, [bar]) +# which is certainly not what was meant. + +# m4_include_unique(FILE) +# ----------------------- +# Declare that the FILE was loading; and warn if it has already +# been included. +m4_define([m4_include_unique], +[m4_ifdef([m4_include($1)], + [m4_warn([syntax], [file `$1' included several times])])dnl +m4_define([m4_include($1)])]) + + +# m4_include(FILE) +# ---------------- +# Like the builtin include, but warns against multiple inclusions. +m4_define([m4_include], +[m4_include_unique([$1])dnl +m4_builtin([include], [$1])]) + + +# m4_sinclude(FILE) +# ----------------- +# Like the builtin sinclude, but warns against multiple inclusions. +m4_define([m4_sinclude], +[m4_include_unique([$1])dnl +m4_builtin([sinclude], [$1])]) + + + +## ------------------------------------ ## +## 5. Additional branching constructs. ## +## ------------------------------------ ## + +# Both `m4_ifval' and `m4_ifset' tests against the empty string. The +# difference is that `m4_ifset' is specialized on macros. +# +# In case of arguments of macros, eg. $1, it makes little difference. +# In the case of a macro `FOO', you don't want to check `m4_ifval(FOO, +# TRUE)', because if `FOO' expands with commas, there is a shifting of +# the arguments. So you want to run `m4_ifval([FOO])', but then you just +# compare the *string* `FOO' against `', which, of course fails. +# +# So you want the variation `m4_ifset' that expects a macro name as $1. +# If this macro is both defined and defined to a non empty value, then +# it runs TRUE, etc. + + +# m4_ifblank(COND, [IF-BLANK], [IF-TEXT]) +# m4_ifnblank(COND, [IF-TEXT], [IF-BLANK]) +# ---------------------------------------- +# If COND is empty, or consists only of blanks (space, tab, newline), +# then expand IF-BLANK, otherwise expand IF-TEXT. This differs from +# m4_ifval only if COND has just whitespace, but it helps optimize in +# spite of users who mistakenly leave trailing space after what they +# thought was an empty argument: +# macro( +# [] +# ) +# +# Writing one macro in terms of the other causes extra overhead, so +# we inline both definitions. +m4_define([m4_ifblank], +[m4_if(m4_translit([[$1]], [ ][ ][ +]), [], [$2], [$3])]) + +m4_define([m4_ifnblank], +[m4_if(m4_translit([[$1]], [ ][ ][ +]), [], [$3], [$2])]) + + +# m4_ifval(COND, [IF-TRUE], [IF-FALSE]) +# ------------------------------------- +# If COND is not the empty string, expand IF-TRUE, otherwise IF-FALSE. +# Comparable to m4_ifdef. +m4_define([m4_ifval], +[m4_if([$1], [], [$3], [$2])]) + + +# m4_n(TEXT) +# ---------- +# If TEXT is not empty, return TEXT and a new line, otherwise nothing. +m4_define([m4_n], +[m4_if([$1], + [], [], + [$1 +])]) + + +# m4_ifvaln(COND, [IF-TRUE], [IF-FALSE]) +# -------------------------------------- +# Same as `m4_ifval', but add an extra newline to IF-TRUE or IF-FALSE +# unless that argument is empty. +m4_define([m4_ifvaln], +[m4_if([$1], + [], [m4_n([$3])], + [m4_n([$2])])]) + + +# m4_ifset(MACRO, [IF-TRUE], [IF-FALSE]) +# -------------------------------------- +# If MACRO has no definition, or of its definition is the empty string, +# expand IF-FALSE, otherwise IF-TRUE. +m4_define([m4_ifset], +[m4_ifdef([$1], + [m4_ifval(_m4_defn([$1]), [$2], [$3])], + [$3])]) + + +# m4_ifndef(NAME, [IF-NOT-DEFINED], [IF-DEFINED]) +# ----------------------------------------------- +m4_define([m4_ifndef], +[m4_ifdef([$1], [$3], [$2])]) + + +# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT) +# ----------------------------------------------------------- +# m4 equivalent of +# switch (SWITCH) +# { +# case VAL1: +# IF-VAL1; +# break; +# case VAL2: +# IF-VAL2; +# break; +# ... +# default: +# DEFAULT; +# break; +# }. +# All the values are optional, and the macro is robust to active +# symbols properly quoted. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_case], +[m4_if([$#], 0, [], + [$#], 1, [], + [$#], 2, [$2], + [$1], [$2], [$3], + [$0([$1], m4_shift3($@))])]) + + +# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT) +# ----------------------------------------------------- +# m4 equivalent of +# +# if (SWITCH =~ RE1) +# VAL1; +# elif (SWITCH =~ RE2) +# VAL2; +# elif ... +# ... +# else +# DEFAULT +# +# All the values are optional, and the macro is robust to active symbols +# properly quoted. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_bmatch], +[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])], + [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])], + [$#], 2, [$2], + [m4_if(m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shift3($@))], + [$3])])]) + +# m4_argn(N, ARGS...) +# ------------------- +# Extract argument N (greater than 0) from ARGS. Example: +# m4_define([b], [B]) +# m4_argn([2], [a], [b], [c]) => b +# +# Rather than using m4_car(m4_shiftn([$1], $@)), we exploit the fact that +# GNU m4 can directly reference any argument, through an indirect macro. +m4_define([m4_argn], +[m4_assert([0 < $1])]dnl +[m4_pushdef([_$0], [_m4_popdef([_$0])]m4_dquote([$]m4_incr([$1])))_$0($@)]) + + +# m4_car(ARGS...) +# m4_cdr(ARGS...) +# --------------- +# Manipulate m4 lists. m4_car returns the first argument. m4_cdr +# bundles all but the first argument into a quoted list. These two +# macros are generally used with list arguments, with quoting removed +# to break the list into multiple m4 ARGS. +m4_define([m4_car], [[$1]]) +m4_define([m4_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) + +# _m4_cdr(ARGS...) +# ---------------- +# Like m4_cdr, except include a leading comma unless only one argument +# remains. Why? Because comparing a large list against [] is more +# expensive in expansion time than comparing the number of arguments; so +# _m4_cdr can be used to reduce the number of arguments when it is time +# to end recursion. +m4_define([_m4_cdr], +[m4_if([$#], 1, [], + [, m4_dquote(m4_shift($@))])]) + + + +# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT]) +# ------------------------------------------------------------------- +# Similar to m4_if, except that each TEST is expanded when encountered. +# If the expansion of TESTn matches the string VALn, the result is IF-VALn. +# The result is DEFAULT if no tests passed. This macro allows +# short-circuiting of expensive tests, where it pays to arrange quick +# filter tests to run first. +# +# For an example, consider a previous implementation of _AS_QUOTE_IFELSE: +# +# m4_if(m4_index([$1], [\]), [-1], [$2], +# m4_eval(m4_index([$1], [\\]) >= 0), [1], [$2], +# m4_eval(m4_index([$1], [\$]) >= 0), [1], [$2], +# m4_eval(m4_index([$1], [\`]) >= 0), [1], [$3], +# m4_eval(m4_index([$1], [\"]) >= 0), [1], [$3], +# [$2]) +# +# Here, m4_index is computed 5 times, and m4_eval 4, even if $1 contains +# no backslash. It is more efficient to do: +# +# m4_cond([m4_index([$1], [\])], [-1], [$2], +# [m4_eval(m4_index([$1], [\\]) >= 0)], [1], [$2], +# [m4_eval(m4_index([$1], [\$]) >= 0)], [1], [$2], +# [m4_eval(m4_index([$1], [\`]) >= 0)], [1], [$3], +# [m4_eval(m4_index([$1], [\"]) >= 0)], [1], [$3], +# [$2]) +# +# In the common case of $1 with no backslash, only one m4_index expansion +# occurs, and m4_eval is avoided altogether. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_cond], +[m4_if([$#], [0], [m4_fatal([$0: cannot be called without arguments])], + [$#], [1], [$1], + m4_eval([$# % 3]), [2], [m4_fatal([$0: missing an argument])], + [_$0($@)])]) + +m4_define([_m4_cond], +[m4_if(($1), [($2)], [$3], + [$#], [3], [], + [$#], [4], [$4], + [$0(m4_shift3($@))])]) + + +## ---------------------------------------- ## +## 6. Enhanced version of some primitives. ## +## ---------------------------------------- ## + +# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...) +# ---------------------------------------------------- +# m4 equivalent of +# +# $_ = STRING; +# s/RE1/SUBST1/g; +# s/RE2/SUBST2/g; +# ... +# +# All the values are optional, and the macro is robust to active symbols +# properly quoted. +# +# I would have liked to name this macro `m4_bpatsubst', unfortunately, +# due to quotation problems, I need to double quote $1 below, therefore +# the anchors are broken :( I can't let users be trapped by that. +# +# Recall that m4_shift3 always results in an argument. Hence, we need +# to distinguish between a final deletion vs. ending recursion. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_bpatsubsts], +[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])], + [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])], + [$#], 2, [m4_unquote(m4_builtin([patsubst], [[$1]], [$2]))], + [$#], 3, [m4_unquote(m4_builtin([patsubst], [[$1]], [$2], [$3]))], + [_$0($@m4_if(m4_eval($# & 1), 0, [,]))])]) +m4_define([_m4_bpatsubsts], +[m4_if([$#], 2, [$1], + [$0(m4_builtin([patsubst], [[$1]], [$2], [$3]), + m4_shift3($@))])]) + + +# m4_copy(SRC, DST) +# ----------------- +# Define the pushdef stack DST as a copy of the pushdef stack SRC; +# give an error if DST is already defined. This is particularly nice +# for copying self-modifying pushdef stacks, where the top definition +# includes one-shot initialization that is later popped to the normal +# definition. This version intentionally does nothing if SRC is +# undefined. +# +# Some macros simply can't be renamed with this method: namely, anything +# involved in the implementation of m4_stack_foreach_sep. +m4_define([m4_copy], +[m4_ifdef([$2], [m4_fatal([$0: won't overwrite defined macro: $2])], + [m4_stack_foreach_sep([$1], [m4_pushdef([$2],], [)])])]dnl +[m4_ifdef([m4_location($1)], [m4_define([m4_location($2)], m4_location)])]) + + +# m4_copy_force(SRC, DST) +# m4_rename_force(SRC, DST) +# ------------------------- +# Like m4_copy/m4_rename, except blindly overwrite any existing DST. +# Note that m4_copy_force tolerates undefined SRC, while m4_rename_force +# does not. +m4_define([m4_copy_force], +[m4_ifdef([$2], [_m4_undefine([$2])])m4_copy($@)]) + +m4_define([m4_rename_force], +[m4_ifdef([$2], [_m4_undefine([$2])])m4_rename($@)]) + + +# m4_define_default(MACRO, VALUE) +# ------------------------------- +# If MACRO is undefined, set it to VALUE. +m4_define([m4_define_default], +[m4_ifndef([$1], [m4_define($@)])]) + + +# m4_default(EXP1, EXP2) +# m4_default_nblank(EXP1, EXP2) +# ----------------------------- +# Returns EXP1 if not empty/blank, otherwise EXP2. Expand the result. +# +# m4_default is called on hot paths, so inline the contents of m4_ifval, +# for one less round of expansion. +m4_define([m4_default], +[m4_if([$1], [], [$2], [$1])]) + +m4_define([m4_default_nblank], +[m4_ifblank([$1], [$2], [$1])]) + + +# m4_default_quoted(EXP1, EXP2) +# m4_default_nblank_quoted(EXP1, EXP2) +# ------------------------------------ +# Returns EXP1 if non empty/blank, otherwise EXP2. Leave the result quoted. +# +# For comparison: +# m4_define([active], [ACTIVE]) +# m4_default([active], [default]) => ACTIVE +# m4_default([], [active]) => ACTIVE +# -m4_default([ ], [active])- => - - +# -m4_default_nblank([ ], [active])- => -ACTIVE- +# m4_default_quoted([active], [default]) => active +# m4_default_quoted([], [active]) => active +# -m4_default_quoted([ ], [active])- => - - +# -m4_default_nblank_quoted([ ], [active])- => -active- +# +# m4_default macro is called on hot paths, so inline the contents of m4_ifval, +# for one less round of expansion. +m4_define([m4_default_quoted], +[m4_if([$1], [], [[$2]], [[$1]])]) + +m4_define([m4_default_nblank_quoted], +[m4_ifblank([$1], [[$2]], [[$1]])]) + + +# m4_defn(NAME) +# ------------- +# Like the original, except guarantee a warning when using something which is +# undefined (unlike M4 1.4.x). This replacement is not a full-featured +# replacement: if any of the defined macros contain unbalanced quoting, but +# when pasted together result in a well-quoted string, then only native m4 +# support is able to get it correct. But that's where quadrigraphs come in +# handy, if you really need unbalanced quotes inside your macros. +# +# This macro is called frequently, so minimize the amount of additional +# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists, +# (added in M4 1.6), then let m4 do the job for us (see m4_init). +m4_define([m4_defn], +[m4_if([$#], [0], [[$0]], + [$#], [1], [m4_ifdef([$1], [_m4_defn([$1])], + [m4_fatal([$0: undefined macro: $1])])], + [m4_map_args([$0], $@)])]) + + +# m4_dumpdef(NAME...) +# ------------------- +# In m4 1.4.x, dumpdef writes to the current debugfile, rather than +# stderr. This in turn royally confuses autom4te; so we follow the +# lead of newer m4 and always dump to stderr. Unlike the original, +# this version requires an argument, since there is no convenient way +# in m4 1.4.x to grab the names of all defined macros. Newer m4 +# always dumps to stderr, regardless of the current debugfile; it also +# provides m4symbols as a way to grab all current macro names. But +# dumpdefs is not frequently called, so we don't need to worry about +# conditionally using these newer features. Also, this version +# doesn't sort multiple arguments. +# +# If we detect m4 1.6 or newer, then provide an alternate definition, +# installed during m4_init, that allows builtins through. +# Unfortunately, there is no nice way in m4 1.4.x to dump builtins. +m4_define([m4_dumpdef], +[m4_if([$#], [0], [m4_fatal([$0: missing argument])], + [$#], [1], [m4_ifdef([$1], [m4_errprintn( + [$1: ]m4_dquote(_m4_defn([$1])))], [m4_fatal([$0: undefined macro: $1])])], + [m4_map_args([$0], $@)])]) + +m4_define([_m4_dumpdef], +[m4_if([$#], [0], [m4_fatal([$0: missing argument])], + [$#], [1], [m4_builtin([dumpdef], [$1])], + [m4_map_args_sep([m4_builtin([dumpdef],], [)], [], $@)])]) + + +# m4_dumpdefs(NAME...) +# -------------------- +# Similar to `m4_dumpdef(NAME)', but if NAME was m4_pushdef'ed, display its +# value stack (most recent displayed first). Also, this version silently +# ignores undefined macros, rather than erroring out. +# +# This macro cheats, because it relies on the current definition of NAME +# while the second argument of m4_stack_foreach_lifo is evaluated (which +# would be undefined according to the API). +m4_define([m4_dumpdefs], +[m4_if([$#], [0], [m4_fatal([$0: missing argument])], + [$#], [1], [m4_stack_foreach_lifo([$1], [m4_dumpdef([$1])m4_ignore])], + [m4_map_args([$0], $@)])]) + +# m4_esyscmd_s(COMMAND) +# --------------------- +# Like m4_esyscmd, except strip any trailing newlines, thus behaving +# more like shell command substitution. +m4_define([m4_esyscmd_s], +[m4_chomp_all(m4_esyscmd([$1]))]) + + +# m4_popdef(NAME) +# --------------- +# Like the original, except guarantee a warning when using something which is +# undefined (unlike M4 1.4.x). +# +# This macro is called frequently, so minimize the amount of additional +# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists, +# (added in M4 1.6), then let m4 do the job for us (see m4_init). +m4_define([m4_popdef], +[m4_if([$#], [0], [[$0]], + [$#], [1], [m4_ifdef([$1], [_m4_popdef([$1])], + [m4_fatal([$0: undefined macro: $1])])], + [m4_map_args([$0], $@)])]) + + +# m4_shiftn(N, ...) +# ----------------- +# Returns ... shifted N times. Useful for recursive "varargs" constructs. +# +# Autoconf does not use this macro, because it is inherently slower than +# calling the common cases of m4_shift2 or m4_shift3 directly. But it +# might as well be fast for other clients, such as Libtool. One way to +# do this is to expand $@ only once in _m4_shiftn (otherwise, for long +# lists, the expansion of m4_if takes twice as much memory as what the +# list itself occupies, only to throw away the unused branch). The end +# result is strictly equivalent to +# m4_if([$1], 1, [m4_shift(,m4_shift(m4_shift($@)))], +# [_m4_shiftn(m4_decr([$1]), m4_shift(m4_shift($@)))]) +# but with the final `m4_shift(m4_shift($@)))' shared between the two +# paths. The first leg uses a no-op m4_shift(,$@) to balance out the (). +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_shiftn], +[m4_assert(0 < $1 && $1 < $#)_$0($@)]) + +m4_define([_m4_shiftn], +[m4_if([$1], 1, [m4_shift(], + [$0(m4_decr([$1])]), m4_shift(m4_shift($@)))]) + +# m4_shift2(...) +# m4_shift3(...) +# -------------- +# Returns ... shifted twice, and three times. Faster than m4_shiftn. +m4_define([m4_shift2], [m4_shift(m4_shift($@))]) +m4_define([m4_shift3], [m4_shift(m4_shift(m4_shift($@)))]) + +# _m4_shift2(...) +# _m4_shift3(...) +# --------------- +# Like m4_shift2 or m4_shift3, except include a leading comma unless shifting +# consumes all arguments. Why? Because in recursion, it is nice to +# distinguish between 1 element left and 0 elements left, based on how many +# arguments this shift expands to. +m4_define([_m4_shift2], +[m4_if([$#], [2], [], + [, m4_shift(m4_shift($@))])]) +m4_define([_m4_shift3], +[m4_if([$#], [3], [], + [, m4_shift(m4_shift(m4_shift($@)))])]) + + +# m4_undefine(NAME) +# ----------------- +# Like the original, except guarantee a warning when using something which is +# undefined (unlike M4 1.4.x). +# +# This macro is called frequently, so minimize the amount of additional +# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists, +# (added in M4 1.6), then let m4 do the job for us (see m4_init). +m4_define([m4_undefine], +[m4_if([$#], [0], [[$0]], + [$#], [1], [m4_ifdef([$1], [_m4_undefine([$1])], + [m4_fatal([$0: undefined macro: $1])])], + [m4_map_args([$0], $@)])]) + +# _m4_wrap(PRE, POST) +# ------------------- +# Helper macro for m4_wrap and m4_wrap_lifo. Allows nested calls to +# m4_wrap within wrapped text. Use _m4_defn and _m4_popdef for speed. +m4_define([_m4_wrap], +[m4_ifdef([$0_text], + [m4_define([$0_text], [$1]_m4_defn([$0_text])[$2])], + [m4_builtin([m4wrap], [m4_unquote( + _m4_defn([$0_text])_m4_popdef([$0_text]))])m4_define([$0_text], [$1$2])])]) + +# m4_wrap(TEXT) +# ------------- +# Append TEXT to the list of hooks to be executed at the end of input. +# Whereas the order of the original may be LIFO in the underlying m4, +# this version is always FIFO. +m4_define([m4_wrap], +[_m4_wrap([], [$1[]])]) + +# m4_wrap_lifo(TEXT) +# ------------------ +# Prepend TEXT to the list of hooks to be executed at the end of input. +# Whereas the order of m4_wrap may be FIFO in the underlying m4, this +# version is always LIFO. +m4_define([m4_wrap_lifo], +[_m4_wrap([$1[]])]) + +## ------------------------- ## +## 7. Quoting manipulation. ## +## ------------------------- ## + + +# m4_apply(MACRO, LIST) +# --------------------- +# Invoke MACRO, with arguments provided from the quoted list of +# comma-separated quoted arguments. If LIST is empty, invoke MACRO +# without arguments. The expansion will not be concatenated with +# subsequent text. +m4_define([m4_apply], +[m4_if([$2], [], [$1], [$1($2)])[]]) + +# _m4_apply(MACRO, LIST) +# ---------------------- +# Like m4_apply, except do nothing if LIST is empty. +m4_define([_m4_apply], +[m4_if([$2], [], [], [$1($2)[]])]) + + +# m4_count(ARGS) +# -------------- +# Return a count of how many ARGS are present. +m4_define([m4_count], [$#]) + + +# m4_curry(MACRO, ARG...) +# ----------------------- +# Perform argument currying. The expansion of this macro is another +# macro that takes exactly one argument, appends it to the end of the +# original ARG list, then invokes MACRO. For example: +# m4_curry([m4_curry], [m4_reverse], [1])([2])([3]) => 3, 2, 1 +# Not quite as practical as m4_incr, but you could also do: +# m4_define([add], [m4_eval(([$1]) + ([$2]))]) +# m4_define([add_one], [m4_curry([add], [1])]) +# add_one()([2]) => 3 +m4_define([m4_curry], [$1(m4_shift($@,)_$0]) +m4_define([_m4_curry], [[$1])]) + + +# m4_do(STRING, ...) +# ------------------ +# This macro invokes all its arguments (in sequence, of course). It is +# useful for making your macros more structured and readable by dropping +# unnecessary dnl's and have the macros indented properly. No concatenation +# occurs after a STRING; use m4_unquote(m4_join(,STRING)) for that. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_do], +[m4_if([$#], 0, [], + [$#], 1, [$1[]], + [$1[]$0(m4_shift($@))])]) + + +# m4_dquote(ARGS) +# --------------- +# Return ARGS as a quoted list of quoted arguments. +m4_define([m4_dquote], [[$@]]) + + +# m4_dquote_elt(ARGS) +# ------------------- +# Return ARGS as an unquoted list of double-quoted arguments. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_dquote_elt], +[m4_if([$#], [0], [], + [$#], [1], [[[$1]]], + [[[$1]],$0(m4_shift($@))])]) + + +# m4_echo(ARGS) +# ------------- +# Return the ARGS, with the same level of quoting. Whitespace after +# unquoted commas are consumed. +m4_define([m4_echo], [$@]) + + +# m4_expand(ARG) +# _m4_expand(ARG) +# --------------- +# Return the expansion of ARG as a single string. Unlike +# m4_quote($1), this preserves whitespace following single-quoted +# commas that appear within ARG. It also deals with shell case +# statements. +# +# m4_define([active], [ACT, IVE]) +# m4_define([active2], [[ACT, IVE]]) +# m4_quote(active, active2) +# => ACT,IVE,ACT, IVE +# m4_expand([active, active2]) +# => ACT, IVE, ACT, IVE +# +# Unfortunately, due to limitations in m4, ARG must expand to +# something with balanced quotes (use quadrigraphs to get around +# this), and should not contain the unlikely delimiters -=<{( or +# )}>=-. It is possible to have unbalanced quoted `(' or `)', as well +# as unbalanced unquoted `)'. m4_expand can handle unterminated +# comments or dnl on the final line, at the expense of speed; it also +# aids in detecting attempts to incorrectly change the current +# diversion inside ARG. Meanwhile, _m4_expand is faster but must be +# given a terminated expansion, and has no safety checks for +# mis-diverted text. +# +# Exploit that extra unquoted () will group unquoted commas and the +# following whitespace. m4_bpatsubst can't handle newlines inside $1, +# and m4_substr strips quoting. So we (ab)use m4_changequote, using +# temporary quotes to remove the delimiters that conveniently included +# the unquoted () that were added prior to the changequote. +# +# Thanks to shell case statements, too many people are prone to pass +# underquoted `)', so we try to detect that by passing a marker as a +# fourth argument; if the marker is not present, then we assume that +# we encountered an early `)', and re-expand the first argument, but +# this time with one more `(' in the second argument and in the +# open-quote delimiter. We must also ignore the slop from the +# previous try. The final macro is thus half line-noise, half art. +m4_define([m4_expand], +[m4_pushdef([m4_divert], _m4_defn([_m4_divert_unsafe]))]dnl +[m4_pushdef([m4_divert_push], _m4_defn([_m4_divert_unsafe]))]dnl +[m4_chomp(_$0([$1 +]))_m4_popdef([m4_divert], [m4_divert_push])]) + +m4_define([_m4_expand], [$0_([$1], [(], -=<{($1)}>=-, [}>=-])]) + +m4_define([_m4_expand_], +[m4_if([$4], [}>=-], + [m4_changequote([-=<{$2], [)}>=-])$3m4_changequote([, ])], + [$0([$1], [($2], -=<{($2$1)}>=-, [}>=-])m4_ignore$2])]) + + +# m4_ignore(ARGS) +# --------------- +# Expands to nothing. Useful for conditionally ignoring an arbitrary +# number of arguments (see _m4_list_cmp for an example). +m4_define([m4_ignore]) + + +# m4_make_list(ARGS) +# ------------------ +# Similar to m4_dquote, this creates a quoted list of quoted ARGS. This +# version is less efficient than m4_dquote, but separates each argument +# with a comma and newline, rather than just comma, for readability. +# When developing an m4sugar algorithm, you could temporarily use +# m4_pushdef([m4_dquote],m4_defn([m4_make_list])) +# around your code to make debugging easier. +m4_define([m4_make_list], [m4_join([, +], m4_dquote_elt($@))]) + + +# m4_noquote(STRING) +# ------------------ +# Return the result of ignoring all quotes in STRING and invoking the +# macros it contains. Among other things, this is useful for enabling +# macro invocations inside strings with [] blocks (for instance regexps +# and help-strings). On the other hand, since all quotes are disabled, +# any macro expanded during this time that relies on nested [] quoting +# will likely crash and burn. This macro is seldom useful; consider +# m4_unquote or m4_expand instead. +m4_define([m4_noquote], +[m4_changequote([-=<{(],[)}>=-])$1-=<{()}>=-m4_changequote([,])]) + + +# m4_quote(ARGS) +# -------------- +# Return ARGS as a single argument. Any whitespace after unquoted commas +# is stripped. There is always output, even when there were no arguments. +# +# It is important to realize the difference between `m4_quote(exp)' and +# `[exp]': in the first case you obtain the quoted *result* of the +# expansion of EXP, while in the latter you just obtain the string +# `exp'. +m4_define([m4_quote], [[$*]]) + + +# _m4_quote(ARGS) +# --------------- +# Like m4_quote, except that when there are no arguments, there is no +# output. For conditional scenarios (such as passing _m4_quote as the +# macro name in m4_mapall), this feature can be used to distinguish between +# one argument of the empty string vs. no arguments. However, in the +# normal case with arguments present, this is less efficient than m4_quote. +m4_define([_m4_quote], +[m4_if([$#], [0], [], [[$*]])]) + + +# m4_reverse(ARGS) +# ---------------- +# Output ARGS in reverse order. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_reverse], +[m4_if([$#], [0], [], [$#], [1], [[$1]], + [$0(m4_shift($@)), [$1]])]) + + +# m4_unquote(ARGS) +# ---------------- +# Remove one layer of quotes from each ARG, performing one level of +# expansion. For one argument, m4_unquote([arg]) is more efficient than +# m4_do([arg]), but for multiple arguments, the difference is that +# m4_unquote separates arguments with commas while m4_do concatenates. +# Follow this macro with [] if concatenation with subsequent text is +# undesired. +m4_define([m4_unquote], [$*]) + + +## -------------------------- ## +## 8. Implementing m4 loops. ## +## -------------------------- ## + + +# m4_for(VARIABLE, FIRST, LAST, [STEP = +/-1], EXPRESSION) +# -------------------------------------------------------- +# Expand EXPRESSION defining VARIABLE to FROM, FROM + 1, ..., TO with +# increments of STEP. Both limits are included, and bounds are +# checked for consistency. The algorithm is robust to indirect +# VARIABLE names. Changing VARIABLE inside EXPRESSION will not impact +# the number of iterations. +# +# Uses _m4_defn for speed, and avoid dnl in the macro body. Factor +# the _m4_for call so that EXPRESSION is only parsed once. +m4_define([m4_for], +[m4_pushdef([$1], m4_eval([$2]))]dnl +[m4_cond([m4_eval(([$3]) > ([$2]))], 1, + [m4_pushdef([_m4_step], m4_eval(m4_default_quoted([$4], + 1)))m4_assert(_m4_step > 0)_$0(_m4_defn([$1]), + m4_eval((([$3]) - ([$2])) / _m4_step * _m4_step + ([$2])), _m4_step,], + [m4_eval(([$3]) < ([$2]))], 1, + [m4_pushdef([_m4_step], m4_eval(m4_default_quoted([$4], + -1)))m4_assert(_m4_step < 0)_$0(_m4_defn([$1]), + m4_eval((([$2]) - ([$3])) / -(_m4_step) * _m4_step + ([$2])), _m4_step,], + [m4_pushdef([_m4_step])_$0(_m4_defn([$1]), _m4_defn([$1]), 0,])]dnl +[[m4_define([$1],], [)$5])m4_popdef([_m4_step], [$1])]) + +# _m4_for(COUNT, LAST, STEP, PRE, POST) +# ------------------------------------- +# Core of the loop, no consistency checks, all arguments are plain +# numbers. Expand PRE[COUNT]POST, then alter COUNT by STEP and +# iterate if COUNT is not LAST. +m4_define([_m4_for], +[$4[$1]$5[]m4_if([$1], [$2], [], + [$0(m4_eval([$1 + $3]), [$2], [$3], [$4], [$5])])]) + + +# Implementing `foreach' loops in m4 is much more tricky than it may +# seem. For example, the old M4 1.4.4 manual had an incorrect example, +# which looked like this (when translated to m4sugar): +# +# | # foreach(VAR, (LIST), STMT) +# | m4_define([foreach], +# | [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])]) +# | m4_define([_arg1], [$1]) +# | m4_define([_foreach], +# | [m4_if([$2], [()], , +# | [m4_define([$1], _arg1$2)$3[]_foreach([$1], (m4_shift$2), [$3])])]) +# +# But then if you run +# +# | m4_define(a, 1) +# | m4_define(b, 2) +# | m4_define(c, 3) +# | foreach([f], [([a], [(b], [c)])], [echo f +# | ]) +# +# it gives +# +# => echo 1 +# => echo (2,3) +# +# which is not what is expected. +# +# Of course the problem is that many quotes are missing. So you add +# plenty of quotes at random places, until you reach the expected +# result. Alternatively, if you are a quoting wizard, you directly +# reach the following implementation (but if you really did, then +# apply to the maintenance of m4sugar!). +# +# | # foreach(VAR, (LIST), STMT) +# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])]) +# | m4_define([_arg1], [[$1]]) +# | m4_define([_foreach], +# | [m4_if($2, [()], , +# | [m4_define([$1], [_arg1$2])$3[]_foreach([$1], [(m4_shift$2)], [$3])])]) +# +# which this time answers +# +# => echo a +# => echo (b +# => echo c) +# +# Bingo! +# +# Well, not quite. +# +# With a better look, you realize that the parens are more a pain than +# a help: since anyway you need to quote properly the list, you end up +# with always using an outermost pair of parens and an outermost pair +# of quotes. Rejecting the parens both eases the implementation, and +# simplifies the use: +# +# | # foreach(VAR, (LIST), STMT) +# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])]) +# | m4_define([_arg1], [$1]) +# | m4_define([_foreach], +# | [m4_if($2, [], , +# | [m4_define([$1], [_arg1($2)])$3[]_foreach([$1], [m4_shift($2)], [$3])])]) +# +# +# Now, just replace the `$2' with `m4_quote($2)' in the outer `m4_if' +# to improve robustness, and you come up with a nice implementation +# that doesn't require extra parentheses in the user's LIST. +# +# But wait - now the algorithm is quadratic, because every recursion of +# the algorithm keeps the entire LIST and merely adds another m4_shift to +# the quoted text. If the user has a lot of elements in LIST, you can +# bring the system to its knees with the memory m4 then requires, or trip +# the m4 --nesting-limit recursion factor. The only way to avoid +# quadratic growth is ensure m4_shift is expanded prior to the recursion. +# Hence the design below. +# +# The M4 manual now includes a chapter devoted to this issue, with +# the lessons learned from m4sugar. And still, this design is only +# optimal for M4 1.6; see foreach.m4 for yet more comments on why +# M4 1.4.x uses yet another implementation. + + +# m4_foreach(VARIABLE, LIST, EXPRESSION) +# -------------------------------------- +# +# Expand EXPRESSION assigning each value of the LIST to VARIABLE. +# LIST should have the form `item_1, item_2, ..., item_n', i.e. the +# whole list must *quoted*. Quote members too if you don't want them +# to be expanded. +# +# This macro is robust to active symbols: +# | m4_define(active, [ACT, IVE]) +# | m4_foreach(Var, [active, active], [-Var-]) +# => -ACT--IVE--ACT--IVE- +# +# | m4_foreach(Var, [[active], [active]], [-Var-]) +# => -ACT, IVE--ACT, IVE- +# +# | m4_foreach(Var, [[[active]], [[active]]], [-Var-]) +# => -active--active- +# +# This macro is called frequently, so avoid extra expansions such as +# m4_ifval and dnl. Also, since $2 might be quite large, try to use it +# as little as possible in _m4_foreach; each extra use requires that much +# more memory for expansion. So, rather than directly compare $2 against +# [] and use m4_car/m4_cdr for recursion, we instead unbox the list (which +# requires swapping the argument order in the helper), insert an ignored +# third argument, and use m4_shift3 to detect when recursion is complete, +# at which point this looks very much like m4_map_args. +m4_define([m4_foreach], +[m4_if([$2], [], [], + [m4_pushdef([$1])_$0([m4_define([$1],], [)$3], [], + $2)m4_popdef([$1])])]) + +# _m4_foreach(PRE, POST, IGNORED, ARG...) +# --------------------------------------- +# Form the common basis of the m4_foreach and m4_map macros. For each +# ARG, expand PRE[ARG]POST[]. The IGNORED argument makes recursion +# easier, and must be supplied rather than implicit. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([_m4_foreach], +[m4_if([$#], [3], [], + [$1[$4]$2[]$0([$1], [$2], m4_shift3($@))])]) + + +# m4_foreach_w(VARIABLE, LIST, EXPRESSION) +# ---------------------------------------- +# Like m4_foreach, but the list is whitespace separated. Depending on +# EXPRESSION, it may be more efficient to use m4_map_args_w. +# +# This macro is robust to active symbols: +# m4_foreach_w([Var], [ active +# b act\ +# ive ], [-Var-])end +# => -active--b--active-end +# +# This used to use a slower implementation based on m4_foreach: +# m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3]) +m4_define([m4_foreach_w], +[m4_pushdef([$1])m4_map_args_w([$2], + [m4_define([$1],], [)$3])m4_popdef([$1])]) + + +# m4_map(MACRO, LIST) +# m4_mapall(MACRO, LIST) +# ---------------------- +# Invoke MACRO($1), MACRO($2) etc. where $1, $2... are the elements of +# LIST. $1, $2... must in turn be lists, appropriate for m4_apply. +# If LIST contains an empty sublist, m4_map skips the expansion of +# MACRO, while m4_mapall expands MACRO with no arguments. +# +# Since LIST may be quite large, we want to minimize how often it +# appears in the expansion. Rather than use m4_car/m4_cdr iteration, +# we unbox the list, and use _m4_foreach for iteration. For m4_map, +# an empty list behaves like an empty sublist and gets ignored; for +# m4_mapall, we must special-case the empty list. +m4_define([m4_map], +[_m4_foreach([_m4_apply([$1],], [)], [], $2)]) + +m4_define([m4_mapall], +[m4_if([$2], [], [], + [_m4_foreach([m4_apply([$1],], [)], [], $2)])]) + + +# m4_map_sep(MACRO, [SEPARATOR], LIST) +# m4_mapall_sep(MACRO, [SEPARATOR], LIST) +# --------------------------------------- +# Invoke MACRO($1), SEPARATOR, MACRO($2), ..., MACRO($N) where $1, +# $2... $N are the elements of LIST, and are in turn lists appropriate +# for m4_apply. SEPARATOR is expanded, in order to allow the creation +# of a list of arguments by using a single-quoted comma as the +# separator. For each empty sublist, m4_map_sep skips the expansion +# of MACRO and SEPARATOR, while m4_mapall_sep expands MACRO with no +# arguments. +# +# For m4_mapall_sep, merely expand the first iteration without the +# separator, then include separator as part of subsequent recursion; +# but avoid extra expansion of LIST's side-effects via a helper macro. +# For m4_map_sep, things are trickier - we don't know if the first +# list element is an empty sublist, so we must define a self-modifying +# helper macro and use that as the separator instead. +m4_define([m4_map_sep], +[m4_pushdef([m4_Sep], [m4_define([m4_Sep], _m4_defn([m4_unquote]))])]dnl +[_m4_foreach([_m4_apply([m4_Sep([$2])[]$1],], [)], [], $3)m4_popdef([m4_Sep])]) + +m4_define([m4_mapall_sep], +[m4_if([$3], [], [], [_$0([$1], [$2], $3)])]) + +m4_define([_m4_mapall_sep], +[m4_apply([$1], [$3])_m4_foreach([m4_apply([$2[]$1],], [)], m4_shift2($@))]) + +# m4_map_args(EXPRESSION, ARG...) +# ------------------------------- +# Expand EXPRESSION([ARG]) for each argument. More efficient than +# m4_foreach([var], [ARG...], [EXPRESSION(m4_defn([var]))]) +# Shorthand for m4_map_args_sep([EXPRESSION(], [)], [], ARG...). +m4_define([m4_map_args], +[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], + [$#], [1], [], + [$#], [2], [$1([$2])[]], + [_m4_foreach([$1(], [)], $@)])]) + + +# m4_map_args_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...) +# ------------------------------------------------------------- +# Perform a pairwise grouping of consecutive ARGs, by expanding +# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the +# final argument is expanded with END-EXPR([ARGn]). +# +# For example: +# m4_define([show], [($*)m4_newline])dnl +# m4_map_args_pair([show], [], [a], [b], [c], [d], [e])dnl +# => (a,b) +# => (c,d) +# => (e) +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_map_args_pair], +[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], + [$#], [1], [m4_fatal([$0: too few arguments: $#: $1])], + [$#], [2], [], + [$#], [3], [m4_default([$2], [$1])([$3])[]], + [$#], [4], [$1([$3], [$4])[]], + [$1([$3], [$4])[]$0([$1], [$2], m4_shift(m4_shift3($@)))])]) + + +# m4_map_args_sep([PRE], [POST], [SEP], ARG...) +# --------------------------------------------- +# Expand PRE[ARG]POST for each argument, with SEP between arguments. +m4_define([m4_map_args_sep], +[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], + [$#], [1], [], + [$#], [2], [], + [$#], [3], [], + [$#], [4], [$1[$4]$2[]], + [$1[$4]$2[]_m4_foreach([$3[]$1], [$2], m4_shift3($@))])]) + + +# m4_map_args_w(STRING, [PRE], [POST], [SEP]) +# ------------------------------------------- +# Perform the expansion of PRE[word]POST[] for each word in STRING +# separated by whitespace. More efficient than: +# m4_foreach_w([var], [STRING], [PRE[]m4_defn([var])POST]) +# Additionally, expand SEP between words. +# +# As long as we have to use m4_bpatsubst to split the string, we might +# as well make it also apply PRE and POST; this avoids iteration +# altogether. But we must be careful of any \ in PRE or POST. +# _m4_strip returns a quoted string, but that's okay, since it also +# supplies an empty leading and trailing argument due to our +# intentional whitespace around STRING. We use m4_substr to strip the +# empty elements and remove the extra layer of quoting. +m4_define([m4_map_args_w], +[_$0(_m4_split([ ]m4_flatten([$1])[ ], [[ ]+], + m4_if(m4_index([$2$3$4], [\]), [-1], [[$3[]$4[]$2]], + [m4_bpatsubst([[$3[]$4[]$2]], [\\], [\\\\])])), + m4_len([[]$3[]$4]), m4_len([$4[]$2[]]))]) + +m4_define([_m4_map_args_w], +[m4_substr([$1], [$2], m4_eval(m4_len([$1]) - [$2] - [$3]))]) + + +# m4_stack_foreach(MACRO, FUNC) +# m4_stack_foreach_lifo(MACRO, FUNC) +# ---------------------------------- +# Pass each stacked definition of MACRO to the one-argument macro FUNC. +# m4_stack_foreach proceeds in FIFO order, while m4_stack_foreach_lifo +# processes the topmost definitions first. In addition, FUNC should +# not push or pop definitions of MACRO, and should not expect anything about +# the active definition of MACRO (it will not be the topmost, and may not +# be the one passed to FUNC either). +# +# Some macros simply can't be examined with this method: namely, +# anything involved in the implementation of _m4_stack_reverse. +m4_define([m4_stack_foreach], +[_m4_stack_reverse([$1], [m4_tmp-$1])]dnl +[_m4_stack_reverse([m4_tmp-$1], [$1], [$2(_m4_defn([m4_tmp-$1]))])]) + +m4_define([m4_stack_foreach_lifo], +[_m4_stack_reverse([$1], [m4_tmp-$1], [$2(_m4_defn([m4_tmp-$1]))])]dnl +[_m4_stack_reverse([m4_tmp-$1], [$1])]) + +# m4_stack_foreach_sep(MACRO, [PRE], [POST], [SEP]) +# m4_stack_foreach_sep_lifo(MACRO, [PRE], [POST], [SEP]) +# ------------------------------------------------------ +# Similar to m4_stack_foreach and m4_stack_foreach_lifo, in that every +# definition of a pushdef stack will be visited. But rather than +# passing the definition as a single argument to a macro, this variant +# expands the concatenation of PRE[]definition[]POST, and expands SEP +# between consecutive expansions. Note that m4_stack_foreach([a], [b]) +# is equivalent to m4_stack_foreach_sep([a], [b(], [)]). +m4_define([m4_stack_foreach_sep], +[_m4_stack_reverse([$1], [m4_tmp-$1])]dnl +[_m4_stack_reverse([m4_tmp-$1], [$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4[]])]) + +m4_define([m4_stack_foreach_sep_lifo], +[_m4_stack_reverse([$1], [m4_tmp-$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4[]])]dnl +[_m4_stack_reverse([m4_tmp-$1], [$1])]) + + +# _m4_stack_reverse(OLD, NEW, [ACTION], [SEP]) +# -------------------------------------------- +# A recursive worker for pushdef stack manipulation. Destructively +# copy the OLD stack into the NEW, and expanding ACTION for each +# iteration. After the first iteration, SEP is promoted to the front +# of ACTION (note that SEP should include a trailing [] if it is to +# avoid interfering with ACTION). The current definition is examined +# after the NEW has been pushed but before OLD has been popped; this +# order is important, as ACTION is permitted to operate on either +# _m4_defn([OLD]) or _m4_defn([NEW]). Since the operation is +# destructive, this macro is generally used twice, with a temporary +# macro name holding the swapped copy. +m4_define([_m4_stack_reverse], +[m4_ifdef([$1], [m4_pushdef([$2], + _m4_defn([$1]))$3[]_m4_popdef([$1])$0([$1], [$2], [$4$3])])]) + + + +## --------------------------- ## +## 9. More diversion support. ## +## --------------------------- ## + + +# m4_cleardivert(DIVERSION-NAME...) +# --------------------------------- +# Discard any text in DIVERSION-NAME. +# +# This works even inside m4_expand. +m4_define([m4_cleardivert], +[m4_if([$#], [0], [m4_fatal([$0: missing argument])], + [_m4_divert_raw([-1])m4_undivert($@)_m4_divert_raw( + _m4_divert(_m4_defn([_m4_divert_diversion]), [-]))])]) + + +# _m4_divert(DIVERSION-NAME or NUMBER, [NOWARN]) +# ---------------------------------------------- +# If DIVERSION-NAME is the name of a diversion, return its number, +# otherwise if it is a NUMBER return it. Issue a warning about +# the use of a number instead of a name, unless NOWARN is provided. +m4_define([_m4_divert], +[m4_ifdef([_m4_divert($1)], + [m4_indir([_m4_divert($1)])], + [m4_if([$2], [], [m4_warn([syntax], + [prefer named diversions])])$1])]) + +# KILL is only used to suppress output. +m4_define([_m4_divert(KILL)], -1) + +# The empty diversion name is a synonym for 0. +m4_define([_m4_divert()], 0) + + +# m4_divert_stack +# --------------- +# Print the diversion stack, if it's nonempty. The caller is +# responsible for any leading or trailing newline. +m4_define([m4_divert_stack], +[m4_stack_foreach_sep_lifo([_m4_divert_stack], [], [], [ +])]) + + +# m4_divert_stack_push(MACRO-NAME, DIVERSION-NAME) +# ------------------------------------------------ +# Form an entry of the diversion stack from caller MACRO-NAME and +# entering DIVERSION-NAME and push it. +m4_define([m4_divert_stack_push], +[m4_pushdef([_m4_divert_stack], m4_location[: $1: $2])]) + + +# m4_divert(DIVERSION-NAME) +# ------------------------- +# Change the diversion stream to DIVERSION-NAME. +m4_define([m4_divert], +[m4_popdef([_m4_divert_stack])]dnl +[m4_define([_m4_divert_diversion], [$1])]dnl +[m4_divert_stack_push([$0], [$1])]dnl +[_m4_divert_raw(_m4_divert([$1]))]) + + +# m4_divert_push(DIVERSION-NAME, [NOWARN]) +# ---------------------------------------- +# Change the diversion stream to DIVERSION-NAME, while stacking old values. +# For internal use only: if NOWARN is not empty, DIVERSION-NAME can be a +# number instead of a name. +m4_define([m4_divert_push], +[m4_divert_stack_push([$0], [$1])]dnl +[m4_pushdef([_m4_divert_diversion], [$1])]dnl +[_m4_divert_raw(_m4_divert([$1], [$2]))]) + + +# m4_divert_pop([DIVERSION-NAME]) +# ------------------------------- +# Change the diversion stream to its previous value, unstacking it. +# If specified, verify we left DIVERSION-NAME. +# When we pop the last value from the stack, we divert to -1. +m4_define([m4_divert_pop], +[m4_if([$1], [], [], + [$1], _m4_defn([_m4_divert_diversion]), [], + [m4_fatal([$0($1): diversion mismatch: +]m4_divert_stack)])]dnl +[_m4_popdef([_m4_divert_stack], [_m4_divert_diversion])]dnl +[m4_ifdef([_m4_divert_diversion], [], + [m4_fatal([too many m4_divert_pop])])]dnl +[_m4_divert_raw(_m4_divert(_m4_defn([_m4_divert_diversion]), [-]))]) + + +# m4_divert_text(DIVERSION-NAME, CONTENT) +# --------------------------------------- +# Output CONTENT into DIVERSION-NAME (which may be a number actually). +# An end of line is appended for free to CONTENT. +m4_define([m4_divert_text], +[m4_divert_push([$1])$2 +m4_divert_pop([$1])]) + + +# m4_divert_once(DIVERSION-NAME, CONTENT) +# --------------------------------------- +# Output CONTENT into DIVERSION-NAME once, if not already there. +# An end of line is appended for free to CONTENT. +m4_define([m4_divert_once], +[m4_expand_once([m4_divert_text([$1], [$2])])]) + + +# _m4_divert_unsafe(DIVERSION-NAME) +# --------------------------------- +# Issue a warning that the attempt to change the current diversion to +# DIVERSION-NAME is unsafe, because this macro is being expanded +# during argument collection of m4_expand. +m4_define([_m4_divert_unsafe], +[m4_fatal([$0: cannot change diversion to `$1' inside m4_expand])]) + + +# m4_undivert(DIVERSION-NAME...) +# ------------------------------ +# Undivert DIVERSION-NAME. Unlike the M4 version, this requires at +# least one DIVERSION-NAME; also, due to support for named diversions, +# this should not be used to undivert files. +m4_define([m4_undivert], +[m4_if([$#], [0], [m4_fatal([$0: missing argument])], + [$#], [1], [_m4_undivert(_m4_divert([$1]))], + [m4_map_args([$0], $@)])]) + + +## --------------------------------------------- ## +## 10. Defining macros with bells and whistles. ## +## --------------------------------------------- ## + +# `m4_defun' is basically `m4_define' but it equips the macro with the +# needed machinery for `m4_require'. A macro must be m4_defun'd if +# either it is m4_require'd, or it m4_require's. +# +# Two things deserve attention and are detailed below: +# 1. Implementation of m4_require +# 2. Keeping track of the expansion stack +# +# 1. Implementation of m4_require +# =============================== +# +# Of course m4_defun calls m4_provide, so that a macro which has +# been expanded is not expanded again when m4_require'd, but the +# difficult part is the proper expansion of macros when they are +# m4_require'd. +# +# The implementation is based on three ideas, (i) using diversions to +# prepare the expansion of the macro and its dependencies (by Franc,ois +# Pinard), (ii) expand the most recently m4_require'd macros _after_ +# the previous macros (by Axel Thimm), and (iii) track instances of +# provide before require (by Eric Blake). +# +# +# The first idea: why use diversions? +# ----------------------------------- +# +# When a macro requires another, the other macro is expanded in new +# diversion, GROW. When the outer macro is fully expanded, we first +# undivert the most nested diversions (GROW - 1...), and finally +# undivert GROW. To understand why we need several diversions, +# consider the following example: +# +# | m4_defun([TEST1], [Test...m4_require([TEST2])1]) +# | m4_defun([TEST2], [Test...m4_require([TEST3])2]) +# | m4_defun([TEST3], [Test...3]) +# +# Because m4_require is not required to be first in the outer macros, we +# must keep the expansions of the various levels of m4_require separated. +# Right before executing the epilogue of TEST1, we have: +# +# GROW - 2: Test...3 +# GROW - 1: Test...2 +# GROW: Test...1 +# BODY: +# +# Finally the epilogue of TEST1 undiverts GROW - 2, GROW - 1, and +# GROW into the regular flow, BODY. +# +# GROW - 2: +# GROW - 1: +# GROW: +# BODY: Test...3; Test...2; Test...1 +# +# (The semicolons are here for clarification, but of course are not +# emitted.) This is what Autoconf 2.0 (I think) to 2.13 (I'm sure) +# implement. +# +# +# The second idea: first required first out +# ----------------------------------------- +# +# The natural implementation of the idea above is buggy and produces +# very surprising results in some situations. Let's consider the +# following example to explain the bug: +# +# | m4_defun([TEST1], [m4_require([TEST2a])m4_require([TEST2b])]) +# | m4_defun([TEST2a], []) +# | m4_defun([TEST2b], [m4_require([TEST3])]) +# | m4_defun([TEST3], [m4_require([TEST2a])]) +# | +# | AC_INIT +# | TEST1 +# +# The dependencies between the macros are: +# +# 3 --- 2b +# / \ is m4_require'd by +# / \ left -------------------- right +# 2a ------------ 1 +# +# If you strictly apply the rules given in the previous section you get: +# +# GROW - 2: TEST3 +# GROW - 1: TEST2a; TEST2b +# GROW: TEST1 +# BODY: +# +# (TEST2a, although required by TEST3 is not expanded in GROW - 3 +# because is has already been expanded before in GROW - 1, so it has +# been AC_PROVIDE'd, so it is not expanded again) so when you undivert +# the stack of diversions, you get: +# +# GROW - 2: +# GROW - 1: +# GROW: +# BODY: TEST3; TEST2a; TEST2b; TEST1 +# +# i.e., TEST2a is expanded after TEST3 although the latter required the +# former. +# +# Starting from 2.50, we use an implementation provided by Axel Thimm. +# The idea is simple: the order in which macros are emitted must be the +# same as the one in which macros are expanded. (The bug above can +# indeed be described as: a macro has been m4_provide'd before its +# dependent, but it is emitted after: the lack of correlation between +# emission and expansion order is guilty). +# +# How to do that? You keep the stack of diversions to elaborate the +# macros, but each time a macro is fully expanded, emit it immediately. +# +# In the example above, when TEST2a is expanded, but it's epilogue is +# not run yet, you have: +# +# GROW - 2: +# GROW - 1: TEST2a +# GROW: Elaboration of TEST1 +# BODY: +# +# The epilogue of TEST2a emits it immediately: +# +# GROW - 2: +# GROW - 1: +# GROW: Elaboration of TEST1 +# BODY: TEST2a +# +# TEST2b then requires TEST3, so right before the epilogue of TEST3, you +# have: +# +# GROW - 2: TEST3 +# GROW - 1: Elaboration of TEST2b +# GROW: Elaboration of TEST1 +# BODY: TEST2a +# +# The epilogue of TEST3 emits it: +# +# GROW - 2: +# GROW - 1: Elaboration of TEST2b +# GROW: Elaboration of TEST1 +# BODY: TEST2a; TEST3 +# +# TEST2b is now completely expanded, and emitted: +# +# GROW - 2: +# GROW - 1: +# GROW: Elaboration of TEST1 +# BODY: TEST2a; TEST3; TEST2b +# +# and finally, TEST1 is finished and emitted: +# +# GROW - 2: +# GROW - 1: +# GROW: +# BODY: TEST2a; TEST3; TEST2b: TEST1 +# +# The idea is simple, but the implementation is a bit involved. If +# you are like me, you will want to see the actual functioning of this +# implementation to be convinced. The next section gives the full +# details. +# +# +# The Axel Thimm implementation at work +# ------------------------------------- +# +# We consider the macros above, and this configure.ac: +# +# AC_INIT +# TEST1 +# +# You should keep the definitions of _m4_defun_pro, _m4_defun_epi, and +# m4_require at hand to follow the steps. +# +# This implementation tries not to assume that the current diversion is +# BODY, so as soon as a macro (m4_defun'd) is expanded, we first +# record the current diversion under the name _m4_divert_dump (denoted +# DUMP below for short). This introduces an important difference with +# the previous versions of Autoconf: you cannot use m4_require if you +# are not inside an m4_defun'd macro, and especially, you cannot +# m4_require directly from the top level. +# +# We have not tried to simulate the old behavior (better yet, we +# diagnose it), because it is too dangerous: a macro m4_require'd from +# the top level is expanded before the body of `configure', i.e., before +# any other test was run. I let you imagine the result of requiring +# AC_STDC_HEADERS for instance, before AC_PROG_CC was actually run.... +# +# After AC_INIT was run, the current diversion is BODY. +# * AC_INIT was run +# DUMP: undefined +# diversion stack: BODY |- +# +# * TEST1 is expanded +# The prologue of TEST1 sets _m4_divert_dump, which is the diversion +# where the current elaboration will be dumped, to the current +# diversion. It also m4_divert_push to GROW, where the full +# expansion of TEST1 and its dependencies will be elaborated. +# DUMP: BODY +# BODY: empty +# diversions: GROW, BODY |- +# +# * TEST1 requires TEST2a +# _m4_require_call m4_divert_pushes another temporary diversion, +# GROW - 1, and expands TEST2a in there. +# DUMP: BODY +# BODY: empty +# GROW - 1: TEST2a +# diversions: GROW - 1, GROW, BODY |- +# Then the content of the temporary diversion is moved to DUMP and the +# temporary diversion is popped. +# DUMP: BODY +# BODY: TEST2a +# diversions: GROW, BODY |- +# +# * TEST1 requires TEST2b +# Again, _m4_require_call pushes GROW - 1 and heads to expand TEST2b. +# DUMP: BODY +# BODY: TEST2a +# diversions: GROW - 1, GROW, BODY |- +# +# * TEST2b requires TEST3 +# _m4_require_call pushes GROW - 2 and expands TEST3 here. +# (TEST3 requires TEST2a, but TEST2a has already been m4_provide'd, so +# nothing happens.) +# DUMP: BODY +# BODY: TEST2a +# GROW - 2: TEST3 +# diversions: GROW - 2, GROW - 1, GROW, BODY |- +# Then the diversion is appended to DUMP, and popped. +# DUMP: BODY +# BODY: TEST2a; TEST3 +# diversions: GROW - 1, GROW, BODY |- +# +# * TEST1 requires TEST2b (contd.) +# The content of TEST2b is expanded... +# DUMP: BODY +# BODY: TEST2a; TEST3 +# GROW - 1: TEST2b, +# diversions: GROW - 1, GROW, BODY |- +# ... and moved to DUMP. +# DUMP: BODY +# BODY: TEST2a; TEST3; TEST2b +# diversions: GROW, BODY |- +# +# * TEST1 is expanded: epilogue +# TEST1's own content is in GROW... +# DUMP: BODY +# BODY: TEST2a; TEST3; TEST2b +# GROW: TEST1 +# diversions: BODY |- +# ... and it's epilogue moves it to DUMP and then undefines DUMP. +# DUMP: undefined +# BODY: TEST2a; TEST3; TEST2b; TEST1 +# diversions: BODY |- +# +# +# The third idea: track macros provided before they were required +# --------------------------------------------------------------- +# +# Using just the first two ideas, Autoconf 2.50 through 2.63 still had +# a subtle bug for more than seven years. Let's consider the +# following example to explain the bug: +# +# | m4_defun([TEST1], [1]) +# | m4_defun([TEST2], [2[]m4_require([TEST1])]) +# | m4_defun([TEST3], [3 TEST1 m4_require([TEST2])]) +# | TEST3 +# +# After the prologue of TEST3, we are collecting text in GROW with the +# intent of dumping it in BODY during the epilogue. Next, we +# encounter the direct invocation of TEST1, which provides the macro +# in place in GROW. From there, we encounter a requirement for TEST2, +# which must be collected in a new diversion. While expanding TEST2, +# we encounter a requirement for TEST1, but since it has already been +# expanded, the Axel Thimm algorithm states that we can treat it as a +# no-op. But that would lead to an end result of `2 3 1', meaning +# that we have once again output a macro (TEST2) prior to its +# requirements (TEST1). +# +# The problem can only occur if a single defun'd macro first provides, +# then later indirectly requires, the same macro. Note that directly +# expanding then requiring a macro is okay: because the dependency was +# met, the require phase can be a no-op. For that matter, the outer +# macro can even require two helpers, where the first helper expands +# the macro, and the second helper indirectly requires the macro. +# Out-of-order expansion is only present if the inner macro is +# required by something that will be hoisted in front of where the +# direct expansion occurred. In other words, we must be careful not +# to warn on: +# +# | m4_defun([TEST4], [4]) +# | m4_defun([TEST5], [5 TEST4 m4_require([TEST4])]) +# | TEST5 => 5 4 +# +# or even the more complex: +# +# | m4_defun([TEST6], [6]) +# | m4_defun([TEST7], [7 TEST6]) +# | m4_defun([TEST8], [8 m4_require([TEST6])]) +# | m4_defun([TEST9], [9 m4_require([TEST8])]) +# | m4_defun([TEST10], [10 m4_require([TEST7]) m4_require([TEST9])]) +# | TEST10 => 7 6 8 9 10 +# +# So, to detect whether a require was direct or indirect, m4_defun and +# m4_require track the name of the macro that caused a diversion to be +# created (using the stack _m4_diverting, coupled with an O(1) lookup +# _m4_diverting([NAME])), and m4_provide stores the name associated +# with the diversion at which a macro was provided. A require call is +# direct if it occurs within the same diversion where the macro was +# provided, or if the diversion associated with the providing context +# has been collected. +# +# The implementation of the warning involves tracking the set of +# macros which have been provided since the start of the outermost +# defun'd macro (the set is named _m4_provide). When starting an +# outermost macro, the set is emptied; when a macro is provided, it is +# added to the set; when require expands the body of a macro, it is +# removed from the set; and when a macro is indirectly required, the +# set is checked. If a macro is in the set, then it has been provided +# before it was required, and we satisfy dependencies by expanding the +# macro as if it had never been provided; in the example given above, +# this means we now output `1 2 3 1'. Meanwhile, a warning is issued +# to inform the user that her macros trigger the bug in older autoconf +# versions, and that her output file now contains redundant contents +# (and possibly new problems, if the repeated macro was not +# idempotent). Meanwhile, macros defined by m4_defun_once instead of +# m4_defun are idempotent, avoiding any warning or duplicate output. +# +# +# 2. Keeping track of the expansion stack +# ======================================= +# +# When M4 expansion goes wrong it is often extremely hard to find the +# path amongst macros that drove to the failure. What is needed is +# the stack of macro `calls'. One could imagine that GNU M4 would +# maintain a stack of macro expansions, unfortunately it doesn't, so +# we do it by hand. This is of course extremely costly, but the help +# this stack provides is worth it. Nevertheless to limit the +# performance penalty this is implemented only for m4_defun'd macros, +# not for define'd macros. +# +# Each time we enter an m4_defun'd macros, we add a definition in +# _m4_expansion_stack, and when we exit the macro, we remove it (thanks +# to pushdef/popdef). m4_stack_foreach is used to print the expansion +# stack in the rare cases when it's needed. +# +# In addition, we want to detect circular m4_require dependencies. +# Each time we expand a macro FOO we define _m4_expanding(FOO); and +# m4_require(BAR) simply checks whether _m4_expanding(BAR) is defined. + + +# m4_expansion_stack +# ------------------ +# Expands to the entire contents of the expansion stack. The caller +# must supply a trailing newline. This macro always prints a +# location; check whether _m4_expansion_stack is defined to filter out +# the case when no defun'd macro is in force. +m4_define([m4_expansion_stack], +[m4_stack_foreach_sep_lifo([_$0], [_$0_entry(], [) +])m4_location[: the top level]]) + +# _m4_expansion_stack_entry(MACRO) +# -------------------------------- +# Format an entry for MACRO found on the expansion stack. +m4_define([_m4_expansion_stack_entry], +[_m4_defn([m4_location($1)])[: $1 is expanded from...]]) + +# m4_expansion_stack_push(MACRO) +# ------------------------------ +# Form an entry of the expansion stack on entry to MACRO and push it. +m4_define([m4_expansion_stack_push], +[m4_pushdef([_m4_expansion_stack], [$1])]) + + +# _m4_divert(GROW) +# ---------------- +# This diversion is used by the m4_defun/m4_require machinery. It is +# important to keep room before GROW because for each nested +# AC_REQUIRE we use an additional diversion (i.e., two m4_require's +# will use GROW - 2. More than 3 levels has never seemed to be +# needed.) +# +# ... +# - GROW - 2 +# m4_require'd code, 2 level deep +# - GROW - 1 +# m4_require'd code, 1 level deep +# - GROW +# m4_defun'd macros are elaborated here. + +m4_define([_m4_divert(GROW)], 10000) + + +# _m4_defun_pro(MACRO-NAME) +# ------------------------- +# The prologue for Autoconf macros. +# +# This is called frequently, so minimize the number of macro invocations +# by avoiding dnl and m4_defn overhead. +m4_define([_m4_defun_pro], +[m4_ifdef([_m4_expansion_stack], [], [_m4_defun_pro_outer([$1])])]dnl +[m4_expansion_stack_push([$1])m4_pushdef([_m4_expanding($1)])]) + +m4_define([_m4_defun_pro_outer], +[m4_set_delete([_m4_provide])]dnl +[m4_pushdef([_m4_diverting([$1])])m4_pushdef([_m4_diverting], [$1])]dnl +[m4_pushdef([_m4_divert_dump], m4_divnum)m4_divert_push([GROW])]) + +# _m4_defun_epi(MACRO-NAME) +# ------------------------- +# The Epilogue for Autoconf macros. MACRO-NAME only helps tracing +# the PRO/EPI pairs. +# +# This is called frequently, so minimize the number of macro invocations +# by avoiding dnl and m4_popdef overhead. +m4_define([_m4_defun_epi], +[_m4_popdef([_m4_expanding($1)], [_m4_expansion_stack])]dnl +[m4_ifdef([_m4_expansion_stack], [], [_m4_defun_epi_outer([$1])])]dnl +[m4_provide([$1])]) + +m4_define([_m4_defun_epi_outer], +[_m4_popdef([_m4_divert_dump], [_m4_diverting([$1])], [_m4_diverting])]dnl +[m4_divert_pop([GROW])m4_undivert([GROW])]) + + +# _m4_divert_dump +# --------------- +# If blank, we are outside of any defun'd macro. Otherwise, expands +# to the diversion number (not name) where require'd macros should be +# moved once completed. +m4_define([_m4_divert_dump]) + + +# m4_divert_require(DIVERSION, NAME-TO-CHECK, [BODY-TO-EXPAND]) +# ------------------------------------------------------------- +# Same as m4_require, but BODY-TO-EXPAND goes into the named DIVERSION; +# requirements still go in the current diversion though. +# +m4_define([m4_divert_require], +[m4_ifdef([_m4_expanding($2)], + [m4_fatal([$0: circular dependency of $2])])]dnl +[m4_if(_m4_divert_dump, [], + [m4_fatal([$0($2): cannot be used outside of an m4_defun'd macro])])]dnl +[m4_provide_if([$2], [], + [_m4_require_call([$2], [$3], _m4_divert([$1], [-]))])]) + + +# m4_defun(NAME, EXPANSION, [MACRO = m4_define]) +# ---------------------------------------------- +# Define a macro NAME which automatically provides itself. Add +# machinery so the macro automatically switches expansion to the +# diversion stack if it is not already using it, prior to EXPANSION. +# In this case, once finished, it will bring back all the code +# accumulated in the diversion stack. This, combined with m4_require, +# achieves the topological ordering of macros. We don't use this +# macro to define some frequently called macros that are not involved +# in ordering constraints, to save m4 processing. +# +# MACRO is an undocumented argument; when set to m4_pushdef, and NAME +# is already defined, the new definition is added to the pushdef +# stack, rather than overwriting the current definition. It can thus +# be used to write self-modifying macros, which pop themselves to a +# previously m4_define'd definition so that subsequent use of the +# macro is faster. +m4_define([m4_defun], +[m4_define([m4_location($1)], m4_location)]dnl +[m4_default([$3], [m4_define])([$1], + [_m4_defun_pro(]m4_dquote($[0])[)$2[]_m4_defun_epi(]m4_dquote($[0])[)])]) + + +# m4_defun_init(NAME, INIT, COMMON) +# --------------------------------- +# Like m4_defun, but split EXPANSION into two portions: INIT which is +# done only the first time NAME is invoked, and COMMON which is +# expanded every time. +# +# For now, the COMMON definition is always m4_define'd, giving an even +# lighter-weight definition. m4_defun allows self-providing, but once +# a macro is provided, m4_require no longer cares if it is m4_define'd +# or m4_defun'd. m4_defun also provides location tracking to identify +# dependency bugs, but once the INIT has been expanded, we know there +# are no dependency bugs. However, if a future use needs COMMON to be +# m4_defun'd, we can add a parameter, similar to the third parameter +# to m4_defun. +m4_define([m4_defun_init], +[m4_define([$1], [$3[]])m4_defun([$1], + [$2[]_m4_popdef(]m4_dquote($[0])[)m4_indir(]m4_dquote($[0])dnl +[m4_if(]m4_dquote($[#])[, [0], [], ]m4_dquote([,$]@)[))], [m4_pushdef])]) + + +# m4_defun_once(NAME, EXPANSION) +# ------------------------------ +# Like m4_defun, but guarantee that EXPANSION only happens once +# (thereafter, using NAME is a no-op). +# +# If _m4_divert_dump is empty, we are called at the top level; +# otherwise, we must ensure that we are required in front of the +# current defun'd macro. Use a helper macro so that EXPANSION need +# only occur once in the definition of NAME, since it might be large. +m4_define([m4_defun_once], +[m4_define([m4_location($1)], m4_location)]dnl +[m4_define([$1], [_m4_defun_once([$1], [$2], m4_if(_m4_divert_dump, [], + [[_m4_defun_pro([$1])m4_unquote(], [)_m4_defun_epi([$1])]], +m4_ifdef([_m4_diverting([$1])], [-]), [-], [[m4_unquote(], [)]], + [[_m4_require_call([$1],], [, _m4_divert_dump)]]))])]) + +m4_define([_m4_defun_once], +[m4_pushdef([$1])$3[$2[]m4_provide([$1])]$4]) + + +# m4_pattern_forbid(ERE, [WHY]) +# ----------------------------- +# Declare that no token matching the forbidden extended regular +# expression ERE should be seen in the output unless... +m4_define([m4_pattern_forbid], []) + + +# m4_pattern_allow(ERE) +# --------------------- +# ... that token also matches the allowed extended regular expression ERE. +# Both used via traces. +m4_define([m4_pattern_allow], []) + + +## --------------------------------- ## +## 11. Dependencies between macros. ## +## --------------------------------- ## + + +# m4_before(THIS-MACRO-NAME, CALLED-MACRO-NAME) +# --------------------------------------------- +# Issue a warning if CALLED-MACRO-NAME was called before THIS-MACRO-NAME. +m4_define([m4_before], +[m4_provide_if([$2], + [m4_warn([syntax], [$2 was called before $1])])]) + + +# m4_require(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK]) +# ----------------------------------------------------------- +# If NAME-TO-CHECK has never been expanded (actually, if it is not +# m4_provide'd), expand BODY-TO-EXPAND *before* the current macro +# expansion; follow the expansion with a newline. Once expanded, emit +# it in _m4_divert_dump. Keep track of the m4_require chain in +# _m4_expansion_stack. +# +# The normal cases are: +# +# - NAME-TO-CHECK == BODY-TO-EXPAND +# Which you can use for regular macros with or without arguments, e.g., +# m4_require([AC_PROG_CC], [AC_PROG_CC]) +# m4_require([AC_CHECK_HEADERS(threads.h)], [AC_CHECK_HEADERS(threads.h)]) +# which is just the same as +# m4_require([AC_PROG_CC]) +# m4_require([AC_CHECK_HEADERS(threads.h)]) +# +# - BODY-TO-EXPAND == m4_indir([NAME-TO-CHECK]) +# In the case of macros with irregular names. For instance: +# m4_require([AC_LANG_COMPILER(C)], [indir([AC_LANG_COMPILER(C)])]) +# which means `if the macro named `AC_LANG_COMPILER(C)' (the parens are +# part of the name, it is not an argument) has not been run, then +# call it.' +# Had you used +# m4_require([AC_LANG_COMPILER(C)], [AC_LANG_COMPILER(C)]) +# then m4_require would have tried to expand `AC_LANG_COMPILER(C)', i.e., +# call the macro `AC_LANG_COMPILER' with `C' as argument. +# +# You could argue that `AC_LANG_COMPILER', when it receives an argument +# such as `C' should dispatch the call to `AC_LANG_COMPILER(C)'. But this +# `extension' prevents `AC_LANG_COMPILER' from having actual arguments that +# it passes to `AC_LANG_COMPILER(C)'. +# +# This is called frequently, so minimize the number of macro invocations +# by avoiding dnl and other overhead on the common path. +m4_define([m4_require], +[m4_ifdef([_m4_expanding($1)], + [m4_fatal([$0: circular dependency of $1])])]dnl +[m4_if(_m4_divert_dump, [], + [m4_fatal([$0($1): cannot be used outside of an ]dnl +m4_if([$0], [m4_require], [[m4_defun]], [[AC_DEFUN]])['d macro])])]dnl +[m4_provide_if([$1], [m4_set_contains([_m4_provide], [$1], + [_m4_require_check([$1], _m4_defn([m4_provide($1)]), [$0])], [m4_ignore])], + [_m4_require_call])([$1], [$2], _m4_divert_dump)]) + + +# _m4_require_call(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK], +# DIVERSION-NUMBER) +# ----------------------------------------------------------------- +# If m4_require decides to expand the body, it calls this macro. The +# expansion is placed in DIVERSION-NUMBER. +# +# This is called frequently, so minimize the number of macro invocations +# by avoiding dnl and other overhead on the common path. +# The use of a witness macro protecting the warning allows aclocal +# to silence any warnings when probing for what macros are required +# and must therefore be located, when using the Autoconf-without-aclocal-m4 +# autom4te language. For more background, see: +# https://lists.gnu.org/archive/html/automake-patches/2012-11/msg00035.html +m4_define([_m4_require_call], +[m4_pushdef([_m4_divert_grow], m4_decr(_m4_divert_grow))]dnl +[m4_pushdef([_m4_diverting([$1])])m4_pushdef([_m4_diverting], [$1])]dnl +[m4_divert_push(_m4_divert_grow, [-])]dnl +[m4_if([$2], [], [$1], [$2]) +m4_provide_if([$1], [m4_set_remove([_m4_provide], [$1])], + [m4_ifndef([m4_require_silent_probe], + [m4_warn([syntax], [$1 is m4_require'd but not m4_defun'd])])])]dnl +[_m4_divert_raw($3)_m4_undivert(_m4_divert_grow)]dnl +[m4_divert_pop(_m4_divert_grow)_m4_popdef([_m4_divert_grow], +[_m4_diverting([$1])], [_m4_diverting])]) + + +# _m4_require_check(NAME-TO-CHECK, OWNER, CALLER) +# ----------------------------------------------- +# NAME-TO-CHECK has been identified as previously expanded in the +# diversion owned by OWNER. If this is a problem, warn on behalf of +# CALLER and return _m4_require_call; otherwise return m4_ignore. +m4_define([_m4_require_check], +[m4_if(_m4_defn([_m4_diverting]), [$2], [m4_ignore], + m4_ifdef([_m4_diverting([$2])], [-]), [-], [m4_warn([syntax], + [$3: `$1' was expanded before it was required +http://www.gnu.org/software/autoconf/manual/autoconf.html#Expanded-Before-Required])_m4_require_call], + [m4_ignore])]) + + +# _m4_divert_grow +# --------------- +# The counter for _m4_require_call. +m4_define([_m4_divert_grow], _m4_divert([GROW])) + + +# m4_expand_once(TEXT, [WITNESS = TEXT]) +# -------------------------------------- +# If TEXT has never been expanded, expand it *here*. Use WITNESS as +# as a memory that TEXT has already been expanded. +m4_define([m4_expand_once], +[m4_provide_if(m4_default_quoted([$2], [$1]), + [], + [m4_provide(m4_default_quoted([$2], [$1]))[]$1])]) + + +# m4_provide(MACRO-NAME) +# ---------------------- +m4_define([m4_provide], +[m4_ifdef([m4_provide($1)], [], +[m4_set_add([_m4_provide], [$1], [m4_define([m4_provide($1)], + m4_ifdef([_m4_diverting], [_m4_defn([_m4_diverting])]))])])]) + + +# m4_provide_if(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ------------------------------------------------------- +# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. +# The purpose of this macro is to provide the user with a means to +# check macros which are provided without letting her know how the +# information is coded. +m4_define([m4_provide_if], +[m4_ifdef([m4_provide($1)], + [$2], [$3])]) + + +## --------------------- ## +## 12. Text processing. ## +## --------------------- ## + + +# m4_cr_letters +# m4_cr_LETTERS +# m4_cr_Letters +# ------------- +m4_define([m4_cr_letters], [abcdefghijklmnopqrstuvwxyz]) +m4_define([m4_cr_LETTERS], [ABCDEFGHIJKLMNOPQRSTUVWXYZ]) +m4_define([m4_cr_Letters], +m4_defn([m4_cr_letters])dnl +m4_defn([m4_cr_LETTERS])dnl +) + + +# m4_cr_digits +# ------------ +m4_define([m4_cr_digits], [0123456789]) + + +# m4_cr_alnum +# ----------- +m4_define([m4_cr_alnum], +m4_defn([m4_cr_Letters])dnl +m4_defn([m4_cr_digits])dnl +) + + +# m4_cr_symbols1 +# m4_cr_symbols2 +# -------------- +m4_define([m4_cr_symbols1], +m4_defn([m4_cr_Letters])dnl +_) + +m4_define([m4_cr_symbols2], +m4_defn([m4_cr_symbols1])dnl +m4_defn([m4_cr_digits])dnl +) + +# m4_cr_all +# --------- +# The character range representing everything, with `-' as the last +# character, since it is special to m4_translit. Use with care, because +# it contains characters special to M4 (fortunately, both ASCII and EBCDIC +# have [] in order, so m4_defn([m4_cr_all]) remains a valid string). It +# also contains characters special to terminals, so it should never be +# displayed in an error message. Also, attempts to map [ and ] to other +# characters via m4_translit must deal with the fact that m4_translit does +# not add quotes to the output. +# +# In EBCDIC, $ is immediately followed by *, which leads to problems +# if m4_cr_all is inlined into a macro definition; so swap them. +# +# It is mainly useful in generating inverted character range maps, for use +# in places where m4_translit is faster than an equivalent m4_bpatsubst; +# the regex `[^a-z]' is equivalent to: +# m4_translit(m4_dquote(m4_defn([m4_cr_all])), [a-z]) +m4_define([m4_cr_all], +m4_translit(m4_dquote(m4_format(m4_dquote(m4_for( + ,1,255,,[[%c]]))m4_for([i],1,255,,[,i]))), [$*-], [*$])-) + + +# _m4_define_cr_not(CATEGORY) +# --------------------------- +# Define m4_cr_not_CATEGORY as the inverse of m4_cr_CATEGORY. +m4_define([_m4_define_cr_not], +[m4_define([m4_cr_not_$1], + m4_translit(m4_dquote(m4_defn([m4_cr_all])), + m4_defn([m4_cr_$1])))]) + + +# m4_cr_not_letters +# m4_cr_not_LETTERS +# m4_cr_not_Letters +# m4_cr_not_digits +# m4_cr_not_alnum +# m4_cr_not_symbols1 +# m4_cr_not_symbols2 +# ------------------ +# Inverse character sets +_m4_define_cr_not([letters]) +_m4_define_cr_not([LETTERS]) +_m4_define_cr_not([Letters]) +_m4_define_cr_not([digits]) +_m4_define_cr_not([alnum]) +_m4_define_cr_not([symbols1]) +_m4_define_cr_not([symbols2]) + + +# m4_newline([STRING]) +# -------------------- +# Expands to a newline, possibly followed by STRING. Exists mostly for +# formatting reasons. +m4_define([m4_newline], [ +$1]) + + +# m4_re_escape(STRING) +# -------------------- +# Escape RE active characters in STRING. +m4_define([m4_re_escape], +[m4_bpatsubst([$1], + [[][*+.?\^$]], [\\\&])]) + + +# m4_re_string +# ------------ +# Regexp for `[a-zA-Z_0-9]*' +# m4_dquote provides literal [] for the character class. +m4_define([m4_re_string], +m4_dquote(m4_defn([m4_cr_symbols2]))dnl +[*]dnl +) + + +# m4_re_word +# ---------- +# Regexp for `[a-zA-Z_][a-zA-Z_0-9]*' +m4_define([m4_re_word], +m4_dquote(m4_defn([m4_cr_symbols1]))dnl +m4_defn([m4_re_string])dnl +) + + +# m4_tolower(STRING) +# m4_toupper(STRING) +# ------------------ +# These macros convert STRING to lowercase or uppercase. +# +# Rather than expand the m4_defn each time, we inline them up front. +m4_define([m4_tolower], +[m4_translit([[$1]], ]m4_dquote(m4_defn([m4_cr_LETTERS]))[, + ]m4_dquote(m4_defn([m4_cr_letters]))[)]) +m4_define([m4_toupper], +[m4_translit([[$1]], ]m4_dquote(m4_defn([m4_cr_letters]))[, + ]m4_dquote(m4_defn([m4_cr_LETTERS]))[)]) + + +# m4_split(STRING, [REGEXP]) +# -------------------------- +# Split STRING into an m4 list of quoted elements. The elements are +# quoted with [ and ]. Beginning spaces and end spaces *are kept*. +# Use m4_strip to remove them. +# +# REGEXP specifies where to split. Default is [\t ]+. +# +# If STRING is empty, the result is an empty list. +# +# Pay attention to the m4_changequotes. When m4 reads the definition of +# m4_split, it still has quotes set to [ and ]. Luckily, these are matched +# in the macro body, so the definition is stored correctly. Use the same +# alternate quotes as m4_noquote; it must be unlikely to appear in $1. +# +# Also, notice that $1 is quoted twice, since we want the result to +# be quoted. Then you should understand that the argument of +# patsubst is -=<{(STRING)}>=- (i.e., with additional -=<{( and )}>=-). +# +# This macro is safe on active symbols, i.e.: +# m4_define(active, ACTIVE) +# m4_split([active active ])end +# => [active], [active], []end +# +# Optimize on regex of ` ' (space), since m4_foreach_w already guarantees +# that the list contains single space separators, and a common case is +# splitting a single-element list. This macro is called frequently, +# so avoid unnecessary dnl inside the definition. +m4_define([m4_split], +[m4_if([$1], [], [], + [$2], [ ], [m4_if(m4_index([$1], [ ]), [-1], [[[$1]]], + [_$0([$1], [$2], [, ])])], + [$2], [], [_$0([$1], [[ ]+], [, ])], + [_$0([$1], [$2], [, ])])]) + +m4_define([_m4_split], +[m4_changequote([-=<{(],[)}>=-])]dnl +[[m4_bpatsubst(-=<{(-=<{($1)}>=-)}>=-, -=<{($2)}>=-, + -=<{(]$3[)}>=-)]m4_changequote([, ])]) + + +# m4_chomp(STRING) +# m4_chomp_all(STRING) +# -------------------- +# Return STRING quoted, but without a trailing newline. m4_chomp +# removes at most one newline, while m4_chomp_all removes all +# consecutive trailing newlines. Embedded newlines are not touched, +# and a trailing backslash-newline leaves just a trailing backslash. +# +# m4_bregexp is slower than m4_index, and we don't always want to +# remove all newlines; hence the two variants. We massage characters +# to give a nicer pattern to match, particularly since m4_bregexp is +# line-oriented. Both versions must guarantee a match, to avoid bugs +# with precision -1 in m4_format in older m4. +m4_define([m4_chomp], +[m4_format([[%.*s]], m4_index(m4_translit([[$1]], [ +/.], [/ ])[./.], [/.]), [$1])]) + +m4_define([m4_chomp_all], +[m4_format([[%.*s]], m4_bregexp(m4_translit([[$1]], [ +/], [/ ]), [/*$]), [$1])]) + + +# m4_flatten(STRING) +# ------------------ +# If STRING contains end of lines, replace them with spaces. If there +# are backslashed end of lines, remove them. This macro is safe with +# active symbols. +# m4_define(active, ACTIVE) +# m4_flatten([active +# act\ +# ive])end +# => active activeend +# +# In m4, m4_bpatsubst is expensive, so first check for a newline. +m4_define([m4_flatten], +[m4_if(m4_index([$1], [ +]), [-1], [[$1]], + [m4_translit(m4_bpatsubst([[[$1]]], [\\ +]), [ +], [ ])])]) + + +# m4_strip(STRING) +# ---------------- +# Expands into STRING with tabs and spaces singled out into a single +# space, and removing leading and trailing spaces. +# +# This macro is robust to active symbols. +# m4_define(active, ACTIVE) +# m4_strip([ active <tab> <tab>active ])end +# => active activeend +# +# First, notice that we guarantee trailing space. Why? Because regular +# expressions are greedy, and `.* ?' would always group the space into the +# .* portion. The algorithm is simpler by avoiding `?' at the end. The +# algorithm correctly strips everything if STRING is just ` '. +# +# Then notice the second pattern: it is in charge of removing the +# leading/trailing spaces. Why not just `[^ ]'? Because they are +# applied to over-quoted strings, i.e. more or less [STRING], due +# to the limitations of m4_bpatsubsts. So the leading space in STRING +# is the *second* character; equally for the trailing space. +m4_define([m4_strip], +[m4_bpatsubsts([$1 ], + [[ ]+], [ ], + [^. ?\(.*\) .$], [[[\1]]])]) + + +# m4_normalize(STRING) +# -------------------- +# Apply m4_flatten and m4_strip to STRING. +# +# The argument is quoted, so that the macro is robust to active symbols: +# +# m4_define(active, ACTIVE) +# m4_normalize([ act\ +# ive +# active ])end +# => active activeend + +m4_define([m4_normalize], +[m4_strip(m4_flatten([$1]))]) + + + +# m4_join(SEP, ARG1, ARG2...) +# --------------------------- +# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG +# is the empty string. No expansion is performed on SEP or ARGs. +# +# Since the number of arguments to join can be arbitrarily long, we +# want to avoid having more than one $@ in the macro definition; +# otherwise, the expansion would require twice the memory of the already +# long list. Hence, m4_join merely looks for the first non-empty element, +# and outputs just that element; while _m4_join looks for all non-empty +# elements, and outputs them following a separator. The final trick to +# note is that we decide between recursing with $0 or _$0 based on the +# nested m4_if ending with `_'. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift2($@))])]) +m4_define([_m4_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift2($@))])]) + +# m4_joinall(SEP, ARG1, ARG2...) +# ------------------------------ +# Produce ARG1SEPARG2...SEPARGn. An empty ARG results in back-to-back SEP. +# No expansion is performed on SEP or ARGs. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_joinall], [[$2]_$0([$1], m4_shift($@))]) +m4_define([_m4_joinall], +[m4_if([$#], [2], [], [[$1$3]$0([$1], m4_shift2($@))])]) + +# m4_combine([SEPARATOR], PREFIX-LIST, [INFIX], SUFFIX...) +# -------------------------------------------------------- +# Produce the pairwise combination of every element in the quoted, +# comma-separated PREFIX-LIST with every element from the SUFFIX arguments. +# Each pair is joined with INFIX, and pairs are separated by SEPARATOR. +# No expansion occurs on SEPARATOR, INFIX, or elements of either list. +# +# For example: +# m4_combine([, ], [[a], [b], [c]], [-], [1], [2], [3]) +# => a-1, a-2, a-3, b-1, b-2, b-3, c-1, c-2, c-3 +# +# This definition is a bit hairy; the thing to realize is that we want +# to construct m4_map_args_sep([[prefix$3]], [], [[$1]], m4_shift3($@)) +# as the inner loop, using each prefix generated by the outer loop, +# and without recalculating m4_shift3 every outer iteration. +m4_define([m4_combine], +[m4_if([$2], [], [], m4_eval([$# > 3]), [1], +[m4_map_args_sep([m4_map_args_sep(m4_dquote(], [)[[$3]], [], [[$1]],]]]dnl +[m4_dquote(m4_dquote(m4_shift3($@)))[[)], [[$1]], $2)])]) + + +# m4_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR`'STRING' +# at the end. It is valid to use this macro with MACRO-NAME undefined, +# in which case no SEPARATOR is added. Be aware that the criterion is +# `not being defined', and not `not being empty'. +# +# Note that neither STRING nor SEPARATOR are expanded here; rather, when +# you expand MACRO-NAME, they will be expanded at that point in time. +# +# This macro is robust to active symbols. It can be used to grow +# strings. +# +# | m4_define(active, ACTIVE)dnl +# | m4_append([sentence], [This is an])dnl +# | m4_append([sentence], [ active ])dnl +# | m4_append([sentence], [symbol.])dnl +# | sentence +# | m4_undefine([active])dnl +# | sentence +# => This is an ACTIVE symbol. +# => This is an active symbol. +# +# It can be used to define hooks. +# +# | m4_define(active, ACTIVE)dnl +# | m4_append([hooks], [m4_define([act1], [act2])])dnl +# | m4_append([hooks], [m4_define([act2], [active])])dnl +# | m4_undefine([active])dnl +# | act1 +# | hooks +# | act1 +# => act1 +# => +# => active +# +# It can also be used to create lists, although this particular usage was +# broken prior to autoconf 2.62. +# | m4_append([list], [one], [, ])dnl +# | m4_append([list], [two], [, ])dnl +# | m4_append([list], [three], [, ])dnl +# | list +# | m4_dquote(list) +# => one, two, three +# => [one],[two],[three] +# +# Note that m4_append can benefit from amortized O(n) m4 behavior, if +# the underlying m4 implementation is smart enough to avoid copying existing +# contents when enlarging a macro's definition into any pre-allocated storage +# (m4 1.4.x unfortunately does not implement this optimization). We do +# not implement m4_prepend, since it is inherently O(n^2) (pre-allocated +# storage only occurs at the end of a macro, so the existing contents must +# always be moved). +# +# Use _m4_defn for speed. +m4_define([m4_append], +[m4_define([$1], m4_ifdef([$1], [_m4_defn([$1])[$3]])[$2])]) + + +# m4_append_uniq(MACRO-NAME, STRING, [SEPARATOR], [IF-UNIQ], [IF-DUP]) +# -------------------------------------------------------------------- +# Like `m4_append', but append only if not yet present. Additionally, +# expand IF-UNIQ if STRING was appended, or IF-DUP if STRING was already +# present. Also, warn if SEPARATOR is not empty and occurs within STRING, +# as the algorithm no longer guarantees uniqueness. +# +# Note that while m4_append can be O(n) (depending on the quality of the +# underlying M4 implementation), m4_append_uniq is inherently O(n^2) +# because each append operation searches the entire string. +m4_define([m4_append_uniq], +[m4_ifval([$3], [m4_if(m4_index([$2], [$3]), [-1], [], + [m4_warn([syntax], + [$0: `$2' contains `$3'])])])_$0($@)]) +m4_define([_m4_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]_m4_defn([$1])[$3], [$3$2$3]), [-1], + [m4_append([$1], [$2], [$3])$4], [$5])], + [m4_define([$1], [$2])$4])]) + +# m4_append_uniq_w(MACRO-NAME, STRINGS) +# ------------------------------------- +# For each of the words in the whitespace separated list STRINGS, append +# only the unique strings to the definition of MACRO-NAME. +# +# Use _m4_defn for speed. +m4_define([m4_append_uniq_w], +[m4_map_args_w([$2], [_m4_append_uniq([$1],], [, [ ])])]) + + +# m4_escape(STRING) +# ----------------- +# Output quoted STRING, but with embedded #, $, [ and ] turned into +# quadrigraphs. +# +# It is faster to check if STRING is already good using m4_translit +# than to blindly perform four m4_bpatsubst. +# +# Because the translit is stripping quotes, it must also neutralize +# anything that might be in a macro name, as well as comments, commas, +# and parentheses. All the problem characters are unified so that a +# single m4_index can scan the result. +# +# Rather than expand m4_defn every time m4_escape is expanded, we +# inline its expansion up front. +m4_define([m4_escape], +[m4_if(m4_index(m4_translit([$1], + [[]#,()]]m4_dquote(m4_defn([m4_cr_symbols2]))[, [$$$]), [$]), + [-1], [m4_echo], [_$0])([$1])]) + +m4_define([_m4_escape], +[m4_changequote([-=<{(],[)}>=-])]dnl +[m4_bpatsubst(m4_bpatsubst(m4_bpatsubst(m4_bpatsubst( + -=<{(-=<{(-=<{(-=<{(-=<{($1)}>=-)}>=-)}>=-)}>=-)}>=-, + -=<{(#)}>=-, -=<{(@%:@)}>=-), + -=<{(\[)}>=-, -=<{(@<:@)}>=-), + -=<{(\])}>=-, -=<{(@:>@)}>=-), + -=<{(\$)}>=-, -=<{(@S|@)}>=-)m4_changequote([,])]) + + +# m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH]) +# ------------------------------------------------------- +# Expands into STRING wrapped to hold in WIDTH columns (default = 79). +# If PREFIX is given, each line is prefixed with it. If FIRST-PREFIX is +# specified, then the first line is prefixed with it. As a special case, +# if the length of FIRST-PREFIX is greater than that of PREFIX, then +# FIRST-PREFIX will be left alone on the first line. +# +# No expansion occurs on the contents STRING, PREFIX, or FIRST-PREFIX, +# although quadrigraphs are correctly recognized. More precisely, +# you may redefine m4_qlen to recognize whatever escape sequences that +# you will post-process. +# +# Typical outputs are: +# +# m4_text_wrap([Short string */], [ ], [/* ], 20) +# => /* Short string */ +# +# m4_text_wrap([Much longer string */], [ ], [/* ], 20) +# => /* Much longer +# => string */ +# +# m4_text_wrap([Short doc.], [ ], [ --short ], 30) +# => --short Short doc. +# +# m4_text_wrap([Short doc.], [ ], [ --too-wide ], 30) +# => --too-wide +# => Short doc. +# +# m4_text_wrap([Super long documentation.], [ ], [ --too-wide ], 30) +# => --too-wide +# => Super long +# => documentation. +# +# FIXME: there is no checking of a longer PREFIX than WIDTH, but do +# we really want to bother with people trying each single corner +# of a software? +# +# This macro does not leave a trailing space behind the last word of a line, +# which complicates it a bit. The algorithm is otherwise stupid and simple: +# all the words are preceded by m4_Separator which is defined to empty for +# the first word, and then ` ' (single space) for all the others. +# +# The algorithm uses a helper that uses $2 through $4 directly, rather than +# using local variables, to avoid m4_defn overhead, or expansion swallowing +# any $. It also bypasses m4_popdef overhead with _m4_popdef since no user +# macro expansion occurs in the meantime. Also, the definition is written +# with m4_do, to avoid time wasted on dnl during expansion (since this is +# already a time-consuming macro). +m4_define([m4_text_wrap], +[_$0(m4_escape([$1]), [$2], m4_default_quoted([$3], [$2]), + m4_default_quoted([$4], [79]))]) + +m4_define([_m4_text_wrap], +m4_do(dnl set up local variables, to avoid repeated calculations +[[m4_pushdef([m4_Indent], m4_qlen([$2]))]], +[[m4_pushdef([m4_Cursor], m4_qlen([$3]))]], +[[m4_pushdef([m4_Separator], [m4_define([m4_Separator], [ ])])]], +dnl expand the first prefix, then check its length vs. regular prefix +dnl same length: nothing special +dnl prefix1 longer: output on line by itself, and reset cursor +dnl prefix1 shorter: pad to length of prefix, and reset cursor +[[[$3]m4_cond([m4_Cursor], m4_Indent, [], + [m4_eval(m4_Cursor > m4_Indent)], [1], [ +[$2]m4_define([m4_Cursor], m4_Indent)], + [m4_format([%*s], m4_max([0], + m4_eval(m4_Indent - m4_Cursor)), [])m4_define([m4_Cursor], m4_Indent)])]], +dnl now, for each word, compute the cursor after the word is output, then +dnl check if the cursor would exceed the wrap column +dnl if so, reset cursor, and insert newline and prefix +dnl if not, insert the separator (usually a space) +dnl either way, insert the word +[[m4_map_args_w([$1], [$0_word(], [, [$2], [$4])])]], +dnl finally, clean up the local variables +[[_m4_popdef([m4_Separator], [m4_Cursor], [m4_Indent])]])) + +m4_define([_m4_text_wrap_word], +[m4_define([m4_Cursor], m4_eval(m4_Cursor + m4_qlen([$1]) + 1))]dnl +[m4_if(m4_eval(m4_Cursor > ([$3])), + [1], [m4_define([m4_Cursor], m4_eval(m4_Indent + m4_qlen([$1]) + 1)) +[$2]], + [m4_Separator[]])[$1]]) + +# m4_text_box(MESSAGE, [FRAME-CHARACTER = `-']) +# --------------------------------------------- +# Turn MESSAGE into: +# ## ------- ## +# ## MESSAGE ## +# ## ------- ## +# using FRAME-CHARACTER in the border. +# +# Quadrigraphs are correctly recognized. More precisely, you may +# redefine m4_qlen to recognize whatever escape sequences that you +# will post-process. +m4_define([m4_text_box], +[m4_pushdef([m4_Border], + m4_translit(m4_format([[[%*s]]], m4_decr(m4_qlen(_m4_expand([$1 +]))), []), [ ], m4_default_quoted([$2], [-])))]dnl +[[##] _m4_defn([m4_Border]) [##] +[##] $1 [##] +[##] _m4_defn([m4_Border]) [##]_m4_popdef([m4_Border])]) + + +# m4_qlen(STRING) +# --------------- +# Expands to the length of STRING after autom4te converts all quadrigraphs. +# +# If you use some other means of post-processing m4 output rather than +# autom4te, then you may redefine this macro to recognize whatever +# escape sequences your post-processor will handle. For that matter, +# m4_define([m4_qlen], m4_defn([m4_len])) is sufficient if you don't +# do any post-processing. +# +# Avoid bpatsubsts for the common case of no quadrigraphs. Cache +# results, as configure scripts tend to ask about lengths of common +# strings like `/*' and `*/' rather frequently. Minimize the number +# of times that $1 occurs in m4_qlen, so there is less text to parse +# on a cache hit. +m4_define([m4_qlen], +[m4_ifdef([$0-$1], [_m4_defn([$0-]], [_$0(])[$1])]) +m4_define([_m4_qlen], +[m4_define([m4_qlen-$1], +m4_if(m4_index([$1], [@]), [-1], [m4_len([$1])], + [m4_len(m4_bpatsubst([[$1]], + [@\(\(<:\|:>\|S|\|%:\|\{:\|:\}\)\(@\)\|&t@\)], + [\3]))]))_m4_defn([m4_qlen-$1])]) + +# m4_copyright_condense(TEXT) +# --------------------------- +# Condense the copyright notice in TEXT to only display the final +# year, wrapping the results to fit in 80 columns. +m4_define([m4_copyright_condense], +[m4_text_wrap(m4_bpatsubst(m4_flatten([[$1]]), +[(C)[- ,0-9]*\([1-9][0-9][0-9][0-9]\)], [(C) \1]))]) + +## ----------------------- ## +## 13. Number processing. ## +## ----------------------- ## + +# m4_cmp(A, B) +# ------------ +# Compare two integer expressions. +# A < B -> -1 +# A = B -> 0 +# A > B -> 1 +m4_define([m4_cmp], +[m4_eval((([$1]) > ([$2])) - (([$1]) < ([$2])))]) + + +# m4_list_cmp(A, B) +# ----------------- +# +# Compare the two lists of integer expressions A and B. For instance: +# m4_list_cmp([1, 0], [1]) -> 0 +# m4_list_cmp([1, 0], [1, 0]) -> 0 +# m4_list_cmp([1, 2], [1, 0]) -> 1 +# m4_list_cmp([1, 2, 3], [1, 2]) -> 1 +# m4_list_cmp([1, 2, -3], [1, 2]) -> -1 +# m4_list_cmp([1, 0], [1, 2]) -> -1 +# m4_list_cmp([1], [1, 2]) -> -1 +# m4_define([xa], [oops])dnl +# m4_list_cmp([[0xa]], [5+5]) -> 0 +# +# Rather than face the overhead of m4_case, we use a helper function whose +# expansion includes the name of the macro to invoke on the tail, either +# m4_ignore or m4_unquote. This is particularly useful when comparing +# long lists, since less text is being expanded for deciding when to end +# recursion. The recursion is between a pair of macros that alternate +# which list is trimmed by one element; this is more efficient than +# calling m4_cdr on both lists from a single macro. Guarantee exactly +# one expansion of both lists' side effects. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_list_cmp], +[_$0_raw(m4_dquote($1), m4_dquote($2))]) + +m4_define([_m4_list_cmp_raw], +[m4_if([$1], [$2], [0], [_m4_list_cmp_1([$1], $2)])]) + +m4_define([_m4_list_cmp], +[m4_if([$1], [], [0m4_ignore], [$2], [0], [m4_unquote], [$2m4_ignore])]) + +m4_define([_m4_list_cmp_1], +[_m4_list_cmp_2([$2], [m4_shift2($@)], $1)]) + +m4_define([_m4_list_cmp_2], +[_m4_list_cmp([$1$3], m4_cmp([$3+0], [$1+0]))( + [_m4_list_cmp_1(m4_dquote(m4_shift3($@)), $2)])]) + +# m4_max(EXPR, ...) +# m4_min(EXPR, ...) +# ----------------- +# Return the decimal value of the maximum (or minimum) in a series of +# integer expressions. +# +# M4 1.4.x doesn't provide ?:. Hence this huge m4_eval. Avoid m4_eval +# if both arguments are identical, but be aware of m4_max(0xa, 10) (hence +# the use of <=, not just <, in the second multiply). +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_max], +[m4_if([$#], [0], [m4_fatal([too few arguments to $0])], + [$#], [1], [m4_eval([$1])], + [$#$1], [2$2], [m4_eval([$1])], + [$#], [2], [_$0($@)], + [_m4_minmax([_$0], $@)])]) + +m4_define([_m4_max], +[m4_eval((([$1]) > ([$2])) * ([$1]) + (([$1]) <= ([$2])) * ([$2]))]) + +m4_define([m4_min], +[m4_if([$#], [0], [m4_fatal([too few arguments to $0])], + [$#], [1], [m4_eval([$1])], + [$#$1], [2$2], [m4_eval([$1])], + [$#], [2], [_$0($@)], + [_m4_minmax([_$0], $@)])]) + +m4_define([_m4_min], +[m4_eval((([$1]) < ([$2])) * ([$1]) + (([$1]) >= ([$2])) * ([$2]))]) + +# _m4_minmax(METHOD, ARG1, ARG2...) +# --------------------------------- +# Common recursion code for m4_max and m4_min. METHOD must be _m4_max +# or _m4_min, and there must be at least two arguments to combine. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([_m4_minmax], +[m4_if([$#], [3], [$1([$2], [$3])], + [$0([$1], $1([$2], [$3]), m4_shift3($@))])]) + + +# m4_sign(A) +# ---------- +# The sign of the integer expression A. +m4_define([m4_sign], +[m4_eval((([$1]) > 0) - (([$1]) < 0))]) + + + +## ------------------------ ## +## 14. Version processing. ## +## ------------------------ ## + + +# m4_version_unletter(VERSION) +# ---------------------------- +# Normalize beta version numbers with letters to numeric expressions, which +# can then be handed to m4_eval for the purpose of comparison. +# +# Nl -> (N+1).-1.(l#) +# +# for example: +# [2.14a] -> [0,2,14+1,-1,[0r36:a]] -> 2.15.-1.10 +# [2.14b] -> [0,2,15+1,-1,[0r36:b]] -> 2.15.-1.11 +# [2.61aa.b] -> [0,2.61,1,-1,[0r36:aa],+1,-1,[0r36:b]] -> 2.62.-1.370.1.-1.11 +# [08] -> [0,[0r10:0]8] -> 8 +# +# This macro expects reasonable version numbers, but can handle double +# letters and does not expand any macros. Original version strings can +# use both `.' and `-' separators. +# +# Inline constant expansions, to avoid m4_defn overhead. +# _m4_version_unletter is the real workhorse used by m4_version_compare, +# but since [0r36:a] and commas are less readable than 10 and dots, we +# provide a wrapper for human use. +m4_define([m4_version_unletter], +[m4_substr(m4_map_args([.m4_eval], m4_unquote(_$0([$1]))), [3])]) +m4_define([_m4_version_unletter], +[m4_bpatsubst(m4_bpatsubst(m4_translit([[[[0,$1]]]], [.-], [,,]),]dnl +m4_dquote(m4_dquote(m4_defn([m4_cr_Letters])))[[+], + [+1,-1,[0r36:\&]]), [,0], [,[0r10:0]])]) + + +# m4_version_compare(VERSION-1, VERSION-2) +# ---------------------------------------- +# Compare the two version numbers and expand into +# -1 if VERSION-1 < VERSION-2 +# 0 if = +# 1 if > +# +# Since _m4_version_unletter does not output side effects, we can +# safely bypass the overhead of m4_version_cmp. +m4_define([m4_version_compare], +[_m4_list_cmp_raw(_m4_version_unletter([$1]), _m4_version_unletter([$2]))]) + + +# m4_PACKAGE_NAME +# m4_PACKAGE_TARNAME +# m4_PACKAGE_VERSION +# m4_PACKAGE_STRING +# m4_PACKAGE_BUGREPORT +# -------------------- +# If m4sugar/version.m4 is present, then define version strings. This +# file is optional, provided by Autoconf but absent in Bison. +m4_sinclude([m4sugar/version.m4]) + + +# m4_version_prereq(VERSION, [IF-OK], [IF-NOT = FAIL]) +# ---------------------------------------------------- +# Check this Autoconf version against VERSION. +m4_define([m4_version_prereq], +m4_ifdef([m4_PACKAGE_VERSION], +[[m4_if(m4_version_compare(]m4_dquote(m4_defn([m4_PACKAGE_VERSION]))[, [$1]), + [-1], + [m4_default([$3], + [m4_fatal([Autoconf version $1 or higher is required], + [63])])], + [$2])]], +[[m4_fatal([m4sugar/version.m4 not found])]])) + + +## ------------------ ## +## 15. Set handling. ## +## ------------------ ## + +# Autoconf likes to create arbitrarily large sets; for example, as of +# this writing, the configure.ac for coreutils tracks a set of more +# than 400 AC_SUBST. How do we track all of these set members, +# without introducing duplicates? We could use m4_append_uniq, with +# the set NAME residing in the contents of the macro NAME. +# Unfortunately, m4_append_uniq is quadratic for set creation, because +# it costs O(n) to search the string for each of O(n) insertions; not +# to mention that with m4 1.4.x, even using m4_append is slow, costing +# O(n) rather than O(1) per insertion. Other set operations, not used +# by Autoconf but still possible by manipulation of the definition +# tracked in macro NAME, include O(n) deletion of one element and O(n) +# computation of set size. Because the set is exposed to the user via +# the definition of a single macro, we cannot cache any data about the +# set without risking the cache being invalidated by the user +# redefining NAME. +# +# Can we do better? Yes, because m4 gives us an O(1) search function +# for free: ifdef. Additionally, even m4 1.4.x gives us an O(1) +# insert operation for free: pushdef. But to use these, we must +# represent the set via a group of macros; to keep the set consistent, +# we must hide the set so that the user can only manipulate it through +# accessor macros. The contents of the set are maintained through two +# access points; _m4_set([name]) is a pushdef stack of values in the +# set, useful for O(n) traversal of the set contents; while the +# existence of _m4_set([name],value) with no particular value is +# useful for O(1) querying of set membership. And since the user +# cannot externally manipulate the set, we are free to add additional +# caching macros for other performance improvements. Deletion can be +# O(1) per element rather than O(n), by reworking the definition of +# _m4_set([name],value) to be 0 or 1 based on current membership, and +# adding _m4_set_cleanup(name) to defer the O(n) cleanup of +# _m4_set([name]) until we have another reason to do an O(n) +# traversal. The existence of _m4_set_cleanup(name) can then be used +# elsewhere to determine if we must dereference _m4_set([name],value), +# or assume that definition implies set membership. Finally, size can +# be tracked in an O(1) fashion with _m4_set_size(name). +# +# The quoting in _m4_set([name],value) is chosen so that there is no +# ambiguity with a set whose name contains a comma, and so that we can +# supply the value via _m4_defn([_m4_set([name])]) without needing any +# quote manipulation. + +# m4_set_add(SET, VALUE, [IF-UNIQ], [IF-DUP]) +# ------------------------------------------- +# Add VALUE as an element of SET. Expand IF-UNIQ on the first +# addition, and IF-DUP if it is already in the set. Addition of one +# element is O(1), such that overall set creation is O(n). +# +# We do not want to add a duplicate for a previously deleted but +# unpruned element, but it is just as easy to check existence directly +# as it is to query _m4_set_cleanup($1). +m4_define([m4_set_add], +[m4_ifdef([_m4_set([$1],$2)], + [m4_if(m4_indir([_m4_set([$1],$2)]), [0], + [m4_define([_m4_set([$1],$2)], + [1])_m4_set_size([$1], [m4_incr])$3], [$4])], + [m4_define([_m4_set([$1],$2)], + [1])m4_pushdef([_m4_set([$1])], + [$2])_m4_set_size([$1], [m4_incr])$3])]) + +# m4_set_add_all(SET, VALUE...) +# ----------------------------- +# Add each VALUE into SET. This is O(n) in the number of VALUEs, and +# can be faster than calling m4_set_add for each VALUE. +# +# Implement two recursion helpers; the check variant is slower but +# handles the case where an element has previously been removed but +# not pruned. The recursion helpers ignore their second argument, so +# that we can use the faster m4_shift2 and 2 arguments, rather than +# _m4_shift2 and one argument, as the signal to end recursion. +# +# Please keep foreach.m4 in sync with any adjustments made here. +m4_define([m4_set_add_all], +[m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1]) + + m4_len(m4_ifdef([_m4_set_cleanup($1)], [_$0_check], [_$0])([$1], $@))))]) + +m4_define([_m4_set_add_all], +[m4_if([$#], [2], [], + [m4_ifdef([_m4_set([$1],$3)], [], + [m4_define([_m4_set([$1],$3)], [1])m4_pushdef([_m4_set([$1])], + [$3])-])$0([$1], m4_shift2($@))])]) + +m4_define([_m4_set_add_all_check], +[m4_if([$#], [2], [], + [m4_set_add([$1], [$3])$0([$1], m4_shift2($@))])]) + +# m4_set_contains(SET, VALUE, [IF-PRESENT], [IF-ABSENT]) +# ------------------------------------------------------ +# Expand IF-PRESENT if SET contains VALUE, otherwise expand IF-ABSENT. +# This is always O(1). +m4_define([m4_set_contains], +[m4_ifdef([_m4_set_cleanup($1)], + [m4_if(m4_ifdef([_m4_set([$1],$2)], + [m4_indir([_m4_set([$1],$2)])], [0]), [1], [$3], [$4])], + [m4_ifdef([_m4_set([$1],$2)], [$3], [$4])])]) + +# m4_set_contents(SET, [SEP]) +# --------------------------- +# Expand to a single string containing all the elements in SET, +# separated by SEP, without modifying SET. No provision is made for +# disambiguating set elements that contain non-empty SEP as a +# sub-string, or for recognizing a set that contains only the empty +# string. Order of the output is not guaranteed. If any elements +# have been previously removed from the set, this action will prune +# the unused memory. This is O(n) in the size of the set before +# pruning. +# +# Use _m4_popdef for speed. The existence of _m4_set_cleanup($1) +# determines which version of _1 helper we use. +m4_define([m4_set_contents], +[m4_set_map_sep([$1], [], [], [[$2]])]) + +# _m4_set_contents_1(SET) +# _m4_set_contents_1c(SET) +# _m4_set_contents_2(SET, [PRE], [POST], [SEP]) +# --------------------------------------------- +# Expand to a list of quoted elements currently in the set, each +# surrounded by PRE and POST, and moving SEP in front of PRE on +# recursion. To avoid nesting limit restrictions, the algorithm must +# be broken into two parts; _1 destructively copies the stack in +# reverse into _m4_set_($1), producing no output; then _2 +# destructively copies _m4_set_($1) back into the stack in reverse. +# If no elements were deleted, then this visits the set in the order +# that elements were inserted. Behavior is undefined if PRE/POST/SEP +# tries to recursively list or modify SET in any way other than +# calling m4_set_remove on the current element. Use _1 if all entries +# in the stack are guaranteed to be in the set, and _1c to prune +# removed entries. Uses _m4_defn and _m4_popdef for speed. +m4_define([_m4_set_contents_1], +[_m4_stack_reverse([_m4_set([$1])], [_m4_set_($1)])]) + +m4_define([_m4_set_contents_1c], +[m4_ifdef([_m4_set([$1])], + [m4_set_contains([$1], _m4_defn([_m4_set([$1])]), + [m4_pushdef([_m4_set_($1)], _m4_defn([_m4_set([$1])]))], + [_m4_popdef([_m4_set([$1],]_m4_defn( + [_m4_set([$1])])[)])])_m4_popdef([_m4_set([$1])])$0([$1])], + [_m4_popdef([_m4_set_cleanup($1)])])]) + +m4_define([_m4_set_contents_2], +[_m4_stack_reverse([_m4_set_($1)], [_m4_set([$1])], + [$2[]_m4_defn([_m4_set_($1)])$3], [$4[]])]) + +# m4_set_delete(SET) +# ------------------ +# Delete all elements in SET, and reclaim any memory occupied by the +# set. This is O(n) in the set size. +# +# Use _m4_defn and _m4_popdef for speed. +m4_define([m4_set_delete], +[m4_ifdef([_m4_set([$1])], + [_m4_popdef([_m4_set([$1],]_m4_defn([_m4_set([$1])])[)], + [_m4_set([$1])])$0([$1])], + [m4_ifdef([_m4_set_cleanup($1)], + [_m4_popdef([_m4_set_cleanup($1)])])m4_ifdef( + [_m4_set_size($1)], + [_m4_popdef([_m4_set_size($1)])])])]) + +# m4_set_difference(SET1, SET2) +# ----------------------------- +# Produce a LIST of quoted elements that occur in SET1 but not SET2. +# Output a comma prior to any elements, to distinguish the empty +# string from no elements. This can be directly used as a series of +# arguments, such as for m4_join, or wrapped inside quotes for use in +# m4_foreach. Order of the output is not guaranteed. +# +# Short-circuit the idempotence relation. +m4_define([m4_set_difference], +[m4_if([$1], [$2], [], [m4_set_map_sep([$1], [_$0([$2],], [)])])]) + +m4_define([_m4_set_difference], +[m4_set_contains([$1], [$2], [], [,[$2]])]) + +# m4_set_dump(SET, [SEP]) +# ----------------------- +# Expand to a single string containing all the elements in SET, +# separated by SEP, then delete SET. In general, if you only need to +# list the contents once, this is faster than m4_set_contents. No +# provision is made for disambiguating set elements that contain +# non-empty SEP as a sub-string. Order of the output is not +# guaranteed. This is O(n) in the size of the set before pruning. +# +# Use _m4_popdef for speed. Use existence of _m4_set_cleanup($1) to +# decide if more expensive recursion is needed. +m4_define([m4_set_dump], +[m4_ifdef([_m4_set_size($1)], + [_m4_popdef([_m4_set_size($1)])])m4_ifdef([_m4_set_cleanup($1)], + [_$0_check], [_$0])([$1], [], [$2])]) + +# _m4_set_dump(SET, [SEP], [PREP]) +# _m4_set_dump_check(SET, [SEP], [PREP]) +# -------------------------------------- +# Print SEP and the current element, then delete the element and +# recurse with empty SEP changed to PREP. The check variant checks +# whether the element has been previously removed. Use _m4_defn and +# _m4_popdef for speed. +m4_define([_m4_set_dump], +[m4_ifdef([_m4_set([$1])], + [[$2]_m4_defn([_m4_set([$1])])_m4_popdef([_m4_set([$1],]_m4_defn( + [_m4_set([$1])])[)], [_m4_set([$1])])$0([$1], [$2$3])])]) + +m4_define([_m4_set_dump_check], +[m4_ifdef([_m4_set([$1])], + [m4_set_contains([$1], _m4_defn([_m4_set([$1])]), + [[$2]_m4_defn([_m4_set([$1])])])_m4_popdef( + [_m4_set([$1],]_m4_defn([_m4_set([$1])])[)], + [_m4_set([$1])])$0([$1], [$2$3])], + [_m4_popdef([_m4_set_cleanup($1)])])]) + +# m4_set_empty(SET, [IF-EMPTY], [IF-ELEMENTS]) +# -------------------------------------------- +# Expand IF-EMPTY if SET has no elements, otherwise IF-ELEMENTS. +m4_define([m4_set_empty], +[m4_ifdef([_m4_set_size($1)], + [m4_if(m4_indir([_m4_set_size($1)]), [0], [$2], [$3])], [$2])]) + +# m4_set_foreach(SET, VAR, ACTION) +# -------------------------------- +# For each element of SET, define VAR to the element and expand +# ACTION. ACTION should not recursively list SET's contents, add +# elements to SET, nor delete any element from SET except the one +# currently in VAR. The order that the elements are visited in is not +# guaranteed. This is faster than the corresponding m4_foreach([VAR], +# m4_indir([m4_dquote]m4_set_listc([SET])), [ACTION]) +m4_define([m4_set_foreach], +[m4_pushdef([$2])m4_set_map_sep([$1], [m4_define([$2],], [)$3])]) + +# m4_set_intersection(SET1, SET2) +# ------------------------------- +# Produce a LIST of quoted elements that occur in both SET1 or SET2. +# Output a comma prior to any elements, to distinguish the empty +# string from no elements. This can be directly used as a series of +# arguments, such as for m4_join, or wrapped inside quotes for use in +# m4_foreach. Order of the output is not guaranteed. +# +# Iterate over the smaller set, and short-circuit the idempotence +# relation. +m4_define([m4_set_intersection], +[m4_if([$1], [$2], [m4_set_listc([$1])], + m4_eval(m4_set_size([$2]) < m4_set_size([$1])), [1], [$0([$2], [$1])], + [m4_set_map_sep([$1], [_$0([$2],], [)])])]) + +m4_define([_m4_set_intersection], +[m4_set_contains([$1], [$2], [,[$2]])]) + +# m4_set_list(SET) +# m4_set_listc(SET) +# ----------------- +# Produce a LIST of quoted elements of SET. This can be directly used +# as a series of arguments, such as for m4_join or m4_set_add_all, or +# wrapped inside quotes for use in m4_foreach or m4_map. With +# m4_set_list, there is no way to distinguish an empty set from a set +# containing only the empty string; with m4_set_listc, a leading comma +# is output if there are any elements. +m4_define([m4_set_list], +[m4_set_map_sep([$1], [], [], [,])]) + +m4_define([m4_set_listc], +[m4_set_map_sep([$1], [,])]) + +# m4_set_map(SET, ACTION) +# ----------------------- +# For each element of SET, expand ACTION with a single argument of the +# current element. ACTION should not recursively list SET's contents, +# add elements to SET, nor delete any element from SET except the one +# passed as an argument. The order that the elements are visited in +# is not guaranteed. This is faster than either of the corresponding +# m4_map_args([ACTION]m4_set_listc([SET])) +# m4_set_foreach([SET], [VAR], [ACTION(m4_defn([VAR]))]) +m4_define([m4_set_map], +[m4_set_map_sep([$1], [$2(], [)])]) + +# m4_set_map_sep(SET, [PRE], [POST], [SEP]) +# ----------------------------------------- +# For each element of SET, expand PRE[value]POST[], and expand SEP +# between elements. +m4_define([m4_set_map_sep], +[m4_ifdef([_m4_set_cleanup($1)], [_m4_set_contents_1c], + [_m4_set_contents_1])([$1])_m4_set_contents_2($@)]) + +# m4_set_remove(SET, VALUE, [IF-PRESENT], [IF-ABSENT]) +# ---------------------------------------------------- +# If VALUE is an element of SET, delete it and expand IF-PRESENT. +# Otherwise expand IF-ABSENT. Deleting a single value is O(1), +# although it leaves memory occupied until the next O(n) traversal of +# the set which will compact the set. +# +# Optimize if the element being removed is the most recently added, +# since defining _m4_set_cleanup($1) slows down so many other macros. +# In particular, this plays well with m4_set_foreach and m4_set_map. +m4_define([m4_set_remove], +[m4_set_contains([$1], [$2], [_m4_set_size([$1], + [m4_decr])m4_if(_m4_defn([_m4_set([$1])]), [$2], + [_m4_popdef([_m4_set([$1],$2)], [_m4_set([$1])])], + [m4_define([_m4_set_cleanup($1)])m4_define( + [_m4_set([$1],$2)], [0])])$3], [$4])]) + +# m4_set_size(SET) +# ---------------- +# Expand to the number of elements currently in SET. This operation +# is O(1), and thus more efficient than m4_count(m4_set_list([SET])). +m4_define([m4_set_size], +[m4_ifdef([_m4_set_size($1)], [m4_indir([_m4_set_size($1)])], [0])]) + +# _m4_set_size(SET, ACTION) +# ------------------------- +# ACTION must be either m4_incr or m4_decr, and the size of SET is +# changed accordingly. If the set is empty, ACTION must not be +# m4_decr. +m4_define([_m4_set_size], +[m4_define([_m4_set_size($1)], + m4_ifdef([_m4_set_size($1)], [$2(m4_indir([_m4_set_size($1)]))], + [1]))]) + +# m4_set_union(SET1, SET2) +# ------------------------ +# Produce a LIST of double quoted elements that occur in either SET1 +# or SET2, without duplicates. Output a comma prior to any elements, +# to distinguish the empty string from no elements. This can be +# directly used as a series of arguments, such as for m4_join, or +# wrapped inside quotes for use in m4_foreach. Order of the output is +# not guaranteed. +# +# We can rely on the fact that m4_set_listc prunes SET1, so we don't +# need to check _m4_set([$1],element) for 0. Short-circuit the +# idempotence relation. +m4_define([m4_set_union], +[m4_set_listc([$1])m4_if([$1], [$2], [], + [m4_set_map_sep([$2], [_$0([$1],], [)])])]) + +m4_define([_m4_set_union], +[m4_ifdef([_m4_set([$1],$2)], [], [,[$2]])]) + + +## ------------------- ## +## 16. File handling. ## +## ------------------- ## + + +# It is a real pity that M4 comes with no macros to bind a diversion +# to a file. So we have to deal without, which makes us a lot more +# fragile than we should. + + +# m4_file_append(FILE-NAME, CONTENT) +# ---------------------------------- +m4_define([m4_file_append], +[m4_syscmd([cat >>$1 <<_m4eof +$2 +_m4eof +]) +m4_if(m4_sysval, [0], [], + [m4_fatal([$0: cannot write: $1])])]) + + + +## ------------------------ ## +## 17. Setting M4sugar up. ## +## ------------------------ ## + +# _m4_divert_diversion should be defined. +m4_divert_push([KILL]) + +# m4_init +# ------- +# Initialize the m4sugar language. +m4_define([m4_init], +[# All the M4sugar macros start with `m4_', except `dnl' kept as is +# for sake of simplicity. +m4_pattern_forbid([^_?m4_]) +m4_pattern_forbid([^dnl$]) + +# If __m4_version__ is defined, we assume that we are being run by M4 +# 1.6 or newer, thus $@ recursion is linear, and debugmode(+do) +# is available for faster checks of dereferencing undefined macros +# and forcing dumpdef to print to stderr regardless of debugfile. +# But if it is missing, we assume we are being run by M4 1.4.x, that +# $@ recursion is quadratic, and that we need foreach-based +# replacement macros. Also, m4 prior to 1.4.8 loses track of location +# during m4wrap text; __line__ should never be 0. +# +# Use the raw builtin to avoid tripping up include tracing. +# Meanwhile, avoid m4_copy, since it temporarily undefines m4_defn. +m4_ifdef([__m4_version__], +[m4_debugmode([+do]) +m4_define([m4_defn], _m4_defn([_m4_defn])) +m4_define([m4_dumpdef], _m4_defn([_m4_dumpdef])) +m4_define([m4_popdef], _m4_defn([_m4_popdef])) +m4_define([m4_undefine], _m4_defn([_m4_undefine]))], +[m4_builtin([include], [m4sugar/foreach.m4]) +m4_wrap_lifo([m4_if(__line__, [0], [m4_pushdef([m4_location], +]]m4_dquote(m4_dquote(m4_dquote(__file__:__line__)))[[)])])]) + +# Rewrite the first entry of the diversion stack. +m4_divert([KILL]) + +# Check the divert push/pop perfect balance. +# Some users are prone to also use m4_wrap to register last-minute +# m4_divert_text; so after our diversion cleanups, we restore +# KILL as the bottom of the diversion stack. +m4_wrap([m4_popdef([_m4_divert_diversion])m4_ifdef( + [_m4_divert_diversion], [m4_fatal([$0: unbalanced m4_divert_push: +]m4_divert_stack)])_m4_popdef([_m4_divert_stack])m4_divert_push([KILL])]) +]) diff --git a/data/stack.hh b/data/stack.hh new file mode 100644 index 0000000..a56e6c7 --- /dev/null +++ b/data/stack.hh @@ -0,0 +1,153 @@ +# C++ skeleton for Bison + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +m4_pushdef([b4_copyright_years], + [2002-2015]) + +# b4_stack_define +# --------------- +m4_define([b4_stack_define], +[[ template <class T, class S = std::vector<T> > + class stack + { + public: + // Hide our reversed order. + typedef typename S::reverse_iterator iterator; + typedef typename S::const_reverse_iterator const_iterator; + + stack () + : seq_ () + { + seq_.reserve (200); + } + + stack (unsigned int n) + : seq_ (n) + {} + + inline + T& + operator[] (unsigned int i) + { + return seq_[seq_.size () - 1 - i]; + } + + inline + const T& + operator[] (unsigned int i) const + { + return seq_[seq_.size () - 1 - i]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + inline + void + push (T& t) + { + seq_.push_back (T()); + operator[](0).move (t); + } + + inline + void + pop (unsigned int n = 1) + { + for (; n; --n) + seq_.pop_back (); + } + + void + clear () + { + seq_.clear (); + } + + inline + typename S::size_type + size () const + { + return seq_.size (); + } + + inline + const_iterator + begin () const + { + return seq_.rbegin (); + } + + inline + const_iterator + end () const + { + return seq_.rend (); + } + + private: + stack (const stack&); + stack& operator= (const stack&); + /// The wrapped container. + S seq_; + }; + + /// Present a slice of the top of a stack. + template <class T, class S = stack<T> > + class slice + { + public: + slice (const S& stack, unsigned int range) + : stack_ (stack) + , range_ (range) + {} + + inline + const T& + operator [] (unsigned int i) const + { + return stack_[range_ - i]; + } + + private: + const S& stack_; + unsigned int range_; + }; +]]) + +b4_defines_if( +[b4_output_begin([b4_dir_prefix[]stack.hh]) +b4_copyright([Stack handling for Bison parsers in C++])[ + +/** + ** \file ]b4_dir_prefix[stack.hh + ** Define the ]b4_namespace_ref[::stack class. + */ + +]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[ + +# include <vector> + +]b4_namespace_open[ +]b4_stack_define[ +]b4_namespace_close[ + +]b4_cpp_guard_close([b4_dir_prefix[]stack.hh]) +b4_output_end() +]) + +m4_popdef([b4_copyright_years]) diff --git a/data/variant.hh b/data/variant.hh new file mode 100644 index 0000000..f918e34 --- /dev/null +++ b/data/variant.hh @@ -0,0 +1,360 @@ +# C++ skeleton for Bison + +# Copyright (C) 2002-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +## --------- ## +## variant. ## +## --------- ## + +# b4_symbol_variant(YYTYPE, YYVAL, ACTION, [ARGS]) +# ------------------------------------------------ +# Run some ACTION ("build", or "destroy") on YYVAL of symbol type +# YYTYPE. +m4_define([b4_symbol_variant], +[m4_pushdef([b4_dollar_dollar], + [$2.$3< $][3 > (m4_shift3($@))])dnl + switch ($1) + { +b4_type_foreach([b4_type_action_])[]dnl + default: + break; + } +m4_popdef([b4_dollar_dollar])dnl +]) + + +# _b4_char_sizeof_counter +# ----------------------- +# A counter used by _b4_char_sizeof_dummy to create fresh symbols. +m4_define([_b4_char_sizeof_counter], +[0]) + +# _b4_char_sizeof_dummy +# --------------------- +# At each call return a new C++ identifier. +m4_define([_b4_char_sizeof_dummy], +[m4_define([_b4_char_sizeof_counter], m4_incr(_b4_char_sizeof_counter))dnl +dummy[]_b4_char_sizeof_counter]) + + +# b4_char_sizeof(SYMBOL-NUMS) +# --------------------------- +# To be mapped on the list of type names to produce: +# +# char dummy1[sizeof(type_name_1)]; +# char dummy2[sizeof(type_name_2)]; +# +# for defined type names. +m4_define([b4_char_sizeof], +[b4_symbol_if([$1], [has_type], +[ +m4_map([ b4_symbol_tag_comment], [$@])dnl + char _b4_char_sizeof_dummy@{sizeof(b4_symbol([$1], [type]))@}; +])]) + + +# b4_variant_includes +# ------------------- +# The needed includes for variants support. +m4_define([b4_variant_includes], +[b4_parse_assert_if([[#include <typeinfo>]])[ +#ifndef YYASSERT +# include <cassert> +# define YYASSERT assert +#endif +]]) + +# b4_variant_define +# ----------------- +# Define "variant". +m4_define([b4_variant_define], +[[ /// A char[S] buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current state. + template <size_t S> + struct variant + { + /// Type of *this. + typedef variant<S> self_type; + + /// Empty construction. + variant ()]b4_parse_assert_if([ + : yytypeid_ (YY_NULLPTR)])[ + {} + + /// Construct and fill. + template <typename T> + variant (const T& t)]b4_parse_assert_if([ + : yytypeid_ (&typeid (T))])[ + { + YYASSERT (sizeof (T) <= S); + new (yyas_<T> ()) T (t); + } + + /// Destruction, allowed only if empty. + ~variant () + {]b4_parse_assert_if([ + YYASSERT (!yytypeid_); + ])[} + + /// Instantiate an empty \a T in here. + template <typename T> + T& + build () + {]b4_parse_assert_if([ + YYASSERT (!yytypeid_); + YYASSERT (sizeof (T) <= S); + yytypeid_ = & typeid (T);])[ + return *new (yyas_<T> ()) T; + } + + /// Instantiate a \a T in here from \a t. + template <typename T> + T& + build (const T& t) + {]b4_parse_assert_if([ + YYASSERT (!yytypeid_); + YYASSERT (sizeof (T) <= S); + yytypeid_ = & typeid (T);])[ + return *new (yyas_<T> ()) T (t); + } + + /// Accessor to a built \a T. + template <typename T> + T& + as () + {]b4_parse_assert_if([ + YYASSERT (*yytypeid_ == typeid (T)); + YYASSERT (sizeof (T) <= S);])[ + return *yyas_<T> (); + } + + /// Const accessor to a built \a T (for %printer). + template <typename T> + const T& + as () const + {]b4_parse_assert_if([ + YYASSERT (*yytypeid_ == typeid (T)); + YYASSERT (sizeof (T) <= S);])[ + return *yyas_<T> (); + } + + /// Swap the content with \a other, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsability. + /// Swapping between built and (possibly) non-built is done with + /// variant::move (). + template <typename T> + void + swap (self_type& other) + {]b4_parse_assert_if([ + YYASSERT (yytypeid_); + YYASSERT (*yytypeid_ == *other.yytypeid_);])[ + std::swap (as<T> (), other.as<T> ()); + } + + /// Move the content of \a other to this. + /// + /// Destroys \a other. + template <typename T> + void + move (self_type& other) + { + build<T> (); + swap<T> (other); + other.destroy<T> (); + } + + /// Copy the content of \a other to this. + template <typename T> + void + copy (const self_type& other) + { + build<T> (other.as<T> ()); + } + + /// Destroy the stored \a T. + template <typename T> + void + destroy () + { + as<T> ().~T ();]b4_parse_assert_if([ + yytypeid_ = YY_NULLPTR;])[ + } + + private: + /// Prohibit blind copies. + self_type& operator=(const self_type&); + variant (const self_type&); + + /// Accessor to raw memory as \a T. + template <typename T> + T* + yyas_ () + { + void *yyp = yybuffer_.yyraw; + return static_cast<T*> (yyp); + } + + /// Const accessor to raw memory as \a T. + template <typename T> + const T* + yyas_ () const + { + const void *yyp = yybuffer_.yyraw; + return static_cast<const T*> (yyp); + } + + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[S]; + } yybuffer_;]b4_parse_assert_if([ + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_;])[ + }; +]]) + + +## -------------------------- ## +## Adjustments for variants. ## +## -------------------------- ## + + +# b4_value_type_declare +# --------------------- +# Declare semantic_type. +m4_define([b4_value_type_declare], +[[ /// An auxiliary type to compute the largest semantic type. + union union_type + {]b4_type_foreach([b4_char_sizeof])[}; + + /// Symbol semantic values. + typedef variant<sizeof(union_type)> semantic_type;][]dnl +]) + + +# How the semantic value is extracted when using variants. + +# b4_symbol_value(VAL, [TYPE]) +# ---------------------------- +m4_define([b4_symbol_value], +[m4_ifval([$2], + [$1.as< $2 > ()], + [$1])]) + +# b4_symbol_value_template(VAL, [TYPE]) +# ------------------------------------- +# Same as b4_symbol_value, but used in a template method. +m4_define([b4_symbol_value_template], +[m4_ifval([$2], + [$1.template as< $2 > ()], + [$1])]) + + + +## ------------- ## +## make_SYMBOL. ## +## ------------- ## + + +# b4_symbol_constructor_declare_(SYMBOL-NUMBER) +# --------------------------------------------- +# Declare the overloaded version of make_symbol for the (common) type of +# these SYMBOL-NUMBERS. Use at class-level. +m4_define([b4_symbol_constructor_declare_], +[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id], +[ static inline + symbol_type + make_[]b4_symbol_([$1], [id]) (dnl +b4_join(b4_symbol_if([$1], [has_type], + [const b4_symbol([$1], [type])& v]), + b4_locations_if([const location_type& l]))); + +])])]) + + +# b4_symbol_constructor_declare +# ----------------------------- +# Declare symbol constructors for all the value types. +# Use at class-level. +m4_define([b4_symbol_constructor_declare], +[ // Symbol constructors declarations. +b4_symbol_foreach([b4_symbol_constructor_declare_])]) + + + +# b4_symbol_constructor_define_(SYMBOL-NUMBER) +# -------------------------------------------- +# Define symbol constructor for this SYMBOL-NUMBER. +m4_define([b4_symbol_constructor_define_], +[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id], +[ b4_parser_class_name::symbol_type + b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl +b4_join(b4_symbol_if([$1], [has_type], + [const b4_symbol([$1], [type])& v]), + b4_locations_if([const location_type& l]))) + { + return symbol_type (b4_join([token::b4_symbol([$1], [id])], + b4_symbol_if([$1], [has_type], [v]), + b4_locations_if([l]))); + } + +])])]) + + +# b4_basic_symbol_constructor_declare +# ----------------------------------- +# Generate a constructor declaration for basic_symbol from given type. +m4_define([b4_basic_symbol_constructor_declare], +[[ + basic_symbol (]b4_join( + [typename Base::kind_type t], + b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]), + b4_locations_if([const location_type& l]))[); +]]) + +# b4_basic_symbol_constructor_define +# ---------------------------------- +# Generate a constructor implementation for basic_symbol from given type. +m4_define([b4_basic_symbol_constructor_define], +[[ + template <typename Base> + ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join( + [typename Base::kind_type t], + b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]), + b4_locations_if([const location_type& l]))[) + : Base (t) + , value (]b4_symbol_if([$1], [has_type], [v])[)]b4_locations_if([ + , location (l)])[ + {} +]]) + +# b4_symbol_constructor_define +# ---------------------------- +# Define the overloaded versions of make_symbol for all the value types. +m4_define([b4_symbol_constructor_define], +[ // Implementation of make_symbol for each symbol type. +b4_symbol_foreach([b4_symbol_constructor_define_])]) diff --git a/data/xslt/bison.xsl b/data/xslt/bison.xsl new file mode 100644 index 0000000..9e60ad9 --- /dev/null +++ b/data/xslt/bison.xsl @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + bison.xsl - common templates for Bison XSLT. + + Copyright (C) 2007-2015 Free Software Foundation, Inc. + + This file is part of Bison, the GNU Compiler Compiler. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + --> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bison="http://www.gnu.org/software/bison/"> + +<xsl:key + name="bison:symbolByName" + match="/bison-xml-report/grammar/nonterminals/nonterminal" + use="@name" +/> +<xsl:key + name="bison:symbolByName" + match="/bison-xml-report/grammar/terminals/terminal" + use="@name" +/> +<xsl:key + name="bison:ruleByNumber" + match="/bison-xml-report/grammar/rules/rule" + use="@number" +/> +<xsl:key + name="bison:ruleByLhs" + match="/bison-xml-report/grammar/rules/rule[ + @usefulness != 'useless-in-grammar']" + use="lhs" +/> +<xsl:key + name="bison:ruleByRhs" + match="/bison-xml-report/grammar/rules/rule[ + @usefulness != 'useless-in-grammar']" + use="rhs/symbol" +/> + +<!-- For the specified state, output: #sr-conflicts,#rr-conflicts --> +<xsl:template match="state" mode="bison:count-conflicts"> + <xsl:variable name="transitions" select="actions/transitions"/> + <xsl:variable name="reductions" select="actions/reductions"/> + <xsl:variable + name="terminals" + select=" + $transitions/transition[@type='shift']/@symbol + | $reductions/reduction/@symbol + " + /> + <xsl:variable name="conflict-data"> + <xsl:for-each select="$terminals"> + <xsl:variable name="name" select="."/> + <xsl:if test="generate-id($terminals[. = $name][1]) = generate-id(.)"> + <xsl:variable + name="shift-count" + select="count($transitions/transition[@symbol=$name])" + /> + <xsl:variable + name="reduce-count" + select="count($reductions/reduction[@symbol=$name])" + /> + <xsl:if test="$shift-count > 0 and $reduce-count > 0"> + <xsl:text>s</xsl:text> + </xsl:if> + <xsl:if test="$reduce-count > 1"> + <xsl:text>r</xsl:text> + </xsl:if> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:value-of select="string-length(translate($conflict-data, 'r', ''))"/> + <xsl:text>,</xsl:text> + <xsl:value-of select="string-length(translate($conflict-data, 's', ''))"/> +</xsl:template> + +<xsl:template name="space"> + <xsl:param name="repeat">0</xsl:param> + <xsl:param name="fill" select="' '"/> + <xsl:if test="number($repeat) >= 1"> + <xsl:call-template name="space"> + <xsl:with-param name="repeat" select="$repeat - 1"/> + <xsl:with-param name="fill" select="$fill"/> + </xsl:call-template> + <xsl:value-of select="$fill"/> + </xsl:if> +</xsl:template> + +</xsl:stylesheet> diff --git a/data/xslt/xml2dot.xsl b/data/xslt/xml2dot.xsl new file mode 100644 index 0000000..aca9045 --- /dev/null +++ b/data/xslt/xml2dot.xsl @@ -0,0 +1,401 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + xml2dot.xsl - transform Bison XML Report into DOT. + + Copyright (C) 2007-2015 Free Software Foundation, Inc. + + This file is part of Bison, the GNU Compiler Compiler. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + Written by Wojciech Polak <polak@gnu.org>. + --> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bison="http://www.gnu.org/software/bison/"> + +<xsl:import href="bison.xsl"/> +<xsl:output method="text" encoding="UTF-8" indent="no"/> + +<xsl:template match="/"> + <xsl:apply-templates select="bison-xml-report"/> +</xsl:template> + +<xsl:template match="bison-xml-report"> + <xsl:text>// Generated by GNU Bison </xsl:text> + <xsl:value-of select="@version"/> + <xsl:text>. </xsl:text> + <xsl:text>// Report bugs to <</xsl:text> + <xsl:value-of select="@bug-report"/> + <xsl:text>>. </xsl:text> + <xsl:text>// Home page: <</xsl:text> + <xsl:value-of select="@url"/> + <xsl:text>>. </xsl:text> + <xsl:apply-templates select="automaton"> + <xsl:with-param name="filename" select="filename"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="automaton"> + <xsl:param name="filename"/> + <xsl:text>digraph "</xsl:text> + <xsl:call-template name="escape"> + <xsl:with-param name="subject" select="$filename"/> + </xsl:call-template> + <xsl:text>" { + node [fontname = courier, shape = box, colorscheme = paired6] + edge [fontname = courier] + +</xsl:text> + <xsl:apply-templates select="state"/> + <xsl:text>} </xsl:text> +</xsl:template> + +<xsl:template match="automaton/state"> + <xsl:call-template name="output-node"> + <xsl:with-param name="number" select="@number"/> + <xsl:with-param name="label"> + <xsl:apply-templates select="itemset/item"/> + </xsl:with-param> + </xsl:call-template> + <xsl:apply-templates select="actions/transitions"/> + <xsl:apply-templates select="actions/reductions"> + <xsl:with-param name="staten"> + <xsl:value-of select="@number"/> + </xsl:with-param> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="actions/reductions"> + <xsl:param name="staten"/> + <xsl:for-each select='reduction'> + <!-- These variables are needed because the current context can't be + refered to directly in XPath expressions. --> + <xsl:variable name="rul"> + <xsl:value-of select="@rule"/> + </xsl:variable> + <xsl:variable name="ena"> + <xsl:value-of select="@enabled"/> + </xsl:variable> + <!-- The foreach's body is protected by this, so that we are actually + going to iterate once per reduction rule, and not per lookahead. --> + <xsl:if test='not(preceding-sibling::*[@rule=$rul and @enabled=$ena])'> + <xsl:variable name="rule"> + <xsl:choose> + <!-- The acceptation state is refered to as 'accept' in the XML, but + just as '0' in the DOT. --> + <xsl:when test="@rule='accept'"> + <xsl:text>0</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@rule"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <!-- The edge's beginning --> + <xsl:call-template name="reduction-edge-start"> + <xsl:with-param name="state" select="$staten"/> + <xsl:with-param name="rule" select="$rule"/> + <xsl:with-param name="enabled" select="@enabled"/> + </xsl:call-template> + + <!-- The edge's tokens --> + <!-- Don't show labels for the default action. In other cases, there will + always be at least one token, so 'label="[]"' will not occur. --> + <xsl:if test='$rule!=0 and not(../reduction[@enabled=$ena and @rule=$rule and @symbol="$default"])'> + <xsl:text>label="[</xsl:text> + <xsl:for-each select='../reduction[@enabled=$ena and @rule=$rule]'> + <xsl:call-template name="escape"> + <xsl:with-param name="subject" select="@symbol"/> + </xsl:call-template> + <xsl:if test="position() != last ()"> + <xsl:text>, </xsl:text> + </xsl:if> + </xsl:for-each> + <xsl:text>]", </xsl:text> + </xsl:if> + + <!-- The edge's end --> + <xsl:text>style=solid] </xsl:text> + + <!-- The diamond representing the reduction --> + <xsl:call-template name="reduction-node"> + <xsl:with-param name="state" select="$staten"/> + <xsl:with-param name="rule" select="$rule"/> + <xsl:with-param name="color"> + <xsl:choose> + <xsl:when test='@enabled="true"'> + <xsl:text>3</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>5</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:for-each> +</xsl:template> + +<xsl:template match="actions/transitions"> + <xsl:apply-templates select="transition"/> +</xsl:template> + +<xsl:template match="item"> + <xsl:param name="prev-rule-number" + select="preceding-sibling::item[1]/@rule-number"/> + <xsl:apply-templates select="key('bison:ruleByNumber', @rule-number)"> + <xsl:with-param name="point" select="@point"/> + <xsl:with-param name="num" select="@rule-number"/> + <xsl:with-param name="prev-lhs" + select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]" + /> + </xsl:apply-templates> + <xsl:apply-templates select="lookaheads"/> +</xsl:template> + +<xsl:template match="rule"> + <xsl:param name="point"/> + <xsl:param name="num"/> + <xsl:param name="prev-lhs"/> + <xsl:text> </xsl:text> + <xsl:choose> + <xsl:when test="$num < 10"> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:when test="$num < 100"> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text></xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$num"/> + <xsl:text> </xsl:text> + <xsl:choose> + <xsl:when test="$prev-lhs = lhs[text()]"> + <xsl:call-template name="lpad"> + <xsl:with-param name="str" select="'|'"/> + <xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="lhs"/> + <xsl:text>:</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="$point = 0"> + <xsl:text> .</xsl:text> + </xsl:if> + + <!-- RHS --> + <xsl:for-each select="rhs/symbol|rhs/empty"> + <xsl:apply-templates select="."/> + <xsl:if test="$point = position()"> + <xsl:text> .</xsl:text> + </xsl:if> + </xsl:for-each> +</xsl:template> + +<xsl:template match="symbol"> + <xsl:text> </xsl:text> + <xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="empty"> + <xsl:text> %empty</xsl:text> +</xsl:template> + +<xsl:template match="lookaheads"> + <xsl:text> [</xsl:text> + <xsl:apply-templates select="symbol"/> + <xsl:text>]</xsl:text> +</xsl:template> + +<xsl:template match="lookaheads/symbol"> + <xsl:value-of select="."/> + <xsl:if test="position() != last()"> + <xsl:text>, </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template name="reduction-edge-start"> + <xsl:param name="state"/> + <xsl:param name="rule"/> + <xsl:param name="enabled"/> + + <xsl:text> </xsl:text> + <xsl:value-of select="$state"/> + <xsl:text> -> "</xsl:text> + <xsl:value-of select="$state"/> + <xsl:text>R</xsl:text> + <xsl:value-of select="$rule"/> + <xsl:if test='$enabled = "false"'> + <xsl:text>d</xsl:text> + </xsl:if> + <xsl:text>" [</xsl:text> +</xsl:template> + +<xsl:template name="reduction-node"> + <xsl:param name="state"/> + <xsl:param name="rule"/> + <xsl:param name="color"/> + + <xsl:text> "</xsl:text> + <xsl:value-of select="$state"/> + <xsl:text>R</xsl:text> + <xsl:value-of select="$rule"/> + <xsl:if test="$color = 5"> + <xsl:text>d</xsl:text> + </xsl:if> + <xsl:text>" [label="</xsl:text> + <xsl:choose> + <xsl:when test="$rule = 0"> + <xsl:text>Acc", fillcolor=1</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>R</xsl:text> + <xsl:value-of select="$rule"/> + <xsl:text>", fillcolor=</xsl:text> + <xsl:value-of select="$color"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>, shape=diamond, style=filled] </xsl:text> +</xsl:template> + +<xsl:template match="transition"> + <xsl:call-template name="output-edge"> + <xsl:with-param name="src" select="../../../@number"/> + <xsl:with-param name="dst" select="@state"/> + <xsl:with-param name="style"> + <xsl:choose> + <xsl:when test="@symbol = 'error'"> + <xsl:text>dotted</xsl:text> + </xsl:when> + <xsl:when test="@type = 'shift'"> + <xsl:text>solid</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>dashed</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + <xsl:with-param name="label"> + <xsl:if test="not(@symbol = 'error')"> + <xsl:value-of select="@symbol"/> + </xsl:if> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template name="output-node"> + <xsl:param name="number"/> + <xsl:param name="label"/> + <xsl:text> </xsl:text> + <xsl:value-of select="$number"/> + <xsl:text> [label="</xsl:text> + <xsl:text>State </xsl:text> + <xsl:value-of select="$number"/> + <xsl:text>\n</xsl:text> + <xsl:call-template name="escape"> + <xsl:with-param name="subject" select="$label"/> + </xsl:call-template> + <xsl:text>\l"] </xsl:text> +</xsl:template> + +<xsl:template name="output-edge"> + <xsl:param name="src"/> + <xsl:param name="dst"/> + <xsl:param name="style"/> + <xsl:param name="label"/> + <xsl:text> </xsl:text> + <xsl:value-of select="$src"/> + <xsl:text> -> </xsl:text> + <xsl:value-of select="$dst"/> + <xsl:text> [style=</xsl:text> + <xsl:value-of select="$style"/> + <xsl:if test="$label and $label != ''"> + <xsl:text> label="</xsl:text> + <xsl:call-template name="escape"> + <xsl:with-param name="subject" select="$label"/> + </xsl:call-template> + <xsl:text>"</xsl:text> + </xsl:if> + <xsl:text>] </xsl:text> +</xsl:template> + +<xsl:template name="escape"> + <xsl:param name="subject"/> <!-- required --> + <xsl:call-template name="string-replace"> + <xsl:with-param name="subject"> + <xsl:call-template name="string-replace"> + <xsl:with-param name="subject"> + <xsl:call-template name="string-replace"> + <xsl:with-param name="subject" select="$subject"/> + <xsl:with-param name="search" select="'\'"/> + <xsl:with-param name="replace" select="'\\'"/> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="search" select="'"'"/> + <xsl:with-param name="replace" select="'\"'"/> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="search" select="' '"/> + <xsl:with-param name="replace" select="'\l'"/> + </xsl:call-template> +</xsl:template> + +<xsl:template name="string-replace"> + <xsl:param name="subject"/> + <xsl:param name="search"/> + <xsl:param name="replace"/> + <xsl:choose> + <xsl:when test="contains($subject, $search)"> + <xsl:variable name="before" select="substring-before($subject, $search)"/> + <xsl:variable name="after" select="substring-after($subject, $search)"/> + <xsl:value-of select="$before"/> + <xsl:value-of select="$replace"/> + <xsl:call-template name="string-replace"> + <xsl:with-param name="subject" select="$after"/> + <xsl:with-param name="search" select="$search"/> + <xsl:with-param name="replace" select="$replace"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$subject"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="lpad"> + <xsl:param name="str" select="''"/> + <xsl:param name="pad" select="0"/> + <xsl:variable name="diff" select="$pad - string-length($str)" /> + <xsl:choose> + <xsl:when test="$diff < 0"> + <xsl:value-of select="$str"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="space"> + <xsl:with-param name="repeat" select="$diff"/> + </xsl:call-template> + <xsl:value-of select="$str"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/data/xslt/xml2text.xsl b/data/xslt/xml2text.xsl new file mode 100644 index 0000000..c3d1529 --- /dev/null +++ b/data/xslt/xml2text.xsl @@ -0,0 +1,564 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + xml2text.xsl - transform Bison XML Report into plain text. + + Copyright (C) 2007-2015 Free Software Foundation, Inc. + + This file is part of Bison, the GNU Compiler Compiler. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + Written by Wojciech Polak <polak@gnu.org>. + --> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bison="http://www.gnu.org/software/bison/"> + +<xsl:import href="bison.xsl"/> +<xsl:output method="text" encoding="UTF-8" indent="no"/> + +<xsl:template match="/"> + <xsl:apply-templates select="bison-xml-report"/> +</xsl:template> + +<xsl:template match="bison-xml-report"> + <xsl:apply-templates select="grammar" mode="reductions"/> + <xsl:apply-templates select="grammar" mode="useless-in-parser"/> + <xsl:apply-templates select="automaton" mode="conflicts"/> + <xsl:apply-templates select="grammar"/> + <xsl:apply-templates select="automaton"/> +</xsl:template> + +<xsl:template match="grammar" mode="reductions"> + <xsl:apply-templates select="nonterminals" mode="useless-in-grammar"/> + <xsl:apply-templates select="terminals" mode="unused-in-grammar"/> + <xsl:apply-templates select="rules" mode="useless-in-grammar"/> +</xsl:template> + +<xsl:template match="nonterminals" mode="useless-in-grammar"> + <xsl:if test="nonterminal[@usefulness='useless-in-grammar']"> + <xsl:text>Nonterminals useless in grammar </xsl:text> + <xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']"> + <xsl:text> </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text> </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="terminals" mode="unused-in-grammar"> + <xsl:if test="terminal[@usefulness='unused-in-grammar']"> + <xsl:text>Terminals unused in grammar </xsl:text> + <xsl:for-each select="terminal[@usefulness='unused-in-grammar']"> + <xsl:sort select="@symbol-number" data-type="number"/> + <xsl:text> </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text> </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="rules" mode="useless-in-grammar"> + <xsl:variable name="set" select="rule[@usefulness='useless-in-grammar']"/> + <xsl:if test="$set"> + <xsl:text>Rules useless in grammar </xsl:text> + <xsl:call-template name="style-rule-set"> + <xsl:with-param name="rule-set" select="$set"/> + </xsl:call-template> + <xsl:text> </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="grammar" mode="useless-in-parser"> + <xsl:variable + name="set" select="rules/rule[@usefulness='useless-in-parser']" + /> + <xsl:if test="$set"> + <xsl:text>Rules useless in parser due to conflicts </xsl:text> + <xsl:call-template name="style-rule-set"> + <xsl:with-param name="rule-set" select="$set"/> + </xsl:call-template> + <xsl:text> </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="grammar"> + <xsl:text>Grammar </xsl:text> + <xsl:call-template name="style-rule-set"> + <xsl:with-param + name="rule-set" select="rules/rule[@usefulness!='useless-in-grammar']" + /> + </xsl:call-template> + <xsl:text> </xsl:text> + <xsl:apply-templates select="terminals"/> + <xsl:apply-templates select="nonterminals"/> +</xsl:template> + +<xsl:template name="style-rule-set"> + <xsl:param name="rule-set"/> + <xsl:for-each select="$rule-set"> + <xsl:apply-templates select="."> + <xsl:with-param name="pad" select="'3'"/> + <xsl:with-param name="prev-lhs"> + <xsl:if test="position()>1"> + <xsl:variable name="position" select="position()"/> + <xsl:value-of select="$rule-set[$position - 1]/lhs"/> + </xsl:if> + </xsl:with-param> + </xsl:apply-templates> + </xsl:for-each> +</xsl:template> + +<xsl:template match="grammar/terminals"> + <xsl:text>Terminals, with rules where they appear </xsl:text> + <xsl:apply-templates select="terminal"/> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="grammar/nonterminals"> + <xsl:text>Nonterminals, with rules where they appear </xsl:text> + <xsl:apply-templates select="nonterminal[@usefulness!='useless-in-grammar']"/> +</xsl:template> + +<xsl:template match="terminal"> + <xsl:value-of select="@name"/> + <xsl:call-template name="line-wrap"> + <xsl:with-param name="first-line-length"> + <xsl:choose> + <xsl:when test="string-length(@name) > 66">0</xsl:when> + <xsl:otherwise> + <xsl:value-of select="66 - string-length(@name)" /> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + <xsl:with-param name="line-length" select="66" /> + <xsl:with-param name="text"> + <xsl:value-of select="concat(' (', @token-number, ')')"/> + <xsl:for-each select="key('bison:ruleByRhs', @name)"> + <xsl:value-of select="concat(' ', @number)"/> + </xsl:for-each> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="nonterminal"> + <xsl:value-of select="@name"/> + <xsl:value-of select="concat(' (', @symbol-number, ')')"/> + <xsl:text> </xsl:text> + <xsl:variable name="output"> + <xsl:call-template name="line-wrap"> + <xsl:with-param name="line-length" select="66" /> + <xsl:with-param name="text"> + <xsl:text> </xsl:text> + <xsl:if test="key('bison:ruleByLhs', @name)"> + <xsl:text>on@left:</xsl:text> + <xsl:for-each select="key('bison:ruleByLhs', @name)"> + <xsl:value-of select="concat(' ', @number)"/> + </xsl:for-each> + </xsl:if> + <xsl:if test="key('bison:ruleByRhs', @name)"> + <xsl:if test="key('bison:ruleByLhs', @name)"> + <xsl:text>, </xsl:text> + </xsl:if> + <xsl:text>on@right:</xsl:text> + <xsl:for-each select="key('bison:ruleByRhs', @name)"> + <xsl:value-of select="concat(' ', @number)"/> + </xsl:for-each> + </xsl:if> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="translate($output, '@', ' ')" /> +</xsl:template> + +<xsl:template match="automaton" mode="conflicts"> + <xsl:variable name="conflict-report"> + <xsl:apply-templates select="state" mode="conflicts"/> + </xsl:variable> + <xsl:if test="string-length($conflict-report) != 0"> + <xsl:value-of select="$conflict-report"/> + <xsl:text> </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="state" mode="conflicts"> + <xsl:variable name="conflict-counts"> + <xsl:apply-templates select="." mode="bison:count-conflicts" /> + </xsl:variable> + <xsl:variable + name="sr-count" select="substring-before($conflict-counts, ',')" + /> + <xsl:variable + name="rr-count" select="substring-after($conflict-counts, ',')" + /> + <xsl:if test="$sr-count > 0 or $rr-count > 0"> + <xsl:value-of select="concat('State ', @number, ' conflicts:')"/> + <xsl:if test="$sr-count > 0"> + <xsl:value-of select="concat(' ', $sr-count, ' shift/reduce')"/> + <xsl:if test="$rr-count > 0"> + <xsl:value-of select="(',')"/> + </xsl:if> + </xsl:if> + <xsl:if test="$rr-count > 0"> + <xsl:value-of select="concat(' ', $rr-count, ' reduce/reduce')"/> + </xsl:if> + <xsl:value-of select="' '"/> + </xsl:if> +</xsl:template> + +<xsl:template match="automaton"> + <xsl:apply-templates select="state"> + <xsl:with-param name="pad" select="'3'"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="automaton/state"> + <xsl:param name="pad"/> + <xsl:text> </xsl:text> + <xsl:text>State </xsl:text> + <xsl:value-of select="@number"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="itemset/item"> + <xsl:with-param name="pad" select="$pad"/> + </xsl:apply-templates> + <xsl:apply-templates select="actions/transitions"> + <xsl:with-param name="type" select="'shift'"/> + </xsl:apply-templates> + <xsl:apply-templates select="actions/errors"/> + <xsl:apply-templates select="actions/reductions"/> + <xsl:apply-templates select="actions/transitions"> + <xsl:with-param name="type" select="'goto'"/> + </xsl:apply-templates> + <xsl:apply-templates select="solved-conflicts"/> +</xsl:template> + +<xsl:template match="actions/transitions"> + <xsl:param name="type"/> + <xsl:if test="transition[@type = $type]"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="transition[@type = $type]"> + <xsl:with-param name="pad"> + <xsl:call-template name="max-width-symbol"> + <xsl:with-param name="node" select="transition[@type = $type]"/> + </xsl:call-template> + </xsl:with-param> + </xsl:apply-templates> + </xsl:if> +</xsl:template> + +<xsl:template match="actions/errors"> + <xsl:if test="error"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="error"> + <xsl:with-param name="pad"> + <xsl:call-template name="max-width-symbol"> + <xsl:with-param name="node" select="error"/> + </xsl:call-template> + </xsl:with-param> + </xsl:apply-templates> + </xsl:if> +</xsl:template> + +<xsl:template match="actions/reductions"> + <xsl:if test="reduction"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="reduction"> + <xsl:with-param name="pad"> + <xsl:call-template name="max-width-symbol"> + <xsl:with-param name="node" select="reduction"/> + </xsl:call-template> + </xsl:with-param> + </xsl:apply-templates> + </xsl:if> +</xsl:template> + +<xsl:template match="item"> + <xsl:param name="pad"/> + <xsl:param name="prev-rule-number" + select="preceding-sibling::item[1]/@rule-number"/> + <xsl:apply-templates + select="key('bison:ruleByNumber', current()/@rule-number)" + > + <xsl:with-param name="itemset" select="'true'"/> + <xsl:with-param name="pad" select="$pad"/> + <xsl:with-param + name="prev-lhs" + select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]" + /> + <xsl:with-param name="point" select="@point"/> + <xsl:with-param name="lookaheads"> + <xsl:apply-templates select="lookaheads"/> + </xsl:with-param> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="rule"> + <xsl:param name="itemset"/> + <xsl:param name="pad"/> + <xsl:param name="prev-lhs"/> + <xsl:param name="point"/> + <xsl:param name="lookaheads"/> + + <xsl:if test="$itemset != 'true' and not($prev-lhs = lhs[text()])"> + <xsl:text> </xsl:text> + </xsl:if> + + <xsl:text> </xsl:text> + <xsl:call-template name="lpad"> + <xsl:with-param name="str" select="string(@number)"/> + <xsl:with-param name="pad" select="number($pad)"/> + </xsl:call-template> + <xsl:text> </xsl:text> + + <!-- LHS --> + <xsl:choose> + <xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]"> + <xsl:call-template name="lpad"> + <xsl:with-param name="str" select="'|'"/> + <xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]"> + <xsl:call-template name="lpad"> + <xsl:with-param name="str" select="'|'"/> + <xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="lhs"/> + <xsl:text>:</xsl:text> + </xsl:otherwise> + </xsl:choose> + + <!-- RHS --> + <xsl:for-each select="rhs/*"> + <xsl:if test="position() = $point + 1"> + <xsl:text> .</xsl:text> + </xsl:if> + <xsl:apply-templates select="."/> + <xsl:if test="position() = last() and position() = $point"> + <xsl:text> .</xsl:text> + </xsl:if> + </xsl:for-each> + <xsl:if test="$lookaheads"> + <xsl:value-of select="$lookaheads"/> + </xsl:if> + + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="symbol"> + <xsl:text> </xsl:text> + <xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="empty"> + <xsl:text> %empty</xsl:text> +</xsl:template> + +<xsl:template match="lookaheads"> + <xsl:text> [</xsl:text> + <xsl:apply-templates select="symbol"/> + <xsl:text>]</xsl:text> +</xsl:template> + +<xsl:template match="lookaheads/symbol"> + <xsl:value-of select="."/> + <xsl:if test="position() != last()"> + <xsl:text>, </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="transition"> + <xsl:param name="pad"/> + <xsl:text> </xsl:text> + <xsl:call-template name="rpad"> + <xsl:with-param name="str" select="string(@symbol)"/> + <xsl:with-param name="pad" select="number($pad) + 2"/> + </xsl:call-template> + <xsl:choose> + <xsl:when test="@type = 'shift'"> + <xsl:text>shift, and go to state </xsl:text> + <xsl:value-of select="@state"/> + </xsl:when> + <xsl:when test="@type = 'goto'"> + <xsl:text>go to state </xsl:text> + <xsl:value-of select="@state"/> + </xsl:when> + </xsl:choose> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="error"> + <xsl:param name="pad"/> + <xsl:text> </xsl:text> + <xsl:call-template name="rpad"> + <xsl:with-param name="str" select="string(@symbol)"/> + <xsl:with-param name="pad" select="number($pad) + 2"/> + </xsl:call-template> + <xsl:text>error</xsl:text> + <xsl:text> (</xsl:text> + <xsl:value-of select="text()"/> + <xsl:text>)</xsl:text> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="reduction"> + <xsl:param name="pad"/> + <xsl:text> </xsl:text> + <xsl:call-template name="rpad"> + <xsl:with-param name="str" select="string(@symbol)"/> + <xsl:with-param name="pad" select="number($pad) + 2"/> + </xsl:call-template> + <xsl:if test="@enabled = 'false'"> + <xsl:text>[</xsl:text> + </xsl:if> + <xsl:choose> + <xsl:when test="@rule = 'accept'"> + <xsl:text>accept</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>reduce using rule </xsl:text> + <xsl:value-of select="@rule"/> + <xsl:text> (</xsl:text> + <xsl:value-of + select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"/> + <xsl:text>)</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="@enabled = 'false'"> + <xsl:text>]</xsl:text> + </xsl:if> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="solved-conflicts"> + <xsl:if test="resolution"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="resolution"/> + </xsl:if> +</xsl:template> + +<xsl:template match="resolution"> + <xsl:text> Conflict between rule </xsl:text> + <xsl:value-of select="@rule"/> + <xsl:text> and token </xsl:text> + <xsl:value-of select="@symbol"/> + <xsl:text> resolved as </xsl:text> + <xsl:if test="@type = 'error'"> + <xsl:text>an </xsl:text> + </xsl:if> + <xsl:value-of select="@type"/> + <xsl:text> (</xsl:text> + <xsl:value-of select="."/> + <xsl:text>). </xsl:text> +</xsl:template> + +<xsl:template name="max-width-symbol"> + <xsl:param name="node"/> + <xsl:variable name="longest"> + <xsl:for-each select="$node"> + <xsl:sort data-type="number" select="string-length(@symbol)" + order="descending"/> + <xsl:if test="position() = 1"> + <xsl:value-of select="string-length(@symbol)"/> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:value-of select="$longest"/> +</xsl:template> + +<xsl:template name="lpad"> + <xsl:param name="str" select="''"/> + <xsl:param name="pad" select="0"/> + <xsl:variable name="diff" select="$pad - string-length($str)" /> + <xsl:choose> + <xsl:when test="$diff < 0"> + <xsl:value-of select="$str"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="space"> + <xsl:with-param name="repeat" select="$diff"/> + </xsl:call-template> + <xsl:value-of select="$str"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="rpad"> + <xsl:param name="str" select="''"/> + <xsl:param name="pad" select="0"/> + <xsl:variable name="diff" select="$pad - string-length($str)"/> + <xsl:choose> + <xsl:when test="$diff < 0"> + <xsl:value-of select="$str"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$str"/> + <xsl:call-template name="space"> + <xsl:with-param name="repeat" select="$diff"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="line-wrap"> + <xsl:param name="line-length"/> <!-- required --> + <xsl:param name="first-line-length" select="$line-length"/> + <xsl:param name="text"/> <!-- required --> + <xsl:choose> + <xsl:when test="normalize-space($text) = ''" /> + <xsl:when test="string-length($text) <= $first-line-length"> + <xsl:value-of select="concat($text, ' ')" /> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="break-pos"> + <xsl:call-template name="ws-search"> + <xsl:with-param name="text" select="$text" /> + <xsl:with-param name="start" select="$first-line-length+1" /> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="substring($text, 1, $break-pos - 1)" /> + <xsl:text> </xsl:text> + <xsl:call-template name="line-wrap"> + <xsl:with-param name="line-length" select="$line-length" /> + <xsl:with-param + name="text" select="concat(' ', substring($text, $break-pos+1))" + /> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="ws-search"> + <xsl:param name="text"/> <!-- required --> + <xsl:param name="start"/> <!-- required --> + <xsl:variable name="search-text" select="substring($text, $start)" /> + <xsl:choose> + <xsl:when test="not(contains($search-text, ' '))"> + <xsl:value-of select="string-length($text)+1" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of + select="$start + string-length(substring-before($search-text, ' '))" + /> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/data/xslt/xml2xhtml.xsl b/data/xslt/xml2xhtml.xsl new file mode 100644 index 0000000..0349891 --- /dev/null +++ b/data/xslt/xml2xhtml.xsl @@ -0,0 +1,740 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + xml2html.xsl - transform Bison XML Report into XHTML. + + Copyright (C) 2007-2015 Free Software Foundation, Inc. + + This file is part of Bison, the GNU Compiler Compiler. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + Written by Wojciech Polak <polak@gnu.org>. + --> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:bison="http://www.gnu.org/software/bison/"> + +<xsl:import href="bison.xsl"/> + +<xsl:output method="xml" encoding="UTF-8" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + indent="yes"/> + +<xsl:template match="/"> + <html> + <head> + <title> + <xsl:value-of select="bison-xml-report/filename"/> + <xsl:text> - GNU Bison XML Automaton Report</xsl:text> + + + + + + + + + + + + +

GNU Bison XML Automaton Report

+

+ input grammar: +

+ + +

Table of Contents

+ + + + + + +
+ + +

+ + Reductions +

+ + + +
+ + +

+ + Nonterminals useless in grammar +

+ + +

+ + + + + + +

+
+ + + +

+ + Terminals unused in grammar +

+ + +

+ + + + + + + +

+
+ + + +

+ + Rules useless in grammar +

+ + + +

+ + + + +

+
+ + + + + +

+ + Rules useless in parser due to conflicts +

+ +

+ + + +

+ + + + + +

+ + Grammar +

+ +

+ + + +

+ + + + + + + + + + + + + + + + + + + + + +

+ + Conflicts +

+ + + + + +

+ + +

+
+ + + + + + + + + +
+ + + + + + conflicts: + + + + + + + + + + + + + + +

+ + Terminals, with rules where they appear +

+ +

+ +

+ +
+ + +

+ + Nonterminals, with rules where they appear +

+ +

+ +

+ + + + + + + + + + + + + + + + + on left: + + + + + + + + + on right: + + + + + + + + + +
+ + + + + + + + +

+ + Automaton +

+ + + +
+ + + + +

+ + + + + + state + +

+ +

+ + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + . + + + + + + + + + + + + + + + + + + + + + + + %empty + + + + [ + + ] + + + + + + , + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + error + ( + + ) + + + + + + + + + + + + [ + + + + accept + + + + + + + + + ( + + ) + + + + ] + + + + + + + + + + + + + Conflict between + + + + + + + and token + + resolved as + + an + + + ( + + ). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + diff --git a/data/yacc.c b/data/yacc.c new file mode 100644 index 0000000..600e77d --- /dev/null +++ b/data/yacc.c @@ -0,0 +1,1915 @@ + -*- C -*- +# Yacc compatible skeleton for Bison + +# Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, +# Inc. + +m4_pushdef([b4_copyright_years], + [1984, 1989-1990, 2000-2015]) + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check the value of %define api.push-pull. +b4_percent_define_default([[api.push-pull]], [[pull]]) +b4_percent_define_check_values([[[[api.push-pull]], + [[pull]], [[push]], [[both]]]]) +b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]]) +b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]]) +m4_case(b4_percent_define_get([[api.push-pull]]), + [pull], [m4_define([b4_push_flag], [[0]])], + [push], [m4_define([b4_pull_flag], [[0]])]) + +# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing +# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the +# behavior of Bison at all when push parsing is already requested. +b4_define_flag_if([use_push_for_pull]) +b4_use_push_for_pull_if([ + b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])], + [m4_define([b4_push_flag], [[1]])])]) + +# Check the value of %define parse.lac and friends, where LAC stands for +# lookahead correction. +b4_percent_define_default([[parse.lac]], [[none]]) +b4_percent_define_default([[parse.lac.es-capacity-initial]], [[20]]) +b4_percent_define_default([[parse.lac.memory-trace]], [[failures]]) +b4_percent_define_check_values([[[[parse.lac]], [[full]], [[none]]]], + [[[[parse.lac.memory-trace]], + [[failures]], [[full]]]]) +b4_define_flag_if([lac]) +m4_define([b4_lac_flag], + [m4_if(b4_percent_define_get([[parse.lac]]), + [none], [[0]], [[1]])]) + +m4_include(b4_pkgdatadir/[c.m4]) + +## ---------------- ## +## Default values. ## +## ---------------- ## + +# Stack parameters. +m4_define_default([b4_stack_depth_max], [10000]) +m4_define_default([b4_stack_depth_init], [200]) + + +## ------------------------ ## +## Pure/impure interfaces. ## +## ------------------------ ## + +b4_percent_define_default([[api.pure]], [[false]]) +b4_percent_define_check_values([[[[api.pure]], + [[false]], [[true]], [[]], [[full]]]]) + +m4_define([b4_pure_flag], [[0]]) +m4_case(b4_percent_define_get([[api.pure]]), + [false], [m4_define([b4_pure_flag], [[0]])], + [true], [m4_define([b4_pure_flag], [[1]])], + [], [m4_define([b4_pure_flag], [[1]])], + [full], [m4_define([b4_pure_flag], [[2]])]) + +m4_define([b4_pure_if], +[m4_case(b4_pure_flag, + [0], [$2], + [1], [$1], + [2], [$1])]) + [m4_fatal([invalid api.pure value: ]$1)])]) + +# b4_yyerror_arg_loc_if(ARG) +# -------------------------- +# Expand ARG iff yyerror is to be given a location as argument. +m4_define([b4_yyerror_arg_loc_if], +[b4_locations_if([m4_case(b4_pure_flag, + [1], [m4_ifset([b4_parse_param], [$1])], + [2], [$1])])]) + +# b4_yyerror_args +# --------------- +# Arguments passed to yyerror: user args plus yylloc. +m4_define([b4_yyerror_args], +[b4_yyerror_arg_loc_if([&yylloc, ])dnl +m4_ifset([b4_parse_param], [b4_args(b4_parse_param), ])]) + + + +## ------------ ## +## Data Types. ## +## ------------ ## + +# b4_int_type(MIN, MAX) +# --------------------- +# Return the smallest int type able to handle numbers ranging from +# MIN to MAX (included). Overwrite the version from c.m4, which +# uses only C89 types, so that the user can override the shorter +# types, and so that pre-C89 compilers are handled correctly. +m4_define([b4_int_type], +[m4_if(b4_ints_in($@, [0], [255]), [1], [yytype_uint8], + b4_ints_in($@, [-128], [127]), [1], [yytype_int8], + + b4_ints_in($@, [0], [65535]), [1], [yytype_uint16], + b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16], + + m4_eval([0 <= $1]), [1], [unsigned int], + + [int])]) + + +## ----------------- ## +## Semantic Values. ## +## ----------------- ## + + +# b4_lhs_value([TYPE]) +# -------------------- +# Expansion of $$. +m4_define([b4_lhs_value], +[b4_symbol_value(yyval, [$1])]) + + +# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) +# -------------------------------------- +# Expansion of $NUM, where the current rule has RULE-LENGTH +# symbols on RHS. +m4_define([b4_rhs_value], + [b4_symbol_value([yyvsp@{b4_subtract([$2], [$1])@}], [$3])]) + + +## ----------- ## +## Locations. ## +## ----------- ## + +# b4_lhs_location() +# ----------------- +# Expansion of @$. +m4_define([b4_lhs_location], +[(yyloc)]) + + +# b4_rhs_location(RULE-LENGTH, NUM) +# --------------------------------- +# Expansion of @NUM, where the current rule has RULE-LENGTH symbols +# on RHS. +m4_define([b4_rhs_location], + [(yylsp@{b4_subtract([$2], [$1])@})]) + + +## -------------- ## +## Declarations. ## +## -------------- ## + +# b4_declare_scanner_communication_variables +# ------------------------------------------ +# Declare the variables that are global, or local to YYPARSE if +# pure-parser. +m4_define([b4_declare_scanner_communication_variables], [[ +/* The lookahead symbol. */ +int yychar; + +]b4_pure_if([[ +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);]b4_locations_if([[ + +/* Location data for the lookahead symbol. */ +static YYLTYPE yyloc_default]b4_yyloc_default[; +YYLTYPE yylloc = yyloc_default;]])], +[[/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval;]b4_locations_if([[ +/* Location data for the lookahead symbol. */ +YYLTYPE yylloc]b4_yyloc_default[;]])[ +/* Number of syntax errors so far. */ +int yynerrs;]])]) + + +# b4_declare_parser_state_variables +# --------------------------------- +# Declare all the variables that are needed to maintain the parser state +# between calls to yypush_parse. +m4_define([b4_declare_parser_state_variables], [b4_pure_if([[ + /* Number of syntax errors so far. */ + int yynerrs; +]])[ + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values.]b4_locations_if([[ + 'yyls': related to locations.]])[ + + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp;]b4_locations_if([[ + + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls; + YYLTYPE *yylsp; + + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[3];]])[ + + YYSIZE_T yystacksize;]b4_lac_if([[ + + yytype_int16 yyesa@{]b4_percent_define_get([[parse.lac.es-capacity-initial]])[@}; + yytype_int16 *yyes; + YYSIZE_T yyes_capacity;]])]) + + +# b4_declare_yyparse_push_ +# ------------------------ +# Declaration of yyparse (and dependencies) when using the push parser +# (including in pull mode). +m4_define([b4_declare_yyparse_push_], +[[#ifndef YYPUSH_MORE_DEFINED +# define YYPUSH_MORE_DEFINED +enum { YYPUSH_MORE = 4 }; +#endif + +typedef struct ]b4_prefix[pstate ]b4_prefix[pstate; + +]b4_pull_if([b4_function_declare([b4_prefix[parse]], [[int]], b4_parse_param) +])b4_function_declare([b4_prefix[push_parse]], [[int]], + [[b4_prefix[pstate *ps]], [[ps]]]b4_pure_if([, + [[[int pushed_char]], [[pushed_char]]], + [[b4_api_PREFIX[STYPE const *pushed_val]], [[pushed_val]]]b4_locations_if([, + [[b4_api_PREFIX[LTYPE *pushed_loc]], [[pushed_loc]]]])])m4_ifset([b4_parse_param], [, + b4_parse_param])) +b4_pull_if([b4_function_declare([b4_prefix[pull_parse]], [[int]], + [[b4_prefix[pstate *ps]], [[ps]]]m4_ifset([b4_parse_param], [, + b4_parse_param]))]) +b4_function_declare([b4_prefix[pstate_new]], [b4_prefix[pstate *]], + [[[void]], []]) +b4_function_declare([b4_prefix[pstate_delete]], [[void]], + [[b4_prefix[pstate *ps]], [[ps]]])dnl +]) + +# b4_declare_yyparse_ +# ------------------- +# When not the push parser. +m4_define([b4_declare_yyparse_], +[b4_function_declare(b4_prefix[parse], [int], b4_parse_param)]) + + +# b4_declare_yyparse +# ------------------ +m4_define([b4_declare_yyparse], +[b4_push_if([b4_declare_yyparse_push_], + [b4_declare_yyparse_])[]dnl +]) + + +# b4_shared_declarations +# ---------------------- +# Declaration that might either go into the header (if --defines) +# or open coded in the parser body. +m4_define([b4_shared_declarations], +[b4_cpp_guard_open([b4_spec_defines_file])[ +]b4_declare_yydebug[ +]b4_percent_code_get([[requires]])[ +]b4_token_enums_defines[ +]b4_declare_yylstype[ +]b4_declare_yyparse[ +]b4_percent_code_get([[provides]])[ +]b4_cpp_guard_close([b4_spec_defines_file])[]dnl +]) + +## -------------- ## +## Output files. ## +## -------------- ## + +b4_output_begin([b4_parser_file_name]) +b4_copyright([Bison implementation for Yacc-like parsers in C])[ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +]b4_identification +b4_percent_code_get([[top]])[]dnl +m4_if(b4_api_prefix, [yy], [], +[[/* Substitute the type names. */ +#define YYSTYPE ]b4_api_PREFIX[STYPE]b4_locations_if([[ +#define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[ +]m4_if(b4_prefix, [yy], [], +[[/* Substitute the variable and function names. */]b4_pull_if([[ +#define yyparse ]b4_prefix[parse]])b4_push_if([[ +#define yypush_parse ]b4_prefix[push_parse]b4_pull_if([[ +#define yypull_parse ]b4_prefix[pull_parse]])[ +#define yypstate_new ]b4_prefix[pstate_new +#define yypstate_delete ]b4_prefix[pstate_delete +#define yypstate ]b4_prefix[pstate]])[ +#define yylex ]b4_prefix[lex +#define yyerror ]b4_prefix[error +#define yydebug ]b4_prefix[debug +#define yynerrs ]b4_prefix[nerrs +]]b4_pure_if([], [[ +#define yylval ]b4_prefix[lval +#define yychar ]b4_prefix[char]b4_locations_if([[ +#define yylloc ]b4_prefix[lloc]])]))[ + +/* Copy the first part of user declarations. */ +]b4_user_pre_prologue[ + +]b4_null_define[ + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE ]b4_error_verbose_if([1], [0])[ +#endif + +]m4_ifval(m4_quote(b4_spec_defines_file), +[[/* In a future release of Bison, this section will be replaced + by #include "@basename(]b4_spec_defines_file[@)". */ +]])dnl +b4_shared_declarations[ + +/* Copy the second part of user declarations. */ +]b4_user_post_prologue +b4_percent_code_get[]dnl + +[#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +]b4_attribute_define[ + +#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[ + +/* The parser invokes alloca or malloc; define the necessary symbols. */]dnl +b4_push_if([], [b4_lac_if([], [[ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif]])])[ + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif]b4_lac_if([[ +# define YYCOPY_NEEDED 1]])[ +#endif]b4_lac_if([], [[ /* ! defined yyoverflow || YYERROR_VERBOSE */]])[ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (]b4_locations_if([[defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL \ + && ]])[defined ]b4_api_PREFIX[STYPE_IS_TRIVIAL && ]b4_api_PREFIX[STYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc;]b4_locations_if([ + YYLTYPE yyls_alloc;])[ +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +]b4_locations_if( +[# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM)], +[# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM)])[ + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL ]b4_final_state_number[ +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST ]b4_last[ + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS ]b4_tokens_number[ +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS ]b4_nterms_number[ +/* YYNRULES -- Number of rules. */ +#define YYNRULES ]b4_rules_number[ +/* YYNSTATES -- Number of states. */ +#define YYNSTATES ]b4_states_number[ + +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ +#define YYUNDEFTOK ]b4_undef_token_number[ +#define YYMAXUTOK ]b4_user_token_number_max[ + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ +static const ]b4_int_type_for([b4_translate])[ yytranslate[] = +{ + ]b4_translate[ +}; + +#if ]b4_api_PREFIX[DEBUG +]b4_integral_parser_table_define([rline], [b4_rline], + [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[ +#endif + +#if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[ +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + ]b4_tname[ +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const ]b4_int_type_for([b4_toknum])[ yytoknum[] = +{ + ]b4_toknum[ +}; +# endif + +#define YYPACT_NINF ]b4_pact_ninf[ + +#define yypact_value_is_default(Yystate) \ + ]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[ + +#define YYTABLE_NINF ]b4_table_ninf[ + +#define yytable_value_is_error(Yytable_value) \ + ]b4_table_value_equals([[table]], [[Yytable_value]], [b4_table_ninf])[ + +]b4_parser_tables_define[ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \]b4_lac_if([[ + YY_LAC_DISCARD ("YYBACKUP"); \]])[ + goto yybackup; \ + } \ + else \ + { \ + yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + +]b4_locations_if([[ +]b4_yylloc_default_define[ +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +]])[ + +/* Enable debugging if requested. */ +#if ]b4_api_PREFIX[DEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +]b4_yy_location_print_define[ + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value]b4_locations_if([, Location])[]b4_user_args[); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + +]b4_yy_symbol_print_define[ + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +]b4_function_define([yy_stack_print], [static void], + [[yytype_int16 *yybottom], [yybottom]], + [[yytype_int16 *yytop], [yytop]])[ +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +]b4_function_define([yy_reduce_print], [static void], + [[yytype_int16 *yyssp], [yyssp]], + [[YYSTYPE *yyvsp], [yyvsp]], + b4_locations_if([[[YYLTYPE *yylsp], [yylsp]], + ])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [, + b4_parse_param]))[ +{ + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &]b4_rhs_value(yynrhs, yyi + 1)[ + ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl + b4_user_args[); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, ]b4_locations_if([yylsp, ])[Rule]b4_user_args[); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !]b4_api_PREFIX[DEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !]b4_api_PREFIX[DEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH ]b4_stack_depth_init[ +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH ]b4_stack_depth_max[ +#endif]b4_lac_if([[ + +/* Given a state stack such that *YYBOTTOM is its bottom, such that + *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty + stack, and such that *YYCAPACITY is the maximum number of elements it + can hold without a reallocation, make sure there is enough room to + store YYADD more elements. If not, allocate a new stack using + YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM, + *YYTOP, and *YYCAPACITY to reflect the new capacity and memory + location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack + using YYSTACK_FREE. Return 0 if successful or if no reallocation is + required. Return 1 if memory is exhausted. */ +static int +yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd, +#if ]b4_api_PREFIX[DEBUG + char const *yydebug_prefix, + char const *yydebug_suffix, +#endif + yytype_int16 **yybottom, + yytype_int16 *yybottom_no_free, + yytype_int16 **yytop, yytype_int16 *yytop_empty) +{ + YYSIZE_T yysize_old = + *yytop == yytop_empty ? 0 : *yytop - *yybottom + 1; + YYSIZE_T yysize_new = yysize_old + yyadd; + if (*yycapacity < yysize_new) + { + YYSIZE_T yyalloc = 2 * yysize_new; + yytype_int16 *yybottom_new; + /* Use YYMAXDEPTH for maximum stack size given that the stack + should never need to grow larger than the main state stack + needs to grow without LAC. */ + if (YYMAXDEPTH < yysize_new) + { + YYDPRINTF ((stderr, "%smax size exceeded%s", yydebug_prefix, + yydebug_suffix)); + return 1; + } + if (YYMAXDEPTH < yyalloc) + yyalloc = YYMAXDEPTH; + yybottom_new = + (yytype_int16*) YYSTACK_ALLOC (yyalloc * sizeof *yybottom_new); + if (!yybottom_new) + { + YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix, + yydebug_suffix)); + return 1; + } + if (*yytop != yytop_empty) + { + YYCOPY (yybottom_new, *yybottom, yysize_old); + *yytop = yybottom_new + (yysize_old - 1); + } + if (*yybottom != yybottom_no_free) + YYSTACK_FREE (*yybottom); + *yybottom = yybottom_new; + *yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]), + [full], [[ + YYDPRINTF ((stderr, "%srealloc to %lu%s", yydebug_prefix, + (unsigned long int) yyalloc, yydebug_suffix));]])[ + } + return 0; +} + +/* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + YY_LAC_ESTABLISH should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). Iff there is a + lookahead token, it should also be invoked before reporting a syntax + error. This latter case is for the sake of the debugging output. + + For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. + Report a syntax error if it cannot. */ +#define YY_LAC_ESTABLISH \ +do { \ + if (!yy_lac_established) \ + { \ + YYDPRINTF ((stderr, \ + "LAC: initial context established for %s\n", \ + yytname[yytoken])); \ + yy_lac_established = 1; \ + { \ + int yy_lac_status = \ + yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \ + if (yy_lac_status == 2) \ + goto yyexhaustedlab; \ + if (yy_lac_status == 1) \ + goto yyerrlab; \ + } \ + } \ +} while (0) + +/* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ +#if ]b4_api_PREFIX[DEBUG +# define YY_LAC_DISCARD(Event) \ +do { \ + if (yy_lac_established) \ + { \ + if (yydebug) \ + YYFPRINTF (stderr, "LAC: initial context discarded due to " \ + Event "\n"); \ + yy_lac_established = 0; \ + } \ +} while (0) +#else +# define YY_LAC_DISCARD(Event) yy_lac_established = 0 +#endif + +/* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can + eventually (after perhaps some reductions) be shifted, return 1 if + not, or return 2 if memory is exhausted. As preconditions and + postconditions: *YYES_CAPACITY is the allocated size of the array to + which *YYES points, and either *YYES = YYESA or *YYES points to an + array allocated with YYSTACK_ALLOC. yy_lac may overwrite the + contents of either array, alter *YYES and *YYES_CAPACITY, and free + any old *YYES other than YYESA. */ +static int +yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes, + YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) +{ + yytype_int16 *yyes_prev = yyssp; + yytype_int16 *yyesp = yyes_prev; + YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken])); + if (yytoken == YYUNDEFTOK) + { + YYDPRINTF ((stderr, " Always Err\n")); + return 1; + } + while (1) + { + int yyrule = yypact[*yyesp]; + if (yypact_value_is_default (yyrule) + || (yyrule += yytoken) < 0 || YYLAST < yyrule + || yycheck[yyrule] != yytoken) + { + yyrule = yydefact[*yyesp]; + if (yyrule == 0) + { + YYDPRINTF ((stderr, " Err\n")); + return 1; + } + } + else + { + yyrule = yytable[yyrule]; + if (yytable_value_is_error (yyrule)) + { + YYDPRINTF ((stderr, " Err\n")); + return 1; + } + if (0 < yyrule) + { + YYDPRINTF ((stderr, " S%d\n", yyrule)); + return 0; + } + yyrule = -yyrule; + } + { + YYSIZE_T yylen = yyr2[yyrule]; + YYDPRINTF ((stderr, " R%d", yyrule - 1)); + if (yyesp != yyes_prev) + { + YYSIZE_T yysize = yyesp - *yyes + 1; + if (yylen < yysize) + { + yyesp -= yylen; + yylen = 0; + } + else + { + yylen -= yysize; + yyesp = yyes_prev; + } + } + if (yylen) + yyesp = yyes_prev -= yylen; + } + { + int yystate; + { + int yylhs = yyr1[yyrule] - YYNTOKENS; + yystate = yypgoto[yylhs] + *yyesp; + if (yystate < 0 || YYLAST < yystate + || yycheck[yystate] != *yyesp) + yystate = yydefgoto[yylhs]; + else + yystate = yytable[yystate]; + } + if (yyesp == yyes_prev) + { + yyesp = *yyes; + *yyesp = yystate; + } + else + { + if (yy_lac_stack_realloc (yyes_capacity, 1, +#if ]b4_api_PREFIX[DEBUG + " (", ")", +#endif + yyes, yyesa, &yyesp, yyes_prev)) + { + YYDPRINTF ((stderr, "\n")); + return 2; + } + *++yyesp = yystate; + } + YYDPRINTF ((stderr, " G%d", yystate)); + } + } +}]])[ + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +]b4_function_define([yystrlen], [static YYSIZE_T], + [[const char *yystr], [yystr]])[ +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +]b4_function_define([yystpcpy], [static char *], + [[char *yydest], [yydest]], [[const char *yysrc], [yysrc]])[ +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP.]b4_lac_if([[ In order to see if a particular token T is a + valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).]])[ + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store]b4_lac_if([[ or if + yy_lac returned 2]])[. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + ]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes, + YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar.]b4_lac_if([[ + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when yy_lac + was invoked. However, at that time, there might have been a + different syntax error that discarded a different initial context + during error recovery, leaving behind the current lookahead.]], [[ + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state.]])[ + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp];]b4_lac_if([[ + YYDPRINTF ((stderr, "Constructing syntax error message\n"));]])[ + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + {]b4_lac_if([], [[ + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;]])[ + int yyx;]b4_lac_if([[ + + for (yyx = 0; yyx < YYNTOKENS; ++yyx) + if (yyx != YYTERROR && yyx != YYUNDEFTOK) + { + { + int yy_lac_status = yy_lac (yyesa, yyes, yyes_capacity, + yyssp, yyx); + if (yy_lac_status == 2) + return 2; + if (yy_lac_status == 1) + continue; + }]], [[ + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + {]])[ + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + }]b4_lac_if([[ +# if ]b4_api_PREFIX[DEBUG + else if (yydebug) + YYFPRINTF (stderr, "No expected tokens.\n"); +# endif]])[ + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +]b4_yydestruct_define[ + +]b4_pure_if([], [ + +b4_declare_scanner_communication_variables])[]b4_push_if([[ + +struct yypstate + {]b4_declare_parser_state_variables[ + /* Used to determine if this is the first time this instance has + been used. */ + int yynew; + };]b4_pure_if([], [[ + +static char yypstate_allocated = 0;]])b4_pull_if([ + +b4_function_define([[yyparse]], [[int]], b4_parse_param)[ +{ + return yypull_parse (YY_NULLPTR]m4_ifset([b4_parse_param], + [[, ]b4_args(b4_parse_param)])[); +} + +]b4_function_define([[yypull_parse]], [[int]], + [[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [, + b4_parse_param]))[ +{ + int yystatus; + yypstate *yyps_local;]b4_pure_if([[ + int yychar; + YYSTYPE yylval;]b4_locations_if([[ + static YYLTYPE yyloc_default][]b4_yyloc_default[; + YYLTYPE yylloc = yyloc_default;]])])[ + if (yyps) + yyps_local = yyps; + else + { + yyps_local = yypstate_new (); + if (!yyps_local) + {]b4_pure_if([[ + yyerror (]b4_yyerror_args[YY_("memory exhausted"));]], [[ + if (!yypstate_allocated) + yyerror (]b4_yyerror_args[YY_("memory exhausted"));]])[ + return 2; + } + } + do { + yychar = ]b4_lex[; + yystatus = + yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[); + } while (yystatus == YYPUSH_MORE); + if (!yyps) + yypstate_delete (yyps_local); + return yystatus; +}]])[ + +/* Initialize the parser data structure. */ +]b4_function_define([[yypstate_new]], [[yypstate *]])[ +{ + yypstate *yyps;]b4_pure_if([], [[ + if (yypstate_allocated) + return YY_NULLPTR;]])[ + yyps = (yypstate *) malloc (sizeof *yyps); + if (!yyps) + return YY_NULLPTR; + yyps->yynew = 1;]b4_pure_if([], [[ + yypstate_allocated = 1;]])[ + return yyps; +} + +]b4_function_define([[yypstate_delete]], [[void]], + [[[yypstate *yyps]], [[yyps]]])[ +{ +#ifndef yyoverflow + /* If the stack was reallocated but the parse did not complete, then the + stack still needs to be freed. */ + if (!yyps->yynew && yyps->yyss != yyps->yyssa) + YYSTACK_FREE (yyps->yyss); +#endif]b4_lac_if([[ + if (!yyps->yynew && yyps->yyes != yyps->yyesa) + YYSTACK_FREE (yyps->yyes);]])[ + free (yyps);]b4_pure_if([], [[ + yypstate_allocated = 0;]])[ +} +]b4_pure_if([[ +#define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs]])[ +#define yystate yyps->yystate +#define yyerrstatus yyps->yyerrstatus +#define yyssa yyps->yyssa +#define yyss yyps->yyss +#define yyssp yyps->yyssp +#define yyvsa yyps->yyvsa +#define yyvs yyps->yyvs +#define yyvsp yyps->yyvsp]b4_locations_if([[ +#define yylsa yyps->yylsa +#define yyls yyps->yyls +#define yylsp yyps->yylsp +#define yyerror_range yyps->yyerror_range]])[ +#define yystacksize yyps->yystacksize]b4_lac_if([[ +#define yyesa yyps->yyesa +#define yyes yyps->yyes +#define yyes_capacity yyps->yyes_capacity]])[ + + +/*---------------. +| yypush_parse. | +`---------------*/ + +]b4_function_define([[yypush_parse]], [[int]], + [[[yypstate *yyps]], [[yyps]]]b4_pure_if([, + [[[int yypushed_char]], [[yypushed_char]]], + [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([, + [[[YYLTYPE *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [, + b4_parse_param]))], [[ + + +/*----------. +| yyparse. | +`----------*/ + +]b4_function_define([yyparse], [int], b4_parse_param)])[ +{]b4_pure_if([b4_declare_scanner_communication_variables +])b4_push_if([b4_pure_if([], [[ + int yypushed_char = yychar; + YYSTYPE yypushed_val = yylval;]b4_locations_if([[ + YYLTYPE yypushed_loc = yylloc;]]) +])], + [b4_declare_parser_state_variables +])b4_lac_if([[ + int yy_lac_established = 0;]])[ + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval;]b4_locations_if([[ + YYLTYPE yyloc;]])[ + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_locations_if([, yylsp -= (N)])[) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0;]b4_push_if([[ + + if (!yyps->yynew) + { + yyn = yypact[yystate]; + goto yyread_pushed_token; + }]])[ + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa;]b4_locations_if([[ + yylsp = yyls = yylsa;]])[ + yystacksize = YYINITDEPTH;]b4_lac_if([[ + + yyes = yyesa; + yyes_capacity = sizeof yyesa / sizeof *yyes; + if (YYMAXDEPTH < yyes_capacity) + yyes_capacity = YYMAXDEPTH;]])[ + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ +]m4_ifdef([b4_initial_action], [ +b4_dollar_pushdef([m4_define([b4_dollar_dollar_used])yylval], [], + [b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])])dnl +/* User initialization code. */ +b4_user_initial_action +b4_dollar_popdef[]dnl +m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval; +]])])dnl +b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])[; +]])dnl +[ goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss;]b4_locations_if([ + YYLTYPE *yyls1 = yyls;])[ + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([ + &yyls1, yysize * sizeof (*yylsp),])[ + &yystacksize); +]b4_locations_if([ + yyls = yyls1;])[ + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([ + YYSTACK_RELOCATE (yyls_alloc, yyls);])[ +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1;]b4_locations_if([ + yylsp = yyls + yysize - 1;])[ + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + {]b4_push_if([[ + if (!yyps->yynew) + {]b4_use_push_for_pull_if([], [[ + YYDPRINTF ((stderr, "Return for a new token:\n"));]])[ + yyresult = YYPUSH_MORE; + goto yypushreturn; + } + yyps->yynew = 0;]b4_pure_if([], [[ + /* Restoring the pushed token is only necessary for the first + yypush_parse invocation since subsequent invocations don't overwrite + it before jumping to yyread_pushed_token. */ + yychar = yypushed_char; + yylval = yypushed_val;]b4_locations_if([[ + yylloc = yypushed_loc;]])])[ +yyread_pushed_token:]])[ + YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[ + yychar = yypushed_char; + if (yypushed_val) + yylval = *yypushed_val;]b4_locations_if([[ + if (yypushed_loc) + yylloc = *yypushed_loc;]])])], [[ + yychar = ]b4_lex[;]])[ + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)]b4_lac_if([[ + { + YY_LAC_ESTABLISH; + goto yydefault; + }]], [[ + goto yydefault;]])[ + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab;]b4_lac_if([[ + YY_LAC_ESTABLISH;]])[ + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY;]b4_lac_if([[ + YY_LAC_DISCARD ("shift");]])[ + + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END +]b4_locations_if([ *++yylsp = yylloc;])[ + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + +]b4_locations_if( +[[ /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);]])[ + YY_REDUCE_PRINT (yyn);]b4_lac_if([[ + { + int yychar_backup = yychar; + switch (yyn) + { + ]b4_user_actions[ + default: break; + } + if (yychar_backup != yychar) + YY_LAC_DISCARD ("yychar change"); + }]], [[ + switch (yyn) + { + ]b4_user_actions[ + default: break; + }]])[ + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval;]b4_locations_if([ + *++yylsp = yyloc;])[ + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (]b4_yyerror_args[YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \]b4_lac_if([[ + yyesa, &yyes, &yyes_capacity, \]])[ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status;]b4_lac_if([[ + if (yychar != YYEMPTY) + YY_LAC_ESTABLISH;]])[ + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (]b4_yyerror_args[yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif + } + +]b4_locations_if([[ yyerror_range[1] = yylloc;]])[ + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + +]b4_locations_if([[ yyerror_range[1] = yylsp[1-yylen]; +]])[ /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + +]b4_locations_if([[ yyerror_range[1] = *yylsp;]])[ + yydestruct ("Error: popping", + yystos[yystate], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + }]b4_lac_if([[ + + /* If the stack popping above didn't lose the initial context for the + current lookahead token, the shift below will for sure. */ + YY_LAC_DISCARD ("error recovery");]])[ + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END +]b4_locations_if([[ + yyerror_range[2] = yylloc; + /* Using YYLLOC is tempting, but would change the location of + the lookahead. YYLOC is available though. */ + YYLLOC_DEFAULT (yyloc, yyerror_range, 2); + *++yylsp = yyloc;]])[ + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if ]b4_lac_if([[1]], [[!defined yyoverflow || YYERROR_VERBOSE]])[ +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (]b4_yyerror_args[YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif]b4_lac_if([[ + if (yyes != yyesa) + YYSTACK_FREE (yyes);]])b4_push_if([[ + yyps->yynew = 1; + +yypushreturn:]])[ +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + return yyresult; +} +]b4_epilogue[]dnl +b4_output_end() + +b4_defines_if( +[b4_output_begin([b4_spec_defines_file])[ +]b4_copyright([Bison interface for Yacc-like parsers in C])[ + +]b4_shared_declarations[ +]b4_output_end() +])# b4_defines_if diff --git a/djgpp/Makefile.maint b/djgpp/Makefile.maint new file mode 100644 index 0000000..84a93aa --- /dev/null +++ b/djgpp/Makefile.maint @@ -0,0 +1,37 @@ +# DJGPP Maintainer's Makefile -*-Makefile-*- +# Requires GNU sed + +## Copyright (C) 2005-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +top_srcdir = .. +srcdir = . + +SHELL = /bin/sh + +all: README + +README: README.in $(top_srcdir)/configure + PACKAGE=`grep "^[ ]*PACKAGE=" $(top_srcdir)/configure | sed -e 's/^[ ]*PACKAGE=//' -e s/[\"\']//g`; \ + VERSION=`grep "^[ ]*VERSION=" $(top_srcdir)/configure | sed -e 's/^[ ]*VERSION=//' -e s/[\"\']//g`; \ + package_version=`echo "$${VERSION}" | sed 's/\.//g'`; \ + tree_version=`echo "$${VERSION}" | sed 's/\.//2g'`; \ + sed \ + -e "s/@V@/$${PACKAGE}-$${VERSION}/g" \ + -e "s/@VERSION@/$${VERSION}/g" \ + -e "s/@PACKAGE_VERSION@/$$package_version/g" \ + -e "s/@TREE_VERSION@/$$tree_version/g" \ + $(srcdir)/README.in > t-$@ + mv t-$@ $@ diff --git a/djgpp/README.in b/djgpp/README.in new file mode 100644 index 0000000..2f88856 --- /dev/null +++ b/djgpp/README.in @@ -0,0 +1,195 @@ +This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP. + +Copyright (C) 2005-2015 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 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + +1.: DJGPP specific changes. + ======================= + + The DJGPP port of Bison offers LFN and SFN support depending on which + OS it is running. If LFN support is available or not is determinated at + run time. If LFN support is available (DOS session under Win9X, Win2K, + WinXP, etc.) the standard posix file name extensions will be used. + These are: y.tab.c, y.tab.c++, y.tab.h, y.output, etc. If only SFN + support is available (plain DOS), then the standard MSDOS short file + names will be used. These are: y_tab.c, y_tab.h, y.out, etc. + It should be noticed that this bison version needs the m4 program as + back end to generate the parser file (y.tab.c etc.) from the skeleton + files. This implies that m4 must always be installed to get bison + working. m4 will use a couple of m4 scripts that will be installed in + /dev/env/DJDIR/share/bison and shall not be removed. + It should also be noticed that the skeleton files bison.simple and + bison.hairy are no longer supported. This applies also to the environ- + ment variables BISON_HAIRY and BISON_SIMPLE. Those variables are *no* + longer honored at all. + The kind of skeleton file bison.hairy is no longer supported at all. + The skeleton file bison.simple is now called yacc.c and is an m4 script. + The other two skeleton files supported by this bison version are glr.c + and lalr1.cc. The first one is a generalized LR C parser based on + Bison's LALR(1) tables and the second one is a experimental C++ parser + class. + As has been told before, bison uses m4 to generate the parser file. + This is done by forking and using pipes for the IPC. MSDOS does not + support this functionality so this has been reproduced in the usual + way by redirecting stdin and stdout of bison and m4 to temporary files + and processing these files in sequence. + It should be noticed that due to the great amount of file names that do + not cleanly map to 8.3 file names, you will need an OS with LFN support + to configure and compile the sources. On Win98 this implies that the + generation of numeric tails for 8.3 file name aliases must be enabled + or the compilation will fail. + + + Please **read** the docs. + + +2.: Installing the binary package. + ============================== + +2.1.: Copy the binary distribution into the top DJGPP installation directory, + just unzip it preserving the directory structure running *ONE* of the + following commands: + unzip32 bsn@PACKAGE_VERSION@b.zip or + djtarx bsn@PACKAGE_VERSION@b.zip or + pkunzip -d bsn@PACKAGE_VERSION@b.zip + + + +3.: Building the binaries from sources. + =================================== + +3.1.: Create a temporary directory and copy the source package into the + directory. If you download the source distribution from one of the + DJGPP sites, just unzip it preserving the directory structure + running *ONE* of the following commands: + unzip32 bsn@PACKAGE_VERSION@s.zip or + djtarx bsn@PACKAGE_VERSION@s.zip or + pkunzip -d bsn@PACKAGE_VERSION@s.zip + and proceed to the paragraph 3.3, below. + +3.2.: Source distributions downloaded from one of the GNU FTP sites need + some more work to unpack, if LFN support is not available. If LFN is + available then you can extract the source files from the archive with + any unzip program and proceed to the paragraph 3.3, below. Any file + name issue will be handled by the DJGPP configuration files. + To unpack the source distribution on SFN systems, first, you MUST use + the `djunpack' batch file to unzip the package. That is because some + file names in the official distributions need to be changed to avoid + problems on the various platforms supported by DJGPP. + `djunpack' invokes the `djtar' program (that is part of the basic DJGPP + development kit) to rename these files on the fly given a file with + name mappings; the distribution includes a file `djgpp/fnchange.lst' + with the necessary mappings. So you need first to retrieve that batch + file, and then invoke it to unpack the distribution. Here's how: + + djtar -x -p -o bison-@VERSION@/djgpp/djunpack.bat bison-@VERSION@.tar.gz > djunpack.bat + djunpack bison-@VERSION@.tar.gz + + (The name of the distribution archive and the leading directory of the + path to `djunpack.bat' in the distribution will be different for + versions of Bison other than @VERSION@.) + + If the argument to `djunpack.bat' include leading directories, it MUST + be given with the DOS-style backslashes; Unix-style forward slashes + will NOT work. + + If the distribution comes as a .tar.bz2 archive, and your version of + `djtar' doesn't support bzip2 decompression, you need to unpack it as + follows: + + bnzip2 bison-@VERSION@.tar.bz2 + djtar -x -p -o bison-@VERSION@/djgpp/djunpack.bat bison-@VERSION@.tar > djunpack.bat + djunpack bison-@VERSION@.tar + +3.3.: To build the binaries you will need the following binary packages: + djdev203.zip (or a later but NOT a prior version) + bsh204b.zip (or a later but NOT a prior version) + gccNNNb.zip, gppNNN.zip, bnuNNNb.zip, makNNNb.zip, filNNNb.zip, + perlNNNb.zip, shlNNNb.zip, txtNNNb.zip, txiNNNb.zip, grepNNNb.zip, + sedNNNb.zip and m4NNN.zip + + If you want to run the check you will need also: + difNNNb.zip + + NNN represents the latest version number of the binary packages. All + this packages can be found in the /v2gnu directory of any + ftp.delorie.com mirror. + You will need bsh204b.zip or later and *NOT* a prior version or + the build will fail. The same applies to djdev203.zip. Please note + that Bison requires m4-144b.zip or later to work properly. + +3.4.: If for some reason you want to reconfigure the package cd into the top + srcdir (bison-@TREE_VERSION@) and run the following commands: + del djgpp\config.cache + make clean + djgpp\config + + Please note that you *MUST* delete the config.cache file in the djgpp + subdir or you will not really reconfigure the sources because the + configuration informations will be read from the cache file instead + of being newly computed. + To build the programs in a directory other than where the sources are, + you must add the parameter that specifies the source directory, + e.g: + x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@ + + Lets assume you want to build the binaries in a directory placed on a + different drive (z:\build in this case) from where the sources are, + then you will run the following commands: + z: + md \build + cd \build + x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@ + + The order of the options and the srcdir option does not matter. You + *MUST* use forward slashes to specify the source directory. + + The batch file will set same environment variables, make MSDOS specific + modifications to the Makefile.in's and supply all other needed options + to the configure script. + +3.5.: To compile the package run from the top srcdir the command: + make + +3.6.: Now you can run the tests if you like. From the top srcdir run the + command: + make check + + No test should fail but the tests #131 (Doxygen Public Documentation) + and #132 (Doxygen Private Documentation) will be skipped. Please note + that the testsuite only works with LFN available. On plain DOS, most + of the tests will fail due to invalid DOS names. + +3.7.: To install the binaries, header, library, catalogs, and info docs + run the following command from the top srcdir: + make install + + This will install the products into your DJGPP installation tree given + by the default prefix "/dev/env/DJDIR". If you prefer to install them + into some other directory you will have to set prefix to the appropriate + value: + make install prefix=z:/some/other/place + + + + Send GNU bison specific bug reports to . + Send suggestions and bug reports concerning the DJGPP port to + comp.os.msdos.djgpp or . + + +Enjoy. + + Guerrero, Juan Manuel diff --git a/djgpp/config.bat b/djgpp/config.bat new file mode 100644 index 0000000..d2ed5ab --- /dev/null +++ b/djgpp/config.bat @@ -0,0 +1,547 @@ +@echo off +Rem Configure Bison for DJGPP. + +Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line +Rem format, or else stock DOS/Windows shells will refuse to run it. + +Rem Copyright (C) 2005-2015 Free Software Foundation, Inc. + +Rem This program is free software: you can redistribute it and/or modify +Rem it under the terms of the GNU General Public License as published by +Rem the Free Software Foundation, either version 3 of the License, or +Rem (at your option) any later version. +Rem +Rem This program is distributed in the hope that it will be useful, +Rem but WITHOUT ANY WARRANTY; without even the implied warranty of +Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +Rem GNU General Public License for more details. +Rem +Rem You should have received a copy of the GNU General Public License +Rem along with this program. If not, see . + +echo Configuring Bison for DJGPP v2.x... + +Rem The SmallEnv tests protect against fixed and too small size +Rem of the environment in stock DOS shell. + +Rem Find out if NLS is wanted or not, +Rem if dependency-tracking is wanted or not, +Rem if caching is wanted or not +Rem and where the sources are. +Rem We always default to NLS support, +Rem no dependency tracking +Rem and to in place configuration. +set ARGS= +set NLS=enabled +if not "%NLS%" == "enabled" goto SmallEnv +set CACHING=enabled +if not "%CACHING%" == "enabled" goto SmallEnv +set DEPENDENCY_TRACKING=disabled +if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv +set LIBICONV_PREFIX=disabled +if not "%LIBICONV_PREFIX%" == "disabled" goto SmallEnv +set LIBINTL_PREFIX=disabled +if not "%LIBINTL_PREFIX%" == "disabled" goto SmallEnv +set HTML=enabled +if not "%HTML%" == "enabled" goto SmallEnv +set XSRC=. +if not "%XSRC%" == "." goto SmallEnv + +Rem Loop over all arguments. +Rem Special arguments are: NLS, XSRC, CACHE, STATIC_LIBS, LIBICONV_PREFIX, LIBINTL_PREFIX and DEPS. +Rem All other arguments are stored into ARGS. +:ArgLoop +if "%1" == "nls" goto NextArgument +if "%1" == "NLS" goto NextArgument +if "%1" == "no-nls" goto NoNLS +if "%1" == "no-NLS" goto NoNLS +if "%1" == "NO-NLS" goto NoNLS +goto CachingOption +:NoNLS +if "%1" == "no-nls" set NLS=disabled +if "%1" == "no-NLS" set NLS=disabled +if "%1" == "NO-NLS" set NLS=disabled +if not "%NLS%" == "disabled" goto SmallEnv +goto NextArgument +:CachingOption +if "%1" == "cache" goto NextArgument +if "%1" == "CACHE" goto NextArgument +if "%1" == "no-cache" goto NoCaching +if "%1" == "no-CACHE" goto NoCaching +if "%1" == "NO-CACHE" goto NoCaching +goto DependencyOption +:NoCaching +if "%1" == "no-cache" set CACHING=disabled +if "%1" == "no-CACHE" set CACHING=disabled +if "%1" == "NO-CACHE" set CACHING=disabled +if not "%CACHING%" == "disabled" goto SmallEnv +goto NextArgument +:DependencyOption +if "%1" == "no-dep" goto NextArgument +if "%1" == "no-DEP" goto NextArgument +if "%1" == "NO-DEP" goto NextArgument +if "%1" == "dep" goto DependecyTraking +if "%1" == "DEP" goto DependecyTraking +goto LibiconvPrefixOption +:DependecyTraking +if "%1" == "dep" set DEPENDENCY_TRACKING=enabled +if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled +if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv +goto NextArgument +:LibiconvPrefixOption +if "%1" == "no-libiconvprefix" goto NextArgument +if "%1" == "no-LIBICONVPREFIX" goto NextArgument +if "%1" == "NO-LIBICONVPREFIX" goto NextArgument +if "%1" == "libiconvprefix" goto WithLibiconvPrefix +if "%1" == "LIBICONVPREFIX" goto WithLibiconvPrefix +goto LibintlPrefixOption +:WithLibiconvPrefix +if "%1" == "libiconvprefix" set LIBICONV_PREFIX=enabled +if "%1" == "LIBICONVPREFIX" set LIBICONV_PREFIX=enabled +if not "%LIBICONV_PREFIX%" == "enabled" goto SmallEnv +goto NextArgument +:LibintlPrefixOption +if "%1" == "no-libiconvprefix" goto NextArgument +if "%1" == "no-LIBICONVPREFIX" goto NextArgument +if "%1" == "NO-LIBICONVPREFIX" goto NextArgument +if "%1" == "libintlprefix" goto _WithLibintlPrefix +if "%1" == "LIBINTLPREFIX" goto _WithLibintlPrefix +goto HTMLOption +:_WithLibintlPrefix +if "%1" == "libintlprefix" set LIBINTL_PREFIX=enabled +if "%1" == "LIBINTLPREFIX" set LIBINTL_PREFIX=enabled +if not "%LIBINTL_PREFIX%" == "enabled" goto SmallEnv +:HTMLOption +if "%1" == "withhtml" goto NextArgument +if "%1" == "withHTML" goto NextArgument +if "%1" == "WITHHTML" goto NextArgument +if "%1" == "withouthtml" goto _WithoutHTML +if "%1" == "withoutHTML" goto _WithoutHTML +if "%1" == "WITHOUTHTML" goto _WithoutHTML +goto SrcDirOption +:_WithoutHTML +if "%1" == "withouthtml" set HTML=disabled +if "%1" == "withoutHTML" set HTML=disabled +if "%1" == "WITHOUTHTML" set HTML=disabled +if not "%HTML%" == "disabled" goto SmallEnv +goto NextArgument +:SrcDirOption +echo %1 | grep -q "/" +if errorlevel 1 goto CollectArgument +set XSRC=%1 +if not "%XSRC%" == "%1" goto SmallEnv +goto NextArgument +:CollectArgument +set _ARGS=%ARGS% %1 +if not "%_ARGS%" == "%ARGS% %1" if not "%_ARGS%" == "%ARGS%%1" goto SmallEnv +echo %_ARGS% | grep -q "[^ ]" +if not errorlevel 0 set ARGS=%_ARGS% +set _ARGS= +:NextArgument +shift +if not "%1" == "" goto ArgLoop + +Rem Create an arguments file for the configure script. +echo --srcdir=%XSRC% > args +if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> args +if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> args +if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> args +if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> args +if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> args +if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> args +if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> args +if "%HTML%" == "enabled" echo --enable-html >> args +if "%HTML%" == "disabled" echo --disable-html >> args +if not "%ARGS%" == "" echo %ARGS% >> args +set ARGS= +set CACHING= +set DEPENDENCY_TRACKING= +set LIBICONV_PREFIX= +set LIBINTL_PREFIX= +set HTML= + +if "%XSRC%" == "." goto InPlace + +:NotInPlace +redir -e /dev/null update %XSRC%/configure.org ./configure +test -f ./configure +if errorlevel 1 update %XSRC%/configure ./configure + +:InPlace +Rem Update configuration files +echo Updating configuration scripts... +test -f ./configure.org +if errorlevel 1 update configure configure.org +sed -f %XSRC%/djgpp/config.sed configure.org > configure +if errorlevel 1 goto SedError + +Rem Make sure they have a config.site file +set CONFIG_SITE=%XSRC%/djgpp/config.site +if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv + +Rem inttypes_.h and inttypes.h map to the same 8.3 alias. +test -f %XSRC%/lib/inttypes_.h +if not errorlevel 1 mv -f %XSRC%/lib/inttypes_.h %XSRC%/lib/_inttypes.h + +Rem Make sure crucial file names are not munged by unpacking +test -f %XSRC%/po/Makefile.in.in +if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in +test -f %XSRC%/po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/po/Makefile.in %XSRC%/po/Makefile.in-in +test -f %XSRC%/po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/po/Makefile.inin %XSRC%/po/Makefile.in-in +test -f %XSRC%/po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/po/Makefile.in_in %XSRC%/po/Makefile.in-in +test -f %XSRC%/po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/po/Makefile_in.in %XSRC%/po/Makefile.in-in +test -f %XSRC%/runtime-po/Makefile.in.in +if not errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in.in %XSRC%/runtime-po/Makefile.in-in +test -f %XSRC%/runtime-po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in %XSRC%/runtime-po/Makefile.in-in +test -f %XSRC%/runtime-po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.inin %XSRC%/runtime-po/Makefile.in-in +test -f %XSRC%/runtime-po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in_in %XSRC%/runtime-po/Makefile.in-in +test -f %XSRC%/runtime-po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile_in.in %XSRC%/runtime-po/Makefile.in-in +test -f %XSRC%/data/c++.m4 +if not errorlevel 1 mv -f %XSRC%/data/c++.m4 %XSRC%/data/cxx.m4 +test -f %XSRC%/data/cxx.m4 +if errorlevel 1 mv -f %XSRC%/data/cpp.m4 %XSRC%/data/cxx.m4 +test -f %XSRC%/data/c++-skel.m4 +if not errorlevel 1 mv -f %XSRC%/data/c++-skel.m4 %XSRC%/data/cxx-skel.m4 +test -f %XSRC%/data/cxx-skel.m4 +if errorlevel 1 mv -f %XSRC%/data/cpp-skel.m4 %XSRC%/data/cxx-skel.m4 +test -f %XSRC%/build-aux/javacomp.sh.in +if not errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh.in %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javacomp.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javacomp.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.shin %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javacomp.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh_in %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javacomp.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh.in %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javaexec.sh.in +if not errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh.in %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/build-aux/javaexec.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/build-aux/javaexec.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.shin %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/build-aux/javaexec.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh_in %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/build-aux/javaexec.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javaexec_sh.in %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/doc/yacc.1.in +if not errorlevel 1 mv -f %XSRC%/doc/yacc.1.in %XSRC%/doc/yacc.1-in +test -f %XSRC%/doc/yacc.1-in +if errorlevel 1 mv -f %XSRC%/doc/yacc.1 %XSRC%/doc/yacc.1-in +test -f %XSRC%/doc/yacc.1-in +if errorlevel 1 mv -f %XSRC%/doc/yacc.1in %XSRC%/doc/yacc.1-in +test -f %XSRC%/doc/yacc.1-in +if errorlevel 1 mv -f %XSRC%/doc/yacc.1_in %XSRC%/doc/yacc.1-in +test -f %XSRC%/doc/yacc.1-in +if errorlevel 1 mv -f %XSRC%/doc/yacc_1.in %XSRC%/doc/yacc.1-in +test -f %XSRC%/etc/bench.pl.in +if not errorlevel 1 mv -f %XSRC%/etc/bench.pl.in %XSRC%/etc/bench.pl-in +test -f %XSRC%/etc/bench.pl-in +if errorlevel 1 mv -f %XSRC%/etc/bench.pl %XSRC%/etc/bench.pl-in +test -f %XSRC%/etc/bench.pl-in +if errorlevel 1 mv -f %XSRC%/etc/bench.plin %XSRC%/etc/bench.pl-in +test -f %XSRC%/etc/bench.pl-in +if errorlevel 1 mv -f %XSRC%/etc/bench.pl_in %XSRC%/etc/bench.pl-in +test -f %XSRC%/etc/bench.pl-in +if errorlevel 1 mv -f %XSRC%/etc/bench_pl.in %XSRC%/etc/bench.pl-in + +:scan_gram_c_Test +test -f %XSRC%/src/c-scan-gram.c +if not errorlevel 1 goto scan_skel_c_Test +test -f %XSRC%/src/scan-gram-c.c +if not errorlevel 1 mv -f %XSRC%/src/scan-gram-c.c %XSRC%/src/c-scan-gram.c +:scan_skel_c_Test +test -f %XSRC%/src/c-scan-skel.c +if not errorlevel 1 goto FixFiles +test -f %XSRC%/src/scan-skel-c.c +if not errorlevel 1 mv -f %XSRC%/src/scan-skel-c.c %XSRC%/src/c-scan-skel.c + +:FixFiles +Rem Fix data/lalr1.cc and data/location.cc to reflect the renaming of c++.m4 +sed "s/c++\.m4/cxx.m4/" %XSRC%/data/lalr1.cc > lalr1.cc +if errorlevel 1 goto lalr1_ccFileError +mv ./lalr1.cc %XSRC%/data/lalr1.cc +sed "s/c++\.m4/cxx.m4/" %XSRC%/data/location.cc > location.cc +if errorlevel 1 goto location_ccFileError +mv ./location.cc %XSRC%/data/location.cc +sed "s/c++\.m4/cxx.m4/" %XSRC%/data/glr.cc > glr.cc +if errorlevel 1 goto glr_ccFileError +mv ./glr.cc %XSRC%/data/glr.cc + +Rem Fix src/getargs.c to reflect the renaming of c++-skel.m4 +sed "s/c++-skel\.m4/cxx-skel.m4/" %XSRC%/src/getargs.c > getargs.c +if errorlevel 1 goto getargs_cFileError +mv ./getargs.c %XSRC%/src/getargs.c + +Rem Define DJGPP specific defs in config.hin +echo Editing config.hin... +test -f %XSRC%/lib/config_h.org +if errorlevel 1 update %XSRC%/lib/config.hin %XSRC%/lib/config_h.org +sed -f %XSRC%/djgpp/config_h.sed %XSRC%/lib/config_h.org > config.hin +if errorlevel 1 goto SedError2 +mv -f config.hin %XSRC%/lib/config.hin + + +Rem Fixing ilicit testsuite file name. +test -f %XSRC%/tests/c++.at +if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at + +test -f %XSRC%/tests/testsuite.org +if errorlevel 1 update %XSRC%/tests/testsuite %XSRC%/tests/testsuite.org +sed -f %XSRC%/djgpp/testsuite.sed %XSRC%/tests/testsuite.org > testsuite.tmp +if errorlevel 1 goto SedError3 +mv -f ./testsuite.tmp %XSRC%/tests/testsuite + +Rem Fixing ilicit calc++ file names in the calc++ directory. +test -d %XSRC%/examples/calc++ +if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx +test -d %XSRC%/examples/calcxx +if errorlevel 1 mv -f %XSRC%/examples/calcpp %XSRC%/examples/calcxx +test -f %XSRC%/examples/calcxx/calc++-scanner.cc +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc +test -f %XSRC%/examples/calcxx/calcxx-scanner.cc +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc +test -f %XSRC%/examples/calcxx/calc++-scanner.ll +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll +test -f %XSRC%/examples/calcxx/calcxx-scanner.ll +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll +test -f %XSRC%/examples/calcxx/calc++-driver.cc +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc +test -f %XSRC%/examples/calcxx/calcxx-driver.cc +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc +test -f %XSRC%/examples/calcxx/calc++-driver.hh +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh +test -f %XSRC%/examples/calcxx/calcxx-driver.hh +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh +test -f %XSRC%/examples/calcxx/calc++-parser.cc +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc +test -f %XSRC%/examples/calcxx/calcxx-parser.cc +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc +test -f %XSRC%/examples/calcxx/calc++-parser.hh +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh +test -f %XSRC%/examples/calcxx/calcxx-parser.hh +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh +test -f %XSRC%/examples/calcxx/calc++-parser.stamp +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp +test -f %XSRC%/examples/calcxx/calcxx-parser.stamp +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp +test -f %XSRC%/examples/calcxx/calc++-parser.yy +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy +test -f %XSRC%/examples/calcxx/calcxx-parser.yy +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy +test -f %XSRC%/examples/calcxx/calc++.cc +if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++.cc %XSRC%/examples/calcxx/calcxx.cc +test -f %XSRC%/examples/calcxx/calcxx.cc +if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp.cc %XSRC%/examples/calcxx/calcxx.cc + +Rem Fixing #include lines in calcxx files. +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc +if errorlevel 1 goto calcxxFileError +mv ./calcxx.cc %XSRC%/examples/calcxx/calcxx.cc +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc +if errorlevel 1 goto calcxxFileError +mv ./calcxx-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh +if errorlevel 1 goto calcxxFileError +mv ./calcxx-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc +if errorlevel 1 goto calcxxFileError +mv ./calcxx-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh +if errorlevel 1 goto calcxxFileError +mv ./calcxx-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh +:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy +:if errorlevel 1 goto calcxxFileError +:mv ./calcxx-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc +if errorlevel 1 goto calcxxFileError +mv ./calcxx-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc +:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll +:if errorlevel 1 goto calcxxFileError +:mv ./calcxx-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll +sed "s/calc++/calcxx/" %XSRC%/examples/calcxx/test > test +if errorlevel 1 goto calcxxFileError +mv ./test %XSRC%/examples/calcxx/test + + +Rem Fixing the scanner files to make file names 8.3 valid. +Rem Use only if you want to change the scan-gram.l and scan-skel.l files. +: sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-gram.l > scan-gram.l +: if errorlevel 1 goto ScannerFileError +: mv ./scan-gram.l %XSRC%/src/scan-gram.l +: sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-skel.l > scan-skel.l +: if errorlevel 1 goto ScannerFileError +: mv ./scan-skel.l %XSRC%/src/scan-skel.l + + +Rem This is required because DOS/Windows are case-insensitive +Rem to file names, and "make install" will do nothing if Make +Rem finds a file called `install'. +if exist INSTALL ren INSTALL INSTALL.txt + +Rem Set SHELL to a sane default or some configure tests stop working +Rem if the package is configured across partitions. +if not "%SHELL%" == "" goto HomeName +set SHELL=/bin/sh +if not "%SHELL%" == "/bin/sh" goto SmallEnv +echo No SHELL found in the environment, using default value + +:HomeName +Rem Set HOME to a sane default so configure stops complaining. +if not "%HOME%" == "" goto HostName +set HOME=%XSRC%/djgpp +if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv +echo No HOME found in the environment, using default value + +:HostName +Rem Set HOSTNAME so it shows in config.status +if not "%HOSTNAME%" == "" goto hostdone +if "%windir%" == "" goto msdos +set OS=MS-Windows +if not "%OS%" == "MS-Windows" goto SmallEnv +goto haveos +:msdos +set OS=MS-DOS +if not "%OS%" == "MS-DOS" goto SmallEnv +:haveos +if not "%USERNAME%" == "" goto haveuname +if not "%USER%" == "" goto haveuser +echo No USERNAME and no USER found in the environment, using default values +set HOSTNAME=Unknown PC +if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv +goto userdone +:haveuser +set HOSTNAME=%USER%'s PC +if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv +goto userdone +:haveuname +set HOSTNAME=%USERNAME%'s PC +if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv +:userdone +set _HOSTNAME=%HOSTNAME%, %OS% +if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv +set HOSTNAME=%_HOSTNAME% +:hostdone +set _HOSTNAME= +set OS= + +Rem install-sh is required by the configure script but clashes with the +Rem various Makefile install-foo targets, so we MUST have it before the +Rem script runs and rename it afterwards +test -f %XSRC%/install-sh +if not errorlevel 1 goto NoRen0 +test -f %XSRC%/install-sh.sh +if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh +:NoRen0 + +if "%NLS%" == "disabled" goto WithoutNLS + +:WithNLS +Rem Check for the needed libraries and binaries. +test -x /dev/env/DJDIR/bin/msgfmt.exe +if errorlevel 1 goto MissingNLSTools +test -x /dev/env/DJDIR/bin/xgettext.exe +if errorlevel 1 goto MissingNLSTools +test -f /dev/env/DJDIR/include/libcharset.h +if errorlevel 1 goto MissingNLSTools +test -f /dev/env/DJDIR/lib/libcharset.a +if errorlevel 1 goto MissingNLSTools +test -f /dev/env/DJDIR/include/iconv.h +if errorlevel 1 goto MissingNLSTools +test -f /dev/env/DJDIR/lib/libiconv.a +if errorlevel 1 goto MissingNLSTools +test -f /dev/env/DJDIR/include/libintl.h +if errorlevel 1 goto MissingNLSTools +test -f /dev/env/DJDIR/lib/libintl.a +if errorlevel 1 goto MissingNLSTools + +Rem Recreate the files in the %XSRC%/po subdir with our ported tools. +redir -e /dev/null rm %XSRC%/po/*.gmo +redir -e /dev/null rm %XSRC%/po/bison.pot +redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c +redir -e /dev/null rm %XSRC%/po/stamp-cat-id + +Rem Update the arguments file for the configure script. +Rem We prefer without-included-gettext because libintl.a from gettext package +Rem is the only one that is guaranteed to have been ported to DJGPP. +echo --enable-nls --without-included-gettext >> args +goto ConfigurePackage + +:MissingNLSTools +echo Needed libs/tools for NLS not found. Configuring without NLS. +:WithoutNLS +Rem Update the arguments file for the configure script. +echo --disable-nls >> args + +:ConfigurePackage +echo Running the ./configure script... +sh ./configure @args +if errorlevel 1 goto CfgError +rm args +echo Done. +goto End + +:lalr1_ccFileError +echo ./data/lalr1.cc file editing failed! +goto End + +:glr_ccFileError +echo ./data/glr.cc file editing failed! +goto End + +:getargs_cFileError +echo ./src/getargs.c file editing failed! +goto End + +:location_ccFileError +echo ./data/location.cc file editing failed! +goto End + +:calcxxFileError +echo ./examples/calcxx file editing failed! +goto End + +:ScannerFileError +echo ./scanner file editing failed! +goto End + +:SedError +echo ./configure script editing failed! +goto End + +:SedError2 +echo ./lib/config.hin editing failed! +goto End + +:SedError3 +echo ./tests/testsuite editing failed! +goto End + +:CfgError +echo ./configure script exited abnormally! +goto End + +:SmallEnv +echo Your environment size is too small. Enlarge it and run me again. +echo Configuration NOT done! + +:End +test -f %XSRC%/install-sh.sh +if not errorlevel 1 goto NoRen1 +test -f %XSRC%/install-sh +if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh +:NoRen1 +if "%SHELL%" == "/bin/sh" set SHELL= +if "%HOME%" == "%XSRC%/djgpp" set HOME= +set CONFIG_SITE= +set HOSTNAME= +set NLS= +set XSRC= diff --git a/djgpp/config.sed b/djgpp/config.sed new file mode 100644 index 0000000..423b1df --- /dev/null +++ b/djgpp/config.sed @@ -0,0 +1,190 @@ +# DJGPP specific configuration file. +# Sed script for additional DJGPP specific editing +# of the configure script generated by autoconf 2.62. + +# Copyright (C) 2005-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# Additional editing of Makefiles +/^eval sed.*ac_file_inputs.*tmp\/out \\$/ { +:loop +n +/^$/!b loop +a\ +cat > "$tmp/subs-djgpp.sed" << eof_djgpp\ +# DJGPP specific Makefile changes.\ +s,\\.deps,_deps,g\ +s,\\.libs,_libs,g\ +s,\\.new\\.,_new.,g\ +s,\\.old\\.,_old.,g\ +s,\\.tab\\.,_tab.,g\ +s,c++\\.at,cxx.at,g\ +s,c++\\.m4,cxx.m4,g\ +s,c++-skel\\.m4,cxx-skel.m4,g\ +s,calc++,calcxx,g\ +s,scan-gram-c,c-scan-gram,g\ +s,scan-skel-c,c-scan-skel,g\ +s,inttypes_,_inttypes,g\ +s,javacomp\\.sh\\.in,javacomp.sh-in,g\ +s,javaexec\\.sh\\.in,javaexec.sh-in,g\ +s,yacc\\.1\\.in,yacc.1-in,g\ +s,bench\\.pl\\.in,bench.pl-in,g\ +s,Makefile\\.am\\.in,Makefile.am-in,g\ +s,Makefile\\.in\\.in,Makefile.in-in,g\ +/^\\.y\\.c:/,/^$/ {\ + /\\\$(YACCCOMPILE)/ {\ + a\\\\\ + -@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\\\ + -@test -f y.tab.h && mv -f y.tab.h y_tab.h\ + }\ +}\ +/^libbison.a:/ i\\\\\ +\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\\\ +subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\\\ + \\$(COMPILE) -c \\$<\ +/^yacc:/ i\\\\\ +yacc.bat:\\\\\ + echo "bison\\$(EXEEXT) -y %1 %2 %3 %4 %5 %6 %7 %8 %9" >\\$@\ +/^bin_SCRIPTS =/s/$/ yacc.bat/\ +/^MOSTLYCLEANFILES = yacc/s/$/ yacc.bat/\ +/cross-options.texi:/,/^$/ s|bison|&.exe|g\ +/^\\.x\\.1:/,/^$/ s|\\$program|&.exe|g\ +eof_djgpp\ +sed -f "\$tmp/subs-djgpp.sed" \$tmp/out > \$tmp/out.djgpp\ +mv -f \$tmp/out.djgpp \$tmp/out +} + +# Makefile.in.in is renamed to Makefile.in-in. +/ac_config_files=/ { + /runtime-po/!s|po/Makefile\.in|&:po/Makefile.in-in| + s|runtime-po/Makefile\.in|&:runtime-po/Makefile.in-in| + s|javacomp\.sh\.in|javacomp.sh-in| + s|javaexec\.sh\.in|javaexec.sh-in| + s|doc/yacc\.1|&:doc/yacc.1-in| + s|etc/bench.pl|&:etc/bench.pl-in| +} + +/CONFIG_FILES=/ { + /runtime-po/!s|po/Makefile\.in|&:po/Makefile.in-in|2 + s|runtime-po/Makefile\.in|&:runtime-po/Makefile.in-in|2 + s|javacomp\.sh\.in|javacomp.sh-in| + s|javaexec\.sh\.in|javaexec.sh-in| + s|doc/yacc\.1|&:doc/yacc.1-in|2 + s|etc/bench\.pl|&:etc/bench.pl-in|2 +} + +# We always use _deps and _libs instead of .deps and .libs, because +# the latter is an invalid name on 8+3 MS-DOS file system. This makes +# the generated Makefiles good for every DJGPP installation, not only +# the one where the package was configured (which could happen to be +# a Windows box, where leading dots in file names are allowed). +/^rmdir[ ]*\.tst/ i\ +am__leading_dot=_ + +# Replace (command) > /dev/null with `command > /dev/null`, since +# parenthesized commands always return zero status in the ported Bash, +# even if the named command doesn't exist +/if ([^|;`]*null/{ + s,(,`, + s,),, + /null[ ]*2>&1/ s,2>&1,&`, + /null.*null/ s,null.*null,&`, + /null.*null/ !{ + /null[ ]*2>&1/ !s,null,&`, + } +} + +# DOS-style absolute file names should be supported as well +/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*, + +# The following two items are changes needed for configuring +# and compiling across partitions. +# 1) The given srcdir value is always translated from the +# "x:" syntax into "/dev/x" syntax while we run configure. +/^[ ]*-srcdir=\*.*$/ a\ + ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"` +/set X `ls -Lt \$srcdir/ i\ + if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\ + srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\ + fi + +# Autoconf 2.52e generated configure scripts +# write absolute paths into Makefiles and bison.in +# making them useless for DJGPP installations for +# which the package has not been configured for. +/MISSING=/,/^$/ { + /^fi$/ a\ +am_missing_run=`echo "$am_missing_run" | sed 's%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%'` +} +/^install_sh=/a\ +install_sh=`echo "$install_sh" | sed 's%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%'` + +# This will only work if the assumption that the +# testsuite is ran from the following path: +# ${top_srcdir}/tests/testsuite.dir +# holds. The explicit names are of no importance. +# ../../. == ${top_srcdir} +#/^esac$/,/^ac_abs_srcdir=/ { +/^ac_abs_srcdir=/ i\ +ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`\ +ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`\ +ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"` +#ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"` +/^ac_abs_srcdir=/ a\ +for dj_dir in $ac_abs_builddir $ac_abs_top_builddir $ac_abs_top_srcdir $ac_abs_srcdir\ +do\ + ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%//%/%g"`\ + ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%//%/%g"`\ + ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%//%/%g"`\ + ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%//%/%g"`\ +done + +# Add DJGPP version information. +/^#define VERSION/ s/\$VERSION/& (DJGPP port (r1))/ + +# We need makeinfo to make the html formated docs. +/\$am_missing_run[ ]*makeinfo/ s,\$am_missing_run,, + +# The path to the FORTRAN compiler and libraries +# shall contain no absolute path reference so it +# will be good for all djgpp installations. +/^FLIBS="\$ac_cv_flibs"/ i\ +ac_djgpp_path=`echo "$DJDIR" | sed 's%\\\\\\%/%g' | tr $as_cr_LETTERS $as_cr_letters`\ +ac_cv_flibs=`echo "$ac_cv_flibs" | sed "s%-L$ac_djgpp_path%-L/dev/env/DJDIR%g"` + +# Autoconf generated configure scripts write absolute +# paths of certain header files into Makefiles making +# them useless for DJGPP installations for which the +# package has not been configured for. +/^.*echo "\$as_me:\$LINENO: result: \$gl_cv_absolute_.*$/ { +h +s,^.*\(gl_cv_absolute_\)\([a-z0-9_]*\)\(_h\).*$,\1\2\3=`echo $\1\2\3 | sed "s%[^:]:.*/include/%/dev/env/DJDIR/include/%"`, +G +} +/^.*echo "\$as_me:\$LINENO: result: \$gl_cv_full_.*$/ { +h +s,^.*\(gl_cv_full_\)\([a-z0-9_]*\)\(_h\).*$,\1\2\3=`echo $\1\2\3 | sed "s%[^:]:.*/include/%/dev/env/DJDIR/include/%"`, +G +} + +# The following is not a valid DOS file name +s/calc++/calcxx/g + +# The CR test for awk does not work for DJGPP. +/^ac_cs_awk_cr=/,/^$/ { + /^fi$/ a\ +ac_cs_awk_cr=$ac_cr +} diff --git a/djgpp/config.site b/djgpp/config.site new file mode 100644 index 0000000..08d40d3 --- /dev/null +++ b/djgpp/config.site @@ -0,0 +1,85 @@ +#! /bin/sh + +# This is the config.site file for configuring GNU packages +# which are to be built with DJGPP tools. + +# Copyright (C) 2005-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# Include the djgpp subdirectory in PATH, so that getconf is found +PATH="$srcdir/djgpp:$PATH" + +# These two variables are required, otherwise looking for +# programs along the PATH will not work. +PATH_SEPARATOR=: +PATH_EXPAND=y + +# This is required in for "test -f foo" to find foo.exe +export TEST_FINDS_EXE=y + +# The root of the DJGPP tree serves as the default prefix +test "x$prefix" = xNONE && prefix='/dev/env/DJDIR' + +# This is required for config.status script to be run, since +# ./configure runs it by invoking ${CONFIG_SHELL-/bin/sh} +CONFIG_SHELL=${CONFIG_SHELL='sh'} + +# These are set here so the generated Makefile's will be good +# for every DJGPP installation, not only the one where the +# package was configured. +# $INSTALL must be an absolute path name, otherwise config.status +# will try to prepend ./ and ../ to it when it goes into subdirs. +INSTALL=${INSTALL='/dev/env/DJDIR/bin/ginstall -c'} +RANLIB=${RANLIB='ranlib'} +GMSGFMT=${GMSGFMT='/dev/env/DJDIR/bin/msgfmt'} +MSGFMT=${MSGFMT='/dev/env/DJDIR/bin/msgfmt'} +XGETTEXT=${XGETTEXT='/dev/env/DJDIR/bin/xgettext'} +AWK=${AWK='gawk'} + +# A sane default for emacs. +ac_cv_path_EMACS=${EMACS='/dev/env/DJDIR/gnu/emacs/bin/emacs'} + +# A sane default for m4. +ac_cv_path_M4=${M4='/dev/env/DJDIR/bin/m4'} + +# A sane default for grep. +ac_cv_path_GREP=${GREP='/dev/env/DJDIR/bin/grep'} + +# A sane default for egrep. +ac_cv_path_EGREP=${EGREP='/dev/env/DJDIR/bin/egrep'} + +# A sane default for fgrep. +ac_cv_path_FGREP=${FGREP='/dev/env/DJDIR/bin/fgrep'} + +# A sane default for sed. +ac_cv_path_SED=${SED='/dev/env/DJDIR/bin/sed'} + +# A sane default for mkdir. +ac_cv_path_mkdir=${MKDIR_P='/dev/env/DJDIR/bin/mkdir -p'} + +# These are set here so the generated libtool will be good +# for every DJGPP installation, not only the one where the +# package was configured. +NM=${NM='nm'} +LD=${LD='ld'} + +# Force the test for 'ln -s' to report 'cp -pf'. +ac_cv_prog_LN_S='cp -pf' + +# There is no fork and vfork functionality. +ac_cv_func_fork=no +ac_cv_func_vfork=no +ac_cv_func_pipe=no diff --git a/djgpp/config_h.sed b/djgpp/config_h.sed new file mode 100644 index 0000000..5308d5d --- /dev/null +++ b/djgpp/config_h.sed @@ -0,0 +1,28 @@ +# sed script for DJGPP specific editing of config.hin + +# Copyright (C) 2005-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +$ a\ +\ +\ +/* DJGPP specific defines. */\ +\ +#include \ +#define TAB_EXT ((pathconf(NULL, _PC_NAME_MAX) > 12) ? ".tab" : "_tab")\ +#define OUTPUT_EXT ((pathconf(NULL, _PC_NAME_MAX) > 12) ? ".output" : ".out")\ +\ +#define DEFAULT_TMPDIR "/dev/env/DJDIR/tmp" diff --git a/djgpp/djunpack.bat b/djgpp/djunpack.bat new file mode 100644 index 0000000..59c8c63 --- /dev/null +++ b/djgpp/djunpack.bat @@ -0,0 +1,87 @@ +@echo off +Rem +Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line +Rem format, or else stock DOS/Windows shells will refuse to run it. +Rem +Rem This batch file unpacks the Bison distribution while simultaneously +Rem renaming some of the files whose names are invalid on DOS or conflict +Rem with other file names after truncation to DOS 8+3 namespace. +Rem +Rem Copyright (C) 2005-2015 Free Software Foundation, Inc. +Rem +Rem This program is free software: you can redistribute it and/or modify +Rem it under the terms of the GNU General Public License as published by +Rem the Free Software Foundation, either version 3 of the License, or +Rem (at your option) any later version. +Rem +Rem This program is distributed in the hope that it will be useful, +Rem but WITHOUT ANY WARRANTY; without even the implied warranty of +Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +Rem GNU General Public License for more details. +Rem +Rem You should have received a copy of the GNU General Public License +Rem along with this program. If not, see . +Rem +Rem +Rem Invoke like this: +Rem +Rem djunpack bison-XYZ.tar.gz +Rem or +Rem djunpack bison-XYZ.tar.bz2 +Rem +Rem where XYZ is the version number. If the argument includes leading +Rem directories, it MUST use backslashes, not forward slashes. +Rem + +set ENVIRONMENT_SIZE_TEST_STRING=ENVIRONMENT_SIZE_TEST_STRING +if "%ENVIRONMENT_SIZE_TEST_STRING%"=="ENVIRONMENT_SIZE_TEST_STRING" GoTo EnvOk +Rem If their environment space is too small, re-exec with a larger one +command.com /e:4096 /c %0 %1 +GoTo End + +:EnvOk +set ENVIRONMENT_SIZE_TEST_STRING= +if "%1" == "" GoTo NoArgument +if not exist %1 GoTo NoArchive +Rem Extract top src dir from archive file. +djtar -t %1 > top_src.dir +Rem The following uses a feature of COPY whereby it does not copy +Rem empty files. We need that because the previous line will create +Rem an empty fnchange.tmp even if the command failed for some reason. +copy top_src.dir junk.tmp > nul +if not exist junk.tmp GoTo NoDjTar +del junk.tmp +sed "1{s/^.*bison-/djtar -x -p -o bison-/;s|$|djgpp/fnchange.lst %%1 > fnchange.tmp|};2,$d" top_src.dir > ext_list.bat +Rem See the comment above about the reason for using COPY. +copy ext_list.bat junk.tmp > nul +if not exist junk.tmp GoTo NoSed +del junk.tmp +Rem Extract fnchange.lst from archive. +call ext_list.bat %1 +del ext_list.bat +sed "1{s|^.*bison-|s/@V@/bison-|;s|$|g|};2,$d" top_src.dir > version.sed +sed -f version.sed < fnchange.tmp > fnchange.lst +del version.sed +del fnchange.tmp +del top_src.dir +Rem unpack the source distribution +djtar -x -n fnchange.lst %1 +del fnchange.lst +GoTo End + +:NoSed +del junk.tmp +echo FAIL: Sed is not available. +GoTo End +:NoDjTar +del junk.tmp +echo FAIL: DJTAR is not available or no fnchange.lst file in %1. +GoTo End +:NoArchive +echo FAIL: the file %1 does not seem to exist. +echo Remember that %1 cannot use forward slashes, only backslashes. +GoTo End +:NoArgument +echo FAIL: no archive file has been specified. +echo Remember that the file name cannot use forward slashes, only backslashes. +:End diff --git a/djgpp/fnchange.lst b/djgpp/fnchange.lst new file mode 100644 index 0000000..1b43d9b --- /dev/null +++ b/djgpp/fnchange.lst @@ -0,0 +1,27 @@ +@V@/build-aux/javacomp.sh.in @V@/build-aux/javacomp.sh-in +@V@/build-aux/javaexec.sh.in @V@/build-aux/javaexec.sh-in +@V@/data/c++-skel.m4 @V@/data/cxx-skel.m4 +@V@/data/c++.m4 @V@/data/cxx.m4 +@V@/doc/yacc.1.in @V@/doc/yacc.1-in +@V@/etc/bench.pl.in @V@/etc/bench.pl-in +@V@/examples/calc++/ @V@/examples/calcxx/ +@V@/examples/calc++/Makefile.am @V@/examples/calcxx/Makefile.am +@V@/examples/calc++/Makefile.in @V@/examples/calcxx/Makefile.in +@V@/examples/calc++/calc++-scanner.cc @V@/examples/calcxx/calcxx-scanner.cc +@V@/examples/calc++/calc++-scanner.ll @V@/examples/calcxx/calcxx-scanner.ll +@V@/examples/calc++/calc++.cc @V@/examples/calcxx/calcxx.cc +@V@/examples/calc++/calc++-driver.hh @V@/examples/calcxx/calcxx-driver.hh +@V@/examples/calc++/calc++-driver.cc @V@/examples/calcxx/calcxx-driver.cc +@V@/examples/calc++/stack.hh @V@/examples/calcxx/stack.hh +@V@/examples/calc++/position.hh @V@/examples/calcxx/position.hh +@V@/examples/calc++/location.hh @V@/examples/calcxx/location.hh +@V@/examples/calc++/calc++-parser.hh @V@/examples/calcxx/calcxx-parser.hh +@V@/examples/calc++/calc++-parser.cc @V@/examples/calcxx/calcxx-parser.cc +@V@/examples/calc++/calc++-parser.stamp @V@/examples/calcxx/calcxx-parser.stamp +@V@/examples/calc++/calc++-parser.yy @V@/examples/calcxx/calcxx-parser.yy +@V@/examples/calc++/test @V@/examples/calcxx/test +@V@/po/Makefile.in.in @V@/po/Makefile.in-in +@V@/runtime-po/Makefile.in.in @V@/runtime-po/Makefile.in-in +@V@/src/scan-gram-c.c @V@/src/c-scan-gram.c +@V@/src/scan-skel-c.c @V@/src/c-scan-skel.c +@V@/tests/c++.at @V@/tests/cxx.at diff --git a/djgpp/local.mk b/djgpp/local.mk new file mode 100644 index 0000000..f510052 --- /dev/null +++ b/djgpp/local.mk @@ -0,0 +1,27 @@ +## Copyright (C) 2008-2015 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 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . + +EXTRA_DIST += \ + djgpp/Makefile.maint \ + djgpp/README.in \ + djgpp/config.bat \ + djgpp/config.sed \ + djgpp/config.site \ + djgpp/config_h.sed \ + djgpp/djunpack.bat \ + djgpp/fnchange.lst \ + djgpp/subpipe.c \ + djgpp/subpipe.h \ + djgpp/testsuite.sed diff --git a/djgpp/subpipe.c b/djgpp/subpipe.c new file mode 100644 index 0000000..47d2bd4 --- /dev/null +++ b/djgpp/subpipe.c @@ -0,0 +1,293 @@ +/* Subprocesses with pipes. + + Copyright (C) 2005-2015 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Juan Manuel Guerrero . */ + + +#include + +#include "subpipe.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "xalloc.h" + + +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif + + +#include "error.h" + +#include "gettext.h" +#define _(Msgid) gettext (Msgid) + + +/* Initialize this module. */ + + +static int old_stdin; +static int old_stdout; +static char **arguments; +static char tmp_file_name[2][L_tmpnam]; + +#define remove_tmp_file(fd, name) \ + do { \ + close ((fd)); \ + if (unlink ((name))) \ + error (EXIT_FAILURE, 0, _("removing of '%s' failed"), (name)); \ + } while (0) + + +void +init_subpipe(void) +{ + char *tmpdir; + int fd; + + tmpdir = getenv("TMPDIR"); + if (tmpdir == NULL) + tmpdir = getenv("TMP"); + if (tmpdir == NULL) + tmpdir = getenv("TEMP"); + if (access(tmpdir, D_OK)) + tmpdir = "."; + + strcpy(tmp_file_name[0], tmpdir); + strcat(tmp_file_name[0], "/bnXXXXXX"); + fd = mkstemp(tmp_file_name[0]); + if (fd < 0) + error(EXIT_FAILURE, 0, _("creation of a temporary file failed")); + close (fd); + + strcpy(tmp_file_name[1], tmpdir); + strcat(tmp_file_name[1], "/bnXXXXXX"); + fd = mkstemp(tmp_file_name[1]); + if (fd < 0) + error(EXIT_FAILURE, 0, _("creation of a temporary file failed")); + close (fd); +} + + +/* Create a subprocess that is run as a filter. ARGV is the + NULL-terminated argument vector for the subprocess. Store read and + write file descriptors for communication with the subprocess into + FD[0] and FD[1]: input meant for the process can be written into + FD[0], and output from the process can be read from FD[1]. Return + the subprocess id. + + Because DOS has neither fork nor pipe functionality to run the subprocess + as a filter, the filter is reproduced using temporary files. First bison's + stdout is redirected to a temporary file. After bison has produced all of + is output, this file is closed and connected to m4's stdin. All m4's output + is redirected from m4's stdout to a second temporary file and reopened as + bison's stdin. */ + +pid_t +create_subpipe(char const *const *argv, int fd[2]) +{ + int argc; + int from_in_fd; /* pipe from bison to m4. */ + pid_t pid; + + + pid = getpid(); + + /* + * Save original stdin and stdout + * for later restauration. + */ + old_stdin = dup(STDIN_FILENO); + if (old_stdin < 0) + error(EXIT_FAILURE, 0, _("saving stdin failed")); + + old_stdout = dup(STDOUT_FILENO); + if (old_stdout < 0) + error(EXIT_FAILURE, 0, _("saving stdout failed")); + + /* + * Save argv for later use. + */ + for (argc = 0; argv[argc]; argc++) + ; + argc++; + arguments = xmalloc(argc * sizeof(arguments[0])); + for (argc = 0; argv[argc]; argc++) + { + arguments[argc] = xmalloc((strlen(argv[argc]) + 1) * sizeof(arguments[0][0])); + strcpy(arguments[argc], argv[argc]); + } + arguments[argc] = NULL; + + /* + * All bison's output will be gathered in this temporary file + * and will be redirected to m4's stdin. + */ + from_in_fd = open(tmp_file_name[0], O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR); + if (from_in_fd < 0) + error(EXIT_FAILURE, 0, _("opening of tmpfile failed")); + if (dup2(from_in_fd, STDOUT_FILENO) < 0) + { + remove_tmp_file(from_in_fd, tmp_file_name[0]); + error(EXIT_FAILURE, 0, _("redirecting bison's stdout to the temporary file failed")); + } + close(from_in_fd); + + + fd[0] = STDOUT_FILENO; + return pid; +} + + +/* A signal handler that just records that a signal has happened. */ +static int child_interrupted; + +static void +signal_catcher(int signo) +{ + child_interrupted++; +} + + +void +end_of_output_subpipe(pid_t pid, int fd[2]) +{ + char *program; + int from_out_fd = open(tmp_file_name[0], O_RDONLY, S_IRUSR); /* pipe from bison to m4. */ + int to_in_fd = open(tmp_file_name[1], O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR); /* pipe from m4 to bison. */ + int status; + void (*previous_handler)(int); + + + program = strrchr(arguments[0], '/'); + if (program) + program++; + else + program = arguments[0]; + + /* + * Redirect bison's output to m4's stdin. + */ + if (from_out_fd < 0) + error(EXIT_FAILURE, 0, _("opening of tmpfile failed")); + if (dup2(from_out_fd, STDIN_FILENO) < 0) + { + remove_tmp_file(from_out_fd, tmp_file_name[0]); + error(EXIT_FAILURE, 0, _("redirecting m4's stdin from the temporary file failed")); + } + close(from_out_fd); + + /* + * All m4's output will be gathered in this temporary file + * and will be redirected to bison's stdin. + */ + if (to_in_fd < 0) + { + remove_tmp_file(STDIN_FILENO, tmp_file_name[0]); + error(EXIT_FAILURE, 0, _("opening of a temporary file failed")); + } + if (dup2(to_in_fd, STDOUT_FILENO) < 0) + { + remove_tmp_file(STDIN_FILENO, tmp_file_name[0]); + remove_tmp_file(to_in_fd, tmp_file_name[1]); + error(EXIT_FAILURE, 0, _("redirecting m4's stdout to a temporary file failed")); + } + close(to_in_fd); + + /* + * Run m4. + */ + child_interrupted = 0; + errno = 0; + previous_handler = signal(SIGINT, signal_catcher); + status = spawnvp(P_WAIT, program, arguments); + signal(SIGINT, previous_handler); + if (child_interrupted) + { + remove_tmp_file(STDIN_FILENO, tmp_file_name[0]); + remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]); + error(EXIT_FAILURE, 0, _("subsidiary program '%s' interrupted"), program); + } + if (status) + { + remove_tmp_file(STDIN_FILENO, tmp_file_name[0]); + remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]); + error(EXIT_FAILURE, 0, _(errno == ENOENT + ? "subsidiary program '%s' not found" + : status < 1 + ? "subsidiary program '%s' failed" + : "subsidiary program '%s' failed (status=%i, errno=%i)"), program, status, errno); + } + + + /* + * Redirect m4's output to bison's stdin. + */ + if (dup2(old_stdout, STDOUT_FILENO) < 0) + error(EXIT_FAILURE, 0, "restore of bison's stdout failed"); + close(old_stdout); + to_in_fd = open(tmp_file_name[1], O_RDONLY, S_IRUSR); /* pipe from m4 to bison. */ + if (to_in_fd < 0) + { + remove_tmp_file(STDIN_FILENO, tmp_file_name[0]); + error(EXIT_FAILURE, 0, _("opening of tmpfile failed")); + } + if (dup2(to_in_fd, STDIN_FILENO) < 0) + { + remove_tmp_file(STDIN_FILENO, tmp_file_name[0]); + remove_tmp_file(to_in_fd, tmp_file_name[1]); + error(EXIT_FAILURE, -1, "dup2"); + error(EXIT_FAILURE, 0, _("redirecting bison's stdin from the temporary file failed")); + } + close(to_in_fd); + + + fd[1] = STDIN_FILENO; +} + + +/* Free resources, unlink temporary files and restore stdin and stdout. */ + +void +reap_subpipe(pid_t pid, char const *program) +{ + int argc; + + for (argc = 0; arguments[argc]; argc++) + free(arguments[argc]); + free(arguments); + + if (unlink(tmp_file_name[0])) + error(EXIT_FAILURE, 0, _("removing of '%s' failed"), tmp_file_name[0]); + if (unlink(tmp_file_name[1])) + error(EXIT_FAILURE, 0, _("removing of '%s' failed"), tmp_file_name[1]); + + if (dup2(old_stdin, STDIN_FILENO) < 0) + error(EXIT_FAILURE, 0, "restore of bison's stdin failed"); + close(old_stdin); +} diff --git a/djgpp/subpipe.h b/djgpp/subpipe.h new file mode 100644 index 0000000..92a26d1 --- /dev/null +++ b/djgpp/subpipe.h @@ -0,0 +1,27 @@ +/* Subprocesses with pipes. + + Copyright (C) 2005-2015 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Juan Manuel Guerrero . */ + +#if HAVE_SYS_TYPES_H +# include +#endif + +void init_subpipe(void); +pid_t create_subpipe(char const * const *, int[2]); +void end_of_output_subpipe(pid_t, int[2]); +void reap_subpipe(pid_t, char const *); diff --git a/djgpp/testsuite.sed b/djgpp/testsuite.sed new file mode 100644 index 0000000..0ba27ee --- /dev/null +++ b/djgpp/testsuite.sed @@ -0,0 +1,23 @@ +# DJGPP specific configuration file. +# Sed script for additional DJGPP specific editing +# of the testsuite script generated by autoconf 2.61. + +# Copyright (C) 2007-2015 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# Remove disallowed characters from file names. + +s/~!@#\\\$%^&\*()-=_+{}\[\]|\\\\:;<>, ./~!@#\\$%^\&()-=_+{}[];, ./g diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in new file mode 100644 index 0000000..85aea94 --- /dev/null +++ b/doc/Doxyfile.in @@ -0,0 +1,2318 @@ +# Doxyfile 1.8.7 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "@PACKAGE_NAME@" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = "@PACKAGE_VERSION@" + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Generate a deterministic LR or generalized LR (GLR) parser employing LALR(1), IELR(1), or canonical LR(1) parser tables." + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @top_builddir@/doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = YES + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = @top_srcdir@/src \ + @top_builddir@/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = *.c \ + *.h \ + *.l \ + *.y + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = @top_builddir@/src/scan-gram.c \ + @top_builddir@/src/scan-skel.c \ + @top_srcdir@/src/parse-*.[ch] + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = YES + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /