From 709fb3fcd188c7852a4c29e17b21d8bb3353f1b7 Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 25 2020 18:16:32 +0000 Subject: grep-3.1 base --- diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..22636cb --- /dev/null +++ b/.mailmap @@ -0,0 +1,12 @@ +# Map git author names and email addresses to canonical/preferred form. + + + +Paul Eggert +Paul Eggert + + + + +# Correct misspelled last name +Norihiro Tanaka Norihirio Tanaka diff --git a/.tarball-version b/.tarball-version new file mode 100644 index 0000000..8c50098 --- /dev/null +++ b/.tarball-version @@ -0,0 +1 @@ +3.1 diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..b1de1b6 --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,1282 @@ +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. + +1.1 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. Installers may use special +options at configuration time for changing the default behaviour. The +command: + + ./configure --disable-nls + +will _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' library +and will decide to use it. If not, you may have to to use the +`--with-libintl-prefix' option to tell `configure' where to look for it. + + 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.2 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.3 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.4 Available Packages +====================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of June +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 an ar as ast az be be@latin bg bn_IN bs ca + +--------------------------------------------------+ + 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 an ar as ast az be be@latin bg bn_IN bs ca + 6 0 1 2 3 19 1 10 3 28 3 1 38 + + crh cs da de el en en_GB en_ZA eo es et eu fa + +-------------------------------------------------+ + 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 | [] [] [] [] [] [] | + +-------------------------------------------------+ + crh cs da de el en en_GB en_ZA eo es et eu fa + 5 64 105 117 18 1 8 0 28 89 18 19 0 + + fi 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 | [] [] [] [] [] | + +----------------------------------------------------+ + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + 105 121 53 20 4 8 3 5 53 2 120 5 84 67 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 13 48 4 2 2 4 24 10 20 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 62 47 91 3 54 46 9 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 | [] [] [] | 12 + 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 | [] [] [] [] [] [] | 14 + 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 | [] [] [] [] [] [] [] | 29 + gettext-tools | [] [] [] [] [] [] | 22 + gip | [] [] [] [] | 22 + gjay | [] | 3 + gliv | [] [] [] | 14 + glunarclock | [] [] [] [] [] | 19 + gnubiff | [] [] | 4 + gnucash | () [] () [] () | 10 + 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 | [] [] [] [] | 26 + gst-plugins-base | [] [] [] [] [] | 24 + gst-plugins-good | [] [] [] [] | 24 + 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 | [] () | 7 + libextractor | [] | 1 + libgnutls | [] [] [] | 9 + libgpewidget | [] [] [] | 14 + libgpg-error | [] [] [] | 9 + libgphoto2 | [] [] | 8 + libgphoto2_port | [] [] [] [] | 14 + 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 | [] [] [] [] [] | 17 + 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 | [] [] [] [] [] [] [] [] [] [] | 63 + xkeyboard-config | [] [] [] | 22 + +---------------------------------------------------+ + 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 + + 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 June 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.5 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..8417b63 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,61 @@ + Copyright (C) 1992, 1997-2002, 2004-2017 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. + +Mike Haertel wrote the main program and the dfa and kwset matchers. + +Arthur David Olson contributed the heuristics for finding fixed substrings +at the end of dfa.c. + +Richard Stallman and Karl Berry wrote the regex backtracking matcher. + +Henry Spencer wrote the original test suite from which grep's was derived. + +Scott Anderson invented the Khadafy test. + +David MacKenzie wrote the automatic configuration software use to +produce the configure script. + +Authors of the replacements for standard library routines are identified +in the corresponding source files. + +The idea of using Boyer-Moore type algorithms to quickly filter out +non-matching text before calling the regexp matcher was originally due +to James Woods. He also contributed some code to early versions of +GNU grep. + +Mike Haertel would like to thank Andrew Hume for many fascinating discussions +of string searching issues over the years. Hume & Sunday's excellent +paper on fast string searching (AT&T Bell Laboratories CSTR #156) +describes some of the history of the subject, as well as providing +exhaustive performance analysis of various implementation alternatives. +The inner loop of GNU grep is similar to Hume & Sunday's recommended +"Tuned Boyer Moore" inner loop. + +More work was done on regex.[ch] by Ulrich Drepper and Arnold +Robbins. Regex is now part of GNU C library, see this package +for complete details and credits. + +Arnold Robbins contributed to improve dfa.[ch]. In fact +it came straight from gawk-3.0.3 with small editing and fixes. + +Many folks contributed. See THANKS; if I omitted someone please +send me email. + +Alain Magloire maintained GNU grep until version 2.5e. + +Bernhard "Bero" Rosenkränzer maintained GNU grep until +version 2.5.1, ie. from Sep 2001 till 2003. + +Stepan Kasal maintained GNU grep since Feb 2004. + +Tony Abou-Assaleh maintains GNU grep since Oct 2007. + +Jim Meyering and Paolo Bonzini +began maintaining GNU grep in Nov 2009. Paolo bowed out in 2012. + +;; Local Variables: +;; coding: utf-8 +;; End: diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..a737dcf --- /dev/null +++ b/COPYING @@ -0,0 +1,675 @@ + + 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..d35e237 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,11008 @@ +2017-07-02 Jim Meyering + + version 3.1 + * NEWS: Record release date. + +2017-07-01 Jim Meyering + + tests: avoid false failures when run in qemu user mode + * tests/filename-lineno.pl: Derive the program name that grep + will use in diagnostics, based on a suggestion from Assaf Gordon. + * tests/in-eq-out-infloop: Similar: accept an arbitrary "command_name: " + prefix on checked diagnostics, rather than requiring "grep: ". + * tests/reversed-range-endpoints: Likewise. + * tests/write-error-msg: Likewise. + Reported by Bruno Haible in http://bugs.gnu.org/27532 + +2017-06-25 Jim Meyering + + gnulib: update to latest + * gnulib: Update to latest for these portability fixes: + - stat: port to xlc 12.01 + - xalloc-oversized: port to icc + + doc: fix another typo + * doc/grep.texi (File and Directory Selection): Fix typo: s/afer/after/ + +2017-06-24 Jim Meyering + + doc: stop calling --perl-regexp (-P) "highly" experimental + Use wording that is less likely to make readers think that + support for -P may be removed. + * doc/grep.in.1: s/highly experimental/experimental/ + * doc/grep.texi: Likewise. + Suggested by Evan Sheahan. + +2017-06-21 Jim Meyering + + doc: correct typo + * doc/grep.texi (Performance): s/suprisingly/surprisingly/ + + gnulib: update to latest + +2017-06-21 Paul Eggert + + grep: -m no longer cuts off trailing context + Problem reported by Markus Jochim (Bug#26254). + * NEWS, doc/grep.texi (General Output Control): Document this. + * src/grep.c (prpending): Selected lines no longer cut off context. + (usage): Say "selected" instead of "matching", where appropriate. + * tests/foad1, tests/max-count-vs-context, tests/yesno: + Adjust to match new behavior. + +2017-05-31 Paul Eggert + + Document grep performance + * doc/grep.texi (Performance): New section. + + build: update gnulib submodule to latest + +2017-05-21 Jim Meyering + + maint: make the announcement template Cc the devel- list + * cfg.mk (announcement_Cc_): Define. + + gnulib: update to latest; and update tests/init.sh + + maint: accommodate GCC7's -Werror=duplicated-branches + * src/system.h (IGNORE_DUPLICATE_BRANCH_WARNING): Define. + * src/grep.c (grepfile): Use it. + * src/kwset.c (bmexec, acexec): Use it. + + maint: update to work with GCC7's -Werror=implicit-fallthrough= + * src/system.h (FALLTHROUGH): Define. + * src/grep.c (context_length_arg): Use new FALLTHROUGH macro in place + of comments + (fgrep_to_grep_pattern, try_fgrep_pattern, main): Likewise. + +2017-05-13 Jim Meyering + + gnulib: update to latest and adapt src/kwset.c + * gnulib: Update to latest. + * src/kwset.c: Include "verify.h" for use of assume. + +2017-03-22 Jim Meyering + + gnulib: update to latest for dfa [0-9] performance improvement + This pulls in the following change that is very relevant to grep: + + commit 6afba02d7869d39ed7f61981045ddbdcb2814101 + Author: Paul Eggert + dfa: make [0-9] faster in non-C locales + + * gnulib: Update to latest. + * NEWS (Improvements): Describe the effect on grep. + +2017-03-05 Jim Meyering + + build: use $(builddir), not $(srcdir) + * cfg.mk (PATH): Use $(builddir), so this also takes effect + in a non-srcdir build. Also, switch ${PATH} syntax to $(PATH). + +2017-03-05 Juan Manuel Guerrero + + build: use $(PATH_SEPARATOR), not ":" to augment PATH + * cfg.mk (PATH): Use $(PATH_SEPARATOR), for those systems that + use something other than ":". + * THANKS.in: Remove name, to avoid syntax-check failure due to + the duplicate, now that there is this commit. + +2017-02-17 Jim Meyering + + maint: fix distcheck failure: remove stale dosbuf.c reference + * src/Makefile.am (EXTRA_DIST): Do not attempt to distribute + the recently deleted file, dosbuf.c. + + maint: fix new syntax-check errors + * po/POTFILES.in: Add lib/xbinary-io.c. + * cfg.mk (FILTER_LONG_LINES): Add TODO to the list of exempt files. + +2017-02-16 Paul Eggert + + Fix up recent -U patches + Inspired by a suggestion by Eric Blake (Bug#25707#17). + * bootstrap.conf (gnulib_modules): Add xbinary-io, + and remove binary-io and xfreopen. + * doc/grep.texi (Other Options): + Fix typo and reword to be a bit more general. + * src/grep.c: Include xbinary-io.h instead of xfreopen.h. + (grepfile): Open with O_BINARY if binary. + (grepdesc): No need for set_binary_mode now. + (grep_command_line_arg, main): Set stdin to binary mode if binary. + (main): Avoid unnecessary test of stdin == NULL. + Use xsetmode instead of xfreopen. + * src/system.h: Do not include binary-io.h. + + build: update gnulib submodule to latest + + Simplify -U on MS-Windows by removing guesswork + Suggested by Eric Blake (Bug#25707#11). + * NEWS, doc/grep.texi: Document this. + * src/dosbuf.c: Remove. + * bootstrap.conf (gnulib_modules): Add xfreopen. + * src/grep.c: Include xfreopen.h, not dosbuf.c. + (fillbuf, print_line_head): Do not undossify input. + (binary): New static var. + (grepdesc): Apply BINARY to input file. + (usage): Remove -u help. + (main): Set BINARY if -U, and apply it to stdout. Do nothing if -u. + With -f, apply BINARY to input file. + +2017-02-16 Eric Blake + + grep: don't forcefully strip carriage returns + Commit 5c92a54 made the mistaken assumption that using fopen("rt") + on platforms where O_TEXT is non-zero makes sense. However, POSIX + already requires fopen("r") to open a file in text mode, vs. + fopen("rb") when binary mode is wanted, and at least on Cygwin, + where it is possible to control whether a mount point is binary + or text by default (using just "r"), the use of fopen("rt") actively + breaks assumptions on a binary mount by silently corrupting any + carriage returns that are supposed to be preserved. + + * src/grep.c (main): Never use fopen("rt") (Bug#25707). + +2017-02-13 Paul Eggert + + Update TODO and doc + * TODO: Bring up-to-date and fix formatting glitches. + * doc/grep.in.1, doc/grep.texi: Fix minor glitches. + The above patches should address the same problems that recent + Debian doc patches address, albeit in a different way. + +2017-02-12 Paul Eggert + + doc: clarify default input (Bug#25651) + * doc/grep.in.1: + * src/grep.c (usage): Clarify default input when -r. + * src/grep.c (usage): Do not bother documenting egrep and fgrep; + the manual is enough. + +2017-02-09 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 3.0 + * NEWS: Record release date. + +2017-02-08 Paul Eggert + + grep: do not mishandle \. in multiple patterns + Problem reported by Lars Wendler (Bug#25655). + * NEWS: Document this. + * src/grep.c (try_fgrep_pattern): Fix typo that prevented + keys from being properly updated. + * tests/foad1: Test for the bug. + +2017-02-07 Paul Eggert + + Do not assume PCRE 8.20 or later + Problem reported by Zube (Bug#25647) + * NEWS: Document this. + * src/pcresearch.c (struct pcre.com.jit_stack): + Declare only if PCRE_STUDY_JIT_COMPILE. + +2017-02-06 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.28 + * NEWS: Record release date. + +2017-02-02 Jim Meyering + + gnulib: update to latest + +2017-02-01 Paul Eggert + + grep: tune to avoid memchr2 sometimes + Problem noted by Norihiro Tanaka in: + http://lists.gnu.org/archive/html/grep-devel/2017-01/msg00027.html + Although not enough to restore all the previous performance in the + case he noted, it helps significantly. + * src/kwset.c (memchr_kwset): Bring back small_heuristic, + in a somewhat different form. + +2017-01-29 Jim Meyering + + gnulib: update to latest + +2017-01-23 Paul Eggert + + grep: simplify recent kwset change + * src/kwset.c (acexec_trans): Simplify. + +2017-01-23 Jim Meyering + + tests: really add the new test name + * tests/Makefile.am (TESTS): Add fgrep-longest. + +2017-01-21 Norihiro Tanaka + + grep -Fo could report a match that is not the longest + * src/kwset.c (acexec): Fix it. + * tests/fgrep-longest: New test. + * tests/Makefile.am: Add the test. + * NEWS: Mention it. + +2017-01-18 Paul Eggert + + grep: speed up Aho-Corasick when at most 2 bytes + When using Aho-Corasick and all matched strings either begin with + the same byte, or begin with one of at most two bytes, use memchr2 + to search for these matching bytes and apply the Aho-Corasick + algorithm only when a memchr2 match is found. On my platform, + this speeds up 'grep -F -e aa -e ba in' by a factor of 7, where + the file 'in' was created by 'seq -f %040.0f 10000000 >in'. + * src/kwset.c (struct kwset.gc1): Now int, not char. + If negative, there is no single terminal byte. All uses changed. + (struct kwset.gc1help): Now int, not char. + If negative, memchr2 cannot be used. + (kwsprep): Set up gc1 and gc1help from kwset->next, with + the new (slightly changed) interpretation. + (memchr_kwset): Use memchr2 if possible. + Adjust to match new meaning of gc1, gc1help. + (memoff2_kwset): Remove; no longer needed. + (acexec_trans): Use memchr_kwset when possible, for speed. + It now supersedes memoff2_kwset. + + grep: remove Commentz-Walter code + This code was not being used, and complicated maintenance. + We can bring it back from the repository if it turns out + to be useful later. + * src/kwset.c (struct kwset.reverse): Remove. All uses of + FOO->reverse replaced by (FOO->kwsexec == bmexec). + (kwsalloc): Remove 'reverse' arg, as callers outside this + module do not care about algorithm choice. All callers changed. + (kwsprep): When deciding whether to use Boyer-Moore, do not worry + about being called twice on the same kwset, as that is not allowed. + (cwexec): Remove; it was never called. All uses removed. + +2017-01-17 Jim Meyering + + maint: avoid new syntax-check failures + * src/kwset.c (struct kwset): Split a line longer than 80. + * bootstrap: Update from gnulib. This fixes a new syntax-check + failure due to its use of "time stamp". + +2017-01-17 Paul Eggert + + * NEWS: Fix typo. + + * src/kwset.c: Fix comment typo. + + Improve -i performance in typical UTF-8 searches + Currently ‘grep -i i’ is slow in a UTF-8 locale, because ‘i’ in + the pattern matches the two-byte character 'ı' (U+0131, LATIN + SMALL LETTER DOTLESS I) in data, and kwset handles only + single-byte character translations, so grep falls back on a slower + DFA-based search for all searches. Improve -i performance in the + typical case by using kwset when data are free of troublesome + characters like 'ı', falling back on the DFA only when data + contain troublesome characters. + * src/dfasearch.c (GEAcompile): + * src/grep.c (compile_fp_t): + * src/kwsearch.c (Fcompile): + * src/pcresearch.c (Pcompile): + Pattern arg is now char *, not char const *, since Fcompile + now reallocates it sometimes. + * src/grep.c (all_single_byte_after_folding): Remove. + All callers removed. + (fgrep_icase_charlen): New function. + (fgrep_icase_available, try_fgrep_pattern): + Use it, for more-generous semantics. + (fgrep_to_grep_pattern): Now extern. + (main): Do not free keys, since Fexecute may use them. + * src/kwsearch.c (struct kwsearch): New struct. + (Fcompile): Return it. If -i, be more generous about patterns. + (Fexecute): Use it. Fall back on DFA when the data contain + troublesome characters; this should be rare in practice. + * src/kwset.c, src/kwset.h (kwswords): New function. + + build: update gnulib submodule to latest + +2017-01-15 Paul Eggert + + dfa: prefer ptrdiff_t to size_t + The code already cannot handle objects with size greater than + SIZE_MAX / 2, so be more honest about it and use ptrdiff_t instead + of size_t. ptrdiff_t arithmetic is signed, which allows for more + checking via -fsanitize=undefined. It also makes the code a tad + smaller on x86-64, since it can test for < 0 rather than for == + SIZE_MAX. + * src/dfasearch.c (struct dfa_comp.kwset_exact_matches): + (kwsmusts, EGexecute): + * src/kwsearch.c (Fcompile, Fexecute): + * src/kwset.c (struct kwset.kwsexec, kwsincr, memchr_kwset) + (memoff2_kwset, bmexec_trans, bmexec, cwexec, acexec_trans) + (acexec, kwsexec): + * src/kwset.h (struct kwsmatch.index, .offset, .size): + Prefer ptrdiff_t to size_t where either will do. + +2017-01-11 Paul Eggert + + grep: improve comments, mostly in kwset + Remove kwset.h comments that are obsolete and seemingly not + maintained anyway; people can look in kwset.c instead. + Update comments to reflect current behavior better. + Cite Faro & Lecroq 2013. Use GNU style for end-of-sentence. + +2017-01-01 Jim Meyering + + maint: update gnulib and copyright dates for 2017 + * gnulib: Update to latest. + * all files: Run "make update-copyright". + +2016-12-31 Paul Eggert + + grep: speed up -x with many patterns + * src/kwsearch.c (Fcompile): Improve buffer allocation overhead + with -x and multiple patterns. In the common case where '\n' is + the end-of-line byte, avoid copying other than the first and last + patterns. + +2016-12-31 Jim Meyering + + gnulib: update to latest, fixing a parallel getopt test failure + +2016-12-29 Paul Eggert + + maint: space before paren + + grep: int cleanup in kwset.c + This should affect only theoretical bugs with very large inputs. + On my platform, this patch shrinks the grep text by 136 bytes. + * src/kwset.c: Include intprops.h, for INT_MULTIPLY_WRAPV. + (struct trie, struct kwset, kwsalloc, kwsincr, treedelta, kwsprep) + (bm_delta2_search, bmexec_trans, cwexec): Prefer ptrdiff_t to int + when counts can exceed INT_MAX in large inputs, at least in theory. + (hasevery): Use bool for booleans. + (bmexec_trans): Avoid undefined behavior on integer overflow. + +2016-12-27 Norihiro Tanaka + + grep: improve performance with multiple patterns + * src/grep.c (main): Avoid fgrep-to-grep conversion for word matching + with multiple patterns in single byte locales. + +2016-12-27 Paul Eggert + + * NEWS: Fix typo. + + grep: fix bug with '... | grep pat >> /dev/null' + Problem reported by Benno Fünfstück (Bug#25283). + * NEWS: Document this. + * src/grep.c (drain_input) [SPLICE_F_MOVE]: + Don't assume /dev/null is always acceptable output to splice. + * tests/grep-dev-null-out: Test for the bug. + +2016-12-26 Paul Eggert + + grep: minor performance tweak for pure functions + * src/search.h (wordchars_size, wordchar_next, wordchar_prev): + Declare to be pure. + +2016-12-25 Zev Weiss + + grep: move localeinfo to grep.c + It's not really dfasearch-specific, and grep.c initializes it, so it + seems like the most appropriate "owner". + + * src/dfasearch.c (localeinfo): Remove. + * src/grep.c (localeinfo): Add. + * src/search.h (localeinfo): Move to new commented section. + +2016-12-25 Zev Weiss + + pcresearch: thread safety + * src/pcresearch.c (pcre_comp): New struct to hold previously-global + state. + (jit_exec): Operate on a pcre_comp parameter instead of global state. + (Pcompile): Allocate and return a pcre_comp instead of setting global + variables. + (Pexecute): Operate on a pcre_comp parameter instead of global state. + + kwsearch: thread safety + * src/kwsearch.c (Fcompile): Return a kwset_t instead of setting a + global variable. + (Fexecute): Use a passed-in kwset_t instead of a global variable. + (kwset): Remove global variable. + + dfasearch: thread safety + * src/dfasearch.c (struct dfa_comp): New struct to hold + previously-global variables. + (dfawarn): Remove static variable. + (kwsmusts): Operate on a dfa_comp parameter instead of global + variables. + (GEAcompile): Allocate and return a dfa_comp struct instead of setting + global variables. + (EGexecute): Operate on a dfa_comp parameter instead of global + variables. + * src/searchutils.c (kwsinit): Replace a static array with a + dynamically-allocated one. + +2016-12-25 Zev Weiss + + grep: prepare search backends for thread-safety + To facilitate removing mutable global state from search backends, + compile() functions will return an opaque pointer to backend-specific + data, which must then be passed back into the corresponding execute() + function. This is merely a preparatory step changing function + signatures and call sites, so the pointers passed & returned are + dummies for now and not (yet) actually used. + + * src/grep.c (compile_fp_t): Now returns an opaque pointer (the + compiled pattern). + (execute_fp_t): Now passed the pointer returned by a compile_fp_t. + All call sites updated accordingly. + (compiled_pattern): New static variable. + * src/dfasearch.c (GEAcompile): Return a void pointer (dummy NULL). + (EGexecute): Receive a void pointer argument (unused). + * src/kwsearch.c (Fcompile): Return a void pointer (dummy NULL). + (Fexecute): Receive a void pointer argument (unused). + * src/pcresearch.c (Pcompile): Return a void pointer (dummy NULL). + (Pexecute): Receive a void pointer argument (unused). + * src/search.h: Update compile/execute function prototypes. + +2016-12-24 Jim Meyering + + maint: fix "syntax-check" failure + * src/grep.c (SEP_STR_GROUP): Declare "static". + +2016-12-23 Paul Eggert + + grep: fix comment in searchutils.c + + grep: improve word checking with UTF-8 + * src/searchutils.c: Do not include . + (word_start): Remove, replacing with ... + (sbwordchar): New static var. All uses changed. + (wordchar_prev): Return size_t, not bool, as this generates + slightly better code. Go back faster if UTF-8. + + grep: standardize on localeinfo.multibyte + * src/dfasearch.c (EGexecute): + * src/grep.c (main): + * src/kwsearch.c (Fexecute): + * src/pcresearch.c (Pcompile): + Prefer localeinfo.multibyte to (MB_CUR_MAX > 1). + + grep: speed up -wf in C locale + Problem reported by Norihiro Tanaka (Bug#22357#100). + This patch improves the performance on that benchmark on my + platform so that grep is now only about 2x slower than grep 2.26, + which means it is considerably faster than grep 2.25 and earlier. + * src/kwsearch.c (Fexecute): + Use wordchars_size to boost performance for this case. + * src/search.h, src/searchutils.c (wordchars_size): New function. + + grep: specialize word-finding functions + This improves performance a bit. + * src/dfasearch.c, src/kwsearch.c (wordchar): + Remove; now in searchutils.c. + * src/grep.c (main): Call wordinit if -w. + * src/search.h: Adjust. + * src/searchutils.c: Include verify.h. + (word_start): New static var. + (wordchar): Move here from dfasearch.c and kwsearch.c. + (wordinit, wordchars_count, wordchar_next, wordchar_prev): + New functions. + (mb_prev_wc, mb_next_wc): Remove. + All callers changed to use the new functions instead. + + grep: simplify Fexecute + * src/kwsearch.c (Fexecute): Avoid the need for a 'try' local or + for a 'goto success'. Update mb_start to reflect newline found. + + grep: remove C label + * src/kwsearch.c (Fexecute): Remove label. + + maint: rewrite to avoid some macros + These days, the dangerous powers of C macros are not needed if + constants or functions will do just as well. + * src/grep.c (SEP_CHAR_SELECTED, SEP_CHAR_REJECTED, SEP_STR_GROUP) + (INITIAL_BUFSIZE): + * src/kwset.c (DEPTH_SIZE): + Now constants, not macros. + * src/kwset.c (link): Remove macro. Instead, rename local vars + from 'link' to 'cur'. + (malloc) [GREP]: Remove macro. All uses of malloc changed to xmalloc. + Omit double-inclusion of xalloc.h. Do not depend on 'GREP'. + (U): Now a function, not a macro. + * src/kwset.c, src/searchutils.c (NCHAR): Move this macro to ... + * src/system.h: ... here, and make it a constant. + +2016-12-20 Paul Eggert + + grep: fix performance with multiple patterns + Problem reported by Jaroslav Skarvada (Bug#22357). + * NEWS: Document this and other recent performance fixes. + * src/grep.c (E_MATCHER_INDEX): New constant. + (all_single_byte_after_folding): + New function, split out from fgrep_icase_available. + (fgrep_icase_available): Use it. + (try_fgrep_pattern): New function, which also uses it. + (main): With two or more patterns, use try_fgrep_pattern to fix + performance regression. The number "two" here is just a heuristic. + + grep: simplify matcher configuration + * src/grep.c (matcher, compile): Remove static vars. + (compile_fp_t): Now takes a 3rd syntax argument. + (Gcomppile, Ecompile, Acompile, GAcompile, PAcompile): Remove. + (struct matcher): Now nameless, since it is used only once. + Make 'name' a bit shorter. New member 'syntax'. + (matchers): Initialize it, and change removed functions to GEAcompile. + (F_MATCHER_INDEX, G_MATCHER_INDEX): New constants. + (setmatcher): New arg MATCHER, and return new matcher index. + Avoid unnecessary call to strcmp. + (main): Keep matcher as a local int, not a global pointer. + * src/kwsearch.c (Fcompile): + * src/pcresearch.c (Pcompile): Ignore the 3rd syntax argument. + + grep: simplify line counting in patterns + * src/grep.c (n_patterns): Rename from patfile_lineno, + as it is now origin-zero. Now size_t, not uintmax_t. + (count_nl_bytes, fl_add): Simplify to just buffer and size. + All callers changed. + +2016-12-19 Paul Eggert + + build: update gnulib submodule to latest + +2016-12-18 Paul Eggert + + build: update gnulib submodule to latest + + build: update gnulib submodule to latest + +2016-12-13 Jim Meyering + + tests: use just-built grep in more places + * cfg.mk (PATH): Prepend $(srcdir)/src, so that we use the just- + built grep also when running commands like those of "make distcheck". + This would have avoided the recently-luckily-noticed infloop bug. + Tested by running this in a just-built directory: + f=src/grep; printf '%s\n' '#!/bin/sh' 'sleep 9h' > $f; chmod a+x $f + and then verifying that nearly every "make syntax-check" rule hangs. + + maint: tell "syntax-check" not to worry about the NEWS update + Whenever we change "old" NEWS, we have to update this checksum. + Otherwise, a "make syntax-check" test that guards against a class + of logical merge conflicts will fail. + * cfg.mk (old_NEWS_hash): Update this hash to accommodate the + recent clarification of a 2.27 NEWS entry. + +2016-12-13 Arnold D. Robbins + + build: update gnulib submodule to latest + * src/dfasearch.c (GEAcompile): Remove use of flag, RE_ICASE covers it. + +2016-12-12 Paul Eggert + + grep: work around proc lseek glitch + Problem reported by Andreas Schwab (Bug#25180). + * NEWS: Document this. + * src/grep.c (finalize_input): Ignore EINVAL lseek failures. + * tests/Makefile.am (TESTS): Add proc. + * tests/proc: New file. + +2016-12-07 Paul Eggert + + grep: simplify finalize_input + * src/grep.c (finalize_input): Simplify without changing behavior. + It's still a bit of a rat's-nest, but it's a cozier rat's-nest. + + maint: clarify early-exit news for 2.27 + * NEWS: Mention early-exit options to avoid confusion. See: + http://lists.gnu.org/archive/html/grep-devel/2016-12/msg00007.html + +2016-12-06 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.27 + * NEWS: Record release date. + +2016-11-29 Jim Meyering + + grep: fix DFA-induced infloop + * gnulib: Update to latest, for the DFA infloop fix. + * tests/dfa-infloop: New test, to trigger an infinite loop + in the DFA matcher. + * tests/Makefile.am (TESTS): Add it. + +2016-11-28 Jim Meyering + + tests: use "returns_ N env VAR=val ..." + rather than "VAR=val returns_ N ..." + Some shells do not propagate envvar settings through our use + of the "returns_" function, so set any envvar via use of "env". + This was an issue at least on Ubuntu and Debian-based systems, + presumably due to their common use of "dash" as /bin/sh. + Reported by Assaf Gordon. + * tests/char-class-multibyte: As above. + * tests/euc-mb: Likewise. + * tests/false-match-mb-non-utf8: Likewise. + * tests/pcre-infloop: Likewise. + * tests/pcre-jitstack: Likewise. + * tests/sjis-mb: Likewise. + * tests/warn-char-classes: Likewise. + +2016-11-28 Paul Eggert + + tests: revert check for unibyte French range bug + The test wasn't portable, as it assumed that rational ranges + were not in effect. Problem reported by Eric Blake (Bug#25048#8). + There doesn't seem to be a portable way to do the test, so omit it. + * tests/init.cfg, tests/unibyte-bracket-expr: + Revert previous change. + + build: update gnulib submodule to latest + +2016-11-27 Jim Meyering + + grep: avoid false matches in non-UTF8 multibyte locales + * gnulib: Update to latest, for the dfa.c fix. + * NEWS (Bug fixes): Mention it. + * tests/false-match-mb-non-utf8: New file, with tests for this. + Based on tests from Stephane Chazelas. + * tests/Makefile.am (TESTS): Add it. + Introduced by commit v2.18-54-g3ef4c8e, a change that made grep use + its DFA matcher more aggressively. The malfunction arises only with + the DFA matcher, not with regex. + Reported by Stephane Chazelas in https://bugs.gnu.org/24975 + +2016-11-20 Paul Eggert + + tests: check for unibyte French range bug + Problem reported by Stephane Chazelas (Bug#24973). + This bug was fixed in Gnulib. + * NEWS: Document the fix. + * tests/init.cfg (require_ru_RU_koi8_r): Remove. + * tests/unibyte-bracket-expr: Add a test for the bug. + Call get-mb-cur-max directly instead of bothering with + require_ru_RU_koi8_r. + + build: update gnulib submodule to latest + +2016-11-19 Paul Eggert + + grep: further -P performance fix + Problem reported by Stephane Chazelas in: + http://bugs.gnu.org/22655#103 + * src/pcresearch.c (Pexecute): Set the subject to the start of + each line as it is found. + + grep: -P no longer uses PCRE_MULTILINE + This reverts commit f6603c4e1e04dbb87a7232c4b44acc6afdf65fef, + as the extra performance is not worth the trouble for PCRE users. + Problem reported by Stephane Chazelas in: + http://bugs.gnu.org/22655#103 + * NEWS: Document this and the next patch. + * src/dfasearch.c (EGexecute): + * src/grep.c (execute_fp_t): + * src/kwsearch.c (Fexecute): + * src/pcresearch.c (Pexecute): + First arg is now a const pointer again. + * src/grep.c (buf_has_encoding_errors): Now static. + * src/grep.h (buf_has_encoding_errors): Remove decl. + * src/search.h: Adjust decls. + * src/pcresearch.c (reflags): Remove. All uses removed. + (Pcompile, Pexecute): Do not use PCRE_MULTILINE. + +2016-11-19 Jim Meyering + + doc: fix a doubled "the" + * doc/grep.texi (--perl-regexp): s/the\nthe/the/ + +2016-11-19 Paul Eggert + + grep: fix -zxP bug + * NEWS: Document this. + * src/pcresearch.c (Pcompile): Search a line at a time if -x is + used, since -x uses ^ and $. + * tests/pcre: Test this. + + grep: simplify by using PRIuMAX + * configure.ac (HAVE_PRINTF_C99_SIZES): Remove; no longer needed. + * src/grep.c (print_offset): Simplify (Bug#24451). + + grep: -T now adjusts number widths for worst case + * NEWS, doc/grep.texi (Output Line Prefix Control): + Document this (Bug#24451). + * src/grep.c (offset_width): New static var. + (print_offset): Use it instead of arg. All callers changed. + (grep): Set it. + * tests/initial-tab: Test this. + + grep: -T no longer outputs BS + * NEWS: Document this (Bug#24451). + * src/grep.c (print_line_head): Do not attempt to backspace output. + * tests/initial-tab: New test. + * tests/Makefile.am (TESTS): Add it. + + grep: document -oz better + * doc/grep.texi (General Output Control, Usage): Tweak (Bug#24961). + + grep: fix performance typo with -P + Reported by Zev Weiss in: http://bugs.gnu.org/22655#88 + * src/pcresearch.c (Pcompile): Initialize reflags. + + tests: use "returns_" rather than "$?" + * tests/grep-dev-null-out: Use "returns_ 124" rather than testing + $? = 124. + + grep -f /dev/null -L PAT FILE outputs FILE + * NEWS: Document this. + * src/grep.c (main): Do not exit right away with -L. + * tests/skip-read: Test for the fix. + + grep: tune -f /dev/null + * src/grep.c (main): Do the -f /dev/null early-exit checks before + more-expensive tests that involve syscalls. + + grep: treat -f /dev/null like -m0 + * NEWS: Document this. + * src/grep.c (main): With -f /dev/null, don't bother to read the + input. This is what FreeBSD grep does. + * tests/Makefile.am (TESTS): Add skip-read. + * tests/skip-read: New file. + + grep: avoid O(N**2) buffer reallocation + * src/grep.c (main): Use x2realloc to avoid O(N**2) performance as + pattern buffers grow. + + grep: avoid unnecessary gettext call + Translate "(standard input)" lazily. + * src/grep.c (input_filename): New function. + (suppressible_error): Remove 1st arg, since it is always + input_filename (). All callers changed. + (suppressible_error, print_filename, grep, grepdesc): Use it. + (grep_command_line_arg): Set filename to NULL if standard + input has no label. Often, this avoids all calls to gettext, + which can be a win as the first call can be expensive. + + grep: drain the input pipe faster + * src/grep.c (dev_null_output): Now static. + (drain_input): New function, using 'splice' if that makes sense. + (finalize_input): Use it. + (main): Omit now-unnecessary initialization. + + grep: scale back /dev/null speedup + The performance improvement when output is /dev/null (commit + af6af288eac28951b5eee1eaaf373e22b2193b7b dated 2016-05-01) + breaks scripts that run "PROGRAM | grep PATTERN >/dev/null" + where PROGRAM dies when writing into a broken pipe. + Suppress the improvement if standard input is not seekable. + Problem reported by Gary Johnson (Bug#24941). + * NEWS: Document this. + * src/grep.c (seek_failed): New static var. + (seek_data_failed): Move decl earlier, to be next to seek_failed. + (file_must_have_nulls): Skip useless syscalls if seek_failed. + Lessen source-code nesting. + (reset): Set seek_failed and seek_data_failed. + Try lseek even on non-regular files. + (grep): New arg INEOF. All callers changed. + Do not clear seek_data_failed here, since 'reset' now does this. + (finalize_input): New static function. + (grepdesc): Use it. + (main): Do not exit on first match merely because output is + /dev/null. + * tests/grep-dev-null-out: Adjust to new behavior. + + grep: improve diagnostic on lseek failure + * src/grep.c (reset): Mention the file name in the (unlikely) + chance of an lseek failure. + + grep: avoid unnecessary isatty calls + This fixes an inefficiency that was mistakenly introduced a while + back, when the macro SET_BINARY became defined on all platforms. + * src/grep.c (grepdesc, main): Do not unecessarily call isatty on + POSIXish platforms. + + grep: -Pz no longer rejects ^, $ + Problem reported by Stephane Chazelas (Bug#22655). + * NEWS: Document this. + * doc/grep.texi (grep Programs): Warn about -Pz. + * src/pcresearch.c (reflags): New static var. + (multibyte_locale): Remove static var; now local to Pcompile. + (Pcompile): Check for (? and (* too. Set reflags instead of + dying when problematic operators are found. + (Pexecute): Use reflags to decide whether searches should + be multiline. + * tests/pcre: Test new behavior. + +2016-11-14 Jim Meyering + + tests: use "returns_" rather than explicit comparison with "$?" + * tests/sjis-mb (encode): Rearrange to emit desired input into + a file, rather than piping directly into grep. That permits + the use of returns_ 1 to verify timeout's exit status. + * tests/euc-mb: Use "returns_ 1" rather than testing $? = 1 + * tests/char-class-multibyte: Likewise. + * tests/dfa-heap-overrun: Likewise. + * tests/encoding-error: Likewise. + * tests/fedora: Likewise. + * tests/grep-dev-null: Likewise. + * tests/init.cfg (envvar_check_fail): Likewise. + * tests/kwset-abuse: Likewise. + * tests/mb-non-UTF8-overrun: Likewise. + * tests/multibyte-white-space: Likewise. + * tests/pcre-infloop: Likewise. + * tests/surrogate-pair: Likewise. + * tests/warn-char-classes: Likewise. + Do the same for other values: + * tests/backref-multibyte-slow: Likewise. + * tests/euc-mb: Likewise. + * tests/pcre-abort: Likewise. + * tests/pcre-jitstack: Likewise. + * tests/repetition-overflow: Likewise. + * tests/reversed-range-endpoints: Likewise. + * tests/warn-char-classes: Likewise. + +2016-10-26 Jim Meyering + + doc: grep builds on HP-UX once again + * NEWS (Bug fixes): Mention the HP-UX fix. + + gnulib: update to latest, for getprogname HPUX port + +2016-10-22 Mark Veltzer + + ignore coverage generated files + + ignore ar-lib in build-aux + +2016-10-20 Zev Weiss + + grep: use 'j' intmax_t printf length modifier if supported + * configure.ac: Use gl_PRINTF_SIZES_C99 to test printf and + (conditionally) define HAVE_PRINTF_C99_SIZES. + * src/grep.c (print_offset): Use printf("%j...") for printing + [u]intmax_t if HAVE_PRINTF_C99_SIZES is defined; otherwise continue + using the existing hand-rolled loop. + +2016-10-15 Jim Meyering + + build: distribute new file, die.h, so "make distcheck" passes + * src/Makefile.am (grep_SOURCES): Add die.h. + Also, sort these file names. + +2016-10-10 Paul Eggert + + build: update gnulib submodule to latest + +2016-10-09 Jim Meyering + + maint: die.h: add the "#define ..." part of double inclusion guard + * src/die.h (DIE_H): Define to 1. + +2016-10-04 Paul Eggert + + grep: don't assume stdbool.h before die call + * src/die.h: Include stdbool.h, since 'die' uses 'false' + + grep: die more systematically + * src/die.h: New file. + * src/dfasearch.c, src/grep.c, src/pcresearch.c: Include die.h. + * src/dfasearch.c (dfaerror): + * src/grep.c (context_length_arg, add_count, prline, setmatcher, main): + * src/pcresearch.c (jit_exec, Pcompile, Pexecute): + Use 'die' instead of 'error' when exiting. + * src/pcresearch.c: Do not include verify.h. + (die): Remove; now in die.h. + * src/search.h: Do not include error.h here, since this file does + not use anything defined in error.h. Instead, dfasearch.c, which + uses error.h's symbols, now includes error.h directly. + +2016-10-02 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.26 + * NEWS: Record release date. + +2016-10-01 Jim Meyering + + gnulib: update to latest; for getprogname fix + +2016-10-01 Paul Eggert + + tests/grep-dir: port to Solaris 10 + * tests/grep-dir: Port to Solaris 10 'cat', which + exits with status 0 even after 'read' fails from a directory. + +2016-09-28 Jim Meyering + + build: placate GCC 7's -Wimplicit-fallthrough + * src/pcresearch.c (die): New macro. + (Pexecute): Use it in place of offending uses of error, + to placate GCC 7's -Wimplicit-fallthrough. + Include verify.h. Since this is grep's first explicit use of this + gnulib module, ... + * bootstrap.conf (gnulib_modules): Add verify. + + gnulib: update to latest; for ... + This includes the following: + - a getprogname-vs-openbsd-5.1 portability fix + - "fallthru" comment-adding changes for dfa and unistr/u8-uctomb-aux.c + - another getprograme fix to avoid breaking newer glibc + +2016-09-27 Paul Eggert + + build: reword .git old-GCC warning + * configure.ac (gl_gcc_warnings): Reword diagnostic. + Suggested by Assaf Gordon in: + http://lists.gnu.org/archive/html/grep-devel/2016-09/msg00024.html + + build: port .git builds to newer GCC + * configure.ac (gl_gcc_warnings): Omit duplicate copy of 'main'. + Problem reported by Assaf Gordon in: + http://lists.gnu.org/archive/html/grep-devel/2016-09/msg00024.html + + build: port .git builds to older GCC + Problem reported by Dagobert Michelsen in: + http://lists.gnu.org/archive/html/grep-devel/2016-09/msg00018.html + * configure.ac (gl_gcc_warnings): Default to false if .git + exists but GCC is too old. + +2016-09-27 Jim Meyering + + tests/long-pattern-perf: avoid false-failure due to cache speed + * tests/long-pattern-perf: This test would fail semi-consistently + on some systems, probably because the smaller regexp fit well + within cache, yet the larger one did not. In that case, there + was a relative speed difference greater than 20x and the test + would fail. Quadruple the sizes, to make that less likely. + Also, construct the 10x larger regexp directly from the smaller, + rather than relying on seq with endpoints to induce that + approximate size ratio. Reported by Bruce Dubbs in + https://lists.gnu.org/archive/html/grep-devel/2016-09/msg00013.html + +2016-09-24 Jim Meyering + + build: avoid "./configure && make dist" missing-dep. failure + * Makefile.am (run-syntax-check): Depend on "all", to avoid a + parallel build failure due to a missing dependency. Reported by + Paul Eggert in https://bugs.gnu.org/24256#50 + +2016-09-24 Paul Eggert + + build: update gnulib submodule to latest + +2016-09-24 Jim Meyering + + tests/fmbtest: avoid false-failure due to reliance on MB-correct sed + * tests/fmbtest: Several of these tests would mistakenly fail due to + postprocessing with a combination of sed and locale support that failed + to handle some multibyte characters in the cs_CZ.UTF-8 locale. Instead + of relying on sed's multibyte support or anything locale-related to + perform this simple filtering, just use this: tr -cs '0-9' '[ *]' + Also, rather than exporting LC_ALL, just set it for each command. + Reported by Nelson H. F. Beebe. + https://bugs.gnu.org/24534 + + tests: revamp multibyte-white-space test to be more permissive + This test elicits too many failures. Whether a system has accurate + unicode "whitespace" attributes should not influence whether grep's + test suite passes. In many cases, now you will see a warning that + some multibyte characters do not pass whitespace-related tests, but + this test no longer fails. However, if you run this test on a modern + enough system, it does require that \s and \S do work properly with + most of the listed characters. + * tests/multibyte-white-space: Confirm that Fedora 24's locale + tables still declare those four Unicode code points *not* whitespace. + Honor a new column telling how to handle failure. Provide more + information in each diagnostic. + Reported by Nelson H. F. Beebe. + https://bugs.gnu.org/24530 + + tests: avoid erroneous failure of pcre-jitstack test + On some systems (*BSD), 'ulimit -s unlimited' would fail, yet the + test for that mistakenly masked the failure, so the following grep + command ended up failing with a segfault. + * tests/pcre-jitstack: Don't mask the ulimit failure. + Reported privately by Nelson H. F. Beebe. + https://bugs.gnu.org/24524 + +2016-09-23 Jim Meyering + + grep: avoid unwarranted "input file 'F' is also the output" on *BSD + On *BSD systems, any command like "echo y | grep x", where grep reads + from a pipe and writes to standard output, would mistakenly emit this: + grep: input file '(standard input)' is also the output + * src/grep.c (grepdesc): Ensure that the file descriptor we're + reading is a regular one before using SAME_INODE to test whether + it is the same as the descriptor open on standard output. + Nelson Beebe reported privately that the foad1 tests failed on many + BSD systems. Exposed by commit v2.25-2-gaf6af28. + https://bugs.gnu.org/24522 + + tests: avoid backref-multibyte-slow false failure + * tests/backref-multibyte-slow (max_seconds): If we calculate + a max duration of 1 second, use 5. Otherwise, on high-latency + systems, it would be way too easy for the duration of the final + test run to exceed that limit. Reported by Nelson H. F. Beebe. + http://bugs.gnu.org/24516 + +2016-09-22 Jim Meyering + + gnulib: update to latest; for getprogname-vs-AIX fix + +2016-09-18 Norihiro Tanaka + + grep: add news entry for fix to bug#24233 + * NEWS (Bug fixes): Add an entry describing bug#24233. + The bug was fixed by commit v2.25-77-gad468bb, by chance. + +2016-09-15 Jim Meyering + + gnulib: update to latest + +2016-09-10 Jim Meyering + + dfa: reflect move of grep's DFA code to gnulib + Now that the core DFA code and tests reside in gnulib, + remove the copies here and use what gnulib provides. + * bootstrap.conf: Use the dfa module. + * cfg.mk: Remove settings involving files that have moved. + (_gl_TS_unmarked_extern_functions): Add dfaerror and dfawarn. + It is wrong/ugly to have to define these global symbols to use + the dfa module, but we'll adjust that separately. + * po/POTFILES.in: Apply s/src/lib/ to src/dfa.c. + * src/Makefile.am: Remove mention of dfa.[ch] and localeinfo.[ch]. + * tests/Makefile.am: Remove mention of the tests that we have + moved to the gnulib module. + * src/dfa.c: Remove file. + * src/dfa.h: Likewise. + * src/localeinfo.c: Likewise. + * src/localeinfo.h: Likewise. + * tests/dfa-match: Likewise. + * tests/dfa-match-aux.c: Likewise. + * tests/invalid-char-class: Likewise. + + gnulib: update to latest, for new dfa module + +2016-09-08 Paul Eggert + + grep: encoding errors suppress just their line + From a suggestion by Marcello Perathoner (Bug#22838). + * NEWS, doc/grep.texi (File and Directory Selection): Document this. + * src/grep.c (print_line_head): Do not suppress later output lines + merely because an earlier output line would have had an encoding error. + * tests/encoding-error: Test for the new behavior. + +2016-09-08 Jim Meyering + + gnulib: update to latest, for getprogname fixes + +2016-09-08 Norihiro Tanaka + + dfa: additional change new option for anchored searches + * src/dfa.c (dfaexec_main): Do it. + +2016-09-07 Paul Eggert + + doc: define "context lines" + Reported by Igor Bogomazov via Santiago Ruano Rincón (Bug#24024). + * doc/grep.texi (Context Line Control): Define "context lines". + + build: update gnulib submodule to latest + +2016-09-05 Jim Meyering + + maint: switch from gnulib's progname to getprogname module + * gnulib: Update to latest, for its new getprogname module. + * bootstrap.conf (avoided_gnulib_modules): Include the getprogname + module rather than the now-obsolescent progname. + * src/grep.c: Include "getprogname.h" rather than "progname.h" + and remove any use of set_program_name. + * tests/dfa-match-aux.c (main): Likewise. + * tests/get-mb-cur-max.c (main): Likewise. + * src/grep.c (usage, main): Use getprogname() in place of program_name. + +2016-09-02 Paul Eggert + + dfa: minor cleanup of previous change + * src/dfa.c (dfaexec_main): Omit redundant code and reindent. + +2016-09-02 Norihiro Tanaka + + dfa: additional change new option for anchored searches + * src/dfa.c (dfaexec_main): Do it. + + dfa: use single-byte algorithm even in non-UTF-8 + * src/dfa.c (dfaexec_main): Do it. (This was inadvertently + omitted in a recent patch.) + +2016-09-02 Paul Eggert + + dfa: merge xalloc.h changes from Gawk + * src/dfa.h (_GL_ATTRIBUTE_MALLOC): Define here, as other + Gnulib .h files do. This is more consistent with Gawk. + * src/dfa.c: Include xalloc.h, since dfa.h no longer does so. + Include localeinfo.h later; we don't care about order, but Gawk does. + +2016-09-02 Arnold Robbins + + dfa: port to C90 + * src/dfa.c (dfamust): Avoid declarations after statement (Bug#21486). + +2016-09-02 Paul Eggert + + dfa: new option for anchored searches + This follows up on a suggestion by Norihiro Tanaka (Bug#24262). + * src/dfa.c (struct regex_syntax): New member 'anchor'. + (char_context): Use it. + (dfasyntax): Change signature to specify it, along with the old + FOLD and EOL args, as a single DFAOPTS arg. All uses changed. + * src/dfa.h (DFA_ANCHOR, DFA_CASE_FOLD, DFA_EOL_NUL): New constants + for dfasyntax new last arg. + +2016-09-02 Norihiro Tanaka + + dfa: simplify and optimize at initial state in execution + * src/dfa.c (skip_remains_mb): Remove argument *pwc. Update calller. + (dfaexec_main): Simplify and optimize at initial state (Bug#24261). + + dfa: simplify to find state index for state 0 + * src/dfa.c (dfastate): Simplify to find state index for state 0. + +2016-09-01 Norihiro Tanaka + + tests: add a new test for SJIS locale + * tests/sjis-mb: Add a new test. It fails in grep-2.25 or prior. + +2016-09-01 Paul Eggert + + grep: update NEWS + * NEWS: Describe previous change. + + grep: use regex fastmap unless -i + This builds on a suggestion by Norihiro Tanaka (Bug#24009). + * src/dfasearch.c (GEAcompile): Use a fastmap unless -i. + This improves performance 20x for me using the first benchmark + given in Bug#24009. + + grep: improve dfasearch storage management + This patch is mostly refactoring, with a bit of performance tweaking. + It is done in preparation for a fix for Bug#24009. + * src/dfasearch.c (patterns): Now of type struct re_pattern_buffer * + instead of an anonymous struct pointer, since there is no longer + any need to keep regs here. All uses changed. + (GEAcompile): Use patlim instead of a hard-to-follow "total". + Use x2nrealloc to avoid potential O(N**2) reallocation algorithm. + Initialize just the pattern members that need clearing. + (EGexecute): Put regs into a static variable, as this code did + before 2001-02-18, as there is no need to have a separate set of + regs for each pattern. Explain the "Q@#%!#" comment better. + +2016-09-01 Norihiro Tanaka + + dfa: remove separation by context in transition in non-UTF8 multibyte locales + * src/dfa.c (struct dfa): Remove member curr_dependent. All uses + removed. + +2016-09-01 Paul Eggert + + dfa: document previous change + * NEWS: Adjust to match previous change. + +2016-09-01 Norihiro Tanaka + + dfa: avoid invalid character matching period + * dfa.c (transit_state): Avoid invalid character matching period. + + dfa: use single-byte algorithm even in non-UTF-8 + Even in non-UTF8 locales, if the current input character + is single byte, we can use CSET to match ANYCHAR. + * src/dfa.c (struct dfa): New member canychar. + Cache index of CSET for ANYCHAR. + (lex): Make CSET for ANYCHAR. + (state_index): Simplify. + (dfastate): Consider CSET for ANYCHAR. + (transit_state_singlebyte, transit_state): Remove handling for eolbyte, + as we assume that eolbyte does not appear at current position. + (dfaexec_main): Use algorithm for single byte character to any single + byte character in input text always. + (dfasyntax): Initialize canychar. + +2016-09-01 Paul Eggert + + grep: avoid code duplication with -iF + This follows up on the -iF performance improvement (Bug#23752). + * NEWS: Simplify description of -iF improvement. + * src/dfa.c: Do not include wctype.h. + (lonesome_lower, case_folded_counterparts): Move to localeinfo.c. + (CASE_FOLDED_BUFSIZE): Move to localeinfo.h. + * src/grep.c: Do not include wctype.h. + (lonesome_lower): Remove. + (fgrep_icase_available): Use case_folded_counterparts instead. + Do not call it for the same character twice. + Return false on wcrtomb failures (which should never happen). + (fgrep_to_grep_pattern, main): Simplify. Let fgrep_to_grep’s + caller fiddle with the global variables. + * src/localeinfo.c: Include + (lonesome_lower, case_folded_counterparts): + Move here from src/dfa.c. Return int, not unsigned int. + Verify that CASE_FOLDED_BUFSIZE is big enough. + * src/localeinfo.h (CASE_FOLDED_BUFSIZE): Now 32, so that + we don’t expose lonesome_lower’s size. + * src/searchutils.c (kwsinit): Return new kwset instead of + storing it via a pointer. All callers changed. Simplify a bit. + +2016-09-01 Norihiro Tanaka + + grep: speed up -iF in multibyte locales + In a multibyte locale, if a pattern is composed of only single byte + characters and their all counterparts are also single byte characters + and the pattern does not have invalid sequences, grep -iF uses the + fgrep matcher, the same as in a single byte locale (Bug#23752). + * NEWS: Mention it. + * src/grep.c (lonesome_lower): New constant. + (fgrep_icase_available): New function. + (fgrep_to_grep_pattern): Simplify it. + (main): Use them. + * src/searchutils.c (kwsinit): New arg MB_TRANS; all uses changed. + Try fgrep matcher for case insensitive matching by grep -F in multibyte + locale. + +2016-08-31 Paul Eggert + + build: update gnulib submodule to latest + +2016-08-31 Jim Meyering + + maint: avoid new 'make syntax-check' failure + * src/dfa.c (using_simple_locale): Prefer STREQ(a,b) over + strcmp(a,b) == 0. + + gnulib: update to latest + +2016-08-31 Paul Eggert + + dfa: make dfa.c fully thread-safe + This follows up on Zev Weiss’s recent patches to make the DFA code + thread-safe (Bug#24249). It removes the remaining static + variables used by dfa.c. These variables are locale-dependent, so + they would cause problems in multithreaded code where different + threads are in different locales (e.g., via uselocale). I + abstracted most of the variables into a new localeinfo module. + * src/Makefile.am (grep_SOURCES): Add localeinfo.c. + (noinst_HEADERS): Add localeinfo.h. + * src/dfa.c: Include localeinfo.h. + (struct dfa): Remove multibyte member, as it is now part of + localeinfo. New members simple_locale and localeinfo. + Put locale-related members at the end. + (mbrtowc_cache): Remove; now part of dfa->localeinfo. + (charclass_index): Rename back from dfa_charclass_index, + since it's private. + (unibyte_word_constituent): New arg DFA; use its sbctowc member. + (using_utf8, dfa_using_utf8, init_mbrtowc_cache, check_utf8): + Remove; now done by localeinfo members. All uses changed. + (dfasyntax): New localeinfo arg. Move to end to avoid forward decls. + Initialize the entire DFA. + (unibyte_c, check_unibyte_c): Remove; now in simple_locale member. + (using_simple_locale): Now takes bool instead of DFA. + Do the locale check here, rather than in the caller, + as the result is now cached in dfa->simple_locale. + (dfaalloc): Just allocate the DFA. dfasyntax now initializes it. + * src/dfa.h: Add forward decl of struct localeinfo. + Adjust to new dfa.c API. + * src/dfasearch.c (localeinfo): New var, replacing former static + vars like mbrtowc_cache. + * src/localeinfo.c, src/localeinfo.h: New files. + * src/search.h: Include localeinfo.h. + (localeinfo): New decl. + * src/searchutils.c (mbclen_cache, build_mbclen_cache): + Remove. All uses changed to localeinfo. + * tests/Makefile.am (dfa_match_aux_LDADD): Add localeinfo.o. + * tests/dfa-match-aux.c: Include localeinfo.h. + (main): Adjust to changes in DFA API. + +2016-08-28 Paul Eggert + + build: update gnulib submodule to latest + This should fix Bug#24323 reported by Dennis Clarke, where grep + does not build on Solaris 10 when compiled with Solaris Studio 12.4. + +2016-08-23 Paul Eggert + + dfa: minor thread-safety cleanups + * src/dfa.c (struct lexer_state): Rename lexptr to ptr and lexleft + to left, for brevity. All uses changed. + (struct dfa): Rename lexstate to lex and parsestate to parse, + for brevity. All uses changed. + (using_simple_locale): Simplify boolean expression. + (FETCH_WC): Parenthesize uses of dfa macro arg. + (FETCH_WC, parse_bracket_exp, addtok_mb): Prefer suffix operators + on structure members when possible, for clarity. + (parse_bracket_exp): Check for buffer exhaustion before + dereferencing buffer pointer. + (struct lexptr): New type. + (push_lex_state, pop_lex_state): Use it. Change from macros + PUSH_LEX_STATE and POP_LEX_STATE to static functions, and add + parameters to make them proper C functions. All uses changed. + (lex): Simplify tests for \) and \|. Avoid some string + duplication by using &"^..."[boolean]. + (dfaalloc): Use xzalloc, not xcalloc with 1. + +2016-08-21 Paul Eggert + + grep: minor tweaks of initial buffer alloc + * src/grep.c (main): Allocate input buffer only when about + to do I/O. Avoid int overflow on systems with 2 GiB pages. + Fix size_t overflow check. + +2016-08-20 Zev Weiss + + dfa: constify some function parameters + * src/dfa.c (char_context): Mark dfa parameter const. + (charclass_context): Likewise. + + dfa: thread-safety: initialize mbrtowc_cache in dfa_init + * src/dfa.c (dfasyntax): Remove initialization of mbrtowc_cache. + (init_mbrtowc_cache): New function. + (dfa_init): Call it. + http://bugs.gnu.org/24259 + + dfa: thread-safety: eliminate static local variables + * src/dfa.c: Replace utf8 and unibyte_c static local variables with + static globals initialized by a new function dfa_init() which must be + called before any other dfa*() functions. + (dfa_using_utf8): Rename using_utf8() to dfa_using_utf8() for + consistency with other exported functions. + * src/dfa.h (dfa_using_utf8): Rename using_utf8() to dfa_using_utf8(); + also add _GL_ATTRIBUTE_PURE. + (dfa_init): New function. + * src/grep.c (main), tests/dfa-match-aux.c (main): Call dfa_init(). + * src/dfasearch.c (EGexecute): Replace using_utf8 with dfa_using_utf8. + * src/kwsearch.c (Fexecute): Likewise. + * src/pcresearch.c (Pcompile): Likewise. + http://bugs.gnu.org/24259 + + dfa: thread-safety: move regex syntax configuration into struct dfa + * src/dfa.c: move global variables holding regex syntax configuration + into a new struct (`struct regex_syntax') and add an instance of it to + struct dfa. All references to the globals are replaced with + references to the dfa struct's new member. As a side effect, a + `struct dfa' must be allocated with dfaalloc() and passed to + dfasyntax(). + * src/dfa.h (dfasyntax): Add new struct dfa* parameter. + * src/dfasearch.c (GEAcompile): Allocate `dfa' earlier and pass it to + dfasyntax(). + * tests/dfa-match-aux.c (main): Pass `dfa' to dfasyntax(). + http://bugs.gnu.org/24259 + + dfa: thread-safety: move parser state into struct dfa + * src/dfa.c: move global variables holding parser state (`tok' and + `depth') into a new struct (`struct parser_state') and add an instance + of it to struct dfa. All references to the globals are replaced by + references to the dfa struct's new member. + http://bugs.gnu.org/24259 + + dfa: thread-safety: move lexer state into struct dfa + * src/dfa.c: move global variables holding lexer state into a new + struct (`struct lexer_state') and add an instance of this struct to + struct dfa. All references to the globals are replaced with + references to the dfa struct's new member. + http://bugs.gnu.org/24259 + +2016-08-19 Zev Weiss + + dfa: thread-safety: remove dfa.c's "dfa" global + Remove the global dfa struct. Instead, add a struct dfa pointer + parameter to each function that had been using the global. + * src/dfa.c (dfa): Remove file-scoped global. + (charclass_index): Remove now-unnecessary function. + (using_simple_locale): Add a dfa parameter and update all callers. + (FETCH_WC, parse_bracket_exp, lex, addtok_mb, addtok): Likewise. + (addtok_wc, add_utf8_anychar, atom, nsubtoks, copytoks): Likewise. + (closure, branch, regexp): Likewise. + (dfaparse): No longer set the global. + http://bugs.gnu.org/24260 + +2016-08-18 Paul Eggert + + grep: tune list_files conversion to enum + * src/grep.c (grepdesc): Use a slightly more-efficient way to test + list_files. + + grep: prefer bitwise to short-circuit when shorter + * src/grep.c (skip_devices, initialize_unibyte_mask, fillbuf, main) + * src/kwsearch.c (Fexecute): Prefer bitwise to short-circuit ops + when they are logically equivalent and the bitwise ops generate + shorter code on GCC 6.1 x86-64. + * src/grep.c (get_nondigit_option, parse_grep_colors): + Use c_isdigit instead of spelling it out with a short-circuit op. + +2016-08-17 Paul Eggert + + dfa: use 64-bit when ulong is at least that wide + * src/dfa.c (charclass_word): Now unsigned long instead of unsigned. + (CHARCLASS_WORD_BITS): Now 64 on 64-bit platforms. + (CHARCLASS_PAIR, CHARCLASS_INIT): New macros. + (CHARCLASS_WORD_MASK): Now a static const, since it no longer + needs to be a macro. + (equal): Open-code rather than calling memcmp. + (add_utf8_anychar): Use CHARCLASS_INIT. + + dfa: avoid uninitialized constants + Some compilers warn about 'static int const x;' on the grounds + that X should have an initializer. Instead of worrying about + this, rewrite to avoid this sort of thing. + * src/dfa.c (emptyset): New function. + (parse_bracket_exp): Use it instead of 'equal' and a zero constant. + * src/dfasearch.c (struct patterns): Remove tag 'patterns'. + (patterns0): Remove zero constant. + (GEAcompile): Use memset instead of the zero constant. + +2016-08-17 Jim Meyering + + maint: avoid new "make syntax-check" failure + * src/dfa.c: Adjust comment not to go past column 80. + + tests: pcre-jitstack: avoid false failure without base64 -d support + * tests/pcre-jitstack: Try harder to find a base64 decoder: + try 'base64 -d', 'base64 -D', 'openssl base64 -d' and perl's + MIME::Base64 decode_base64. The old code would fail at least on + OS X, for which base64 expects -D or --decode. + Reported by Jack Howarth in http://bugs.gnu.org/24243. + +2016-08-16 Paul Eggert + + dfa: minor refactoring and doc fixes + * NEWS: Improve description of recent change. + * src/dfa.c: Improve commentary. Indent new code (and some + long-existing howlers) more in GNU style. + (dfa_state): Reorder members to make struct smaller on x86. + mb_trindex member is now state_num, not size_t, so that -1 is more + natural; all uses changed. + (struct dfa): Similarly for mb_trcount member. + (state_index): Compute values for new state components before + allocating the state, to make the code easier to understand. + (state_index, dfastate): Prefer A & ~B to other forms like (A & B) + != A. + (dfastate, build_state, transit_state): In new code, prefer i++ to + ++i in for-loop control. + (build_state, transit_state): In new code, prefer < to >. + (transit_state): Add to *PP in one assignment, rather than in a + loop. Prefer !x to x == NULL. Use xmalloc instead of xnmalloc, + since the size is a constant. Do the size calculation as a signed + integer constant expression, so that the compiler diagnoses any + overflow. + (transit_state, free_mbdata): Tune by looping from -1 to N - 1, + rather than from 0 to N - 1 with a separate instance for -1. + (dfaexec_main): Rewrite to avoid side effects in if-part. + (free_mbdata): Simplify. + + dfa: port to C90 + * src/dfa.c (transit_state, dfa_supported, dfamust): + Don't use declarations after statements. + If I recall correctly, gawk still wants to port to C90. + + dfa: fix context newline confusion + * src/dfa.c (transit_state): Fix "... & ~0" that was evidently + intended to be "... & ~1". Do index calculation in a simpler way, + that uses just addition (Bug#21486). + +2016-08-16 Norihiro Tanaka + + dfa: improve leading "." with non-UTF8 multibyte + In non-UTF8 multibyte locales, matching the dot expression is very + slow, as the next state is calculated on demand. This change caches + the result for the typical case (Bug#21486). + + Compare the run times of this command before and after this change, + on a i5-4570 CPU @ 3.20GHz using rawhide (~fedora 22) and compiled + with gcc 5.1.1 20150618: + yes "$(printf 'a%38db\n' 0)" | head -1000000 >in + env LC_ALL=ja_JP.eucJP time -p \ + src/grep .......................................... in + Before: 19.10 + After : 0.55 + + * NEWS: Document this. + * src/dfa.c: (struct dfa_state): New members curr_dependent, mb_trindex. + (MAX_TRCOUNT): New constant. + (struct dfa): New members mb_trans, mb_trcount. + (state_index): Initialize new members of struct dfa_state and calculate + dependency on context of next character for positions for dot. + (dfastate): Calculate follows positions for dot if enabled. + (realloc_trans_if_necessary): Allocate transition tables. + (build_state): Use new constant and reset transition tables. + (transit_state): Use cache for transition from a state with the dot + expression. + (free_mbdata): Deallocate transition tables. + +2016-08-06 Jim Meyering + + tests: standardize on 10-second timeouts to avoid rare false failure + In a parallel test run, it is not unusual to exceed a timeout of + 1-3 seconds. Increase several from 3 or fewer to 10 seconds. + * tests/skip-device: Increase timeout from 2 to 10 seconds. + * tests/grep-dev-null-out: Likewise, but s/1/10/. + * tests/pcre-invalid-utf8-input: Likewise, but s/3/10/. + * tests/dfa-match: Likewise. + * tests/pcre-invalid-utf8-infloop: Likewise. + * tests/pcre-infloop: Likewise. + * tests/max-count-overread: Likewise. + * tests/invalid-multibyte-infloop: Likewise. + Prompted by http://bugs.gnu.org/24159. + + tests/backref-multibyte-slow:: avoid false positive + * tests/backref-multibyte-slow: When redirecting the "fast" LC_ALL=C + run's output to /dev/null, we got an artificially low timing (of 0), + due to grep's own stdout-vs-/dev/null optimization. With an initial + timing of 0 on that first run, the derived timeout for the UTF-8 run + (which redirects to a file) would be a mere 1 second. The fix: also + redirect that first run's output to a file, not to /dev/null. + +2016-08-05 Norihiro Tanaka + + dfa: minor fix for whether dfa is "fast" + * src/dfa.c (dfaoptimize): When a UTF-8 optimization succeeds for + a DFA (it can use single-byte code paths), record that by setting + its ->fast flag. + +2016-07-25 Jim Meyering + + grep: print "filename:lineno:" in invalid-regex diagnostic + Determining the file name and line number is a little tricky because + of the way the regular expressions are all concatenated onto a newline- + separated list. By the time grep would compile regular expressions, + the origin of each regexp was no longer available. + This patch adds a list of filename,first_lineno pairs, one per input + source, by which we can then map the ordinal regexp number to a + filename,lineno pair for the diagnostic. + + * src/dfasearch.c (GEAcompile): When diagnosing an invalid regexp + specified via -f FILE, include the "FILENAME:LINENO: " prefix. + Also, when there are two or more lines with compilation failures, + diagnose all of them, rather than stopping after the first. + * src/grep.h (pattern_file_name): Declare it. + * src/grep.c: (struct FL_pair): Define type. + (fl_pair, n_fl_pair_slots, n_pattern_files, patfile_lineno): + Define globals. + (fl_add, pattern_file_name): Define functions. + (main): Call fl_add for each type of the following: -e argument, + -f argument, command-line-specified (without -e) regexp. + * tests/filename-lineno.pl: New file. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Improvements): Mention this. + Initially reported by Gunnar Wolf in https://bugs.debian.org/525214 + Forwarded to grep's bug list by Santiago Ruano Rincón as + http://debbugs.gnu.org/23965 + +2016-07-24 Jim Meyering + + tests: add coreutils' perl-driven test framework + * configure.ac: Set the AM_CONDITIONAL variable, HAVE_PERL. + * tests/Coreutils.pm: New file. + * tests/CuSkip.pm: New file. + * tests/CuTmpdir.pm: New file. + * tests/no-perl: New file. + * tests/Makefile.am: Set up to use .pl tests: + (TEST_EXTENSIONS, TESTSUITE_PERL, TESTSUITE_PERL_OPTIONS): Define. + (SH_LOG_COMPILER, PL_LOG_COMPILER): Define. + (EXTRA_DIST): Add the four new file names. + + doc: omit an excess word in HACKING + +2016-07-21 Norihiro Tanaka + + grep: always match single line only with DFA superset + \n cannot occur inside a multibyte character. So an input always + matches single line only with DFA superset. + + * src/dfasearch.c (EGexecute): Simplify it with above. + +2016-07-15 Norihiro Tanaka + + dfa: fix whitespace problems + * src/dfa.c: Use GNU style for pointer decls. + +2016-07-15 Paul Eggert + + maint: modernize HACKING a bit + * HACKING: Remove some ancient history to simplify maintenance. + +2016-07-14 Paul Eggert + + grep: minor style changes for -F crash fix + * src/kwset.c (memoff2_kwset): Use ?: instead of if-else. + +2016-07-14 Norihiro Tanaka + + grep: fix -F crash when alternating duplicates + grep -F crashes with a pattern like 0\n0. + This bug was introduced in 966f6586fbce3081ce6e5e2f9b55301b0ec3d2b4. + + * src/kwset.c (memoff2_kwset): If two characters are the same, + use memchr instead of memchr2. + * tests/two-chars: New test. + * tests/Makefile.am (TESTS): Add it. + +2016-07-07 Paul Eggert + + dfa: fix comments to match code better + * src/dfa.c: Fix comments. + +2016-07-06 Paul Eggert + + dfa: don't treat null bytes specially + * src/dfa.c (transit_state): Do not treat null byte specially + when eolbyte == '\n'. + +2016-07-06 Norihiro Tanaka + + dfa: don't distingish letter in non-POSIX locales + For non-POSIX locales, dfa does not support word delimiter + support, so remove distinction between letters and non-letters. + * src/dfa.c (struct dfa): Remove members initstate_letter, + initstate_others. All uses removed. New member initstate_notbol. + (dfaanalyze, dfaexec_main): Replace old members with new member. + (wchar_context): Remove. Update callers. + +2016-07-06 Paul Eggert + + dfa: minor cleanups for non-POSIX simplification + * src/dfa.c (transit_state_singlebyte): Remove unnecessary 'const' + from arg; we usually don't bother with 'const' on locals. + (transit_state_singlebyte): Omit '!= NULL' in boolean context. + Use assert rather than abort. + +2016-07-06 Norihiro Tanaka + + dfa: simplify for non-POSIX locales + Simplify the dfa code, since it no longer supports ranges, + collating elements, and equivalent classes in non-POSIX locales. + * src/dfa.c (struct dfa): Remove mb_match_lens. + (enum status_transit_state, match_anychar) + (check_matching_with_multibyte_ops, transit_state_consume_1char): + (State_transition): Remove. + (transit_state_singlebyte): Accepts pointer-to-pointer position, + instead of pointer, and no longer accept pointer to next state. + Return next state instead of status_transit_state. All callers + changed. + (transit_state_singlebyte, transit_state): Simplify. + (dfaexec_main): Now transit_state is called only when next character + matches with ANYCHAR. + +2016-06-14 Paul Eggert + + doc: propagate more changes from grep.texi + Problem reported by Björn Voigt in: http://bugs.gnu.org/23763#27 + * doc/grep.in.1: Fix more inconsistencies with grep.texi. + +2016-06-13 Paul Eggert + + doc: remove obsolete MS-DOS mention + * doc/grep.in.1: Remove obsolete discussion of MS-DOS heuristics. + Problem reported by Björn Voigt in: http://bugs.gnu.org/23763 + +2016-06-09 Zev Weiss + + grep: do pagesize initialization and buffer allocation earlier + * src/grep.c (reset, main): We're going to need pagesize and buffer + initialized anyway, so we might as well do so unconditionally early on + rather than checking on every call to reset(). + http://bugs.gnu.org/23717 + + grep: remove unnecessary dirdesc variable. + * src/grep.c (grepdirent): Remove dirdesc variable and just use + fts_cwd_fd directly, since the fts_options test was guaranteed to + succeed (and fts_cwd_fd was already being used directly in fstatat() + anyway). http://bugs.gnu.org/23716 + + grep: convert list_files to an enum + * src/grep.c: Make list_files a tristate enum instead of an int. + http://bugs.gnu.org/23715 + + grep: correct a stale comment and remove dead code + * src/grep.c (grepdesc): The `grep()' function no longer has + special-case negative return values, since it no longer handles + directories, so don't bother checking for them. + http://bugs.gnu.org/23714 + + maint: replace bitwise with logical OR + * src/grep.c (main): replace bitwise ORs with logical ORs where it + makes sense (when dealing with boolean conditions as opposed to + bitmasks). http://bugs.gnu.org/23713 + + maint: mark a couple of static variables const + * src/dfa.c (parse_bracket_exp): mark zeroclass const. + * src/dfasearch.c: mark patterns0 const. + http://bugs.gnu.org/23712 + +2016-06-03 Paul Eggert + + tests: fix similar bug in exit status test + * tests/grep-dir (status_range): New shell function. + Use it to fix bug where $? was not saved properly. + +2016-06-03 Zev Weiss + + tests: fix bug in exit status test + When checking $? against multiple values, save its value in another + variable and check that so as to avoid tests beyond the first seeing a + $? clobbered by earlier ones. + + * tests/status: save $? in a temporary variable before testing it. + +2016-06-02 Norihiro Tanaka + + dfa: more simplification of dfaexec_main + * src/dfa.c (dfaexec_main): Failure at an acceptable position and demand + to build state is unlikely. So go next loop without checking them after + a newline. This commit induces no semantic change. + +2016-06-02 Paul Eggert + + maint: correct attribution + * build-aux/git-log-fix: Fix attribution of primary Aho-Corasick patch + +2016-06-02 Paul Eggert + + grep: simplify -F Aho-Corasick a bit + This removes some tuning that complicates the code without providing + performance benefits that I could measure (GCC 6.1, x86-64). + (acexec_trans): Do not hand-unroll. Unduplicate the code for a + transition step. + + * src/kwset.c (struct kwset.kwsexec, bmexec, acexec_trans, acexec) + +2016-06-02 Paul Eggert + + grep: minor cleanups for -F Aho-Corasick + * NEWS: Don't claim 7x, as the value seems to be system-dependent. + * src/kwset.c (struct kwset.kwsexec, bmexec, acexec_trans, acexec): + * src/kwset.c, src/kwset.h (kwsalloc, kwsexec): + Don't put 'const' into the declaration when that is irrelevant to + the API. More generally, don't bother with 'const' when it's only + a local so it is reasonably obvious to a reader that it is 'const' + anyway. It would be overkill to add 'const' to all locals that + never change. + * src/kwset.c (U): Avoid unnecessary parens. + (treefails, memoff2_kwset, bmexec_trans, bmexec, cwexec, acexec_trans): + Prefer SIZE_MAX to (size_t) -1. + (bmexec_trans, cwexec, acexec_trans): + Remove attributes for static functions that no longer seem needed. + (memoff2_kwset): Rename from memchr2_kwset, since it returns + an offset, not a pointer. All uses changed. + (cwexec, acexec_trans) [lint]: Remove initialization that is no + longer needed; at least, GCC 6.1 x86-64 does not need it. + (acexec_trans): Clarify code by using nesting rather than 'continue'. + +2016-06-02 Norihiro Tanaka + + grep: use memchr2 for two patterns of a character + * src/kwset.c (memchr2_kwset): Add a new function. grep uses memchr2 to + search just two letters. + (cwexec, acexec_trans): Use it. + + grep: -F multiword longest match not always needed + Searching multiple fixed words, grep immediately returns without longest + match if not needed. Without this change, grep tries longest match for + multiple words even if not needed. + * src/kwset.c (kwsexec, acexec, cwexec, bmexec): Add a bool argument + for whether longest match is needed. All callers changed. + * src/kwset.h (kwsexec): Update prototype. + +2016-06-02 Norihiro Tanaka + + grep: use Aho-Corasick algorithm to search multiple fixed words + Searching multiple fixed words, grep used the Commentz-Walter + algorithm, but this was O(m*n) and was very slow in the worst case. + For example: + + - input: yes `printf %040d` | head -10000000 + - word1: x0000000000000000000 + - word2: x + + This change instead uses the Aho-Corasick algorithm to search multiple + fixed words. It uses a high-quality trie-building function that is + already defined for Commentz-Walter in kwset.c. + + I see 7x speed-up even for a typical case on Fedora 21 with a 3.2GHz i5 + by this change. Using best-of-5 trials for the benchmark: + + find /usr/share/doc/ -type f | + LC_ALL=C time -p xargs.sh src/grep -Ff /usr/share/dict/linux.words >/dev/null + + The results were: + + real 11.37 user 11.03 sys 0.24 [without the change] + real 1.49 user 1.31 sys 0.15 [with the change] + + * src/kwset.c (struct kwset): Add a new member 'mode'. + (kwsalloc): Use it. + All callers are changed. + (kwsincr): Using Aho-Corasick algorithm, build tries in normal order. + (acexec_trans, acexec): Add a new function. + (kwsexec): Use it. + * src/kwset.h (kwsalloc): Update a prototype. + * NEWS (Improvements): Mention it. + +2016-05-13 Jim Meyering + + maint: do not let a LANGUAGE envvar setting perturb tests + E.g., running "LANGUAGE=eo make check" would provoke a failure + of the encoding-error test, on systems that mistakenly let that + envvar trump the setting of LC_ALL. + * tests/envvar-check: New file, copied from coreutils. + * tests/Makefile.am (EXTRA_DIST): Add it. + (TESTS_ENVIRONMENT): Source it. + Also select TMPDIR as we do for coreutils tests. + Reported by Benno Schulenberg in http://bugs.gnu.org/23527. + +2016-05-02 Jim Meyering + + maint: avoid NEWS syntax-check failure + * NEWS: Move the mention of the /dev/null speed-up from the + block for 2.25 into the current, in-preparation block. + +2016-05-01 Paul Eggert + + dfa: prefer bool for boolean + * src/dfa.c (syntax_bits_set, dfasyntax, using_utf8, FETCH_WC) + (POP_LEX_STATE, State_transition): + * src/dfa.h (using_utf_8): + Use bool for boolean. + +2016-05-01 Norihiro Tanaka + + dfa: stop exporting internal functions + * src/dfa.c, src/dfa.h (dfaparse, dfaanalyze, dfastate, dfainit): + Now static. + + dfa: prefer bool at DFA interfaces + * src/dfa.c (struct dfa, dfasyntax, dfaanalyze, dfaexec_main) + (dfaexec_mb, dfaexec_sb, dfaexec_noop, dfaexec, dfacomp): + * src/dfa.h (dfasyntax, dfacomp, dfaexec, dfaanalyze): + * src/dfasearch.c (EGexecute): + Use bool for boolean. + +2016-05-01 Paul Eggert + + dfa: speed up checking for character boundary + This should help performance with gawk; not so much with grep. + Suggested by Norihiro Tanaka in: http://bugs.gnu.org/18777 + * src/dfa.c (never_trail): New static var. + (dfasyntax): Initialize it. + (skip_remains_mb): Use it to speed up a common case in Gawk. + + grep: /dev/null output speedup + This sped up 'seq 10000000000 | grep . >/dev/null' by a factor of + 380,000 on my platform (Fedora 23, x86-64, AMD Phenom II X4 910e, + en_US.UTF-8 locale). + * NEWS: Document this. + * src/grep.c (grepbuf): exit_on_match no longer implies that -q + was specified, so when a match is found, exit with exit_failure if + an error was also found. + (grepdesc): Omit unnecessary S_ISREG and st_ino checks. + out_stat.st_ino is zero if stdout is not a regular file, + and this cannot possibly equal st->st_ino. + (main): Omit duplicate initialization of exit_failure. Do not + bother with isatty unless -q is not used and stdout is a character + special file and --color=auto and TERM says colorization is + possible. Most importantly, set exit_on_match if the output is + /dev/null. + * tests/grep-dev-null-out: New test. + * tests/Makefile.am (TESTS): Add it. + * tests/status: Do not require grep to actually read all the input + files when the output is /dev/null and a matching line has been + found. + +2016-04-21 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.25 + * NEWS: Record release date. + +2016-04-19 Paul Eggert + + dfa: remove dependency on btowc + MirOS BSD btowc is a macro that (when GCC is being used) hardcodes + btowc (0x80) == WEOF regardless of locale, which contradicts + future POSIX in the C locale. Instead of bothering to develop a + Gnulib workaround for the btowc incompatibility, use mbrtowc, + which we are using elsewhere and fixing anyway, and are caching so + it is fast here. Problem reported by Nelson H. F. Beebe via Jim + Meyering in: http://bugs.gnu.org/23269#14 + * bootstrap.conf (gnulib_modules): Remove btowc. + * src/dfa.c (struct dfa): Remove mbrtowc_cache member, replacing with ... + (mbrtowc_cache): ... this new static var. All uses changed. + (dfambcache): Remove; now done by setsyntax. Call removed. + (is_valid_unibyte_character): Remove. + (IS_WORD_CONSTITUENT): Remove this macro, replacing it with ... + (unibyte_word_constituent): ... this new function. It uses + mbrtowc_cache rather than btowc. + (dfasyntax): Initialize mbrtowc_cache before using it. + +2016-04-10 Paul Eggert + + grep: minor doc tweaks inspired by Debian + Problem reported by Santiago Ruano Rincón in: http://bugs.gnu.org/22911 + * doc/grep.in.1: + * doc/grep.texi (Matching Control, grep Programs) + (Regular Expressions): + Document -e, -f, and PCRE more carefully. + +2016-04-10 Jim Meyering + + maint: remove unused mbtoupper function + * src/searchutils.c (mbtoupper): Remove now-unused function. + Also remove inclusion of , since this change removed + the final use of assert. + * src/search.h (mbtoupper): Remove declaration. + +2016-04-10 Paul Eggert + + grep: in C locale, all bytes are valid characters + This works around glibc bug 19932: + https://sourceware.org/bugzilla/show_bug.cgi?id=19932 + The actual bug fix was the update to the current version of Gnulib. + grep problem reported by Björn Jacke in: http://bugs.gnu.org/23234 + * NEWS: Mention this. + * doc/grep.texi (File and Directory Selection): Crossref to LC_* + section. Suggest why -a or LC_ALL=C might be useful. + (Environment Variables): Mention 'locale -a'. + Say that LC_CTYPE also specifies encoding, and that every + byte is a valid character in the C or POSIX locale. + * tests/c-locale: New test. + * tests/Makefile.am (TESTS): Add it. + + build: update gnulib submodule to latest + +2016-04-05 Paul Eggert + + Give another example of binary file processing + Problem reported by Shlomi Fish + * doc/grep.texi (File and Directory Selection): + Document that 'q$' might match 'q' followed by a NUL + if --binary-files=binary is in effect. + +2016-04-03 Paul Eggert + + tests: test egrep/fgrep help only if our grep + Problem reported by Christian Weisgerber in: http://bugs.gnu.org/23146 + * tests/Makefile.am (TESTS_ENVIRONMENT): + Test egrep and fgrep only if they use our grep. + +2016-03-29 Jim Meyering + + tests: remove spurious test of egrep + * tests/reversed-range-endpoints: Do not test egrep here. + There is already a test of grep -E. + Prompted by http://bugs.gnu.org/23146 + +2016-03-23 Paul Eggert + + grep: -Pz no longer misdiagnoses [^a] + Problem reported by Michael Jess. + * NEWS: Document this. + * src/pcresearch.c (Pcompile): Do not diagnose [^ when [ is unescaped. + * tests/pcre: Test for the bug. + +2016-03-22 Jim Meyering + + maint: move new 'Improvements' blurb into proper section + * NEWS (Improvements): Move this new section from within the block + for the already-released 2.24 into the proper "next-release" block. + Also, retain the 2-blank-line separator between blocks. + +2016-03-18 Jim Meyering + + maint: avoid spurious "binary file ... matches" in generated THANKS + * Makefile.am (THANKS): Don't apply grep to a stream containing + NUL bytes. Sync this rule from the one in coreutils: it was missing + some improvements. + Reported by Bailes Magio in http://bugs.gnu.org/22899 + +2016-03-18 Paul Eggert + + grep: -oz now outputs null bytes, not newlines + * NEWS: Document this. + * doc/grep.texi (Other Options): Clarify that -z affects output + as well as input data. + * src/grep.c (print_line_middle): Output eolbyte, not newline, if -o. + * tests/null-byte: Test -o too. + * tests/pcre-context: Adjust test to match new behavior. + +2016-03-17 Paul Eggert + + grep: use errno consistently in write diagnostics + Feature request and initial version reported by Assaf Gordon in: + http://bugs.gnu.org/23031 + * NEWS: Document this. + * src/grep.c: Include . + (stdout_errno): New static var. + (write_error_seen): Remove; superseded by stdout_errno. + All uses changed. + (putchar_errno, fputs_errno, printf_errno, fwrite_errno) + (fflush_errno): New static functions. + (print_filename, print_sep, print_offset, print_line_head) + (print_line_middle, print_line_tail, prline, prtext, grep) + (grepdesc): Use them. + * tests/write-error-msg: New file. + * tests/Makefile.am (TESTS): Add it. + +2016-03-10 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.24 + * NEWS: Record release date. + +2016-02-28 Jim Meyering + + maint: add dist-check.mk + This file augments "make distcheck" rules. + * dist-check.mk: New file, from coreutils via gzip. + * Makefile.am (EXTRA_DIST): Add it. + * cfg.mk: Include it. + +2016-02-21 Paul Eggert + + grep: -Pz is incompatible with ^ and $ + Problem reported by Sergei Trofimovich in: http://bugs.gnu.org/22655 + * NEWS: Document this. + * src/pcresearch.c (Pcompile): Warn with -Pz and anchors. + * tests/pcre: Test new behavior. + +2016-02-21 Jim Meyering + + tests: test cleanup + * tests/z-anchor-newline: Remove test artifact that would write + to /t/x. + +2016-02-20 Jim Meyering + + grep -z: avoid erroneous match with regexp anchor and \n in text + * src/dfasearch.c (EGexecute): Clear the newline_anchor bit when + eolbyte is not '\n'. + * tests/z-anchor-newline: New file. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Describe it. + Originally reported by Ulrich Mueller in + https://bugs.gentoo.org/show_bug.cgi?id=574662 + Reported to us by Sergei Trofimovich as http://debbugs.gnu.org/22655 + + tests: convert "cmd && fail=1" to "returns_ 1 cmd || fail=1" + The latter is robust, while the former can silently ignore + failure due to signals. + * cfg.mk (sc_prohibit_and_fail_1): New rule, copied from coreutils. + * tests/long-pattern-perf: Perform the above substitution. + * tests/mb-non-UTF8-performance: Likewise. + * tests/help-version: Merge from coreutils. + +2016-02-09 Jim Meyering + + maint: add a check-very-expensive target + * Makefile.am (check-very-expensive): New convenience rule, + currently merely equivalent to check-expensive. + +2016-02-04 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.23 + * NEWS: Record release date. + +2016-02-02 Jim Meyering + + gnulib: update to latest + Update for this "make distcheck"-fixing change: + > verify-tests: also remove stray test-verify.Tpo + +2016-02-01 Jim Meyering + + tests/null-byte: test another code path + * tests/null-byte: Also exercise the case in which there is + a match in the block along with the NUL byte. + +2016-01-31 Paul Eggert + + Omit excess "Binary file ... matches" + Problem reported in: http://bugs.gnu.org/22461 + * src/grep.c (grep): Don't report "Binary file ... matches" + merely because the file contained both matches and binary data. + Insist that the binary data contained a match. + * tests/null-byte: Add a test for this. + +2016-01-28 Jim Meyering + + gnulib: update to latest + +2016-01-23 Jim Meyering + + gnulib: update to latest + + maint: fix typo in NEWS: s/a/an/ + +2016-01-15 Paul Eggert + + grep: -x now supersedes -w more consistently + * NEWS, doc/grep.texi (Matching Control): Mention this. + * src/dfasearch.c (EGexecute): + * src/pcresearch.c (Pcompile): + Don't get confused by -w if -x is also present. + * src/pcresearch.c (Pcompile): Remove misleading comment about + non-UTF-8 multibyte locales, as PCRE doesn't support them. + Calculate buffer sizes more carefully; the old method + allocated a buffer slightly too big, seemingly due to luck. + * tests/backref-word, tests/pcre: Add tests for this bug. + + tests: omit update-copyright-tests + This test does not check how 'grep' itself operates, so it is + out of place for grep's 'make check'. Problem reported by Sam Razavi in: + http://bugs.gnu.org/22376 + * bootstrap.conf (avoided_gnulib_modules): Add update-copyright-tests. + +2016-01-11 Jim Meyering + + tests: do use "yes" but via an AWK replacement + Also, use sed Nq in place of head -N + * tests/init.cfg (yes): Define. + Thanks to Paul Eggert for this definition. + * tests/max-count-overread: Revert to using "yes". + * tests/mb-non-UTF8-performance: Likewise, and use + "sed Nq" in place of head -N. + +2016-01-11 Paul Eggert + + * tests/pcre-count: Don't assume the page size is 32kB. + +2016-01-08 Paul Eggert + + tests: port to other POSIXish platforms + I tested this on Solaris 10 and AIX 7.1. + * tests/max-count-overread: + * tests/mb-non-UTF8-performance: + Don't assume 'yes' exists, as 'yes' is not in POSIX. + * tests/mb-non-UTF8-performance: + Don't rely on 'head -1000', as that option syntax is not POSIX. + * tests/pcre-count: Don't rely on "printf '\x0'". + * tests/unibyte-binary: Don't assume \200 is an encoding error + in every unibyte locale. + +2016-01-08 Jim Meyering + + tests: fix encoding-error test failure to use of printf '\xHH' + * tests/encoding-error: Don't rely on printf having support for \xHH + hexadecimal. That is not portable. Use \OOO octal, instead. + + maint: fix typo in NEWS: s/a/an/ + +2016-01-07 Jim Meyering + + mb-non-UTF8-performance: avoid FP test failure on fast hardware + * tests/mb-non-UTF8-performance: Don't use a fixed size. + Otherwise, on a fast system, the fixed-size unibyte test + would complete in a nominal 0 ms, which might well be + smaller than 1/30 of the multibyte duration, provoking + a false positive test failure. Instead, increase the + size of the input until we obtain a unibyte duration of + at least 10ms. + +2016-01-07 Paul Eggert + + doc: mention unibyte encoding fix + * NEWS: Document recent fix for encoding errors in unibyte locales. + + grep: improve unibyte -P performance + This is a followon to the recent changes prompted by Bug#20526. + In Norihiro Tanaka pointed out + that grep mistakenly assumed that unibyte locales cannot have + encoding errors. Here, the mistake hurt performance significantly. + On Fedora 23 x86-64 in the C locale, this patch improved grep's + performance by a factor of 7 when run as "grep -P 'z.*a'" on the + output of "yes $(printf '\200\n') | head -n 1000000000". + * src/pcresearch.c (multibyte_locale) [HAVE_LIBPCRE]: New static var. + (Pcompile): Set it. + (Pexecute): Use it to avoid the need to call + buf_has_encoding_errors in unibyte locales. + +2016-01-06 Paul Eggert + + Improve on fix for Bug#22181 + * src/pcresearch.c (Pexecute): Update subject when skipping past + easily-determined encoding errors, as this is faster than letting + pcre_exec skip them. On my platform this improves performance + 4.7x on a benchmark created via "yes $(printf '\200\200\200\200 + \200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200x\n') + | head -n 1000000 >j; grep -oP y j" in a UTF-8 locale. Rework + code that deals with PCRE_ERROR_BADUTF8 return, to avoid an + incorrect (albeit currently harmless) 'bol = false' assignment. + + grep: restore -P optimization (followup fix) + * src/search.h (EGexecute, Fexecute, Pexecute): + Change decls to match new implementations. + I forgot to add this file to the previous commit. + + grep: restore -P PCRE_NO_UTF8_CHECK optimization + On my platform in the en_US.utf8 locale, this makes 'grep -P "z.*a" k' + 220x faster, where k is created by the shell command: + yes 'abcdefg hijklmn opqrstu vwxyz' | head -n 10000000 >k + * src/dfasearch.c (EGexecute): + * src/grep.c (execute_fp_t): + * src/kwsearch.c (Fexecute): + * src/pcresearch.c (Pexecute): + First arg is now char *, not char const *, since Pexecute now + temporarily modifies this argument. + * src/grep.c, src/grep.h (buf_has_encoding_errors): Now extern. + * src/pcresearch.c (Pexecute): Use it. If the input is free of + encoding errors, use a multiline search and the PCRE_NO_UTF8_CHECK + option, as this is typically way faster. This restores an + optimization that was removed with the recent changes for binary + file detection. + +2016-01-05 Paul Eggert + + Fix calculation of unibyte_mask + * src/grep.c (initialize_unibyte_mask): The old method worked for + UTF-8 and other typical encodings, but did not work for weird + encodings, e.g., one where all bytes other than 0x7f and 0x80 are + unibyte characters. + +2016-01-01 Paul Eggert + + grep: fix bug with with invalid unibyte sequence + This was introduced by the recent binary-data-detection changes. + Problem reported by Norihiro Tanaka in: http://bugs.gnu.org/20526#86 + * src/grep.c (HIBYTE, easy_encoding, init_easy_encoding): Remove, + replacing with ... + (uword_max, unibyte_mask, initialize_unibyte_mask): ... this new + constant, static var, and function. All uses changed. The + unibyte_mask var generalizes the old local var hibyte_mask, which + worked only for encodings where every byte with 0x80 turned off is + a single-byte character. + (buf_has_encoding_errors): Return false immediately if + unibyte_mask is zero, not whether the current encoding is unibyte. + The old test was incorrect in unibyte locales in which some bytes + were encoding errors. + * tests/pcre-z: Require UTF-8 locale, since the grep -z . test now + needs this. Use printf \0 rather than tr. Port the 'grep -z .' + test to platforms where the C locale says '\200' is an encoding + error. Use cmp rather than compare, as the file is binary and + so non-GNU diff might not work. + * tests/unibyte-binary: New file. + * tests/Makefile.am (TESTS): Add it. + +2016-01-01 Jim Meyering + + maint: update copyright year, bootstrap, init.sh + Run "make update-copyright" and then... + + * gnulib: Update to latest. + * tests/init.sh: Update from gnulib. + * bootstrap: Likewise. + +2015-12-31 Paul Eggert + + doc: clarify text vs binary match output + * NEWS: + * doc/grep.texi (File and Directory Selection): + Make it clearer that grep can now output matching text before + reporting a binary match. Problem reported by Norihiro Tanaka in: + http://bugs.gnu.org/20526#83 + + doc: minor clarifications + * doc/grep.in.1, doc/grep.texi: Minor clarifications suggested by + Debian documentation patches. Problem reported by Santiago Ruano + Rincón in: http://bugs.gnu.org/18651 + + grep: fix -l --line-buffer bug + Problem reported by Louis Sautier in: http://bugs.gnu.org/18750 + * NEWS: Document this. + * src/grep.c (grep, grepdesc): If --line-buffered, flush + stdout after outputting newline (or null byte, if applicable). + +2015-12-30 Paul Eggert + + grep: remove duplicate init + * src/grep.c (print_line_middle): Remove duplicate initialization. + + grep: report line-buffered write error right away + * src/grep.c (prline): When line buffered, if there is a write + error, report it immediately rather than waiting until the next + line of output. + + grep: -c should keep counting after binary data + Problem and fix reported by Jaroslav Škarvada, and test case + reported by Norihiro Tanaka, in: http://bugs.gnu.org/22028 + * NEWS: Document this. + * src/grep.c (grep): Don't stop counting merely because nulls seen. + * tests/pcre-count: New file. + * tests/Makefile.am (TESTS): Add it. + + dfa: port to tinycc + * src/dfa.c (add_utf8_anychar): Put 'const' after type. + Problem reported by Aharon Robbins in: + http://bugs.gnu.org/22260 + + grep: be less picky about encoding errors + This fixes a longstanding problem introduced in grep 2.21, + which is overly picky about binary files. + * NEWS: + * doc/grep.texi (File and Directory Selection): Document this. + * src/grep.c (input_textbin, textbin_is_binary, buffer_textbin) + (file_textbin): + Remove. All uses removed. + (encoding_error_output): New static var. + (buf_has_encoding_errors, buf_has_nulls, file_must_have_nulls): + New functions, which reuse bits + and pieces of the removed functions. + (lastout, print_line_head, print_line_middle, print_line_tail, prline) + (prpending, prtext, grepbuf): + Avoid use of const, now that we have + functions that require modifying a sentinel. + (print_line_head): New arg LEN. All uses changed. + (print_line_head, print_line_tail): + Return indicator whether the output line was printed. + All uses changed. + (print_line_middle): Exit early on encoding error. + (grep): Use new method for determining whether file is binary. + * src/grep.h (enum textbin, TEXTBIN_BINARY, TEXTBIN_UNKNOWN) + (TEXTBIN_TEXT, input_textbin): Remove decls. All uses removed. + * src/pcresearch.c (Pexecute): Remove multiline optimization, + since the main program no longer checks for encoding errors on input. + * tests/encoding-error: New file. + * tests/Makefile.am (TESTS): Add it. + +2015-12-29 Jim Meyering + + maint: correct (make sorted) order of test file names + * tests/Makefile.am (TESTS): Insert new test name in sorted order. + +2015-12-28 Paul Eggert + + grep: --exclude matches trailing parts of args + Problem reported by Vincent Lefevre in: + http://bugs.gnu.org/22144 + * NEWS: + * doc/grep.texi (File and Directory Selection): Document this. + * src/grep.c (excluded_patterns, excluded_directory_patterns): + Now 2-element arrays, with one element for subfiles and another + for command-line args. All uses changed. This implements the change. + (exclude_options): New function. + * tests/include-exclude: Test the change. + +2015-12-18 Jim Meyering + + grep -oP: don't infloop when processing invalid UTF8 preceding a match + * src/pcresearch.c (Pexecute): When advancing SUBJECT past an + encoding error, don't blindly set P to that new value, since we + will soon compute SEARCH_OFFSET = P - SUBJECT, and mistakenly + making that difference too small would allow us to match some + previously-processed text, resulting in an infinite loop. + * NEWS (Bug fixes): Mention it. + * THANKS.in: Add Christian's name and email address. + * tests/pcre-invalid-utf8-infloop: New file. + * tests/Makefile.am (TESTS): Add it. + Reported by Christian Boltz in http://debbugs.gnu.org/22181 + Introduced by commit, v2.21-37-g14f8e48. + +2015-11-04 Jim Meyering + + tests: mark performance-related tests as expensive + These performance-related tests are slightly failure prone due to + varying system load during the two runs. + Marking these tests as "expensive" makes it so they are no longer run + via "make check". You can still run them via make "check-expensive". + This makes them less likely to be run by regular users. + * tests/long-pattern-perf: Use expensive_. + * tests/mb-non-UTF8-performance: Likewise. + Reported by Jaroslav Skarvada in http://debbugs.gnu.org/21826 + and by Andreas Schwab in http://debbugs.gnu.org/21812. + +2015-11-01 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.22 + * NEWS: Record release date. + + tests: pcre-jitstack: upon failure, retry with no stack size limit + * tests/pcre-jitstack: Don't let an example that provokes inordinate + stack space use cause a test failure. Thanks to reports from and + analysis by Bruce Dubbs; see http://debbugs.gnu.org/21755 + +2015-10-27 Jim Meyering + + maint: update THANKS.in + * THANKS.in: Add name+email of those who found and reported + the bug that made grep -E '^x|x$' match any "x". + +2015-10-25 Zev Weiss + + dfa: plug a memory leak in dfamust + * src/dfa.c (dfamust): Ensure MP is freed, by refraining + from returning early when, at "done:" *RESULT is NULL. + +2015-10-25 Jim Meyering + + gnulib: update to latest + * gnulib: Pull in one more portability fix: + stdalign: port to Sun C 5.9 + +2015-10-24 Jim Meyering + + gnulib: update to latest, for portability fixes + * gnulib: Pull in changes like these: + fts: port to C11 alignof + stdalign: work around pre-4.9 GCC x86 bug + + maint: NEWS: correct/amend + * NEWS: Move the long-regexp-performance-improvement from + "Bug fixes" to "Improvements." Say more and include an example. + The -Fw degradation was introduced in commit v2.18-125-g94555dd + + tests: avoid spurious failure on OpenBSD 5.8 + * tests/fedora: Don't rely on "diff - FILE" reading from stdin. + Reported privately by Nelson Beebe. + +2015-10-17 Jim Meyering + + gnulib: update to latest; also bootstrap and tests/init.sh + * bootstrap: Update from gnulib. + * tests/init.sh: Likewise. + * gnulib: Update submodule to latest. + + build: avoid spurious bootstrap failure involving pkg.m4 + Running ./bootstrap could fail mistakenly at the very end in + its attempt to obtain a copy of pkg.m4. It would search only + $(aclocal --print-ac-dir) and some other directories, but not + those listed in $(aclocal --print-ac-dir)/dirlist. + * bootstrap.conf (bootstrap_post_import_hook): Also search the + directories named in $(aclocal --print-ac-dir)/dirlist when that + file exists with nonzero size. + +2015-10-16 Paul Eggert + + maint: add news item + * NEWS: Document grep -Fw speedup. + + grep: simplify previous change + * src/grep.c (main): Simplify recently-changed grep -Fw test. + +2015-10-16 Norihiro Tanaka + + grep: use grep matcher for grep -Fw when unibyte + In single byte locales with grep -Fw, prefer the grep matcher to the + kwset matcher, as the former uses KWset and a DFA, whereas the latter + calls kwsexec many times until it matches a word. + * src/grep.c (main): Change pattern for fgrep into grep for grep -Fw in + single byte locales. + +2015-10-16 Paul Eggert + + grep: use memchr/memrchar + * src/kwsearch.c (Fexecute): Prefer memchr and memrchr to doing it + by hand. + +2015-10-16 Norihiro Tanaka + + grep: improve performance of grep -Fw + * src/kwsearch.c (Fexecute): grep -Fw examined whether the previous + character is a word character after matching from the head of the + buffer. It is extremely slow. Now, if grep found a potential match, + it looks for the previous newline, and examines from there. + +2015-10-13 Jim Meyering + + maint: use single quote rather than UTF-8 multi-byte version + * tests/backref-alt: Translate unnecessary non-ASCII in comment. + +2015-10-13 Paul Eggert + + dfa: make the executable a bit smaller + * src/dfa.c (dfamust): Hoist MB_CUR_MAX calculation out of loops. + +2015-10-13 Norihiro Tanaka + + dfa: fix bug in alternate of sub-patterns that differ only in constraints + Fix a bug where a line incorrectly matches alternates of sub-patterns + that differ only in the constraints, e.g., the ERE '^a|a$'. + Reported by Greg Boyd in: http://debbugs.gnu.org/21670 + * src/dfa.c (dfamust): For a pattern with constraints, check that it is + matched including the constraints, to judge whether it is exact. + + dfa: fix off-by-one error + * src/dfa.c (dfamust): Fix off-by-one error in computing 'must' length, + which caused the 'must' to be too short. See: + http://bugs.gnu.org/21670#28 + +2015-10-12 Jim Meyering + + doc: NEWS: mention a bug fix + * NEWS (Bug fixes): Describe it. + This bug was introduced by commit v2.18-85-g2c94326 + and fixed by commit v2.21-51-g256a4b4. + +2015-10-11 Paul Eggert + + tests: add test case for Bug#21670 + * tests/options: Add test #4 to catch Bug#21670. + Also, do not overescape # in shell strings. + +2015-09-19 Paul Eggert + + Add test for pop_fail_stack bug + Problem reported by Hanno Böck in: http://bugs.gnu.org/21513 + If you use --with-included-regex the bug fix is in gnulib, here: + http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=5513b40999149090987a0341c018d05d3eea1272 + If you use glibc, the bug fix has not been installed yet. + * tests/Makefile.am (XFAIL_TESTS): Add backref-alt if system matcher. + (TESTS): Add backref-alt. + * tests/backref-alt: New file. + * tests/triple-backref: Remove unused var. + Don't skip if tested with glibc, as Makefile.am now handles this. + + build: update gnulib submodule to latest + +2015-08-19 Norihiro Tanaka + + grep: avoid use of uninitialized variable + EGexecute would use "backref" uninitialized. + While that could have no bearing on correctness, it could + impact performance, via an unnecessary use of regexp. + * src/dfasearch.c (EGexecute): Initialize backref. + Reported as http://debbugs.gnu.org/21273 + Introduced by commit v2.21-55-gea0ebaa. + +2015-08-12 Norihiro Tanaka + + grep: remove fgrep code for case insensitive match + The fgrep matcher is no longer called in case insensitive matching, + so remove the code to support it. + * src/kwsearch.c (mb_case_map_apply): Remove function. + (Fexecute): Remove now-unused code. + +2015-08-12 Paul Eggert + + dfa: optimize [x-x] + * src/dfa.c (parse_bracket_exp): Treat [x-x] as if it were [x]. + This also pacifies GCC, which otherwise complains about wc2 + being set but not used. + +2015-08-12 Norihiro Tanaka + + dfa: remove unused multibyte support + Now regex should be used for range, collating element, equivalent class + in non POSIX locales. So remove code to support these features. + * dfa.c (struct mb_char_classes): Remove members ch_classes, + nch_classes, ranges, nranges, equivs, nequivs, coll_elems, ncoll_elems. + All uses removed. + (match_mb_charset): Remove function. + +2015-08-01 Jim Meyering + + tests: mb-non-UTF8-performance: use new function + * tests/mb-non-UTF8-performance: Rewrite to use + the user-time measuring function in init.cfg. + + tests: long-pattern-perf: measure user time, not elapsed + Measuring user time makes this test less prone to false + positive failure, and also lets us use a tighter bound. + * tests/long-pattern-perf: Measure elapsed user time rather than + wall-clock time, to permit a tighter bound on the ratio of + N-to-10N timings. Suggested by Giuseppe Ottaviano. + Also, use regexps built from mostly 5-digit numbers, so that the 10:1 + ratio applies to lines of "seq" output as well as to total bytes. + + tests: new function to measure elapsed user time + * tests/init.cfg (user_time_): New function. + +2015-07-25 Norihiro Tanaka + + dfa: remove word delimiter support for multibyte locales + DFA supports word delimiter expressions, but it does not behave + correctly for multibyte locales. Even if it were to be fixed, + the DFA matcher's performance would be no better than that of regex. + Thus, this change removes DFA support for word delimiter expressions + in multibyte locales. + + * src/dfa.c (dfa_supported): Return false also when a pattern uses any + word delimiter expression in a multibyte locale. + +2015-07-25 Norihiro Tanaka + + dfa: avoid execution for a pattern including an unsupported expression + If a pattern includes a construct unsupported by the DFA matcher, + the DFA search would fail in most cases. Make dfaexec immediately + return for any such pattern. + + * src/dfa.c (struct dfa_state) [has_backref, has_mbcset]: Remove members + and all uses. + (dfaexec_main): Remove 'backref' parameter. Update callers. + (dfaexec_noop): New function. + (dfa_supported): New function. + (dfassbuild): Remove now-unused code. + (dfacomp): When a pattern uses a DFA-unsupported construct, do not + waste time performing any further analysis. + +2015-07-19 Norihiro Tanaka + + dfa: DEBUG: print detail of DFA states + When compiled with -DDEBUG, grep outputs tokens etc. + With this change, also print DFA states and transitions. + This change is very useful when debugging those. + + * src/dfa.c (prtok) [DEBUG]: Change `%c' to `%02x' in printf format. + (state_index) [DEBUG]: Print detail of new state. + (dfastate) [DEBUG]: Print detail of DFA states. + Reported as http://debbugs.gnu.org/18707 + +2015-07-18 Norihiro Tanaka + + tests: sjis-mb: accept two more locales + * tests/sjis-mb: Accept the ja_JP.SJIS and ja_JP.PCK locales + as well as ja_JP.SHIFT_JIS, so this test is less likely to + be skipped unnecessarily. Reported as http://bugs.gnu.org/18983 + +2015-07-18 Jim Meyering + + tests: add a test for the performance fix + * tests/long-pattern-perf: New file. + * tests/Makefile.am (TESTS): Add it. + +2015-07-18 Norihiro Tanaka + + dfa: speed up handling of long pattern + DFA tries to find a long sequence of characters that must appear + in any matching line. However, when a pattern is long (length N), + it is very slow, because it makes O(N^2) strstr calls. + This change reduces that to O(N) by processing each sequence of + adjacent "regular" characters as a group. + + Compare the run times of this command before and after this change: + (on a i7-4770S CPU @ 3.10GHz using rawhide (~fedora 22) and compiled + with gcc 6.0.0 20150627) + : | env time -f %e grep -f <(seq -s '' 9999) + Before: 0.85 + After: 0.02 + + * src/dfa.c (dfamust): Process each string of concatenated normal + characters as a unit. + * NEWS (Improvement): Mention it. + Prompted by a bug report and patch by Ivan Yanikov + in http://bugs.gnu.org/15191#5 + +2015-07-17 Jim Meyering + + tests: fix mis-applied patch. + * tests/include-exclude: I applied "|sort" to the wrong creation + of "out", and didn't push the same patch that I'd tested. + + tests: avoid FS-dependent false-positive failure + * tests/include-exclude: Sort file name list, so that this test + is not sensitive to the order in which those names are returned + via readdir. I noticed the failure on a Fedora 21 system using ext4. + Also fix a typo: s/framework_failure+/framework_failure_/ + +2015-07-13 Paul Eggert + + grep: fix bug with --exclude-dir and command line + Reported by Aron Griffis in: http://bugs.gnu.org/21027 + * NEWS: Document this. + * src/grep.c (grepdirent): Don't check whether the file is skipped + when on the command line, as that's the caller's responsibility. + (main): Anchor the exclude patterns. + * tests/include-exclude: Adjust test case to match fixed behavior. + Add some more test cases. + + tests: fix $? typo in null-byte + * tests/null-byte: Don't assume $? survives an invocation of 'test'. + +2015-07-05 Jim Meyering + + maint: dfa: used unsigned types where appropriate + * src/dfa.c (case_folded_counterparts): Return unsigned int, not int. + Change type of two locals to unsigned int, to reflect that their + values are never negative. + (parse_bracket_exp): Adjust type of result at each use, as well + as that of related index variables. + +2015-07-04 Norihiro Tanaka + + dfa: build struct dfamust on demand + If we won't use KWset, do not build a "struct dfamust". + Now it is built only when needed. + * src/dfa.c (struct dfa) [musts]: Remove member. + (dfacomp): Don't build dfamust here. + (dfamustfree): New function to free a struct dfamust. + (dfamust): Make it a global function, and make it return a pointer + to a malloc'd struct dfamust. + (dfamusts): Remove it. + * src/dfa.h (struct dfamust) [next]: Remove member. + In the implementation preceding this patch, there was + never more than one of these in a given "struct dfa". + (dfamustfree, dfamust): Add prototypes. + (dfamusts): Remove prototype. + (dfaalloc): Declare with _GL_ATTRIBUTE_MALLOC. + To make that symbol usable there, move the inclusion + of "xalloc.h" from dfa.c to this file, dfa.h. + * src/dfasearch.c (kwsmusts): Adapt to use the new interface. + Update the comments to reflect reality. + This addresses http://bugs.gnu.org/17715 + +2015-07-04 Paul Eggert + + grep: use recent gnulib syntax bits + * src/grep.c (Gcompile, Ecompile): Use plain RE_SYNTAX_GREP + and RE_SYNTAX_EGREP, now that we assume a recent-enough gnulib. + + maint: ignore gendocs_template_min + * doc/.gitignore: Add '/gendocs_template_min'. + + build: update gnulib submodule to latest + + dfa: '.' and '[^x]' now consistently match newline + * src/dfa.c (parse_bracket_exp, lex, add_utf8_anychar) + (match_anychar): RE_DOT_NEWLINE and RE_HAT_LISTS_NOT_NEWLINE + are about LF, not about eolbyte. This patch does not affect + 'grep', but may affect other users of dfa.c. + + grep: -z '[^x]' now consistently matches newline + Problem reported by Norihiro Tanaka in: http://bugs.gnu.org/20974#19 + * NEWS: Document this. + * src/grep.c (Gcompile, Ecompile): Clear RE_HAT_LISTS_NOT_NEWLINE. + * tests/utf8-bracket: Test this. + +2015-07-03 Paul Eggert + + grep: -z '.' now consistently matches newline + Problem reported by Balazs Kezes in: http://bugs.gnu.org/20974 + * NEWS: Document this. + * tests/utf8-bracket: New file, to test for this bug. + * src/grep.c (Gcompile, Ecompile): Also specify RE_DOT_NEWLINE. + * tests/Makefile.am (TESTS): Add it. + + grep: simplify print_line_middle slightly + * src/grep.c (print_line_middle): Simplify. + + grep: don't mishandle left context in -P + http://bugs.gnu.org/20957 + * src/pcresearch.c (jit_exec): New arg SEARCH_OFFSET. + Caller changed. + (Pexecute): Pass the left context to pcre_exec, so that PCRE + regular-expression matching can see it. + * tests/pcre-context: New file, to test for this bug. + * tests/Makefile.am (TESTS): Add it. + +2015-06-28 Jim Meyering + + tests/case-fold-backref: factor test + +2015-06-26 Paul Eggert + + grep: don't hang on command-line fifo if -D skip + * NEWS: Document this. + * src/grep.c (skip_devices): + New function, with code taken from grepdirent. + (grepdirent): Use it. Avoid an unnecessary initialization. + (grepfile): If skipping devices, open files with O_NONBLOCK. + Throw in O_NOCTTY while we're at it. + (grepdesc): Skip devices here, too. Not only does this fix the + bug, it fixes an unlikely race condition if some other process + renames a device between fstatat and openat. + * tests/skip-device: Add a test for this bug. + + grep: minor tweaks + * src/grep.c (main): Change recently-added static vars to be + constants, which makes them sharable. Prefer 'return' to 'exit' + when returning/exiting from 'main'. Move decl closer to first use + and rename local from 'ok' (which was confusing) to 'status'. + Prefer named constant STDOUT_FILENO to unnamed constant 1. + +2015-06-26 Jim Meyering + + maint: unify three argv-processing calls + * src/grep.c (main): Unify three calls to grep_commandline_arg. + + maint: alphabetize anonymous enum member names + +2015-05-30 Paul Eggert + + test: tighten tests for bracket exprs + * tests/posix-bracket: Test '[a-a[.-.]--]'. + Also, test that failures are with status 1 + (nonmatching data), not status 2 (invalid expressions). + +2015-04-26 Jim Meyering + + maint: update bootstrap from gnulib + * bootstrap: Update from gnulib. + + maint: reword a diagnostic not to trigger leading capital check + * src/pcresearch.c: Reword diagnostic to avoid "make syntax-check" + failure. + + maint: sort test names in tests/Makefile.am and add syntax-check rule + * cfg.mk (sc_sorted_tests): New rule. + * tests/Makefile.am (TESTS): Alphabetize. + +2015-04-25 Norihiro Tanaka + + dfa: make find_pred return NULL for an invalid predicate + This could never happen when invoked via grep, but could have triggered + a bug if dfa.c's find_pred function were invoked by some other program. + * src/dfa.c (find_pred): Return NULL for an invalid predicate. + * tests/invalid-char-class: New file to test for this. + * tests/Makefile.am (TESTS): Add that new file name to the list. + This addresses http://debbugs.gnu.org/18631 + +2015-04-06 Paul Eggert + + build: improve pkg-config doc and error handling + Error-handling improvement suggested by Mike Frysinger in: + http://bugs.gnu.org/16757#29 + * NEWS: Document pkg-config changes. + * README-prereq: pkg-config is now a prereq when building from + repository. + * m4/pcre.m4 (gl_FUNC_PCRE): Report an error if pcre is explicitly + requested but not available. Defer to user-supplied PCRE_CFLAGS + and PCRE_LIBS. + + build: remove typo and don't bother with /usr/include/pcre + Problem reported by Holger Bruenjes. + * m4/pcre.m4: Remove test for /usr/include/libpng (a typo). + Come to think of it, don't bother worrying about + /usr/include/pcre, as hosts with that problem can use pkg-config + or configure with CFLAGS by hand. + + build: use pkg-config (if available) to configure libpcre + Problem reported by Mike Frysinger in: http://bugs.gnu.org/16757 + * bootstrap.conf (bootstrap_post_import_hook): + Copy pkg-config's pkg.m4. + * configure.ac: Invoke PKG_PROG_PKG_CONFIG. + * m4/pcre.m4 (gl_FUNC_PCRE): Rewrite to use pkg-config if + available, and to test that pcre_compile can be linked to. + * src/Makefile.am (AM_CFLAGS): Add PCRE_CFLAGS. + (grep_LDADD): Add PCRE_LIBS. + * src/pcresearch.c: Simply include if HAVE_LIBPCRE, + since 'configure' arranges for the appropriate -I option now. + +2015-03-11 Paul Eggert + + grep: output "." file name in diagnostic + This is bug C as reported by David Grayson in: + http://bugs.gnu.org/16444#18 + This bug occurs only in obscure circumstances, and I didn't see + how to write a reasonable test case for it. + * src/grep.c (filename_prefix_len): Remove, replacing with ... + (omit_dot_slash): New static var. All uses of the former replaced + with uses of the latter. + (grepdirent): Don't add 2 if the filename is just ".". + + egrep, fgrep: just use what's in PATH + * src/egrep.sh: Don't monkey with PATH; just use whatever 'grep' + is in the path. This is simpler, and lets the user specify + default options with a script for only grep, with no need for + egrep and fgrep scripts. + Fixes: bug#19998 + + doc: give a script wrapper example + * doc/grep.texi (Environment Variables): Give an example of a + wrapper script, as an alternative to using GREP_OPTIONS. + Fixes: bug#19998 + + doc: clarify how -a matches + * doc/grep.in.1, doc/grep.texi (File and Directory Selection): + Give an example of how non-text bytes affect pattern matching in + binary files. + Fixes: bug#20080 + +2015-02-23 Paul Eggert + + Cover the non-INSTALL case + * README: Mention what to do if there is no INSTALL file. + Fixes: bug#19928 + +2015-02-11 Jim Meyering + + maint: use ASAN-poisoning more carefully + The ASAN-poisoning instituted by commit v2.21-14-g1555185 was + incomplete, since the poisoned tail of the read buffer could well + be the target of a legitimate follow-on read. To accommodate that, + we must unpoison each such region just before beginning fillbuf's + read loop. + * src/grep.c [HAVE_ASAN] (asan_poison): Define. + (clear_asan_poison): Define. + (fillbuf): Clear before reading, since we are likely to read + into memory that was poisoned on the preceding iteration. + * tests/two-files: New file, to test for this. + * tests/Makefile.am (TESTS): Add it. + +2015-02-10 Paul Eggert + + Grow the JIT stack if it becomes exhausted + Problem reported by Oliver Freyermuth in: http://bugs.gnu.org/19833 + * NEWS: Document the fix. + * tests/Makefile.am (TESTS): Add pcre-jitstack. + * tests/pcre-jitstack: New file. + * src/pcresearch.c (NSUB): Move decl earlier, since it's needed + earlier now. + (jit_stack_size) [PCRE_STUDY_JIT_COMPILE]: New static var. + (jit_exec): New function. + (Pcompile): Initialize jit_stack_size. + (Pexecute): Use new jit_exec function. Report a useful diagnostic + if the error is PCRE_ERROR_JIT_STACKLIMIT. + +2015-02-01 Jim Meyering + + maint: reference CVE-2015-1345 from NEWS + * NEWS: Mention the CVE that was addressed by v2.21-13-g83a95bd, + "grep -F: fix a heap buffer (read) overrun". + +2015-01-18 Jim Meyering + + maint: convert "goto" to "continue" and remove now-spurious label + * src/kwset.c (bmexec_trans): Using "goto big_advance" here is + equivalent to using "continue". Make that change and remove + the now-unused label. + +2015-01-10 Jim Meyering + + tests: add support for ASAN memory poisoning + This lets us reliably detect with ASAN some UMR bugs + that would otherwise be detectable only some of the time + with MSAN. Use __asan_poison_memory_region to mark the unused + portion of a read buffer as inaccessible. Then, with ASAN, + any attempt to access those bytes results in an ASAN abort. + * src/system.h: Include "ignore-value.h". + (__has_feature): Define. + (HAVE_ASAN): Define when address sanitizer is enabled. + [HAVE_ASAN]: Declare these two __asan_* symbols. + [!HAVE_ASAN] (__asan_poison_memory_region): Define stub. + [!HAVE_ASAN] (__asan_unpoison_memory_region): Likewise. + * src/grep.c: Use __asan_poison_memory_region. + +2015-01-09 Yuliy Pisetsky + + grep -F: fix a heap buffer (read) overrun + grep's read buffer is often filled to its full size, except when + reading the final buffer of a file. In that case, the number of + bytes read may be far less than the size of the buffer. However, for + certain unusual pattern/text combinations, grep -F would mistakenly + examine bytes in that uninitialized region of memory when searching + for a match. With carefully chosen inputs, one can cause grep -F to + read beyond the end of that buffer altogether. This problem arose via + commit v2.18-90-g73893ff with the introduction of a more efficient + heuristic using what is now the memchr_kwset function. The use of + that function in bmexec_trans could leave TP much larger than EP, + and the subsequent call to bm_delta2_search would mistakenly access + beyond end of the main input read buffer. + + * src/kwset.c (bmexec_trans): When TP reaches or exceeds EP, + do not call bm_delta2_search. + * tests/kwset-abuse: New file. + * tests/Makefile.am (TESTS): Add it. + * THANKS.in: Update. + * NEWS (Bug fixes): Mention it. + + Prior to this patch, this command would trigger a UMR: + + printf %0360db 0 | valgrind src/grep -F $(printf %019dXb 0) + + Use of uninitialised value of size 8 + at 0x4142BE: bmexec_trans (kwset.c:657) + by 0x4143CA: bmexec (kwset.c:678) + by 0x414973: kwsexec (kwset.c:848) + by 0x414DC4: Fexecute (kwsearch.c:128) + by 0x404E2E: grepbuf (grep.c:1238) + by 0x4054BF: grep (grep.c:1417) + by 0x405CEB: grepdesc (grep.c:1645) + by 0x405EC1: grep_command_line_arg (grep.c:1692) + by 0x4077D4: main (grep.c:2570) + + See the accompanying test for how to trigger the heap buffer overrun. + + Thanks to Nima Aghdaii for testing and finding numerous + ways to break early iterations of this patch. + +2015-01-08 Jim Meyering + + grep: avoid false-positive UMR + For some inputs, valgrind would report an uninitialized + memory read error, but it was harmless. + * src/grep.c (fillbuf): Initialize those trailing bytes. + +2015-01-01 Jim Meyering + + gnulib: update to latest + + maint: update copyright year ranges to include 2015 + Run "make update-copyright". Also, ... + * grep.texi: Update manually, converting each "--" to "-". + +2014-12-15 Paul Eggert + + doc: document binary-data heuristic better + Problem reported by Martin Hoch in: http://bugs.gnu.org/19388 + * doc/grep.texi (File and Directory Selection): + Document what non-text bytes are. + (Usage): Fix cross reference. + +2014-12-12 Jim Meyering + + maint: fix a new "make syntax-check" failure + * tests/dfa-match-aux.c: s/can not/cannot/ + +2014-12-12 Norihiro Tanaka + + build: avoid build failure with --enable-gcc-warnings and no PCRE + * src/pcresearch.c [HAVE_LIBPCRE] (empty_match): Guard the declaration + of this PCRE-only variable. + +2014-12-07 Paul Eggert + + tests: port fmbtest to CentOS 6 and earlier + * tests/fmbtest: Port to platforms where the 'sed' pattern + '[^0-9]' does not match every non-digit character. Problem + reported by Norihiro Tanaka in: http://bugs.gnu.org/19293 + +2014-12-06 Norihiro Tanaka + + dfa: simplify dfaexec + * src/dfa.c (dfaexec): Simplify by rearrangement of IF conditions. + This commit induces no semantic change, and reverts part of commit + v2.5.4-144-gbafa134. + +2014-12-06 Norihiro Tanaka + + dfa: avoid invalid match or infinite loop in unused matching mode + Neither grep nor gawk uses this DFA code in its matching mode, + since each always calls dfacomp with a nonzero final argument. + However, when used in that mode, it had bug: + After failing to match in matching mode, it should return NULL, + but instead would either report a false match or enter an + infinite loop. + + * src/dfa.c (dfaexec_main): After failing to match in matching mode + return NULL, rather than transitioning to the next state. + * tests/dfa-match: Add a new test. + * tests/dfa-match-aux.c: Add a new program to exercise this + otherwise-unused part of dfa.c. + * tests/Makefile.am: Add a rule to build new test. + (check_PROGRAMS): Add dfa-match-aux. + (AM_CPPFLAGS): Add -I$(top_srcdir)/src. + (TESTS): Add dfa-match. + * cfg.mk (exclude_file_name_regexp--sc_bindtextdomain): + (exclude_file_name_regexp--sc_prohibit_atoi_atof): + Exempt the new test file from some syntax-check rules. + +2014-12-04 Santiago Ruano Rincón + + doc: document grep-2.11 change in behavior of -r, --recursive + * doc/grep.texi (--recursive, -r): Mention the new behavior + of recursively searching "." when there is no FILE argument. + * doc/grep.in.1: Likewise. + That change first appeared in grep-2.11, released on 2012-03-02. + +2014-11-24 Jim Meyering + + maint: correct for four Author: name misspellings + * .mailmap: Correct for misspelling in Norihiro Tanaka's last name + as listed in four commit Author: fields: s/Norihirio/Norihiro/ + +2014-11-23 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.21 + * NEWS: Record release date. + +2014-11-21 Jim Meyering + + tests: sjis-mb: remove now-obsolete and failing sub-tests + * tests/sjis-mb: Commit v2.18-123-geb3292b changed how grep + handles patterns with encoding errors. These SJIS tests are + skipped so often that we didn't notice until now that there were + two tests of that changed behavior, and that on any system with + the ja_JP.SHIFT_JIS locale, they would always fail. Remove those + two tests, since this functionality is well tested separately, + via tests/prefix-of-multibyte. + +2014-11-20 Norihiro Tanaka + + grep -F could erroneously fail to match in non-UTF8 multibyte locales + This fixes a bug that can strike only when using a non-UTF8 multibyte + locale like ja_JP.SHIFT_JIS. + + Consider this example: it would mistakenly fail to match before + this patch: + + printf '\203AA\n'|LC_ALL=ja_JP.SHIFT_JIS src/grep -F A + + When searching for a single byte that happens to be the latter + byte of a multibyte character, and the target byte also follows + that multibyte character, grep -F would advance an internal pointer + by one byte too many, thus missing the target byte. A test case + for this bug is already included in tests/sjis-mb. + + * src/kwsearch.c (Fexecute): Skip one byte less, after matched middle of a + multi-byte character. Introduced by commit v2.18-119-gfb7d538. + +2014-11-17 Jim Meyering + + tests: big-match: disable OOM-provoking subtest + * tests/big-match: Our application of this regexp '^.*x\(\)\1' + to a file containing a single matching line of length 2GiB+2 + would cause inordinate memory consumption (over 100GB) via + regexec.c, but no leak. That would cause disruption on most + systems, so remove this subtest. Reported by Assaf Gordon. + +2014-11-16 Norihiro Tanaka + + dfa: avoid undefined behavior + * src/dfa.c (dfassbuild): Don't call memcpy with a second + argument of NULL, even when the size (3rd argument) is 0. + +2014-11-14 Jim Meyering + + gnulib: update to latest + +2014-11-14 Norihiro Tanaka + + grep -F -x -o PAT would print an extra newline for each match + * src/kwsearch.c (Fexecute): Correctly compute the length of a match + by subtracting 2 (not 1) when match_lines is set. With -x, we augment + the "line" by both prepending and appending an EOLBYTE to the search + pattern. Here, we must correct for that. However, to compensate, + when we are using -x (--line-regexp) and start_ptr is NULL, we have + to add 1 to the length so that we still print the trailing EOLBYTE. + Introduced by commit v2.18-85-g2c94326. + * tests/match-lines: Add a new test. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + +2014-11-11 Paul Eggert + + tests: port to Darwin + The 'sed' command 's/.//' does not delete all bytes in the C locale. + Problem reported by Nelson H. F. Beebe. + * tests/fmbtest: Don't assume that sed treats bytes with the + top bit set as valid characters in the C locale, as this is not + true for Darwin. Use the cs_CZ.UTF-8 locale instead, and + simplify the sed script. + + tests: fix recently-introduced stray output + * tests/init.cfg (require_pcre_): Remove stray debugging output. + + build: port to GCC 4.6.4 + glibc 2.5 + On platforms this old, building with _FORTIFY_SOURCE equal to 2 + results in duplicate definitions of standard library functions. + Problem reported by Nelson H. F. Beebe. + * configure.ac (_FORTIFY_SOURCE): Sort after GNULIB_PORTCHECK. + By default, do not enable this unless GNULIB_PORTCHECK is defined. + This better matches the original intent, which as I recall was to + enable these extra checks only with --enable-gcc-warnings. + + tests: port to libpcre sans UTF-8 support + Problem reported by Nelson H. F. Beebe. + * tests/pcre-infloop, tests/pcre-invalid-utf8-input, tests/pcre-utf8: + Skip the test unless PCRE works in an en_US.UTF-8 locale. + +2014-11-09 Jim Meyering + + tests: do not fail when the zh_CN.UTF-8 locale is not installed + * tests/word-multibyte: This test would fail on a system with + no zh_CN.UTF-8 locale. Use it only if it is installed. + + tests: avoid hex_printf_ portability problems + * tests/init.cfg (hex_printf_): Spell out a-f and A-F, for + non-C locales, ensure that the input to sed is newline-terminated, + and quote the final octal format string. + Suggestions from Paul Eggert. + +2014-11-08 Jim Meyering + + tests: avoid a multibyte tr portability problem + * tests/init.cfg (tr): New wrapper function. + See comments for details. Reported by Norihiro Tanaka + in http://debbugs.gnu.org/18991 + + maint: remove spurious LC_ALL setting from one test + * tests/word-multibyte: Remove unnecessary setting of LC_ALL. + + tests: fix typo in previous change + * tests/init.cfg (hex_printf_): Fix typo s/A-f/A-F/. + For the record, I introduced that error, not Norihiro. + +2014-11-08 Norihiro Tanaka + + tests: avoid awk+printf+\xHH portability trap + * tests/init.cfg (hex_printf_): Rewrite in terms of printf and sed. + Using awk's printf with \xHH in the format string was not portable + to the awk of Solaris 10, AIX 7 or HP-UX 11.23, as reported in + http://debbugs.gnu.org/18987. + * tests/word-multibyte: Use printf rather than hex_printf_, + and give the character we're printing a name: e_acute (rather + than A-grave), since that is used in other tests. + a trailing \n in the format string, adjust by removing it, and + instead invoking echo. + * tests/multibyte-white-space: Simply remove each trailing \n. + They were not needed. + +2014-11-07 Jim Meyering + + tests: avoid printf+\xHH portability trap + * tests/word-multibyte: Using the bourne shell's printf function + with strings like "\xHH\xHH" happens to work for most interactive + shells, but not for dash. That is not portable. Use our hex_printf_ + awk wrapper instead. Without this change, this test would fail on + a Debian system for which /bin/sh is configured to be "dash". + + maint: move helper function, hex_printf to init.cfg + * tests/init.cfg (hex_printf_): New function, from ... + * tests/multibyte-white-space: ... here. Reflect the + s/hex_print/hex_printf_/ renaming. + +2014-11-02 Paul Eggert + + grep: port O_NOFOLLOW errno checking to NetBSD + Problem reported by Assaf Gordon in: http://bugs.gnu.org/18892 + * NEWS: Document it. + * src/grep.c (open_symlink_nofollow_error): + New function, which does the right thing on NetBSD. + (grepfile): Use it. + +2014-10-31 Jim Meyering + + build: generate man pages even when existing targets are read-only + * doc/Makefile.am (grep.1): Use mv -f to move temporary to target, + in case the target is read-only. Also, always make the generated + files read-only. + (egrep.1 fgrep.1): Likewise. + This avoids a build failure reported by Eric Blake in + http://lists.gnu.org/archive/html/bug-grep/2014-10/msg00112.html + +2014-10-30 Jim Meyering + + tests: avoid false-positive failure due to some zh_CN.* locales + On some systems, and for some zh_CN.* locales (e.g., OpenBSD5.5) the + E-acute pair of bytes do not qualify as a word-constituent character. + * tests/word-multibyte: Use zh_CN.UTF-8, rather than "zh_CN". + Reported by Assaf Gordon and Bruce Dubbs in + http://debbugs.gnu.org/18892 + +2014-10-29 Jim Meyering + + gnulib: update to latest; bootstrap, too + * gnulib: Update to latest. + * bootstrap: Copy latest from gnulib. + +2014-10-28 Jim Meyering + + tests: make new test script executable + * tests/word-multibyte: Make this file executable. + +2014-10-28 Norihiro Tanaka + + dfa: make \w and \W work in multibyte locales + Reported by Jaroslav Skarvada in: http://bugs.gnu.org/18817 + Now, \w and \W are supported in not only single byte locale but multibyte + locale. + + * src/dfa.c (PUSH_LEX_STATE, POP_LEX_STATE): Move definitions "up", + so they are not within the function. + (lex): Make \w and \W work in a multibyte locale, the same way + we made \s and \S work. + * tests/word-multibyte: New test for this change. + * tests/Makefile.am: Add a rule to build new test. + * NEWS (Bug fixes): Mention it. + +2014-10-26 Norihiro Tanaka + + dfa: avoid false match in a non-UTF8 multibyte locale + This command should print nothing: + + printf '\263\244\263\244\n' \ + | LC_ALL=ja_JP.eucJP grep -E "$(printf '^x|\244\263')" + + Before this patch, it would print its sole input line. + * src/dfa.c (struct dfa): Add new members: min_trcount, + initstate_letter, initstate_others. + (dfaanalyze): Build states with not only a newline context but others. + (build_state): Don't release initial states. + (skip_remains_mb): Add a parameter. + Add a comment describing all parameters. + (dfaexec_main): When there are multiple start states, we are about + to transition from one state to another and the current byte is not + the first byte of a multibyte character, first advance past the + current multibyte character. + * tests/euc-mb: Add a new test. + * NEWS (Bug fixes): Mention it. + This addresses http://debbugs.gnu.org/18685 + +2014-10-25 Paul Eggert + + tests: work around older libpcre bugs when testing -P and UTF-8 + * tests/pcre-invalid-utf8-input: Add require_timeout_ and + require_compiled_in_MB_support. Put a timeout of 3 seconds on + grep, to avoid having this test case loop forever with older + versions of libpcre, such as those found on RHEL 6.5. + Reported by Jim Meyering in: http://bugs.gnu.org/18806#34 + +2014-10-24 Norihiro Tanaka + + tests: add test for grep -P fix + * tests/pcre-o: New test for this change. + * tests/Makefile.am (TESTS): Add it. + +2014-10-24 Paul Eggert + + grep: fix grep -P crash + Reported by Shlomi Fish in: http://bugs.gnu.org/18806 + Commit 9fa500407137f49f6edc3c6b4ee6c7096f0190c5 (2014-09-16) is a + hack that I put in to speed up 'grep -P'. Unfortunately, not only + is it violation of modularity, it's also a bug magnet, as we have + found out with Bug#18738 and Bug#18806. Remove the optimization + instead of applying more bandaids. Perhaps we can think of a + better way of doing the optimization, or perhaps we can just live + with a slower grep -P (as -P is inherently slower anyway...). + * src/grep.c, src/grep.h (validated_boundary): + Remove. All uses removed. + * src/pcresearch.c (Pexecute): Do not worry about validated_boundary. + +2014-10-19 Norihiro Tanaka + + dfa: remove two erroneous clauses from a now-unused function + RE_DOT_NEWLINE and RE_DOT_NOT_NULL apply only to a dot that + matches any character. Do not consider them when matching + with a bracket expression. + + * src/dfa.c (match_mb_charset): Remove tests for RE_DOT_NEWLINE + and RE_DOT_NOT_NULL. + +2014-10-19 Norihiro Tanaka + + dfa: process all MBCSET constructs via glibc's matcher + The DFA matcher does not support collating symbols or equivalence + classes, so ensure that any MBCSET reference is handled by the glibc + matcher. dfa.c already handled this in one case, but not the other, + so that a command like "printf '\0' |src/grep -aE '^\s?$'" would + mistakenly end up using dfa.c's match_mb_charset function rather + than glibc's matcher. + + * src/dfa.c (dfaexec_main): Move that code into the + State_transition macro. This renders the match_mb_charset + unused by grep. + * tests/multibyte-white-space: Add a test to exercise the + just-rendered-inaccessible code path. + +2014-10-15 Norihiro Tanaka + + grep: initialize validation_boundary properly before use + * src/grep.c (main): Initialize validation_boundary before pre-searching + for an empty line. + +2014-10-15 Paul Eggert + + grep: fix off-by-one bug in -P optimization + Reported by Norihiro Tanaka in: http://bugs.gnu.org/18738 + * src/pcresearch.c (Pexecute): Fix off-by-one bug with + validation_boundary. + * tests/init.cfg (envvar_check_fail): Catch off-by-one bug. + +2014-10-08 Norihiro Tanaka + + dfa: fix a theoretical bug + * src/dfa.c (dfaexec_main): After searching for a match from + the initial state, set the previous state, S1, to 0. + So far, we have found no case in which this fix makes a difference. + See http://debbugs.gnu.org/18645 + +2014-10-07 Paul Eggert + + doc: modernize and simplify man page + * doc/grep.in.1 (Tx, Id): Remove. All uses removed. + (MTO, URL): New macros, used for email and URL. + Use them when appropriate. + In main text, omit chatty discussions of other implementations; + the full manual suffices for this sort of thing. + + doc: clarify exit status + Reported by Santiago Ruano Rincón in: http://bugs.gnu.org/18651 + * doc/grep.in.1 (EXIT STATUS): + * doc/grep.texi (Exit Status): Clarify. + +2014-10-07 Norihiro Tanaka + + dfa: test for just-fixed bug + * tests/mb-dot-newline: New file. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + Bisection suggests that the bug was introduced by + commit v2.18-123-geb3292b. Also see + http://debbugs.gnu.org/cgi/bugreport.cgi?msg=17;bug=18580 + +2014-10-05 Norihiro Tanaka + + dfa: factor out a new nontrivial block of duplicated code + * src/dfa.c (State_transition): New macro. + (dfaexec_main): Use it twice. + + dfa: check end of input buffer after transition in non-UTF8 multibyte locale + * src/dfa.c (dfaexec_main): Check for end of input buffer after each + transition in a non-UTF8 multibyte locale. + * tests/mb-non-UTF8-overrun: New test. + * tests/Makefile.am (TESTS): Add it. + * src/grep.c (main): With this fix, we no longer need the fourth + byte of "eolbytes". + +2014-10-04 Jim Meyering + + grep: avoid stack buffer read-underrun and overrun + Testing binaries built with -fsanitize=address caused aborts due + to stack underrun and overrun. + * src/grep.c (main): Allocate a larger buffer for eolbytes: + one byte before the beginning and one more after the end. + For details, see http://debbugs.gnu.org/18580#44. + +2014-10-04 Norihiro Tanaka + + grep: fix subscript error when testing whether empty lines match + src/grep.c (grep): When testing whether an empty line matches, + make the input buffer one byte longer, as dfaexec uses that + for a sentinel. + +2014-09-27 Paul Eggert + + dfa: minor tweaks, mostly to remove __attribute__ ((noinline)) + That attribute isn't portable, and I found a way to get similar + performance with standard C features. + * NEWS: Document the recently-installed performance improvement. + * src/dfa.c (struct dfa): New member dfaexec. + (dfaexec_main): Remove unnecessary 'const'. + (dfaexec_mb, dfaexec_sb): Remove __attribute__ ((noinline)); + no longer needed. + (dfaexec): Use new dfaexec member. + (dfainit, dfaoptimize, dfassbuild): Initialize it. + +2014-09-27 Norihiro Tanaka + + dfa: separate dfaexec function to help optimization by compiler + * src/dfa.c (dfaexec_main): Rename from dfaexec, add inline attribute. + (dfaexec_mb): New function. Run it when d->multibyte is true. For this + function inlination must be avoided. + (dfaexec_sb): New function. Run it when d->multibyte is false. For this + function inlination must be avoided. + (dfaexec): Call dfaexec_mb or dfaexec_sb accoding to d->multibyte. + +2014-09-27 Norihiro Tanaka + + dfa: speed-up at initial state + DFA state is always 0 until have found potential match. So we improve + matching there by continuing to use the transition table. + + * src/dfa.c (skip_remains_mb): New function. + (dfaexec): Speed-up at initial state. + +2014-09-27 Paul Eggert + + maint: generalize the -Wcast-align fix + * src/grep.c (CAST_ALIGNED): New macro. + (skip_easy_bytes): Use it. + +2014-09-27 Jim Meyering + + maint: suppress a false-positive -Wcast-align warning + Building with --enable-gcc-warnings and gcc-4.9.1 would provoke this: + grep.c:499:12: error: cast from 'const char *' to 'const uword *'\ + (aka 'const unsigned long *') increases required alignment from\ + 1 to 8 [-Werror,-Wcast-align] + for (s = (uword const *) p; ! (*s & hibyte_mask); s++) + ^~~~~~~~~~~~~~~~~ + * src/grep.c (skip_easy_bytes): Use a pragma to suppress + gcc's false-positive cast-alignment warning. + +2014-09-26 Paul Eggert + + grep: don't check extensively for invalid prefix bytes unless -P + Problem reported by Jim Meyering in: http://bugs.gnu.org/18454#56 + * src/grep.c (grep): After the first buffer is checked, leave the + file-type checker in TEXTBIN_UNKNOWN state only when -P is used. + Only the -P matcher has performance problems with checking binary + data that make it worthwhile to check every prefix input byte so + the -P matcher's TEXTBIN_UNKNOWN optimizations can come into play. + Other matchers can simply check the data directly, and using + TEXTBIN_UNKNOWN with them slows 'grep' down for no benefit. + + grep: scan for valid multibyte strings more quickly + Scan valid multibyte strings more quickly in the common case of + encodings that are upward compatible with ASCII, such as UTF-8. + You'd think there'd be a fast standard way to do this nowadays, + but nooooo.... + Problem reported by Jim Meyering in: http://bugs.gnu.org/18454#56 + * src/grep.c (HIBYTE): New constant. + (easy_encoding): New static var. + (init_easy_encoding, skip_easy_bytes): New functions. + (uword): New type. + (buffer_textbin): Skip easy bytes quickly. + Don't bother with mb_clen here, since skip_easy_bytes typically + captures the easy cases; just use mbrlen directly. + (buffer_textbin, file_textbin): First arg is no longer a const + pointer, since the byte past the end is now an overwritten sentinel. + (fillbuf): Make room for a uword after the buffer, for skip_easy_bytes. + (main): Call init_easy_encoding. + +2014-09-17 Paul Eggert + + grep: speed up processing of holes before EOF on Solaris + * src/grep.c (fillbuf): If SEEK_DATA fails with errno == ENXIO, + skip over the hole at EOF. + + grep: port to platforms lacking SEEK_DATA + Reported by Norihiro Tanaka in: http://bugs.gnu.org/18454#38 + * src/grep.c (SEEK_DATA): Default to SEEK_SET if not defined. + (SEEK_HOLE): Move to top level, and default it to SEEK_SET. + (file_textbin): Adjust to new default. + (fillbuf): Don't bother with SEEK_DATA if it defaults to SEEK_SET. + + grep: skip past holes efficiently + Take advantage of the relaxed rules for treating non-text bytes in + binary data, by efficiently skipping past holes on platforms + supporting lseek's SEEK_DATA flag. + On one test on a circa-2008 Sun Fire V40z running Solaris 11.2, + 'grep x' took 0.009 real-time seconds to scan a holey file of size + 9,223,372,036,854,775,802 bytes, for a nominal scan rate of 1 ZB/s. + grep 2.20's scan rate on this platform was 843 MB/s, so this is a + speedup by a factor of 1.2 trillion. The speedup factor is not + as great on GNU/Linux hosts, due to what appear to be SEEK_DATA + inefficiencies, but presumably this will be cleared up in time. + * NEWS: Document this. + * src/grep.c, src/grep.h (eolbyte): Now char, not unsigned char. + This is for compatibility with the rest of the code. + The old (performance?) reasons for 'unsigned char' are now moot. + * src/grep.c (skip_nuls, skip_empty_lines, seek_data_failed): + New static vars. + (totalnl): Move up, since it's about input, not output, and + fillbuf now uses it. + (add_count): Move up, since fillbuf now uses it. + (all_zeros): New function. + (fillbuf): Use SEEK_DATA to skip past holes efficiently, + on systems that support this. + (grep, main): Set the new static vars. + + grep: improve -P performance in typical cases + * src/grep.c, src/grep.h (enum textbin): Move to grep.h. + (input_textbin, validated_boundary): New vars. + * src/grep.c (grepbuf, grep): Initialize them. + * src/pcresearch.c (Pexecute): Do a multiline search + when the input is known to be free of encoding errors. + Quickly discard bytes that are obviously encoding errors. + Quickly match empty strings. + + grep: minor -P speedup with jit_stack + * src/pcresearch.c (jit_stack): No longer static. + + grep: non-text bytes in binary data may be treated as line ends + * NEWS, doc/grep.texi (File and Directory Selection): + Document this change. + * src/grep.c (zap_nuls): New function. + (grep): Use it. + * tests/null-byte: Relax to allow new behavior. + + grep: -z no longer considers '\200' to be binary data + This avoids a problem when using grep -z in a Windows-1252 locale. + Plus, it lets 'grep -z' run a bit faster. + * NEWS: Document this. + * src/grep.c (buffer_textbin): Don't look for '\200' if -z. + * tests/pcre-z: Test for new behavior. + + grep: refactor binary-vs-unknown-vs-text flags for clarity + * src/grep.c (enum textbin): New enum. + (textbin_is_binary): New function. + (buffer_textbin, file_textbin, grep): Use them, for clarity. + +2014-09-16 Paul Eggert + + grep: fix -P speedup bug with empty match + * src/pcresearch.c (NSUB): New top-level constant, replacing + 'nsub' within Pexecute. + (Pcompile, Pexecute): Use it. + (Pexecute): Don't assume sub[1] is zero after a PCRE_ERROR_BADUTF8 + match failure. + * tests/pcre-invalid-utf8-input: Test for this bug. + + grep: port -P speedup to hosts lacking PCRE_STUDY_JIT_COMPILE + * src/pcresearch.c (Pcompile): Do not assume that + PCRE_STUDY_JIT_COMPILE is defined. + (empty_match): Define on all platforms. + + grep: use mbclen cache in one more place + * src/grep.c (fgrep_to_grep_pattern): Use mb_clen here, too. + + grep: avoid false alarms for mb_clen and to_uchar + * cfg.mk (_gl_TS_unmarked_extern_functions): New var, + to bypass the tight_scope false alarms on mb_clen and to_uchar. + + grep: use mbclen cache more effectively + * src/grep.c (buffer_textbin, contains_encoding_error): + Use mb_clen for speed. + (buffer_textbin): Bypass mb_clen in unibyte locales. + (main): Always initialize the cache, since it's sometimes used in + unibyte locales now. Initialize it before contains_encoding_error + might be called. + * src/search.h (SEARCH_INLINE): New macro. + (mbclen_cache): Now extern decl. + (mb_clen): New inline function. + * src/searchutils.c (SEARCH_INLINE, SYSTEM_INLINE): Define. + (mbclen_cache): Now extern. + (build_mbclen_cache): Put 1 into the cache when mbrlen returns 0. + (mb_goback): Use mb_len for speed, and rely on it returning nonzero. + * src/system.h (SYSTEM_INLINE): New macro. + (to_uchar): Use it. + + grep: improve performance for older glibc + glibc has a bug where mbrlen and mbrtowc mishandle length-0 inputs. + Working around it in gnulib slows grep down, so disable the tests for it + and make sure grep works even if the bug is present. + * bootstrap.conf (avoided_gnulib_modules): Add mbrtowc-tests. + * configure.ac (gl_cv_func_mbrtowc_empty_input): Assume yes. + * src/searchutils.c (mb_next_wc): Don't invoke mbrtowc on empty input. + + grep: treat a file as binary if its prefix contains encoding errors + * NEWS: + * doc/grep.texi (File and Directory Selection): + Document this. + * src/grep.c (buffer_encoding, buffer_textbin): New functions. + (file_textbin): Rename from file_is_binary. Now returns 3-way value. + All callers changed. + (file_textbin, grep): Check the input more carefully for text vs + binary data. + (contains_encoding_error): Remove; use replaced by buffer_encoding. + * tests/backref-multibyte-slow: + * tests/high-bit-range: + * tests/invalid-multibyte-infloop: + Use -a, since the input is now considered to be binary. + * tests/invalid-multibyte-infloop: Add a check for new behavior. + + grep: use bool for boolean in grep.c + * src/grep.c (show_version, suppress_errors, only_matching) + (align_tabs, match_icase, match_words, match_lines, errseen) + (write_error_seen, is_device_mode, usable_st_size) + (file_is_binary, skipped_file, reset, fillbuf, out_quiet) + (out_line, out_byte, count_matches, no_filenames, line_buffered) + (done_on_match, exit_on_match, print_line_head, prline, grep) + (grepdirent, grepfile, grepdesc, grep_command_line_arg) + (get_nondigit_option, main): Use bool for boolean. + (print_line_head, prline): Use char for byte. + * src/grep.h: Include , and adjust decls to match + changes in grep.c. + + grep: speed up -P on files containing many multibyte errors + * src/pcresearch.c (empty_match): New var. + (Pcompile): Set it. + (Pexecute): Use it. + + grep: remove/refactor unnecessary code about line splitting + * src/grep.c (do_execute): Remove. Caller now uses 'execute'. + * src/pcresearch.c (Pexecute): Improve comment about this. + +2014-09-12 Paul Eggert + + grep: diagnose -P in non-UTF-8 multibyte locale + * src/pcresearch.c (Pcompile): + libpcre supports only unibyte and UTF-8 locales, + so report an error and exit if used in other locales. + * NEWS: Mention this. + * tests/euc-mb: Test this. + +2014-09-12 Jim Meyering + + doc: move NEWS note about GREP_OPTIONS into proper section + * NEWS (Changes in behavior): Move the note about GREP_OPTIONS + from the 2.20 section into the section for the upcoming release. + +2014-09-12 Paul Eggert + + grep: make GREP_OPTIONS obsolescent + * NEWS: + * doc/grep.in.1 (ENVIRONMENT_VARIABLES): + * doc/grep.texi (Environment Variables): + Document that GREP_OPTIONS is obsolescent now. + * src/grep.c (main): Warn if GREP_OPTIONS is used. + * tests/r-dot, tests/skip-device: Don't use GREP_OPTIONS. + +2014-09-11 Paul Eggert + + doc: bug tracker has moved to debbugs.gnu.org + * README (KNOWN BUGS): + * doc/grep.in.1: + * doc/grep.texi (Reporting Bugs): Document this. + + grep: fix false matches with -P '...$' and invalid UTF-8 + * tests/pcre-invalid-utf8-input: Add a test for that. + + grep: fix false matches with -P '...$' and invalid UTF-8 + * src/pcresearch.c (Pexecute): Use PCRE_NOTEOL when matching + initial substrings of a line. + +2014-09-10 Jim Meyering + + tests: add expect-to-fail test for a glibc regexp bug + * tests/triple-backref: New file. + * tests/Makefile.am (TESTS): Add it. + (XFAIL_TESTS): List it as a known, always-failing test. + Based on the bug report from Paul Eggert: + https://sourceware.org/bugzilla/show_bug.cgi?id=17356 + + maint: avoid distcheck failure + * Makefile.am (EXTRA_DIST): Add .mailmap. + +2014-09-10 Paul Eggert + + grep: port recent fix to older pcre version + * src/pcresearch.c (Pexecute): Don't assume that a pcre_exec + that returns PCRE_ERROR_NOMATCH leaves its sub argument alone. + This assumption is false for libpcre-3 version 8.31-2ubuntu2. + +2014-09-09 Paul Eggert + + grep: -P now treats invalid UTF-8 input as non-matching + Problem reported by Santiago Vila in: http://bugs.gnu.org/18266 + * NEWS: Mention this. + * src/pcresearch.c (Pexecute): Treat UTF-8 encoding errors + as non-matching data, instead of exiting 'grep'. + * tests/pcre-infloop: grep now exits with status 1, not 2. + * tests/pcre-invalid-utf8-input: grep now exits with status 0, not 2. + +2014-08-14 Paul Eggert + + grep: fix integer-width bugs in undossify_input etc. + undossify_input bug reported by Vincent Lefevre in: + http://bugs.gnu.org/18269 + * src/dosbuf.c (undossify_input): Return size_t, not int. + * src/grep.c (fillbuf): Work portably even if safe_read returns a + value greater than SSIZE_MAX, e.g., if there's an I/O error. + +2014-08-03 Paul Eggert + + doc: document LANGUAGE + Reported by Benno Schulenberg in: http://bugs.gnu.org/18185 + * doc/grep.texi (Environment Variables): Document LANGUAGE. + + doc: prefer @env to @code + Reported by Benno Schulenberg in: http://bugs.gnu.org/18184 + * doc/grep.texi: Avoid @code in favor of @env, or of nothing at all. + +2014-07-11 Paul Eggert + + doc: Document -r vs --exclude more carefully. + Problem reported by Hugues Andreux in: http://bugs.gnu.org/17763 + * doc/grep.texi (File and Directory Selection): Be more careful + about documenting the interaction between recursive searching, + --include, --exclude, and --exclude-dir. + +2014-06-27 Jim Meyering + + maint: split long lines, and enforce the 80-column limit + * cfg.mk (sc_long_lines): New rule, from coreutils; exempt tests/* + * src/grep.c (usage): Tweak -F wording to shorten a line. + Correct grammar in a comment. + Split the --exclude-file=... description to fit within 80 columns. + Use emit_bug_reporting_address, eliminating another long line. + * src/dfa.c: Split long lines. No semantic change. + * doc/grep.texi: Likewise. + * tests/include-exclude: Split a long line. + * tests/backref: Split long lines. + * tests/empty: Likewise. + * tests/fmbtest: Likewise. + + doc: update HACKING + * HACKING: Update from coreutils. + + maint: generate distributed THANKS from VC'd THANKS.in + * Makefile.am (THANKS): New rule. + * THANKS.in: New file. + * THANKS: Remove. Now it's generated from the combination of + THANKS.in and git logs. + * .mailmap: New file. + * cfg.mk (sc_THANKS_in_duplicates): New syntax-check rule, from + coreutils. + * .gitignore: Add THANKS. + * thanks-gen: New file, from coreutils. + +2014-06-27 Paul Eggert + + grep: with -E, unmatched ')' matches itself + Problem reported by Nathan Weeks in: http://bugs.gnu.org/17856 + * src/grep.c (Ecompile): Also specify RE_UNMATCHED_RIGHT_PAREN_ORD. + * doc/grep.texi (Fundamental Structure), NEWS: Document this. + * tests/ere.tests: Add a couple of tests for this. + * tests/spencer1.tests: Fix exit status. + +2014-06-17 Paul Eggert + + build: avoid -Wstack-protector + This allows the use of --enable-gcc-warnings on Gentoo and Ubuntu. + See: http://bugs.gnu.org/17793 + * configure.ac (WERROR_CFLAGS): Avoid -Wstack-protector. + + This can be worked around, but the cure is worse than the disease. + +2014-06-17 Paul Eggert + + build: don't make output files read-only + This led to problems, such as the prompt "mv: try to overwrite + 'egrep', overriding mode 0555 (r-xr-xr-x)? " during a build. + It can be worked around, but the cure is worse than the disease; + making output files read-only is more trouble than it's worth. + * doc/Makefile.am (grep.1, egrep.1, fgrep.1): + * lib/Makefile.am (colorize.c): + * src/Makefile.am (egrep fgrep): + Don't make output files read-only. Prefer separate commands to + '&&' when either will do. + +2014-06-08 Paul Eggert + + maint: remove grep.spec + * grep.spec: Remove; obsolete and evidently not used. + +2014-06-07 Paul Eggert + + doc: use gnulib fdl module + * bootstrap.conf (gnulib_modules): Add fdl. + * doc/fdl.texi: Remove, as this now comes from gnulib. + * doc/.gitignore: Update to match current sources. + +2014-06-06 Jim Meyering + + build: improve rule to generate egrep+fgrep scripts + * src/Makefile.am (egrep fgrep): chmod a=rx generated files, + and remove $@-t before attempting to redirect to it, in case it + is read-only. + + build: don't redirect directly to $@ + * lib/Makefile.am (colorize.c): Don't redirect directly to target, $@. + Otherwise, we could create a corrupt colorize.c file with a + timestamp that indicates it is up to date. + Also, make the generated file read-only. + +2014-06-05 Paul Eggert + + grep: undo part of previous change + * src/dfa.c (enlist): Undo part of previous change that doesn't + look correct and doesn't help performance much anyway. + + grep: use system strstr if available and fast + Problem reported by Norihiro Tanaka in: http://bugs.gnu.org/17700 + * NEWS: Document this. + * bootstrap.conf (gnulib_modules): Add strstr. + * src/dfa.c (istrstr): Remove. + (enlist): Use strstr instead. Wait until we need memory before + allocating it; this can save an unnecessary allocate and free. + + build: update gnulib submodule to latest + +2014-06-03 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.20 + * NEWS: Record release date. + +2014-05-30 Jim Meyering + + grep: fix --max-count=N (-m N) to stop reading after Nth match + With --max-count=N (-m N), grep is supposed to stop reading input + after it has found the Nth match. However, a recent context- + related change made it so grep would always read to end of file. + * src/grep.c (prtext): Don't let a negative "out_after" value + make "pending" line count negative. + * tests/max-count-overread: New test, for this. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + * THANKS: Add names of two recent bug reporters. + This bug was introduced by commit v2.18-139-g5122195. + Reported by Marc Aldorasi in http://bugs.gnu.org/17640. + +2014-05-29 Jim Meyering + + dfa: fix off-by-one under-allocation from recent change + Commit v2.19-10-gc32ff67 mistakenly made this change: + -realloc_trans_if_necessary (d, 1); + +realloc_trans_if_necessary (d, 0); + which led to a heap buffer overflow. + * src/dfa.c (dfaexec): Allocate space for one state, as before. + +2014-05-28 Norihiro Tanaka + + dfa: fix bug with regex containing multiple begin/end-line constraints + grep -E 'a(b$|c$)' would mistakenly match "aa". + * src/dfa.c (dfamust): When resetting 'is' in OR, also reset + 'begline' and 'endline' of 'must'. + * NEWS (Bug fixes): Mention it. + This bug was introduced via commit v2.18-85-g2c94326. + Reported by Péter Radics in . + +2014-05-26 Norihiro Tanaka + + dfa: simplify building initial state + build_state_zero doesn't need the struct dfa to be initialized, + so remove the initialization and simplify. + * src/dfa.c (build_state_zero): Remove. + (dfaexec): Call realloc_trans_if_necessary and build_state directly. + + dfa: revert "grep: do not count newline before the start of buffer" + This reverts commit 5dc3af2806d21455b818be3f9da26c372e4a7f8d. + The previous change renders that commit unnecessary. + + dfa: do not clear the first state of a transition table + If number of DFA states reaches 1024, build_state clears transition + tables to save memory. However, the initial state is always used, + so clearing it just wastes time. + * src/dfa.c (build_state): Do not clear the initial state's + transition and failure tables. + + grep: remove unnecessary argument + * src/grep.c (do_execute): Remove argument 'start_ptr'. It's always null. + All uses changed. + +2014-05-24 Paul Eggert + + grep: --exclude-dir=FOO/ now ignores the trailing slash + Problem reported by Khaled Ziyaeen; see: http://bugs.gnu.org/17481 + * NEWS, doc/grep.texi (File and Directory Selection): Document this. + * src/grep.c (main): Implement this. + * tests/include-exclude: Test this. + + dist: don't distribute lib/colorize.c + 'configure' creates this file, so it shouldn't be distributed; see: + http://bugs.gnu.org/17480 + * configure.ac (COLORIZE_SOURCE): New macro. + Don't use AC_CONFIG_LINKS for lib/colorize.c. + * lib/Makefile.am (nodist_libgreputils_a_SOURCES): New macro. + (libgreputils_a_SOURCES): Remove colorize.c. + (CLEANFILES): Add colorize.c + (colorize.c): New rule. + +2014-05-23 behoffski + + maint: uncapitalize first letter of two dfaerror message strings + * dfa.c (lex): Make two message strings consistent with all of + the others: do not capitalize the first letter of the first word. + +2014-05-23 Jim Meyering + + maint: revert "grep: port mb_next_wc to RHEL 6.5 x86-64" + This reverts commit v2.18-148-ga6ae68d. + Now that we have gnulib change v0.1-131-g2a045bc, "mbrlen, mbrtowc: + fix bug with empty input", this work-around is no longer needed. + + gnulib: update, for mbrlen/mbrtowc empty input bug fix + +2014-05-22 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.19 + * NEWS: Record release date. + +2014-05-21 Jim Meyering + + maint: avoid new false-positive syntax-check failure + * cfg.mk (exclude_file_name_regexp--sc_prohibit_doubled_word): + Exempt new test file that contains legitimate use of "in in". + +2014-05-17 Norihiro Tanaka + + tests: add test case for newline-count fix + * tests/count-newline: New test. + * tests/Makefile.am (TESTS): Add it. + +2014-05-16 Norihiro Tanaka + + grep: do not count newline before the start of buffer + * src/dfa.c (build_state): When checking whether the previous + character was a newline, do not count any newline before the + start of the buffer. + +2014-05-15 Paul Eggert + + grep: port mb_next_wc to RHEL 6.5 x86-64 + * src/searchutils.c (mb_next_wc): Work around glibc bug 16950; see: + https://sourceware.org/bugzilla/show_bug.cgi?id=16950 + This bug was masked in the other GNU/Linux tests I made. It was + exposed on RHEL 6.5 x86-64, where the compiler (GCC Red Hat 4.4.7-4) + happened to use temporaries in a different way. + Also see recent changes to the Gnulib documentation in this area: + http://lists.gnu.org/archive/html/bug-gnulib/2014-05/msg00013.html + + tests: port mb-non-UTF8-performance to RHEL 6.5 + * tests/mb-non-UTF8-performance (timeout): Use an integer, + as 'timeout 1.234' doesn't work in EUC locales. + +2014-05-12 Paul Eggert + + egrep, fgrep: port to Solaris 10 /bin/sh + This old shell doesn't grok ${0%/*}; see: http://bugs.gnu.org/17471 + * src/Makefile.am (egrep fgrep): Don't assume the shell does substrings. + * src/egrep.sh (dir): New var, so that the substring calculation is + done only once (which is a small win even with newer shells), + and so that the calculation is easier to edit on older shells. + +2014-05-10 Jim Meyering + + maint: NEWS: adjust wording to reflect move + * NEWS (Improvements): Correct direction-relative wording, + now that the referent is below, not above. + + maint: NEWS: move "Improvements" to the top + * NEWS: Move the small "Improvements" section to precede + the longer "Bug fixes" one. + + gnulib: update submodule to latest, and bootstrap + * gnulib: Update submodule. + * bootstrap: Update from gnulib. + +2014-05-10 Paul Eggert + + dfa: omit double includes + * src/dfa.c: Don't include stddef.h or stdbool.h, as dfa.h includes + them already, and it's the same module as we are. + Suggested by Aharon Robbins in: http://bugs.gnu.org/17458 + + dfa: fix bug with \< etc in multibyte locales + Problem reported by Stephane Chazelas in: http://bugs.gnu.org/16867 + * NEWS: Document the fix. + * src/dfa.c (dfaoptimize): Remove any superset if changing from + UTF-8 to unibyte, and if the pattern has no backreferences. + (dfassbuild): In multibyte locales, treat \< \> \b \B as + backreferences in the DFA, since the DFA relies on unibyte + tests to check them. + (dfacomp): Optimize after building the superset, so that + dfassbuild can depend on d->multibyte. A downside is that + dfaoptimize must remove supersets that are likely slower than the + DFA after optimization, but that's been done in the + above-described change. + * tests/Makefile.am (XFAIL_TESTS): Remove word-delim-multibyte, + since the test works now. + + tests: add test case for -C 0 change + * tests/context-0: New test. + * tests/Makefile.am (TESTS): Add it. + + grep: -A 0, -B 0, -C 0 now output a separator + Problem reported by Dan Jacobson in: http://bugs.gnu.org/17380 + * NEWS: + * doc/grep.texi (Context Line Control): Document this. + * src/grep.c (prtext): Output a separator even if context is zero. + (main): Default context is now -1, not 0. + +2014-05-09 Paul Eggert + + grep: minor improvements to retry-DFA-superset patch + * src/dfasearch.c (EGexecute): Avoid unnecessary test in a context + where memrchr cannot return a null pointer. + +2014-05-09 Norihiro Tanaka + + grep: retry DFA superset after matching multiple lines + * src/dfasearch.c (EGexecute): Without this patch, the code reverts + to KWset when the DFA superset matches multiple lines. + However, if the DFA superset matches multiple lines, it most likely + also matches a single line, and reverting to KWset means dfafast + won't work effectively. Change the code so that it retries the DFA + superset immediately after it matches multipline lines. On my platform + this improves the performance of "LC_ALL=C grep '\(ab\)cd\1d' k" from + 3.48 to 2.14 seconds realtime, where k contains the output of + "yes abcdabc | head -50000000". + + dfa: fix inconsistency in multibyte locales + * src/dfa.c (dfaexec): Use the same exit condition in multibyte + locales as in unibyte. + +2014-05-08 Jim Meyering + + maint: mark some breakless cases with /* fallthrough */ comment + * src/dfa.c (addtok_mb, dfaanalyze): Add comment so that it is + clear that the "break" statement is deliberately omitted. + +2014-05-08 Paul Eggert + + dfa: assume C89 for CHAR_BIT + * src/dfa.c (CHARBITS): Remove. All uses replaced by CHAR_BIT. + (NOTCHAR): Now an enum, since it need not be a macro. + + dfa: don't assume unsigned int is exactly 32 bits wide + Sun C 5.12 (sparc) warns of the potential unportability. + * src/dfa.c (charclass_word): New type, for clarity. + All relevant uses of 'unsigned' changed. + (CHARCLASS_WORD_BITS): Rename from INTBITS. All uses changed. + Now an enum, since it needn't be a macro. + (CHARCLASS_WORD_MASK): New macro. + (CHARCLASS_WORDS): Rename from CHARCLASS_INTS. All uses changed. + (setbit, clrbit): Cast 1 to charclass_word, for clarity. + (notset, add_utf8_anychar, dfastats): + Don't assume unsigned int is exactly 32 bits wide. + (dfastate): Don't rely on implementation-defined conversion of + greater-than-INT_MAX unsigned to int. Change bit test to resemble + tstbit more. + + maint: fix indenting to pacify 'prohibit_tab_based_indentation' + * src/dfa.c: Use spaces and not tabs to indent some lines. + + grep: simplify and clarify invert-related code + * src/grep.c (out_invert, prtext): Use bool for booleans. + (prline): Remove unnecessary '!!' on a value that is always 0 or 1. + (prtext): Remove last arg NLINESP; use !out_invert instead. All uses + changed. Move decls to nearer uses, since we can assume C99 here. + Update 'outleft' and 'after_last_match' here; it's simpler. + (grepbuf): Compute return value by subtracting new from old 'outleft', + rather than by keeping a separate running total. Avoid code duplication + by arranging for prtext to be called from one place, not three. + +2014-05-08 Norihiro Tanaka + + grep: improve performance of -v when combined with -L, -l or -q + Problem reported by Jörn Hees in: http://bugs.gnu.org/17427 + * src/grep.c (grepbuf, grep): When -v is combined with -L, -l, or -q, + don't read data unnecessarily after a non-match is found. + +2014-05-06 Paul Eggert + + doc: mention performance changes + * NEWS: Discuss recent performance improvements and downgrades. + + dfa: clarify use of "if" + The phrase "Y is true if X" is logically equivalent to "X implies Y", + but often "X if and only if Y" was intended. + * src/dfa.c, src/dfa.h: Reword to avoid the incorrect use of "if". + + dfa: minor performance improvement for previous change + * src/dfa.c (struct dfa): New member 'fast'. Remove 'has_backref'. + All uses changed. + +2014-05-06 Norihiro Tanaka + + dfa: speed up 'dfaisfast' + * src/dfa.c (struct dfa): New member 'has_backref'. + (addtok_mb): Set it. + (dfaisfast): Use it. + +2014-05-05 Paul Eggert + + grep: fix -w match next to a multibyte letter + * NEWS: Document this. + * src/dfasearch.c, src/kwsearch.c (WCHAR): Remove. + (wordchar): New static function. + * src/dfasearch.c (EGexecute): + * src/kwsearch.c (Fexecute): Use the new functions, so that the + code works correctly if a multibyte character adjacent to the + match has two or more bytes. + * src/search.h, src/searchutils.c (mb_prev_wc, mb_next_wc): + New functions. + * tests/word-delim-multibyte: Add a test for grep -w (which now + passes), and a test for \> (which still fails). The \< test also + still fails. + + grep: improve internal API for multibyte boundary + * src/search.h, src/searchutils.c (mb_goback): Rename from + is_mb_middle. Omit last arg. Return number of bytes to go back, + not just a boolean. All uses changed. + * src/dfasearch.c (EGexecute): + * src/kwsearch.c (Fexecute): Adjust to API change. + * src/kwsearch.c (Fexecute): Eliminate common subexpression. + + grep: fix encoding-error incompatibilities among regex, DFA, KWset + This follows up to http://bugs.gnu.org/17376 and fixes a different + set of incompatibilities, namely between the regex matcher and the + other matchers, when the pattern contains encoding errors. + The GNU regex matcher is not consistent in this area: sometimes + an encoding error matches only itself, and sometimes it + matches part of a multibyte character. There is no documentation + for grep's behavior in this area and users don't seem to care, + and it's simpler to defer to the regex matcher for problematic + cases like these. + * NEWS: Document this. + * src/dfa.c (ctok): Remove. All uses removed. + (parse_bracket_exp, atom): Use BACKREF if a pattern contains + an encoding error, so that the matcher will revert to regex. + * src/dfasearch.c, src/grep.c, src/pcresearch.c, src/searchutils.c: + Don't include dfa.h, since search.h now does that for us. + * src/dfasearch.c (EGexecute): + * src/kwsearch.c (Fexecute): In a UTF-8 locale, there's no need to + worry about matching part of a multibyte character. + * src/grep.c (contains_encoding_error): New static function. + (main): Use it, so that grep -F is consistent with plain fgrep + when the pattern contains an encoding error. + * src/search.h: Include dfa.h, so that kwsearch.c can call using_utf8. + * src/searchutils.c (is_mb_middle): Remove UTF-8-specific code. + Callers now ensure that we are in a non-UTF-8 locale. + The code was clearly wrong, anyway. + * tests/fgrep-infloop, tests/invalid-multibyte-infloop: + * tests/prefix-of-multibyte: + Do not require that grep have a particular behavor for this test. + It's OK to match (exit status 0), not match (exit status 1), or + report an error (exit status 2), since the pattern contains an + encoding error and grep's behavior is not specified for such + patterns. Test only that KWset, DFA, and regex agree. + * tests/prefix-of-multibyte: Add tests for ABCABC and __..._ABCABC___. + +2014-05-04 Paul Eggert + + dfa: minor simplification + * src/dfa.c (parse_bracket_exp): Use enum, not macro, and move var + to just the scope it's needed. + + grep: simplify and fix problems with KWset-DFA agreement patch + * src/dfa.c (dfambcache, parse_bracket_exp): Simplify. + (mbs_to_wchar, wctok, FETCH_WC, match_anychar, match_mb_charset) + (check_matching_with_multibyte_ops, transit_state_consume_1char) + (transit_state, dfaexec): Use wint_t, not wchar_t, so that + WEOF is treated correctly on platforms where WEOF is not a valid + wchar_t value. + (ctok, lex): Use int, not unsigned int, for characters, + so that EOF is treated more naturally. + (parse_bracket_exp): Use NOTCHAR to mark uninitialized char, since + FETCH_WC can now set the char to EOF. + (lex): Remove unnecessary test for EOF. + (parse_bracket_exp, atom): Swap then and else parts, to put + the small one first; this is more readable here. + * src/searchutils.c (is_mb_middle): Simplify. + + tests: improve coverage for prefix-of-multibyte + * tests/prefix-of-multibyte: Also test the regex version. + +2014-05-04 Norihiro Tanaka + + grep: make KWset and DFA agree about invalid sequences in patterns + See: http://bugs.gnu.org/17376 + * src/dfa.c (dfambcache): Don't cache invalid sequences, because they can't be + represented by wide characters. + (dfambcache, mbs_to_wchar): Return WEOF for invalid sequences. + (ctok): New global variable. + (parse_bracket_exp, atom, match_anychar, match_mb_charset): Don't allow WEOF. + (lex): Set 'ctok'. + * src/kwsearch.c (Fexecute): + * src/searchutils.c (is_mb_middle): Don't check here. + * tests/invalid-multibyte-infloop: Adjust to fixed behavior. + * tests/prefix-of-multibyte: Add test cases for this bug. + +2014-05-03 Jim Meyering + + maint: make ChangeLog generation more robust + * Makefile.am (gen-ChangeLog): Sync changes from GNU coreutils, + to ensure exit status is propagated, and to support an optional + git-log-fix file. + +2014-05-03 Paul Eggert + + grep: clarify EGexecute slightly + * src/dfasearch.c (EGexecute): Change if-then-else to !if-else-then. + +2014-05-03 Norihiro Tanaka + + grep: fix the bug in previous patch. + * src/dfasearch.c (EGexecute): Do it. + +2014-04-30 Paul Eggert + + grep: simplify EGexecute further + * src/dfa.c, src/dfa.h (dfasuperset): Arg is now const pointer. + Now pure. + * src/dfasearch.c (EGexecute): Coalesce some duplicate code. + Don't worry about memrchr returning NULL when that's impossible. + +2014-04-30 Norihiro Tanaka + + grep: adjust timing back to kwset when dfaisfast is true + * src/dfasearch.c (EGexecute): If DFA fails after kwset succeeds, + the code doesn't return to kwset until it reaches the end of the buffer + or finds a match. Because of this, although some cases speed up, + others slow down. + + Adjust the heuristic for switching to the DFA, so that it + is more likely to switch at the right times. + +2014-04-30 Norihiro Tanaka + + grep: simplify superset + * src/dfa.h (dfahint): Remove decl. + (dfasuperset): New decl. + * src/dfa.c (dfahint): Remove. + (dfassbuild): Rename from dfasuperset. + (dfasuperset): New function. It returns the superset of D. + * src/dfasearch.c: Use dfasuperset instead of dfahint, and simplify. + + dfa: optimize memory allocation + * src/dfa.c (epsclosure): get the value of 'visited' from the argument. + (dfaanalyze): Define and allocate variable 'visited'. + (dfastate): Use not 'insert' but 'merge' to insert positions for + state 0 of DFA. + +2014-04-29 Norihiro Tanaka + + kwset: improve performance by inlining tr + Without this change, older versions of GCC won't inline 'tr', and this + can hurt performance significantly. See: http://bugs.gnu.org/17229#64 + * src/kwset.c (tr): Make it inline. + +2014-04-27 Jim Meyering + + gnulib: update to latest + * gnulib: This fixes a bug whereby running bootstrap + would remove our build-aux/git-log-fix file. + +2014-04-27 Paul Eggert + + kwset: improve performance by inlining more + Problem reported by Norihiro Tanaka in . + * src/kwset.c (bmexec_trans): Rename from bmexec, and make it inline. + (bmexec): New implementation, which calls bmexec_trans. This helps + GCC inline more aggressively with the default optimization, and + improves performance 25% with the reported benchmark on my host. + +2014-04-26 Paul Eggert + + kwset: speed up by using memchr2 + Idea suggested by Eric Blake in: http://bugs.gnu.org/17229#43 + * bootstrap.conf (gnulib_modules): Add memchr2. + * src/kwset.c: Include stdint.h, for uintptr_t. Include memchr2.h. + (struct kwset): New members gc1, gc2, gc1help. + (tr): Move earlier, so it can be used earlier. + (kwsprep): Initialize struct kwset's new members. + (memchr_kwset): Rename from memchr_trans. Combine C and TRANS args into + new arg KWSET. All uses changed. Use memchr2 when appropriate. + (bmexec): Use new members instead of recomputing their values. + Increase advance_heuristic; it's just a guess, but memchr2 probably + makes it reasonable to increase it. + + kwset: improve performance when large Boyer-Moore key doesn't match + * src/kwset.c (bmexec): As a heuristic, prefer memchr to seeking + by delta1 only when the latter doesn't advance much. + + dfa: fix index bug in previous patch, and simplify + * src/dfa.c, src/dfa.h (dfaisfast): Arg is const pointer. + * src/dfa.c (dfaisfast): Simplify, since supersets never contain BACKREF. + * src/dfa.h (dfaisfast): Declare to be pure. + * src/dfasearch.c (EGexecute): Fix typo that could cause buffer + read overrun when !dfafast. Hoist duplicate computation out + of an if's then and else parts. + +2014-04-26 Norihiro Tanaka + + grep: speed up for a case to repeat failure in DFA after success in kwset + A DFA is typically much faster if it is unibyte and does not set BACKREF. + Skip kwset if the DFA is fast. For example: + + yes abcdabc | head -50000000 >k + env LC_ALL=C time -p src/grep -i 'abcd.bd' k + + This improved real-time from 4.86 to 1.34 s. + + * src/dfa.c, src/dfa.h (dfaisfast): New function. + * src/dfasearch.c (EGexecute): Use it. + +2014-04-24 Paul Eggert + + dfa: fix recently-introduced memory leak + Problem reported by Aharon Robbins in: http://bugs.gnu.org/17341 + * src/dfa.c (dfasuperset): free after dfafree. + + misc: fix doc and test bugs re grep -z + Problem reported by Stephane Chazelas in: http://bugs.gnu.org/16871 + * doc/grep.texi (Usage): Remove incorrect example with -P. + * tests/pcre: Improve test so that it actually tests whether \s + matches a newline. + + dfa: minor simplification of dfaexec + * src/dfa.c (dfaexec): Streamline updating of returned values. + Don't bother to check d->multibyte before updating mbp. + Avoid duplicate p > end test. + +2014-04-24 Paul Eggert + + dfa: simplify and be more consistent about MB_CUR_MAX + * src/dfa.c (struct dfa): New member 'multibyte', + replacing 'mb_cur_max'. All uses changed. Use this new member + consistently, instead of sometimes referring to MB_CUR_MAX directly. + + dfa: fix comment + * src/dfa.c (maybe_realloc): Fix comment to match behavior better. + +2014-04-24 Norihiro Tanaka + + grep: skip checking of multibyte character boundary, reaching at eolbyte + * src/dfa.c (dfaexec): Skip checking of multibyte character boundary, + reaching at eolbyte. + +2014-04-24 Paul Eggert + + dfa: fix incorrect comment that led to heap overrun + * dfa.c (maybe_realloc): Fix comment to match behavior. + + dfa: minor tuneup of dfamust memory savings patch + * src/dfa.c (allocmust): Use xmalloc, not xzalloc. + Initialize the must completely, so that the caller need not + invoke resetmust. All callers changed. + (dfamust): Omit asserts that aren't needed on typical machines + where dereferencing NULL dumps core. Don't leak memory if the + pattern contains a NUL byte. + +2014-04-24 Norihiro Tanaka + + grep: avoid wasting memory for large patterns in dfamust + * src/dfa.c (struct must): New member 'prev'. It points to the + previous must. + (allocmust): New function. + (freemust): New function. + (dfamust): Use it. + +2014-04-24 Jim Meyering + + grep: fix new heap write buffer overrun + * src/dfa.c (parse_bracket_exp): Fix off-by-one allocation error. + Exposed by running the tests with an ASAN-enabled binary (i.e., + created using gcc's -fsanitize=address option). Introduced by + commit v2.18-70-gd3d9612, "dfa: simplify range char allocation". + +2014-04-24 Paul Eggert + + build: suppress unsafe-loop-optimizations warnings + I ran into one of these while trying out GCC 4.9.0's new + -fsanitize=undefined option. The warning told me that GCC didn't + do an unsafe optimization, but in 'grep' this is not typically a + symptom of a programming error. + * configure.ac (WERROR_CFLAGS): Suppress -Wunsafe-loop-optimizations. + +2014-04-23 Paul Eggert + + dfa: fix memory leak reintroduced by previous patch + Reported by Norihiro Tanaka in . + * src/dfa.c (dfaexec): Allocate mb_match_lens and mb_follows only + if not already allocated. + (free_mbdata): Null out mb_match_lens to mark it as being freed. + +2014-04-23 Jim Meyering + + tests: use consistent spelling for locale name, en_US.UTF-8 + * tests/pcre-infloop: Spell locale name, en_US.UTF-8, consistently, + converting this one use from "en_US.utf8", which would provoke a + test failure on OS/X. + +2014-04-23 Paul Eggert + + dfa: omit static variables that limited dfaexec to one struct dfa + Problem reported by Aharon Robbins in: http://bugs.gnu.org/17328 + * src/dfa.c (struct dfa): New member mbs. + mb_follows is now a position_set, not a pointer to one; + this simplifies memory allocation. All uses changed. + (mbs_to_wchar): Put DFA arg at the end, in place of the mbstate_t *arg, + since the DFA now contains an mbstate_t. All uses changed. + (mbs): Remove static variable. + (dfaexec): Remove static bool that attempted to optimize memory + allocation, as this wasn't correct for Gawk. Perhaps we can think + of a better way to optimize memory. + +2014-04-22 Paul Eggert + + kwset: simplify and speed up Boyer-Moore unibyte -i in some cases + This improves the performance of, for example, + yes jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj | head -10000000 | grep -i jk + in a unibyte locale. + * src/kwset.c (memchr_trans): New function. + (bmexec): Use it. Simplify the code and remove some of the + confusing gotos and breaks and labels. Do not treat glibc memchr + as a special case; if non-glibc memchr is slow, that is lower + priority and I suppose we can try to work around the problem in + gnulib. + +2014-04-22 Norihiro Tanaka + + grep: speed-up by using memchr() in Boyer-Moore searching + memchr() of glibc is faster than seeking by delta1 on some platforms. + When there is no chance to match for a while, use it on them. + * src/kwset.c (bmexec): Use memchr() in Boyer-Moore searching. + +2014-04-22 Paul Eggert + + kwset: simplify Boyer-Moore with unibyte -i + This change doesn't significantly affect performance on my platform, + and should make the code easier to maintain. + * src/kwset.c (BM_DELTA2_SEARCH, LAST_SHIFT, TRANS): + Remove these macros, in favor of ... + (tr, bm_delta2_search): New functions. All uses changed. + The latter function is inline because this improves code size and + runtime CPU slightly on x86-64 with gcc -O2 (GCC 4.9.0). + (bmexec): Prefer tr when that's simpler. + +2014-04-22 Norihiro Tanaka + + grep: may also use Boyer-Moore algorithm for case-insensitive matching + * src/kwset.c (BM_DELTA2_SEARCH, LAST_SHIFT, TRANS): New macro. + (bmexec): Use character translation table. + (kwsexec): Call bmexec for case-insensitive matching. + (kwsprep): Change the `if' condition. + +2014-04-21 Paul Eggert + + grep: -P now rejects invalid input sequences in UTF-8 locales + See and . + * NEWS: Document this. + * src/pcresearch.c (Pexecute): Do not use PCRE_NO_UTF8_CHECK, + as this leads to undefined behavior when the input is not UTF-8. + * tests/pcre-infloop, tests/pcre-invalid-utf8-input: + Exit status is now 2, not 1, when grep -P is given invalid UTF-8 + data in a UTF-8 locale. + + dfa: minor improvements to previous patch + * src/dfa.c (dfamust): Use &=, not if-then. + * src/dfa.h (struct dfamust): + * src/dfasearch.c (begline, hwsmusts): Use bool for boolean. + * src/dfasearch.c (kwsmusts): + * src/kwsearch.c (Fcompile): Prefer decls after statements. + * src/dfasearch.c (kwsmusts): Avoid conditional branch. + * src/kwsearch.c (Fcompile): Unify the two calls to kwsincr. + +2014-04-21 Norihiro Tanaka + + grep: speed-up for exact matching with begline and endline constraints. + dfamust turns on the flag when a state exactly matches the proposed one. + However, when the state has begline and/or endline constraints, turns + off it. + + This patch enables to match a state exactly, even if the state has + begline and/or endline constraints. If a exact string has one of their + constrations, the string adding eolbyte to a head and/or foot is pushed + to kwsincr(). In addition, if it has begline constration, start + searching from just before the position of the text. + + * src/dfa.c (variable must): New members `begline' and `endline'. + (dfamust): Consideration of begline and endline constrations. + * src/dfa.h (struct dfamust): New members `begline' and `endline'. + * src/dfasearch.c (kwsmusts): If a exact string has begline constration, + start searching from just before the position of the text. + (EGexecute): Same as above. + * src/kwsearch.c (Fexecute): Same as above. + +2014-04-20 Paul Eggert + + dfa: fix bug that caused NUL to be mishandled in patterns + This bug was introduced in the early-2012 patches that fixed some + context-handling bugs. Bisecting found commit + d8951d3f4e1bbd564809aa8e713d8333bda2f802 (2012-02-05 18:00:43 +0100), + but it apears the underlying problem was introduced in commit + 8b47c4cf6556933f59226c234b0fe984f6c77dc7 (2012-01-03 11:22:09 +0100). + * NEWS: Mention bug fix. + * src/dfa.c (char_context): Consider NUL to be a newline only if -z. + * tests/Makefile.am (TESTS): Add null-byte. + * tests/null-byte: New file. + +2014-04-19 Jim Meyering + + build: reenable some compiler warning options + +2014-04-18 Paul Eggert + + dfa: fix pointer type conversion bug + The code converted between size_t * and ptrdiff_t *, which wasn't + diagnosed by modern x86-64 GCC but isn't portable. Problem + reported by Norihiro Tanaka in . + * configure.ac (WERROR_CFLAGS): Don't add -Wno-pointer-sign. + We want GCC to diagnose pointer signedness problems, as they + violate the C standard and other compilers no doubt complain too. + * src/dfa.c (struct dfa): Change type of salloc to size_t. + (realloc_trans_if_necessary): Convert signed value to size_t before + passing its address to x2nrealloc. Changing the type of tralloc + to size_t might have led to problems elsewhere. + +2014-04-18 Jim Meyering + + maint: Revert "dfa: avoid new NULL dereference" + This reverts commit 5190041fe515743ef4545abf287d243bc025c701. + It was only a bug if one neglected to update to the latest gnulib. + With the newer xn2realloc, there is no problem. + + dfa: avoid new NULL dereference + * src/dfa.c (dfa_charclass_index): Restore a "+ 1" mistakenly omitted + during recent improvements. Introduced in v2.18-66-g6a60fd5. + +2014-04-17 Paul Eggert + + dfa: minor cleanup + * src/dfa.c (MAX): Remove; no longer used. + +2014-04-17 Norihiro Tanaka + + dfa: speed up by checking multibyte characters on demand + If dfaexec() runs in non-UTF8 locales, length and wide character + representation are checked for all characters of a line in a input + string. However, if matched early in the line, results for remaining + characters are wasted. + + This patch checks multibyte characters on demand. It should work + faster for early matches, and reduces memory requirements. + + * src/dfa.c (struct dfa): Remove members mblen_buf, nmblen_buf, + inputwcs, ninputwcs. All uses removed. + (buf_begin, buf_end, prepare_wc_buf): Remove. All uses removed. + (SKIP_REMAINS_MB_IF_INITIAL_STATE): Remove. This is now expanded + when used. + (match_anychar, match_mb_charset, check_matching_with_multibyte_ops): + New arg wc, mbclen. Remove arg idx. All uses changed. + (transit_state_consume_1char): New arg wc. All uses changed. + (transit_state): New arg 'end'. All uses changed. + +2014-04-17 Paul Eggert + + dfa: trans reallocation microoptimization + * src/dfa.c (realloc_trans_if_necessary): + Help the compiler avoid unnecessary reloads. + + dfa: simplify dfmust initialization + * src/dfa.c (dfamust): Don't initialize musts twice. + Use zcalloc, not xmalloc followed by zeroing. + Make result a const pointer. + + dfa: simplify freelist + * src/dfa.c (freelist): Don't null out array while freeing its + pointers; the caller can do that if needed. + (resetmust): Null out zeroth entry of array. + + dfa: avoid duplicate strlen when allocating memory + * src/dfa.c (dfamust): Use xstrdup, not strlen (twice) + xmemdup. + + dfa: simplify memory allocation + * src/dfa.c (icatalloc, freelist, enlist, comsubs, addlists, inboth) + (dfamust): Don't worry about null arguments or results, + as memory allocators no longer can return null pointers. + (dfamust): Invoke malloc just once when building a concatenated string. + + dfa: simplify position set and element count allocation + * src/dfa.c (dfaanalyze): Allocation position set info all at one go, + and similarly for element count info. + + dfa: simplify multibyte_prop allocation + * src/dfa.c (struct dfa): Simplify by removing nmultibyte_prop; + it should always be the same as talloc. All uses changed. + + dfa: simplify range char allocation + * src/dfa.c (struct dfa): Simplify by allocating one array of ranges + rather than one for range starts and another for range ends. + All uses changed. + + dfa: simplify transition table allocation + * src/dfa.c (struct dfa): Remove member 'realtrans', as it can + be computed from 'trans'. All uses changed. + (realloc_trans_if_necessary): Move earlier, to avoid a forward decl. + Use x2nrealloc to compute new size, rather than doing it by hand, + which omits a check for unlikely overflow. + (realloc_trans_if_necessary, dfafree): Adjust to the fact that + d->trans now might be either NULL, or 1 + the pointer to free. + (build_state, build_state_zero): Use realloc_trans_if_necessary + instead of duplicating its code. + + dfa: better size-overflow check + * src/dfa.c (dfasuperset): Let xnmalloc do the multiplication, + to check for size arithmetic overflow better. + + dfa: avoid unnecessary work and other initialization + * src/dfa.c (dfaanalyze, dfainit): + Don't bother allocating when x2nrealloc will do it for us. + (dfastate): Allocate grps and labels on the stack, as their + size is known at compile time. + (build_state): Use xmalloc, not xnmalloc, since the multiplication + can be done at compile-time. + + dfa: clarify memory allocation and port to IRIX + This change was prompted by a porting problem: + IRIX defines its own MALLOC macro, which clashes with ours. + More generally, the MALLOC etc. macros are confusing, as they + look like functions but do not have C-function semantics. + A functional style makes the code easier to read, and though + it lengthens the code a bit here it'll make other + simplifications easier. + * src/dfa.c (XNMALLOC, XCALLOC, CALLOC, MALLOC, REALLOC): Remove. + All uses replaced by xnmalloc etc. + (REALLOC_IF_NECESSARY): Remove; all uses replaced by .... + (maybe_realloc): New function. + (copy, merge): Free and allocate rather than realloc, as we + needn't save the contents. + +2014-04-14 Jim Meyering + + tests: detect an infloop-inducing bug in grep -P (pcre-8.35) + * tests/pcre-infloop: New test. + * tests/Makefile.am (TESTS): Add it. + +2014-04-12 Paul Eggert + + build: update gnulib submodule to latest + +2014-04-11 Paul Eggert + + grep: improvements for the open-CSET patch + * src/dfa.c (dfamust): Simplify by removing some duplicate code. + Optimize patterns like [aaa] even when not case-folding. + Avoid an unnecessary copy of the charclass. + +2014-04-11 Norihiro Tanaka + + grep: open CSET and transform into uppercase when MB_CUR_MAX == 1 + In unibyte locales with -i, kwset matching isn't helpful, because + dfamust doesn't extract the CSET entries. Fix dmamust so that it + does that, and makes it possible to take out a longer fixed string + from tokens. + * src/dfa.c (dfamust): open CSET and transform into uppercase + when MB_CUR_MAX == 1. + +2014-04-11 Paul Eggert + + grep: cleanup for HAS_DOS_FILE_CONTENTS issue + While cleaning up the empty-string fix, I noticed that one part of + the code worried about CRLF in pattern files whereas another part + did not. Fix this by using the same approach in both places, + and make the CRLF code more modular in the process. + * src/dosbuf.c (dos_binary, dos_unix_byte_offsets): New functions. + (undossify_input, dossified_pos): Do nothing if ! O_BINARY. + * src/grep.c: Always include dosbuf.c so that the code is + checked statically even on non-DOS hosts. + (dos_binary, dos_unix_byte_offsets): New decls. + (undossify_input): Declare unconditionally. + * src/grep.c (fillbuf, print_line_head, main): + * src/kwsearch.c (Fcompile): + Simplify by not worrying about HAVE_DOS_FILE_CONTENTS. + * src/grep.c (main): fopen with "rt" if O_TEXT; this is simpler + than worrying about HAVE_DOS_FILE_CONTENTS elsewhere. + * src/system.h (HAVE_DOS_FILE_CONTENTS): Remove. + + grep: cleanup for empty-string fix + * NEWS: Document it. + * src/dfasearch.c (GEAcompile): + * src/kwsearch.c (Fcompile): + Use C99-style decls to simplify. Avoid duplicate code. + * tests/empty-line: Add some more tests like this. + +2014-04-11 Norihiro Tanaka + + grep: no match for the empty string included in multiple patterns + * src/dfasearch.c (EGAcompile): Fix it. + * src/kwsearch.c (Fcompile): Fix it. + +2014-04-08 Paul Eggert + + grep: remove bool_bf + The extra complexity of this microoptimization wasn't ever much help, + and currently it generated bigger code with gcc -O2 (x86-64). + * src/dfa.c (bool_bf): Remove. All uses replaced by plain 'bool', + without a bitfield. + +2014-04-08 Jim Meyering + + maint: avoid sc_po_check syntax-check failure (kwset.c) + * po/POTFILES.in: Remove kwset.c from this list, since it + no longer contains a translatable diagnostic. + +2014-04-08 Paul Eggert + + grep: port better to hosts with nonstandard nl_langinfo + On some hosts, nl_langinfo returns strings other than "UTF-8" when + UTF-8 is used, and (worse) return "UTF-8" even if the encoding is + single-byte. Work around these problems by trying a sample + character instead. + * src/dfa.c, src/pcresearch.c, src/searchutils.c: + Don't include . + * src/dfa.c (using_utf8): Test for UTF-8 by trying a character + rather than by invoking nl_langinfo (CODESET); this is more + portable in practice, and removes a dependency on + HAVE_LANGINFO_CODESET. + * src/pcresearch.c: Include dfa.h, for using_utf8. + (Pcompile): Use using_utf8 rather than nl_langinfo. + +2014-04-07 Paul Eggert + + grep: prefer bool in DFA internals + * src/dfa.c (bool_bf): New type. + (dfa_state): Use it, as this seems to generate slightly better + code with GCC. + (struct mb_char_classes, struct dfa, equal, case_fold, dfasyntax) + (laststart, parse_bracket_exp, lex, dfaparse, dfaanalyze, dfastate) + (match_mb_charset, dfamust): + Use bool for boolean. + (using_utf8) [!HAVE_LANGINFO_CODESET]: Tune. + (dfaanalyze): Prefer & to && and | to || on booleans; it's simpler here. + (dfastate): Simplify charclass nonzero testing. Redo has_mbcset + test so that the compiler's more likely to optimize it. + +2014-04-07 Norihiro Tanaka + + grep: prefer regex to DFA for ANYCHAR in multibyte locales + * src/dfa.c (dfa_state): New member has_mbcset. + Rename backref to has_backref, and make it of type bool too. + All uses changed. + (state_index, dfastate): Initialize new member. + (dfaexec): Prefer regex to DFA for ANYCHAR in multibyte locales. + +2014-04-07 Paul Eggert + + grep: remove trival_case_ignore + This optimization is no longer needed, given the other + optimizations recently installed. Derived from a patch by + Norihiro Tanaka; see . + * bootstrap.conf (gnulib_modules): Remove assert-h. + * src/dfa.c (CASE_FOLDED_BUFSIZE): Move here from dfa.h. + Remove now-unnecessary static assert. + (case_folded_counterparts): Now static. + * src/dfa.h (CASE_FOLDED_BUFSIZE, case_folded_counterparts): + Remove decls; no longer public. + * src/dfasearch.c (kwsmusts): Use kwset even if fill MB_CUR_MAX > 1 + and case-insensitive. + * src/grep.c (MBRTOWC, WCRTOMB): Remove. + (fgrep_to_grep_pattern): Use mbrtowc, not MBRTOWC. + (trivial_case_ignore): Remove; this optimization is no longer needed. + All uses removed. + + grep: simplify memory allocation in kwset + * src/kwset.c: Include kwset.h first, to check its prereqs. + Include xalloc.h, for xmalloc. + (kwsalloc): Use xmalloc, not malloc, so that the caller need not + worry about memory allocation failure. + (kwsalloc, kwsincr, kwsprep): Do not worry about obstack_alloc + returning NULL, as that's not possible. + (kwsalloc, kwsincr, kwsprep, bmexec, cwexec, kwsexec, kwsfree): + Omit unnecessary conversion between struct kwset * and kwset_t. + (kwsincr, kwsprep): Return void since memory-allocation failure is + not possible now. All uses changed. + * src/kwset.h: Include , for size_t, so that this + include file doesn't require other files to be included first. + + grep: minor cleanups for Galil speedups + * src/kwset.c: Update citations. + Include stdbool.h. + (kwsincr, kwsprep): Clarify by using C99 decls after statements. + (kwsprep): Clarify by using MIN. Avoid a couple of buffer copies + when !TRANS. + (bmexec): Use bool for boolean. Prefer "continue;" to ";". + +2014-04-07 Norihiro Tanaka + + grep: use the Galil rule for Boyer-Moore algorithm in KWSet + The Boyer-Moore algorithm is O(m*n), which means it may be much + slower than the DFA. Its Galil rule variant is O(n) and increases + efficiency in the typical case; it skips sections that are known + to match and does not compare more than once for a position in the text. + To use the Galil rule, look for the delta2 shift at each position + from the trie instead of the 'mind2' value. + * src/kwset.c (struct kwset): Replace member 'mind2' with 'shift'. + (kwsprep): Look for the delta2 shift. + (bmexec): Use it. + +2014-04-06 Paul Eggert + + grep: cleanup DFA superset optimization + * src/dfa.c (dfa_charclass_index): New function, with body of + old dfa_charclass but with an extra parameter D. + (charclass_index): Reimplement in terms of dfa_charclass_index. + (dfahint): Clarify. + (dfasuperset): Do not assign to 'dfa' static variable. Instead, + use a local, and use the new dfa_charclass_index function. This + doesn't fix any bugs, but it's clearer. Initialize a few more + members, to simplify dfafree. Copy the charclasses with + just one memcpy call. Don't assign nonnull to D->superset until + it's known to be valid; that's simpler. + (dfafree, dfaalloc): Simplify based on dfasuperset initializations. + * src/dfa.h (dfahint): Add comment. + * src/dfasearch.c (EGexecute): Simplify use of memchr. + Simplify by using memrchr. Fix typo that could cause a buffer + read overrun. + +2014-04-06 Norihiro Tanaka + + grep: optimization with the superset of DFA + The superset of a DFA is like the DFA, except that for speed + ANYCHAR, MBCSET and BACKREF are replaced by (CSET full bits) STAR, + and mb_cur_max is 1. For example, for 'a\(b\)c\1': + original: a b CAT c CAT BACKREF CAT + superset: a b CAT c CAT CSET STAR CAT (The CSET has all bits set.) + If a string matches a DFA, it matches the DFA's superset. + Using the superset to filter can dramatically improve performance, + over 200x in some cases. See . + * src/dfa.c (struct dfa): New member 'superset'. + (dfahint, dfasuperset): New functions. + (dfacomp): Create and analyze the superset. + (dfafree): Free only non-NULL items. + (dfaalloc): Initialize superset member. + (dfaoptimize): If succeed in optimization for UTF-8 locale, don't use + the superset. + * src/dfa.h (dfahint): New decl. + * src/dfasearch.c (EGexecute): Use dfahint. + +2014-04-06 Jim Meyering + + build: avoid OS X 10.8.5 build failure due to lack of static_assert + * bootstrap.conf (gnulib_modules): Add assert-h, to accommodate the + new use of static_assert on systems lacking support for that construct. + Without this change, compilation of dfa.c failed on OS X 10.8.5 with + gcc-4.9.0 20140324. We should be using gnulib's assert-h module, + regardless, for its nominal improved portability, since grep includes + assert.h and uses assert. + +2014-04-05 Norihiro Tanaka + + grep: fix performance bug with regex in line-by-line mode + * src/dfasearch.c (EGexecute): Match line-by-line with regex. + +2014-04-05 Paul Eggert + + grep: minor improvements to previous patch + * src/dfa.c (MAX): New macro. + (match_anychar, match_mb_charset, transit_state_consume_1char): + Use it to simplify assignments. + (SKIP_REMAINS_MB_IF_INITIAL_STATE): Prefer != 0 for unsigned. + (free_mbdata): Omit an unnecessary 'free'. + +2014-04-05 Norihiro Tanaka + + grep: reuse multibyte DFA buffers in non-UTF8 locales + * src/dfa.c (struct dfa): New members 'mblen_buf', 'nmblen_buf', + 'inputwcs', 'ninputwcs', 'mb_follows' and 'mb_match_lens'. + (mblen_buf, inputwcs): Remove static vars. + (SKIP_REMAINS_MB_IF_INITIAL_STATE, match_anychar, match_mb_charset) + (transit_state_consume_1char, transit_state, prepare_wc_buf): + Use new members instead of global variables. + (check_matching_with_multibyte_ops): Use new members + instead of new allocation. + (dfaexec): Initialize new members. + (free_mbdata): Free new members. + +2014-04-05 Paul Eggert + + grep: simplify dfa.c by having it not include mbsupport.h directly + * src/mbsupport.h: Remove. + * src/Makefile.am (noinst_HEADERS): Remove mbsupport.h. + * src/dfa.c, src/grep.c, src/search.h: Don't include mbsupport.h. + * src/dfa.c: Include wchar.h and wctype.h unconditionally, as + this simplifies the use of dfa.c in grep, and it does no harm + in gawk. + (setlocale, static_assert): Remove gawk-specific hacks, as + gawk now does these itself. + (struct dfa, dfambcache, mbs_to_wchar) + (is_valid_unibyte_character, setbit_wc, using_utf8, FETCH_WC) + (addtok_wc, add_utf8_anychar, atom, state_index, epsclosure) + (dfaanalyze, dfastate, prepare_wc_buf, dfaoptimize, dfafree, dfamust): + * src/dfasearch.c (EGexecute): + * src/grep.c (main): + * src/searchutils.c (mbtoupper): + Assume MBS_SUPPORT. + +2014-04-01 Norihiro Tanaka + + dfa: avoid re-building a state built previously + * src/dfa.c (dfaexec): Avoid to re-build a state built previously. + +2014-03-28 Paul Eggert + + dfa: improve port to freestanding DJGPP + Suggested by Aharon Robbins (Bug#17056). + * src/dfa.c (setlocale) [!LC_ALL]: Return NULL, not "C", + reverting part of a recent change. + (using_simple_locale): Return true if setlocale returns null. + +2014-03-28 Jim Meyering + + tests: placate "make syntax-check" re compare arg ordering + * tests/euc-mb: Reverse order of arguments to compare. + Be consistent in ordering compare arguments: expected followed + by actual. + +2014-03-28 Paul Eggert + + dfa: avoid an indirection and port wint_t usage + * src/dfa.c (struct dfa): Put mbrtowc_cache directly into struct dfa + rather than having a pointer; this saves a malloc and an indirection. + All uses changed. + (dfambcache): Port to hosts where wint_t * can't be cast to wchar_t *. + +2014-03-28 Norihiro Tanaka + + grep: take mbrtowc_cache into new member of struct dfa + When struct dfa more than one are used at the same time, mbrtowc cache + may be conflict. So, take mbrtowc_cache into new member of struct dfa, + and define each mbrtowc cache for them. + + * src/dfa.c (struct dfa): New member `mbrtowc_cache'. + (dfambcache): Rename from build_mbrtowc_cache. Add dependency on struct dfa. + (mbs_to_wchar): Add dependency on struct dfa. + (FETCH_WC): Use it. + (prepare_wc_buf): Use it. Add dependency on struct dfa. + (dfacomp): Call it. + (dfafree): Release it. + +2014-03-28 Paul Eggert + + dfa: cache results of mbrtowc for speed + Idea suggested by Norihiro Tanaka in Bug#16842. + * src/dfa.c (mbrtowc_cache): New static var. + (build_mbrtowc_cache, mbs_to_wchar): New functions. + (FETCH_WC) [MBS_SUPPORT]: Speed up by using mbs_to_wchar + instead of mbrtowc and wctob. + (FETCH_WC) [!MBS_SUPPORT]: Rewrite in terms of old FETCH macro. + (FETCH): Remove; no longer used. + (lex): Simplify by avoiding the need for FETCH. + (prepare_wc_buf) [MBS_SUPPORT]: Speed up by using mbs_to_wchar. + Simplify the loop. + (dfacomp): Initialize the cache. + +2014-03-27 Norihiro Tanaka + + grep: perform the kwset-helping DFA match in narrower range + When kwsexec gives us the offset of a potential match, we compute + line begin/end and then run the DFA matcher to see if there really + is a match on that line. When the beginning of the line, BEG, is + not on a multibyte character boundary, advance BEG until it on such + a boundary, before running the DFA search. + * src/dfasearch.c (EGexecute): As above. Add a comment. + * tests/euc-mb: Add a test case that exercises this code. + This addresses http://debbugs.gnu.org/17095. + +2014-03-26 Jim Meyering + + maint: fix "make dist" + * src/Makefile.am (egrep fgrep): Specify egrep.sh via + $(srcdir)/egrep.sh, so non-srcdir builds work once again. + +2014-03-26 Paul Eggert + + dfa: improve port to freestanding DJGPP + * src/dfa.c (setlocale) [!LC_ALL]: Return "C", not NULL (Bug#17056). + (using_simple_locale): Store setlocale result in a ptr-to-const. + + egrep, fgrep: improve diagnostics from shell scripts + This should fix Bug#17098. + * src/Makefile.am (EXTRA_DIST): Add egrep.sh. + (egrep fgrep): Depend on egrep.sh and Makefile. + Build from new file egrep.sh, as this makes the build process + easier to follow. Arrange for $0 to look nicer in subgrep. + * src/egrep.sh: New file. + +2014-03-23 Paul Eggert + + dfa: avoid undefined behavior + * src/dfa.c (FETCH_WC, addtok_wc): Don't rely on undefined behavior + when converting an out-of-range value to 'int'. + (FETCH_WC, prepare_wc_buf): Don't rely on conversion state after + mbrtowc returns a special value, as it's undefined for (size_t) -1. + (prepare_wc_buf): Simplify test for valid character. + + grep: fix and simplify grep -iF optimization + * src/grep.c (check_any_alphabets): Remove. + (fgrep_to_grep_pattern): Fix problems when mbrtowc returns -1 or -2. + Simplify a bit. + (main): Don't bother optimizing 'grep -iF PAT' when PAT contains no + alphabetics; it's so rare it's not worth the complexity. + +2014-03-23 Norihiro Tanaka + + grep: optimization for fgrep with changing the macher to grep macher. + fgrep macher is only use kwset engine. However, it's very slow for + case-insensitive matching in multibyte locales. + + And so, if the matcher is fgrep and case-insensitive and keys including + any alphabets, change it into grep matcher by escape of keys. OTOH, if + keys include no alphabet, turn match_icase flag off. + + I prepare following string to measure the performance. + + yes $(printf '%078dm' 0)| head -1000000 | tr 0 a > in + A=`printf '\xef\xbc\xa1'` # FULLWIDTH LATIN CAPITAL LETTER A + + I run three tests with this patch (best-of-5 trials): + + env LC_ALL=en_US.UTF-8 time -p src/fgrep -i "$A" in + real 8.54 user 7.13 sys 1.16 + + Back out that commit (temporarily), recompile, and rerun the experiment: + + env LC_ALL=en_US.UTF-8 time -p src/fgrep -i "$A" in + real 0.07 user 0.02 sys 0.05 + + * src/fgrep.c (Gcompile) New function. + * src/main.c (check_any_alphabets) New function. + (fgrep_to_grep_pattern) New function. + (main) Use them. + +2014-03-23 Paul Eggert + + egrep, fgrep: go back to shell scripts + Although egrep's and fgrep's switch from shell scripts to + executables may have made sense in 2005, it complicated + maintenance and recently has caused subtle performance bugs. + Go back to the old way of doing things, as it's simpler and more + easily separated from the mainstream implementation. This should + be good enough nowadays, as POSIX has withdrawn egrep/fgrep and + portable applications should be using -E/-F anyway. + * po/POTFILES.in: Remove src/egrep.c, src/fgrep.c, src/main.c. + * src/Makefile.am (bin_PROGRAMS): Remove egrep, fgrep. + (bin_SCRIPTS): New macro. + (grep_SOURCES): Move searchutils.c, dfa.c, dfasearch.c, kwset.c, + kwsearch.c, pcresearch.c here from libgrep_a_SOURCES. + (egrep_SOURCES, fgrep_SOURCES, noinst_LIBRARIES, libgrep_a_SOURCES): + Remove. + (LDADD): Remove libgrep.a. + (egrep, fgrep): New rules. + (CLEANFILES): New macro. + * src/grep.c: Rename from src/main.c. + (usage, setmatcher, main): + Simplify, since there's now just one executable. + (Gcompile, Ecompile, Acompile, GAcompile, PAcompile, matchers): + Move here from the (removed) src/grep.c. + (compile_fp_t, execute_fp_t, struct matcher, matchers): + Move here from src/grep.h, as they no longer need to be public. + (struct matcher.name): Avoid one level of indirection/relocation. + (do_execute, main): Fix a performance bug when it was compiled + as 'fgrep', due to confusion about which matcher was which. + (main): Fix a performance bug with -P, likewise. + * src/grep.h (before_options, after_options): Remove. + * src/egrep.c, src/fgrep.c, src/grep.c: Remove. + + dfa: port to freestanding DJGPP (Bug#17056) + * src/dfa.c (setlocale) [!LC_ALL]: Define a dummy. + +2014-03-16 Jim Meyering + + tests: avoid false-positive failure on some AMD CPUs + * tests/mb-non-UTF8-performance: Avoid false-positive failure + when run on certain AMD processors. + +2014-03-10 Jim Meyering + + tests: make a performance-measuring test less system-sensitive + Andreas Schwab reported in http://debbugs.gnu.org/16941 + that this test would timeout and fail on m68k-suse-linux. + Rather than testing absolute duration with a limit tuned + to today's hardware, compare performance of grep with LC_ALL=C + against that same command using LC_ALL=ja_JP.eucJP. + * tests/init.cfg (require_hi_res_time_): New function. + * tests/mb-non-UTF8-performance: Rewrite to use it: + record absolute duration D of the first (normally much faster) + command, and set a timeout of 8*D for the command running in + an affected locale. + +2014-03-09 Paul Eggert + + maint: pacify 'make dist' + * src/dfa.c (parse_bracket_exp): Reindent with spaces. + * src/dfa.h (case_folded_counterparts): Prefix decl with 'extern'. + * src/main.c: Don't include assert.h. + +2014-03-07 Paul Eggert + + fgrep: fix case-fold incompatibility with plain 'grep' + fgrep converted to lowercase, whereas the regex code converted + to uppercase. The resulting behaviors don't agree in offbeat + cases like Greek sigmas and Turkish Is. Fix this by changing + fgrep to agree with the regex code. + * src/kwsearch.c (Fcompile, Fexecute): + * src/searchutils.c (kwsinit, mbtoupper): + Convert to uppercase, not to lowercase, for compatibility with + plain 'grep'. + * src/search.h, src/searchutils.c (mbtoupper): + Rename from mbtolower, since it now converts to uppercase. + All uses changed. + * tests/case-fold-titlecase: Add tests for this. + + grep: fix case-fold mismatches between DFA and regex + The DFA code and the regex code didn't use the same semantics for + case-folding. The regex code says that the data char d matches + the pattern char p if uc (d) == uc (p). POSIX is unclear in this + area; the simplest fix for now is to change the DFA code to agree + with the regex code. See . + * src/dfa.c (static_assert): New macro, if not already defined. + (setbit_case_fold_c): Assume MB_CUR_MAX is 1 and that case_fold + is nonzero; all callers changed. + (setbit_case_fold_c, parse_bracket_exp, lex, atom): + Case-fold like the regex code does. + (lonesome_lower): New constant. + (case_folded_counterparts): New function. + (parse_bracket_exp): Prefer plain setbit when case-folding is + not needed. + * src/dfa.h (CASE_FOLDED_BUFSIZE): New constant. + (case_folded_counterparts): New function decl. + * src/main.c (trivial_case_ignore): Case-fold like the regex code does. + (main): Try to improve comment re trivial_case_ignore. + * tests/case-fold-titlecase: Add lots more test cases. + +2014-03-06 Paul Eggert + + build: update gnulib submodule to latest + + doc: do not overpromise --ignore-case's behavior + * NEWS: Omit vague statement about titlecase that could be + misinterpreted, and is more trouble than it's worth. + * doc/grep.texi: Add @documentencoding. Fix copyright range to + use endash not hyphen. + (Matching Control): Do not overpromise what --ignore-case will do. + Give examples of corner cases where the documentation does not + specify behavior. + +2014-03-05 Paul Eggert + + maint: remove differences from gnulib regex code + These don't seem to be needed with GCC 4.8.2, and are making + maintenance harder. If we need to disable warnings with older + compilers, we can add pragmas to the gnulib versions. See + . + * gl/lib/regcomp.c.diff, gl/lib/regex_internal.c.diff: + * gl/lib/regex_internal.h.diff, gl/lib/regexec.c.diff: + Remove. + * cfg.mk (exclude_file_name_regexp--sc_prohibit_tab_based_indentation): + Don't mention gl/* files. + +2014-03-03 Paul Eggert + + grep: fix comment + * src/main.c (trivial_case_ignore): Fix comment typo. + +2014-03-03 Norihiro Tanaka + + grep: avoid to add same character to a bracket expression + * src/main.c (trivial_ignore_case): Only when uppercase and/or + lowercase is different from original character, add it to new pattern. + +2014-03-02 Paul Eggert + + grep: fix some unlikely bugs in trivial_case_ignore + * src/main.c (MBRTOWC, WCRTOMB): Reformat as per usual GNU style. + (trivial_case_ignore): Don't overrun buffer in the unusual case + when a character has both lowercase and uppercase counterparts. + Don't rely on undefined behavior when assigning out-of-range value + to an 'int'. Simplify by avoiding unnecessary buffer copies. + Work even with shift encodings, by using mbsinit to + disable the optimization if we are not in the initial state + when we replace B by [BCD]. + +2014-03-02 Norihiro Tanaka + + grep: revert removal of trivial_case_ignore + Revive trivial_case_ignore function in order to be able to use kwset. + + * src/main.c (MBRTOWC, WCRTOMB): New macros. + (trivial_case_ignore): New function. + (main): Use it. + +2014-03-02 Norihiro Tanaka + + grep: optimization of bracket expression for non-UTF8 locales + * src/dfa.c (addtok): Replace an MBCSET with a CSET even in + non-UTF8 locales, and even when it has individual characters. + +2014-03-01 Paul Eggert + + doc: describe titlecase fix better + * NEWS: Document behavior on lowercase text too. + Suggested by Eric Blake in . + * doc/grep.texi (Matching Control): Specify behavior of -i + more precisely. + +2014-02-28 Paul Eggert + + grep: minor tuning for mb_case_map_apply + * src/kwsearch.c (mb_case_map_apply): Avoid unnecessary widening of + size_t to intmax_t. Avoid unnecessary reinitialization of k. + + grep: avoid 'inline' when it doesn't matter + These days, compilers generally do just fine without advice from + users about 'inline', and there's little need for 'static inline', + just as there's little need for 'register'. + * src/dfa.c (to_uchar): + * src/dosbuf.c (guess_type, undossify_input, dossified_pos): + * src/main.c (undossify_input): + No longer inline. + * src/search.h (mb_case_map_apply): Move from here ... + * src/kwsearch.c (mb_case_map_apply): ... to here, and + make it no longer 'inline'. + + grep: fix bugs with -i and titlecase + * NEWS: Document this. + * src/dfa.c (setbit_wc): Simplify. + (setbit_c): Remove; no longer used. + (setbit_case_fold_c, parse_bracket_exp, atom): + Don't mishandle titlecase. For 'atom', this removes the need for + the refactoring of Bug#16729. + (lex): Use the slower approach only for letters that have a + differing case. + * tests/case-fold-titlecase: New file. + * tests/Makefile.am (TESTS): Add it. + + grep: remove lint + * src/main.c (MBRTOWC, WCRTOMB): Remove no-longer-used macros. + +2014-02-28 Norihiro Tanaka + + grep: remove trivial_case_ignore + * src/main.c (trivial_case_ignore): Remove. + (main): Remove its use; this optimization is no longer needed. + + grep: don't match line-by-line for case-insensitive with grep and awk + * src/main.c (matcher): Move decl up. + (do_execute): With the grep or awk matchers, + no need to match line by line. + +2014-02-27 Jim Meyering + + maint: dfa: pass NULL, not 0, as 2nd arg to setlocale + * src/dfa.c (using_simple_locale): Use NULL, not 0. + +2014-02-27 Paul Eggert + + * src/dfa.c (prednames): POSIX allows [[:xdigit:]] to match multibyte chars. + + * src/dfa.c (parse_bracket_exp): Parenthesize. + + grep: fix multiple bugs with bracket expressions + * NEWS: Document this. + * src/dfa.c (using_simple_locale): New function. + (parse_bracket_exp): Handle bracket expressions like [a-[.z.]] + correctly. Don't assume that dfaexec handles expressions like + [^a-z] correctly, as they can match multiple characters in some + locales. + * tests/posix-bracket: New file. + * tests/Makefile.am (TESTS): Add it. + +2014-02-25 Stephane Chazelas + + align grep -Pw with grep -w + For the -w option, with -P, we used to look for the pattern surrounded by + word boundaries. That's different from what grep -w does and what the + documentation describes. Now align with grep -w and the documentation by + using PCRE look-behind and look-ahead operators to match the pattern if + it is not surrounded by word constituents. + * src/pcresearch.c (Pcompile): Use (? + + grep -P: fix it so backreferences now work with -w and -x + To implement -w and -x, we bracket the search term with parentheses. + However, that set of parentheses had the default semantics of + "capturing", i.e., creating a backreferenceable matched quantity. + Instead, use (?:...), to create a non-capturing group. + * src/pcresearch.c (Pcompile): Use (?:...) rather than (...). + * NEWS (Bug fixes): Mention it. + * tests/pcre-wx-backref: New file. + * tests/Makefile.am (TESTS): Add it. + This addresses http://debbugs.gnu.org/16865 + +2014-02-20 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.18 + * NEWS: Record release date. + + tests: test for the non-UTF8 multi-byte performance regression + Test for the just-fixed performance regression. + With a 100-200x differential, it is reasonable to expect that + a very slow system will be able to complete the designated + task in a few seconds, while with the bug, even a very fast + system would exceed the timeout. + * tests/mb-non-UTF8-performance: New file. + * tests/Makefile.am (TESTS): Add it. + * tests/init.cfg (require_JP_EUC_locale_): New function. + + grep -i: avoid a performance regression in multibyte non-UTF8 locales + * src/main.c: Include dfa.h. + (trivial_case_ignore): Perform this optimization only for UTF8 locales. + This rectifies a 100-200x performance regression in non-UTF8 multi-byte + locales like ja_JP.eucJP. The regression was introduced by the 10x + UTF8/grep-i speedup, commit v2.16-4-g97318f5. + * NEWS (Bug fixes): Mention it. + Reported by Norihiro Tanaka in http://debbugs.gnu.org/16232#50 + + maint: give dfa.c's using_utf8 function external scope + * src/dfa.c (using_utf8): Remove "static inline". + * src/dfa.h (using_utf8): Declare it. + * src/searchutils.c (is_mb_middle): Use using_utf8 rather than + rolling our own. + +2014-02-20 Paul Eggert + + tests: test [^^-^] in unibyte locales + This is a bug in the current dfa.c, which was reintroduced by the + recent reversion from RRI. + * tests/unibyte-negated-circumflex: New file. + * tests/Makefile.am (TESTS): Add it. + * tests/init.cfg (require_unibyte_locale): New function. + + grep: fix bug with patterns like [^^-~] in unibyte locales + * NEWS: Document this. + * src/dfa.c (parse_bracket_exp): Escape patterns like [^^-~], or + Awk patterns like [\^-\]], so that they are not misinterpreted by + the system regex library. Check for system regex failure due to + memory exhaustion. + +2014-02-17 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.17 + * NEWS: Record release date. + +2014-02-17 Paolo Bonzini + + revert "grep: DFA now uses rational ranges in unibyte locales" + The correct course of action for grep is to defer range interpretation + to regex, because otherwise you can get mismatches between regexes with + backreferences and those without. + + For example, [A-Z]. will use RRI but ([A-Z])\1 won't, with the confusing + result that the first regex won't match a superset of the language + described by the second regex. + + The source of the confusion is that, even though grep's dfa.c was changed + to use range checking instead of strcoll, that code is only invoked if + dfaexec is called with backref = NULL, and that never happens for grep! + + In the end, all that's needed for RRI is compiling --with-included-regex, + and in that case the patch is almost a no-op. Almost, because there + are corner cases that aren't handled correctly (e.g. [a-[.e.]], or + regular expressions that include a NUL character), but this can be + handled separately. + + * NEWS: Revert paragraph introduced by commit v2.16-7-g1078b64. + * src/dfa.c (parse_bracket_exp): Revert back to regcomp/regexec. + +2014-02-16 Mike Frysinger + + maint: ignore configure.lineno + * .gitignore: Add configure.lineno. + +2014-02-11 Benno Schulenberg + + help: remove surplus newline + * src/main.c (usage): Remove inconsistent \n introduced by previous + patch. + +2014-02-10 Benno Schulenberg + + help: fix a line ending, and use the same word for similar things + * src/main.c (usage): Change a stray 'n' to a newline, and use + the word "display" for showing version info as for help text. + +2014-02-09 Norihiro Tanaka + + speed up mb-boundary-detection after each preliminary match + After each kwsexec or dfaexec match, we must determine whether + the tentative match falls in the middle of a multi-byte character. + That is what our is_mb_middle function does, but it was expensive, + even when most input consisted of single-byte characters. The main + cost was for each call to mbrlen. This change constructs and uses + a cache of the lengths returned by mbrlen for unibyte values. + The largest speed-up (3x to 7x, CPU-dependent) is when most + lines contain a match, yet few are printed, e.g., when using + grep -v common-pattern ... to filter out all but a few lines. + + * src/search.h (build_mbclen_cache): Declare it. + * src/main.c: Include "search.h". + [MBS_SUPPORT] (main): Call build_mbclen_cache in a multibyte locale. + * src/searchutils.c [HAVE_LANGINFO_CODESET]: Include . + (mbclen_cache): New global. + (build_mbclen_cache): New function. + (is_mb_middle) [HAVE_LANGINFO_CODESET]: Use it. + * NEWS (Improvements): Mention it. + +2014-02-01 Jim Meyering + + maint: use to_uchar function rather than explicit casts + * src/system.h (to_uchar): Define function. + * src/kwsearch.c (Fexecute): Use to_uchar twice in place of casts. + * src/dfasearch.c (EGexecute): Likewise. + * src/main.c (prepend_args): Likewise. + * src/kwset.c (U): Define in terms of to_uchar. + * src/dfa.c (match_mb_charset): Use to_uchar, not an explicit cast. + +2014-01-27 Jim Meyering + + maint: remove vestiges of support for long-disabled --mmap option + This option was disabled in March of 2010, and began to elicit a + warning in January of 2012. Its time has come. + * doc/grep.in.1: Remove mention. + * doc/grep.texi: Likewise. + * src/main.c (GROUP_SEPARATOR_OPTION, usage, MMAP_OPTION) + (long_options, main): Remove all traces. + * tests/Makefile.am (check_PROGRAMS): Remove mention of ignore-mmap. + * tests/ignore-mmap: Remove file. + * NEWS (Maintenance): Mention it. + +2014-01-26 Jim Meyering + + maint: move two local variable declarations + * src/dfasearch.c (kwsmusts): Move one declaration down to the point + of definition. Move another into the sole scope where it is used. + +2014-01-26 Norihiro Tanaka + + dfasearch: skip kwset optimization when multi-byte+case-insensitive + Now that DFA searching works with multi-byte locales, the only remaining + reason to case-convert the searched input is the kwset optimization. + But multi-byte case-conversion is so expensive that it's not + worthwhile even to attempt that optimization. + + * src/dfasearch.c (kwsmusts): Skip this function in ignore-case mode + when the locale is multi-byte. + (EGexecute): Now that this code need not handle multi-byte case-ignoring + matches, remove the expensive copy/case-conversion code. + With no case-converted buffer, there is no longer any need to call + mb_case_map_apply, so remove it and associated code. + (kwsincr_case): Remove function. Now, every use of this function + is equivalent to a use of kwsincr. Replace all uses. + * tests/turkish-eyes: Test all of -E, -F and -G. + +2014-01-25 Norihiro Tanaka + + dfa: remove GREP-ifdef'd code in favor of code used by gawk + For many years, gawk and grep have used different #ifdef'd bits of + code relating to how the DFA matcher matches multibyte characters. + Remove the GREP-specific code in favor of the code gawk uses. This + permits us to avoid still more cases in which grep must resort to + the expensive process of copying/case-converting each input line + before matching against a case-converted regexp. + * src/dfa.c (parse_bracket_exp, atom): As above. + +2014-01-25 Jim Meyering + + gnulib: update to latest + +2014-01-17 Paul Eggert + + grep: DFA now uses rational ranges in unibyte locales + Problem reported by Aharon Robbins in . + * NEWS: + * doc/grep.texi (Environment Variables) + (Character Classes and Bracket Expressions): + Document this. + * src/dfa.c (parse_bracket_exp): Treat unibyte locales like multibyte. + +2014-01-17 Aharon Robbins + + grep: add undocumented '-X gawk' and '-X posixawk' options + See . + * src/grep.c (GAcompile, PAcompile): New functions. + (const): Use them. + +2014-01-10 Pádraig Brady + + tests: remove superfluous uses of printf + * tests/turkish-eyes: Remove unnecessary uses of printf. + +2014-01-09 Jim Meyering + + grep: make --ignore-case (-i) faster (sometimes 10x) in multibyte locales + These days, nearly everyone uses a multibyte locale, and grep is often + used with the --ignore-case (-i) option, but that option imposes a very + high cost in order to handle some unusual cases in just a few multibyte + locales. This change gets most of the performance of using LC_ALL=C + without eliminating the ability to search for multibyte strings. + + With the following example, I see an 11x speed-up with a 2.3GHz i7: + Generate a 10M-line file, with each line consisting of 40 'j's: + + yes jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj | head -10000000 > k + + Time searching it for the simple/noexistent string "foobar", + first with this patch (best-of-5 trials): + + LC_ALL=en_US.UTF-8 env time src/grep -i foobar k + 1.10 real 1.03 user 0.07 sys + + Back out that commit (temporarily), recompile, and rerun the experiment: + + git log -1 -p|patch -R -p1; make + LC_ALL=en_US.UTF-8 env time src/grep -i foobar k + 12.50 real 12.41 user 0.08 sys + + The trick is to realize that for some search strings, it is easy + to convert to an equivalent one that is handled much more efficiently. + E.g., convert this command: + + grep -i foobar k + + to this: + + grep '[fF][oO][oO][bB][aA][rR]' k + + That allows the matcher to search in buffer mode, rather than having to + extract/case-convert/search each line separately. Currently, we perform + this conversion only when search strings contain neither '\' nor '['. + See the comments for more detail. + + * src/main.c (trivial_case_ignore): New function. + (main): When possible, transform the regexp so we can drop the -i. + * tests/turkish-eyes: New file. + * tests/Makefile.am (TESTS): Use it. + * NEWS (Improvements): Mention it. + +2014-01-07 Paul Eggert + + tests: port Solaris 10 /bin/sh patch back to GNU/Linux + Problem reported by Jim Meyering. + * tests/bre, tests/ere, tests/spencer1-locale: + Prefer re_shell, not re_shell_. + * tests/init.sh (re_shell): New var, which is exported instead of + re_shell_. + + Port to Solaris 10 /bin/sh. + Problem reported by Dagobert Michelsen in . + * tests/bre, tests/ere, tests/spencer1-locale: + Prefer re_shell_ to SHELL, if re_shell_ is set. + * tests/init.sh (re_shell_): Export if it's used. + +2014-01-01 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.16 + * NEWS: Record release date. + + gnulib: update to latest, for maint.mk fix + + maint: update copyright dates for 2014 + Do that by running "make update-copyright". + + gnulib: update to latest + +2013-12-31 Jim Meyering + + pcre: use PCRE_NO_UTF8_CHECK properly + In order to obtain the behavior we want, i.e., to disable + error-on-invalid-UTF-in-input, apply this PCRE option in + pcre_exec, not when compiling. + * src/pcresearch.c (Pexecute): Use PCRE_NO_UTF8_CHECK here, ... + (Pcompile): ...rather than here. + * tests/pcre-invalid-utf8-input: Adjust test case to test for this. + +2013-12-26 Jim Meyering + + maint: fix inconsistent spacing in expression + * src/main.c (prline): Fix inconsistent spacing in expression: + s/ / /. + +2013-12-26 behoffski + + maint: fix a garbled comment + * src/dfa.c (XNMALLOC, etc.): Fix garbled comment wording. + +2013-12-23 Jim Meyering + + maint: fix/improve a comment + * src/main.c (prline): Replace untrue FIXME comment with one + telling how the hard-to-reach code can be exercised. + +2013-12-21 Santiago Ruano Rincón + + pcre: tell grep -P to relax its stance on invalid multibyte chars + Do not exit-2 for invalid UTF-8 characters. Just prior to this + change, this command would match no lines and fail like this: + $ printf 'j\x82\nj\n'|LC_ALL=en_US.UTF-8 grep -P j|cat -A; echo $? + grep: invalid UTF-8 byte sequence in input + 2 + After this change, the same command matches both lines, and succeeds: + jM-^B$ + j$ + 0 + * src/pcresearch.c (Pcompile): Use PCRE_NO_UTF8_CHECK, too, and + add a comment. + * tests/pcre-utf8: Add a test and a comment. + This change did not work with Debian unstable pcre-8.31-2 + or with some 8.33 and 8.34-based versions, but does work with + Fedora 20's 8.33 and with a built-from-latest source library. + Based on a patch by Santiago Ruano Rincón. + See http://bugs.gnu.org/15758/ + +2013-12-21 Jim Meyering + + tests: avoid FP failure due to exhausted memory + * tests/long-line-vs-2GiB-read: Don't declare the test "failed" + when running out of memory. In that case, skip it. + +2013-12-18 Jim Meyering + + maint: add comments and split some long lines + * src/main.c (do_execute): Add a comment. + Split some lines longer than 80 bytes. + + pcre: avoid a nominal leak + * src/pcresearch.c (Pcompile)[HAVE_LIBPCRE && !PCRE_STUDY_JIT_COMPILE]: + We would leak "re" if built with HAVE_LIBPCRE but without + PCRE_STUDY_JIT_COMPILE. Move the free out one level. + + maint: indent cpp directives to reflect nesting + * src/pcresearch.c: Insert spaces after a few "#", to indent + cpp directives to reflect their nesting. + + grep: handle lines longer than INT_MAX on more systems + When trying to exercize some long-line-handling code, I ran these + commands: + $ dd bs=1 seek=2G of=big < /dev/null; grep -l x big; echo $? + grep: big: Invalid argument + 2 + grep should not have issued that diagnostic, and it should + have exited with status 1, not 2. What happened? + grep read the 2GiB of NULs, doubled its buffer size, + copied the 2GiB into the new 4GiB buffer, and proceeded + to call "read" with a byte-count argument of 2^32. + On at least Darwin 12.5.0, that makes read fail with EINVAL. + The solution is to use gnulib's safe_read wrapper. + * src/main.c: Include "safe-read.h" + (fillbuf): Use safe_read, rather than bare read. The latter + cannot handle a read size of 2^32 on some systems. + * bootstrap.conf (gnulib_modules): Add safe-read. + * tests/long-line-vs-2GiB-read: New file. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + +2013-11-25 Jim Meyering + + tests: port to non-GNU sed + * tests/multibyte-white-space (utf8_space_characters): The generation + of test inputs relied on GNU sed's interpretation of \<, but that is + not portable, and caused spurious test failures. Adjust the sed regexp + to work on all versions. + Reported by Karl Dubost in http://bugs.gnu.org/15953. + +2013-11-22 Jim Meyering + + maint: minor cleanup: xmalloc+strcpy -> xmemdup + * src/main.c (main): Replace an xmalloc+strcpy combination + with an equivalent use of xmemdup. + +2013-11-21 Jim Meyering + Paul Eggert + + dfa: avoid undefined behavior of "1 << 31" + * src/dfa.c (charclass): Change type from "int" to "unsigned int". + (tstbit): Rather than shifting "1" left to form a mask, shift the + LHS bits the right and use "1" as the mask. Also, return bool, rather + than "int". + (setbit, clrbit, dfastate): Don't shift "1" (aka (int)1) left by 31 bits. + Instead, use "1U" as the operand, to avoid undefined behavior. + Spotted by gcc's new -fsanitize=undefined. + +2013-11-02 Jim Meyering + + grep: fix regression with -P vs. invalid UTF-8 input + * src/pcresearch.c (Pexecute): Don't abort upon unexpected + PCRE-specific error code. Explicitly handle PCRE_ERROR_BADUTF8, + and change the default to print a diagnostic including the unhandled + integer PCRE error code and exit with status 2. + * tests/pcre-invalid-utf8-input: New file. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + * THANKS: Update. + Reported by Dave Reisner in http://bugs.gnu.org/15758. + + grep: fix regression involving \s and \S + Commit v2.14-40-g01ec90b made \s and \S work with multi-byte + characters, but it made it so any use like \s*, \s+, \s?, \s{3} + would malfunction in a multi-byte locale. + * src/dfa.c (lex): Also reset laststart. + * tests/backslash-s-and-repetition-operators: New file. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + * THANKS: Update. + Reported by Mirraz Mirraz in http://bugs.gnu.org/15773. + +2013-11-01 Jim Meyering + + maint: NEWS: document a release-related bug fix + * NEWS (Bug fixes): Add an entry for a fix pulled from gnulib. + +2013-10-26 Jim Meyering + + build: update gnulib submodule to latest + This pulls in a gnulib fix for maint.mk that ensures the procedure + described in README-release actually does what we want. Before this + change, that procedure resulted in a grep-2.15 tarball that would + lead to a grep binary whose --version- reported version number was + 2.14.51... rather than the expected 2.15. + + maint: avoid automake deprecation warning re ACLOCAL_AMFLAGS + * Makefile.am (ACLOCAL_AMFLAGS): Don't use this deprecated variable. + * configure.ac (AC_CONFIG_MACRO_DIRS): Use this instead. + (AUTOMAKE_OPTIONS): Require automake-1.12. + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.15 + * NEWS: Record release date. + +2013-10-25 Paul Eggert + + build: port to AIX + Problem reported by Pavel Kharitonov in . + * src/Makefile.am (LDADD): Add $(LIBTHREAD). + + build: avoid duplicate -funit-at-a-time etc. options + * configure.ac (WERROR_CFLAGS): Don't add -fdiagnostics-show-option + and -funit-at-a-time, as Gnulib does that for us now, and we're + merely piling on duplicats. + +2013-10-24 Jim Meyering + + tests: port more tests to bourne shells with hex-challenged printf + * tests/pcre-utf8: Convert the hex \xHH literals for the euro symbol + to octal \OOO. + * tests/turkish-I: Likewise for "I with dot". + * tests/turkish-I-without-dot: Likewise for another Turkish I: U+0131. + + maint: clean up an ugly 'while' condition + * src/main.c (get_nondigit_option): Separate a slightly baroque + "while" expression into two separate statements, both inside the loop. + +2013-10-23 Jim Meyering + + tests: port to bourne shells whose printf doesn't grok hex + Use octal escapes, not hex, in printf(1) format strings, + and in one case, use $AWK's printf so we can continue + to use the table of hex values. + * tests/char-class-multibyte: Use printf octal escapes, not hex, + for portability to shells like dash and Solaris 10's /bin/sh. + * tests/backslash-s-vs-invalid-multitype: Likewise. + * tests/surrogate-pair: Likewise. + * tests/unibyte-bracket-expr: Count in decimal and convert to octal. + * tests/multibyte-white-space (hex_printf): New function. + Use it in place of printf so we can retain the table of hex digits + without hitting the limitation of some bourne shells. + Reported by Paul Eggert in http://bugs.gnu.org/15690#11 + +2013-10-21 Jim Meyering + + gnulib: update to latest + + maint: remove now-unused wcscoll module + * bootstrap.conf (gnulib_modules): Remove wcscoll; no longer used. + +2013-10-20 Paul Eggert + + build: avoid chatter from Automake 1.14 + * configure.ac (AM_INIT_AUTOMAKE): Add subdir-objects. + + build: port shell pattern to Solaris 10 + * configure.ac: Don't use unquoted '^' in a pattern, as this + breaks 'configure' on Solaris 10, whose /bin/sh complains about it, + which causes 'configure' to exit even before it finds a decent shell. + Unix 7th edition shell accepted '^' as an alias for '|'. + + build: port to platforms that predefine _FORTIFY_SOURCE + Problem reported by Brenton Hoff (Bug#15663). + * configure.ac (_FORTIFY_SOURCE): Don't define if already defined. + This is what Emacs does. + +2013-10-20 Jim Meyering + + build: update gnulib submodule to latest + +2013-10-19 Jim Meyering + + tests: extend the multibyte-white-space test + * tests/multibyte-white-space (utf8_space_characters): Add more + single-byte whitespace characters. Align RHS hex values and + make the sed substitution less rigid, to accommodate. + Also, ensure that grep '\S' exits with status 1. + + maint: update bootstrap to latest from gnulib + * bootstrap: Update from gnulib. + + maint: fix typo in NEWS + * NEWS: Fix/improve example commands in most recent entry. + The LC_ALL envvar setting goes before grep, not before printf. + Don't reference src/ in the second example command, and do specify + the locale. + +2013-10-09 Jim Meyering + + tests: add a test for better coverage of some tricky code + * tests/spencer1.tests: Add a non-range bracket expression representing the + same regexp, to cover the alternate code path, the one that does not require + a regcomp/exec call to interpret the regexp. + +2013-10-01 Jim Meyering + + tests: ensure neither \s nor \S matches an invalid multibyte character + * tests/backslash-S-vs-invalid-multitype: New file. + Prompted by the bug report from Roman at + http://savannah.gnu.org/bugs/?40009 + * tests/Makefile.am (TESTS): Add it. + + dfa: fix \s and \S to work for multibyte + * src/dfa.c (lex): In multibyte mode, we can't treat \s and \S as we do + in single-byte mode. Map them to [[:space:]] and [^[:space:]] respectively, + to make the DFA matcher use the regex-matcher for this term. + * tests/multibyte-white-space: New file. Test for the bug. + * tests/Makefile.am (TESTS): Add it. + This bug was introduced with the addition of DFA support + for \s and \S in commit v2.5.4-112-gf979ca0. + +2013-09-30 Jim Meyering + + maint: change all references: s/POSIX\.2/POSIX/ + There is no longer any point in referring to POSIX.N. + POSIX is sufficient. + * doc/grep.in.1: As above. + * src/main.c (main): Likewise. + * tests/file: Likewise. + * tests/options: Likewise. + * ChangeLog: Likewise. + * NEWS: Likewise. + * cfg.mk: Update, to match changed NEWS. + Inspired by Glenn Golden's suggestion in http://bugs.gnu.org/15486 + +2013-09-22 Jim Meyering + + dfa: remove dead disjunct + * src/dfa.c (parse_bracket_exp): Remove dead disjunct. + At that point, we know MB_CUR_MAX <= 1, so the test, + MB_CUR_MAX > 1 && ... is always false. Remove the disjunct. + + maint: dfa: improve comments and formatting + * src/dfa.c (add_utf8_anychar): Correct wording/alignment of a comment. + (dfaexec): Add curly braces around multi-line while statement within + a "then" block. + (ANYCHAR): Clarify comment: "." does not match an invalid UTF8 character. + (parse_bracket_exp) Improve comment. + +2013-09-08 Jim Meyering + + dfa: appease a static analyzer, and save 95 stack bytes + * src/dfa.c (MAX_BRACKET_STRING_LEN): Rename from BRACKET_BUFFER_SIZE + and decrease from 128 to 32. + (parse_bracket_exp): Add one byte more than MAX_BRACKET_STRING_LEN + to the length of "str" buffer, to avoid appearance that we may store + the trailing NUL beyond the end of buffer. A string of length 32 + or greater is rejected by earlier processing, so would never reach + this code. Addresses http://bugs.gnu.org/15307 + +2013-09-01 Corinna Vinschen + + fix Cygwin UTF-16 surrogate-pair handling with -i + grep -i would segfault on systems using UTF-16-based wchar_t (Cygwin) + when converting an input string containing certain 4-byte UTF-8 + sequences to lower case. The conversions to wchar_t and back to + a UTF-8 multibyte string did not take surrogate pairs into account. + * src/searchutils.c (mbtolower) [__CYGWIN__]: Detect and handle + surrogate pairs when converting. + * NEWS (Bug fixes): Mention it. + * tests/surrogate-pair: New test. + * tests/Makefile.am (TESTS): Add it. + Reported by: Jim Burwell + +2013-08-19 Paul Eggert + + doc: mention how to use the latest gnulib + * README-hacking: Steal some text from coreutils/README-hacking. + +2013-08-10 Jim Meyering + + build: update gnulib-related code + * gnulib: Update submodule to latest. + * bootstrap: Update from gnulib. + * gl/lib/regex_internal.h.diff: Update to reflect gnulib changes. + * bootstrap.conf: Partial sync from coreutils. + +2013-08-09 Jim Meyering + + tests: simplify and factor newest test + * tests/char-class-multibyte2: Simplify file names. + Factor out $e_acute, so that the grep argument representation + is ascii (though the value is still UTF8). + + doc: NEWS: mention the DFA segfault fix + * NEWS (Bug fixes): List the DFA segfault fix. + +2013-07-05 Paul Eggert + + Redo comments and white space to better approach GNU style. + +2013-07-05 Paolo Bonzini + + tests: add testcase for previous change + * tests/Makefile.am (TESTS): add char-class-multibyte2. + * tests/char-class-multibyte2: New file. + +2013-07-05 Mike Haertel + + dfa: fix multibyte character in brackets with repetition + Let FOO stand for any multibyte (e.g. CJK character) in the regexp. + It turns out the following much simpler regexp: + ([^.]*[FOO]){1,2} + is sufficient to cause the crash. + + In the first step of its parsing, DFA transforms regexp from human + readable syntax into reverse-polish form. For regexps of the form a{m,n} + repeat counts, it simply builds repeated copies of the representation + of a, with appropriate inserted CAT and QMARK operators. For the above + example with a regexp of the form a{1,2} it would build: + + + + QMARK + CAT + + When building repeated copies of RPN representations, additional + copies of the RPN representations are made by calling a function + copytoks() with arguments consisting of the start position and + length of the original copy. + + The problem is that the current code for copytoks() is simply + incorrect. It operates by calling addtok() for each individual + token in the source range being copied. But, in the particular + case that the token being added is MBCSET, addtok(): + + (1) incorrectly assumes that the character set being added to be added + is the one most (addtok has no argument to indicate which cset is + being added, so it just uses the latest one) + + (2) attempts to do some token sequence expansion into more primitive + operators so things like [FOO] are matched efficiently. + + Both of these assumptions are incorrect in the case that addtok() + is being called from copytoks(): (1) is simply not true, and + (2) is redundant--the expansion has already been done token sequence + being copied, so there is no need to do the expansion again. + + The correct function to add exactly one token, without further expansion, + is addtok_mb(). So here is my proposed fix, which is that copytoks() + should never call addtok(), but instead directly call addtok_mb() + (which is what addtok() eventually calls). + + * src/dfa.c (copytoks): Rewrite using addtok_mb directly. + +2013-05-28 Jim Meyering + + maint: align backslashes consistently + * tests/Makefile.am: Most backslashes were aligned with TABs, + so adjust the few that used spaces to conform. + + grep -F: avoid an infinite loop with invalid multi-byte search string + * src/kwsearch.c (Fexecute): Avoid an infinite loop when processing + a fixed (-F) multibyte search string that is an invalid byte sequence + in the current locale and that matches the bytes of the input twice + on a line. Reported by Daisuke GOTO in + http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4773 + * tests/invalid-multibyte-infloop: New test. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + +2013-04-18 Paul Eggert + + * cfg.mk (old_NEWS_hash): Update. + + doc: document EREs like a{,10} + Problem reported by Eric Blake in + . + * NEWS: Document the bug fix. + * doc/grep.in.1: Restore documentation for this feature, but mention + that it is a GNU extension. + * doc/grep.texi (Fundamental Structure): Mention that this feature + is a GNU extension. + +2013-04-02 Paul Eggert + + build: make dfa.c closer to Gawk's + * src/dfa.c: Include , not . + stddef.h is smaller and is all we need and is portable nowadays. + Include and only if MBS_SUPPORT. + +2013-01-15 Paul Eggert + + grep: make dfa.h standalone + Problem reported by Aharon Robbins in + . + * src/dfa.c: Include dfa.h first, so that it's tested standalone. + No need to include , since we are in charge of dfa.h and + know that it includes . + * src/dfa.h: Include and , so that it's standalone. + +2013-01-11 Stefano Lattarini + + build: update gettext version to 0.18.2 + * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18.2. + This is necessary to have the gettext-provided m4 files to use + AC_PROG_MKDIR_P rather than AM_PROG_MKDIR_P. This latter macro, + planned to disappear in Automake 1.14, has already been removed + in the development version of Automake, so that, without this + change, grep fails to bootstrap with bleeding-edge Automake. + +2013-01-11 Paul Eggert + + build: update gnulib submodule to latest + +2013-01-11 Stefano Lattarini + + build: remove redundant use of $(INCLUDES) + * lib/Makefile.am (INCLUDES): Remove. Automake automatically adds + $(srcdir) and $(top_builddir) to the C preprocessor search path. + INCLUDES is deprecated in Automake 1.13 (causing a runtime + warning), and will be removed in Automake 1.14. + +2013-01-04 Jim Meyering + + build: update gnulib submodule to latest + + maint: update all copyright year number ranges + Run "make update-copyright". + +2012-11-20 Paul Eggert + + grep: normalize diagnostics + * src/pcresearch.c (Pcompile): Use similar format diagnostics + as elsewhere, and translate them. + +2012-11-19 Paul Eggert + + grep: diagnose read errors from -f dir, porting to Solaris + Problem reported by Dennis Clarke for Solaris 10 in + . + * src/main.c (main): For -f F, diagnose any read errors + encountered when reading F. + * tests/Makefile.am (XFAIL_TESTS): Remove grep-dir. + * tests/grep-dir: Don't assume that directories cannot be read + via fread, as POSIX allows this and it can happen on Solaris. + +2012-11-09 Paolo Bonzini + + pcre: add PCRE-JIT support for grep + * NEWS: Document new feature. + * src/pcresearch.c [PCRE_STUDY_JIT_COMPILE] (jit_stack): New. + [PCRE_STUDY_JIT_COMPILE] (Pcompile): JIT-compile the regular expression + and allocate a stack for it. Based on a patch from Zoltan Herczeg. + * THANKS: Add Zoltan to the list. + +2012-10-24 Paul Eggert + + build: go back to AC_PROG_CC + * configure.ac: Go back to using AC_PROG_CC rather than AC_PROG_CC_STDC, + as the latter is obsolescent and the Autoconf bug involving the former + has been fixed. + +2012-10-24 Jim Meyering + + build: use AC_PROG_CC_STDC rather than AC_PROG_CC + * configure.ac: Use AC_PROG_CC_STDC rather than AC_PROG_CC, + to accommodate autoconf-2.69-37+. + + build: update gnulib submodule to latest + +2012-10-23 Eric Blake + + build: default to --enable-gcc-warnings in a git tree + Anyone building from cloned sources can be assumed to have a new + enough environment, such that enabling gcc warnings by default will + be useful. Tarballs still default to no warnings, and the default + can still be overridden with --disable-gcc-warnings. + * configure.ac (gl_gcc_warnings): Set default based on environment. + +2012-10-03 Jim Meyering + + maint: factor out STREQ definition + * src/main.c (STREQ): Remove definition. + * src/pcresearch.c: (STREQ): Likewise. + * src/system.h (STREQ): Define it here instead. + + maint: correct syntax-check failures; adjust NEWS + * tests/pcre-utf8: Reverse order of compare arguments. + Remove all copyright year numbers except 2012. + Use skip_ "diagnostic...", rather than a bare "exit 77". + * NEWS: Start with a concise description of the bug. + * src/pcresearch.c (STREQ): Define, so that we can... + (Pcompile): use STREQ, not strcmp. + +2012-10-03 Paolo Bonzini + + tests: include UTF-8 testcases for grep -P + * tests/Makefile.am (TESTS): Add pcre-utf8. + * tests/pcre-utf8: New file. + +2012-10-03 Petr Pisar + + pcresearch: set UTF-8 flag correctly for UTF-8 locales + Otherwise, Unicode properties (\p{XXX}) do not work with characters + outside the 7-bit ASCII character set. + + * src/pcresearch.c (Pcompile): Look for UTF-8 locales and set PCRE_UTF8 + if one is found. + +2012-10-03 Jaroslav Škarvada + + doc: fix a formatting bug in grep.1 template + * doc/grep.in.1: Insert .TP before the paragraph describing + --dereference-recursive (-R). + +2012-10-03 Jim Meyering + + maint: placate gcc's -Wjump-misses-init warning + * src/kwsearch.c (Fexecute): Replace a "goto" and "return" with + a simple return statement, eliminating the label, since that was + the sole use. + * src/dfasearch.c (EGexecute): Likewise. + +2012-09-01 Jim Meyering + + build: update gnulib submodule to latest + +2012-09-01 Eric Blake + + build: work with new glibc when not optimizing + Starting with glibc 2.15, the system headers refuse to compile + unconditional use of FORTIFY_SOURCE if optimization is disabled + but -Werror is in effect. + + * configure.ac (FORTIFY_SOURCE): Make conditional. + +2012-08-19 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.14 + * NEWS: Record release date. + +2012-08-07 Jim Meyering + + build: update gnulib and bootstrap + + tests: test for bug with -i and ^$ in a multi-byte locale + * tests/empty-line-mb: New file. + * tests/Makefile.am (TESTS): Add it. + + grep -i '^$' in a multi-byte locale could report a false match + * src/dfasearch.c (EGexecute): Do not match the sentinel "newline" + that is appended to each buffer. + This bug may sound like a big deal (it certainly surprised me), but + realize that only the empty-line-matching regular expression '^$' + can trigger it, and then only when you add the unnecessary (and + arguably superfluous) -i, *and* run the command in a multi-byte + locale. Using a multi-byte locale for such a regular expression + is also pointless, and hurts performance. + * NEWS (Bug fixes): Mention it. + Reported by Alexander Katassonov + +2012-08-06 Jim Meyering + + tests: fix a skip diagnostic that mentioned the wrong locale + * tests/init.cfg (require_tr_utf8_locale_): s/en_US/tr_TR/ + +2012-08-02 Jim Meyering + + tests: skip failing test on FS/system that lack SEEK_HOLE support + * tests/big-hole: Test for SEEK_HOLE support. If not available, + skip this test. Hence, this test is now skipped on linux-3.5.0 with + ext4 or tmpfs. The test runs (and passes) with at least btrfs, xfs, + or ocfs2. + * bootstrap.conf (gnulib_modules): Use the perl module. + +2012-07-30 Jim Meyering + + maint: optimize long-line processing + * src/main.c (grep): Use memrchr rather than an open-coded loop, + reducing the cost of the replaced code by 50% when processing very + long lines. If there were a rawmemrchr function (analogous to glibc's + rawmemchr), then the performance improvement would be even greater. + +2012-07-27 Paul Eggert + + maint: remove stat-size + * bootstrap.conf (gnulib_modules): Remove stat-size. + * src/main.c: Don't include stat-size.h; no longer needed. + + grep: don't falsely report compressed text files as binary + * NEWS: Document this. + * src/main.c (file_is_binary): Remove the heuristic based on + st_blocks, as it does not work for compressed file systems. + On Solaris, it'd be cheap to test whether the file system is known + to be uncompressed, which allow the heuristic, but Solaris has + SEEK_HOLE so there's little point. + + grep: don't falsely report tiny text files as binary + * NEWS: Document this. + * src/main.c (file_is_binary): When we are already at apparent + EOF, skip the file-size check, as some servers use zero blocks + to store binary files. Reported by Martin Carroll in + . + +2012-07-26 Paul Eggert + + doc: document -r/-R in man page + * doc/grep.in.1: Document -r vs. -R. + +2012-07-21 Jim Meyering + + tests: avoid false positive upon kernel OOM-kill + * tests/big-match (skip_diagnostic): Handle case of 139 (SIGKILL) + with no diagnostic. + + build: update gnulib and bootstrap + + maint: fix misspellings in old ChangeLog + * ChangeLog-2009: Fix typos. + +2012-07-19 Paul Eggert + + grep: fix ptrdiff/size_t clash + Reported by Jaroslav Škarvada in . + * src/dfasearch.c (EGexecute): Use size_t, not ptrdiff_t, for lengths. + Use regoff_t to store re_match's output, and test it before converting + it to size_t. + +2012-07-06 Jim Meyering + + maint: correct log typo, to reflect in generated ChangeLog + * Makefile.am (gen-ChangeLog): Use --amend, now that we must + make our first log correction. + * build-aux/git-log-fix: New file. + +2012-07-04 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.13 + * NEWS: Record release date. + + build: update gnulib submodule, bootstrap, init.sh + +2012-06-17 Jim Meyering + + tests: add another turkish-I-related test case + * tests/turkish-I-without-dot: Also exercise the case in which + the original string and the lower-case buffer have precisely + the same length (22 bytes here), yet internal offsets do differ. + +2012-06-16 Jim Meyering + + grep -i: work also when converting to lower-case inflates byte count + Commit v2.12-16-g7aa698d addressed the case in which the lower-case + representation of an input byte occupies fewer bytes than the original. + However, even with commit v2.12-20-g074842d, grep -i would still + misbehave when converting a character to lower-case increased its + byte count. The map-manipulation code assumed that the case conversion + could only shrink the byte count. With the consideration that it may + also inflate it, the deltas recorded in the map array must be signed, + and we must account for the one-to-two-or-more mapping when the + original-to-lower-case conversion causes the byte count to increase. + * src/searchutils.c (mbtolower): When a lower-case character occupies + more than one byte, set its remaining map slots to zero. Change the + type of the map to be signed, and compute the change in character + byte count as new_length - old_length. + * src/search.h: Include , for decl of intmax_t. + (mb_case_map_apply): Adjust for signed increments: + each map entry is now signed. + (mb_len_map_t): Define type. Thanks to Paul Eggert for noticing + in review that using a bare "char" as the base type would be wrong on + systems for which it is a signed type (as with gcc's -funsigned-char). + * src/kwsearch.c (Fcompile, Fexecute): Likewise. + * src/dfasearch.c (kwsincr_case, EGexecute): Likewise. + * tests/turkish-I-without-dot: New test. Thanks to Paolo Bonzini + for the tip that in the tr_TR.utf8 locale, mapping "I" to lower case + increases the character's byte count. + * tests/Makefile.am (TESTS): Add it. + * tests/init.cfg (require_tr_utf8_locale_): New function. + * NEWS (Bug fixes): Expand the existing entry. + +2012-06-12 Paul Eggert + + grep: handle -i when chars differ in length but line does not + * src/searchutils.c (mbtolower): Return the map back to the caller + if any input character's length differs from the corresponding output + character's, not merely if the total string length differs. + Problem reported by Johannes Meixner in + . + +2012-06-07 Jim Meyering + + tests: extend coverage of dfa.c's match_mb_charset + Add a test case to increase test coverage of part of dfa.c (the DFA + matcher used by grep and gawk). While thinking about removing the few + remaining uses of strncpy in dfa.c, I found that none of the existing + tests covered the 40+ lines of code at the end of match_mb_charset, + so constructed this test case to demonstrate that it's not dead code + * tests/dfa-coverage: New test, for improved coverage. + * tests/Makefile.am (TESTS): Add it. + +2012-06-05 Jim Meyering + + build: fix a subtly twisted "make distcheck" failure + "make distcheck" would fail when, during a test build, + an attempt to overwrite the deliberately-write-protected + $(srcdir)/grep.pot file would fail. + * bootstrap.conf (bootstrap_epilogue): Don't let the existence of + a large sparse file in the build directory induce "make distcheck" + failure. The existence of a large sparse test file named 8T-or-so + would make po/Makefile.in.in's use of grep (to search for "GNU grep" + as an indication that this is a GNU package) exit 2 without generating + any output, which made the first xgettext use --package-name=grep, + while that same search for "GNU grep" would succeed when run + from a pristine from-tarball build, thus making the second + xgettext invocation use --package-name='GNU grep'. + That mismatch: + -"Project-Id-Version: grep 2.12.18-1080\n" + +"Project-Id-Version: GNU grep 2.12.18-1080\n" + led to the attempt by Makefile.in.in's grep.pot-update rule to + overwrite ../../grep.pot in the read-only po/ source directory. + +2012-06-03 Jim Meyering + + build: update gnulib submodule, bootstrap and init.sh + cfg.mk: Exempt dfa.c from the new no-strncpy test, for now. + +2012-06-02 Jim Meyering + + grep: fix how -i works with a match containing the Turkish I-with-dot + Fix a long-standing problem in the way grep's -i interacts with + data whose byte count changes when we convert it to lower case. + For example, the UTF-8 Turkish I-with-dot (İ) occupies two bytes, + but its lower case analog, i, occupies just one byte. The code + converts both search string and the haystack data to lower case, + and then searches for the modified string in the modified buffer. + The trouble arose when using a lowercase buffer + pair to manipulate the original (longer) buffer. + + The solution is to change mbtolower to return additional information: + a malloc'd mapping vector. With that, the caller maps the lowercase- + relative to numbers that refer to the original buffer. + This mapping is used only when lengths actually differ, so the cost + in general should be small. + + * src/searchutils.c (mbtolower): Add the new map parameter. + * src/search.h (mb_case_map_apply): New function. + * src/kwsearch.c (Fexecute): Update mbtolower caller, and upon + success, apply the new map. + * src/dfasearch.c (EGexecute): Likewise. + * tests/Makefile.am (XFAIL_TESTS): Remove turkish-I from this list; + that test is no longer expected to fail. + * NEWS (Bug fixes): Mention it. + Reported by Ilya Basin in + http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3413 and later + by Strahinja Kustudic in http://savannah.gnu.org/bugs/?36567 + +2012-06-01 Paul Eggert + + grep: remove unnecessary "what-if-signal?" code + * src/main.c (fillbuf): Don't worry about EINTR when closing -- + not possible, since we're not catching signals. + +2012-05-16 Paul Eggert + + grep: avoid nominal integer overflow + * src/dfa.c (add_utf8_anychar): Avoid signed integer overflow. + Although this works on all platforms we know about, strictly + speaking the behavior is undefined, and Sun C 5.8 warns about it. + +2012-05-15 Jim Meyering + + maint: avoid nit-picky syntax-check test failure; tweak big-hole test + * NEWS: Restore deleted newline in "old" NEWS, to fix a syntax-check + test failure. + * tests/big-hole: Use awk, rather than a shell loop: saves 3000 lines + of verbose shell output in the .log file. + +2012-05-15 Paul Eggert + + grep: sparse files are now considered binary + * NEWS: Document this. + * doc/grep.texi (File and Directory Selection): Likewise. + * bootstrap.conf (gnulib_modules): Add stat-size. + * src/main.c: Include stat-size.h. + (usable_st_size): New function, mostly stolen from coreutils. + (fillbuf): Use it. + (file_is_binary): New function, which looks for holes too. + (grep): Use it. + * tests/Makefile.am (TESTS): Add big-hole. + * tests/big-hole: New file. + +2012-05-06 Paul Eggert + + maint: quote 'like this' or "like this", not `like this' + See . + * ChangeLog-2009, HACKING, NEWS, README-hacking, cfg.mk, configure.ac: + * lib/colorize-w32.c, m4/pcre.m4: + * src/Makefile.am, src/dfa.c, src/dosbuf.c, src/main.c: + * tests/backref, tests/help-version, tests/tests: + In commentary, quote 'like this' or "like this" rather than + `like this' or ``like this''. + * cfg.mk (old_NEWS_hash): Update due to changed old NEWS. + * doc/grep.texi (General Output Control): Quote sample text + with @samp, not with `...'. + * src/main.c (usage): + * tests/help-version: Quote 'like this' rather than `like this' + in diagnostics. + + exclude: process exclude and include directives in order + Also, change exclude and include directives so that they apply to + command-line arguments too. This restores the pre-2.6 behavior, + and fixes a bug reported by Quentin Arce in + . + * NEWS: Document this. + * src/main.c (included_patterns): Remove. All uses removed. + (skipped_file): New function. + (grepdirent): New arg command_line; all callers changed. This is + needed because non-command-line files can invoke fts_open, and + their directory entries need to be distinguished from top-level + directory entries. Move code into the new skipped_file function. + (grepdesc): Check whether a command-line argument should be skipped. + (main): --include and --exclude options now share excluded_patterns + rather than having separate variables included_patterns and + excluded_patterns. + * tests/include-exclude: Add a test to detect the fixed bug. + + build: update gnulib submodule to latest + +2012-04-30 Jim Meyering + + cosmetic: binary operator goes *after* the newline, when split + * src/dfa.c (match_mb_charset): Join split lines. + (parse_bracket_exp): Move "||" from end of first split line + to the beginning of the continued line. + * src/dosbuf.c (dossified_pos): Likewise, but for "&&". + + grep: -K is not an option: remove it from list + The presence of "K" in the short-option string meant that + an erroneous "grep -K ..." would fail with a bare Usage/Try... + message, without the usual "invalid option -- 'K'". With this + removal, now grep prints the expected invalid option diagnostic. + * src/main.c (short_options): Remove "K". + Reported by Петр Досычев in + http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4488 + +2012-04-29 Paolo Bonzini + + dfa: small fixes to single-byte range computation + * src/dfa.c (parse_bracket_exp): Do not call regexec with an invalid + subject. Move declarations before all statements. + +2012-04-27 Paolo Bonzini + + dfa: do not use hard-locale + * bootstrap.conf (gnulib_modules): Remove hard-locale. + * src/dfa.c (hard_LC_COLLATE): Remove. + (dfaparse): Do not initialize it. + (parse_bracket_exp): Always go through system regex matcher to find + single byte characters matching a range. + + drop support for Makefile.boot + * Makefile.am: Do not distribute README-boot and Makefile.boot. + * NEWS: Mention this change. + * README-alpha: Do not mention README-boot and Makefile.boot. + * Makefile.boot: Remove. + * README-boot: Remove. + +2012-04-27 Aharon Robbins + + dfa: do not use strcoll to match multibyte characters in ranges + This does not affect the behavior of grep, which always defers + to glibc or gnulib when matching ranges. + * src/dfa.c (match_mb_charset): Compare wc directly to the range + endpoints. + + dfa: include stdbool.h explicitly + * src/dfa.c: Include stdbool.h explicitly + +2012-04-23 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.12 + * NEWS: Record release date. + + build: update gnulib submodule to latest + + tests: skip annoyingly long gnulib lock tests + * bootstrap.conf (avoided_gnulib_modules): Define. + (gnulib_tool_option_extras): Use it. + +2012-04-22 Jim Meyering + + tests: avoid spurious quote-mismatch failure on OS/X + * tests/in-eq-out-infloop: Simplify expected error output, eliminating + expected quotes altogether, thus avoiding spurious OS/X-specific + failure due to mismatch of multi-byte vs. single-byte quotes. + +2012-04-17 Jim Meyering + + build: update gnulib submodule to latest + * bootstrap: Also update this file. + +2012-04-17 Jim Meyering + + grep: fix --devices=ACTION (-D) so stdin is once again exempt + An oversight in the 2.11 changes made it so "echo x|grep x" would + fail for those who set GREP_OPTIONS=--devices=skip. + + * src/main.c (grepdesc): Ignore skip-related options when reading + from standard input. + * tests/skip-device: New file. Test for the above. + * tests/Makefile.am (TESTS): Add it. + * doc/grep.texi (File and Directory Selection): Clarify this point, + documenting the stdin exemption. + * NEWS (Bug fixes): Mention it, and add a few "[fixed in ...] notes. + Reported by Tino Keitel in http://bugs.debian.org/669084, + and forwarded to bug-grep by Aníbal Monsalve Salazar. + +2012-04-13 Jim Meyering + + maint: dfa: correct bogus formatting + * src/dfa.c (transit_state, dfaexec): s/++ * VAR/++*VAR/ + + maint: dfa: add/improve comments + * src/dfa.c (transit_state_consume_1char): Note always-ignored + return value. + Fix typos: s/equivalent class/equivalence class/. + + maint: dfa: avoid unnecessary uses of strcpy/strncpy + * src/dfa.c (icatalloc): Use memcpy, not strcpy, given the length. + (dfamust): Combine MALLOC+strcpy into cleaner xmemdup. + (parse_bracket_exp): Likewise, but replace a use of strncpy. + + grep: handle symlinked directory loops as usual + * src/main.c (grepfile): Treat EMLINK just like ELOOP, for + systems like FreeBSD 9.0 on which we would otherwise report + "Too many links" rather than ignoring that type of failure. + E.g., "mkdir d; cd d; ln -s . a; grep -r ^" would print + grep: a: Too many links and would exit with status 2. + Now, it prints nothing and exits with status 1, as before. + Reported by Nelson H. F. Beebe. + + tests: avoid spurious failure of the symlink test + * tests/symlink: Ignore spurious "Binary file d matches" on + systems for which reading from a directory actually succeeds. + Reported by Bruno Haible and Nelson Beebe. + +2012-04-09 Jim Meyering + + tests: avoid syntax-check failure: reverse compare arguments + * tests/repetition-overflow: Fix reversed compare arguments. + + build: update gnulib submodule to latest + +2012-03-18 Paul Eggert + + grep: report overflow for ERE a{1000000000} + * NEWS: Document this. + * src/dfa.c (MIN): New macro. + (lex): Lexically analyze the repeat-count operator once, not + twice; the double-scan complicated the code and made it harder to + understand and fix. Adjust the repeat-count parsing so that it + better matches the behavior of the regex code, in three ways: + 1. Diagnose too-large repeat counts rather than treating them as + literal characters. 2. Use RE_INVALID_INTERVAL_ORD, not + RE_NO_BK_BRACES, to decide whether to treat invalid-syntax {...}s + as literals. 3. Use the same wording for {...}-related + diagnostics that the regex code uses. + * tests/bre.tests, tests/ere.tests, tests/repetition-overflow: + Adjust to match new behavior, and add a few tests. + * cfg.mk (exclude_file_name_regexp--sc_error_message_uppercase): + New macro, since the diagnostics start with uppercase letters. + +2012-03-14 Paul Eggert + + grep: -r no longer follows symlinks; use fts + Change -r to follow only command-line symlinks, and by default to + read only devices named on the command line. This is a simple + way to get a more-useful behavior when searching random + directories; the idea is to use 'find' if you want something fancy. + -R acts as before and gets a new alias --dereference-recursive. + The code now uses fts internally, so it is more robust and + faster with large hierarchies. + * .gitignore: Remove lib/savedir.c, lib/savedir.h. + * tests/symlink: New file + * Makefile.boot (LIB_OBJS_core): Remove isdir.o, savedir.o. + Perhaps other changes are needed too, but I'm not sure what + this makefile is for. + * NEWS: Document changes. + * doc/grep.texi (File and Directory Selection): Likewise. + * bootstrap.conf (gnulib_modules): Remove dirent, dirname, isdir, open. + Add fstatat, fts, openat-safer. + * lib/Makefile.am (libgreputils_a_SOURCES): Remove savedir.c, savedir.h. + * lib/savedir.c, lib/savedir.h: Remove. + * po/POTFILES.in: Add lib/openat-die.c. + * src/main.c: Include fcntl-safer.h, fts_.h. Don't include + isdir.h, savedir.h. + (struct stats, stats_base): Remove. + (long_options, usage, main): Add --dereference-recursive and + implement -r vs -R. + (filename_prefix_len, fts_options): New static vars. + (basic_fts_options, READ_COMMAND_LINE_DEVICES): New constants. + (devices): Now defaults to READ_COMMAND_LINE_DEVICES. + (reset, grep): Now takes just struct stat rather than file name and + struct stats. All callers changed. + (fillbuf): Now takes struct stat reather than struct stats. + All callers changed. + (grep): Don't worry about recursing too deeply; fts and grepdesc + handle this now. + (is_device_mode, grepdirent, grepdesc, grep_command_line_args): + New functions. + (grepfile): New args DIRDESC, FOLLOW, COMMAND_LINE. Remove struct stats + arg. All callers changed. Use openat_safer rather than open. + Use desc == STDIN_FILENO to tell whether we're reading "-". + Don't worry about EINTR when closing -- not possible, since we're + not catching signals. + * tests/Makefile.am (TESTS): Add symlink. + * tests/symlink: New file. + +2012-03-12 Paul Eggert + + tests: port big-match to non-GNU dd + * tests/big-match: Don't assume GNU dd extension "bs=1M". + + tests: test for bug with -r --exclude-dir and no file operand + * tests/include-exclude: Test for the bug and fix. + +2012-03-12 Allan McRae + + grep: fix segfault with -r --exclude-dir and no file operand + * src/main.c (grepdir): Don't invoke excluded_file_name on NULL. + * NEWS (Bug fixes): Mention it. + +2012-03-09 Jim Meyering + + tests: exercise two recently-fixed bugs + * tests/repetition-overflow: New test for bugs fixed by commit + v2.10-82-gcbbc1a4. + * tests/Makefile.am (TESTS): Add it. + +2012-03-03 Jim Meyering + + maint: use an optimal-for-grep xz compression setting + * cfg.mk (XZ_OPT): Use -6e (determined empirically, see comments). + This sacrifices a meager 60 bytes of compressed tarball size for a + 55-MiB decrease in the memory required during decompression. I.e., + using -9e would shave off only 60 bytes from the tar.xz file, yet + would force every decompression process to use 55 MiB more memory. + + build: update gnulib submodule to latest + +2012-03-02 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.11 + * NEWS: Record release date. + + tests: avoid failure when using Solaris 10's sed + * tests/reversed-range-endpoints: Use a simpler sed expression to + sanitize actual output, so it also works with Solaris 10's /bin/sed. + +2012-03-01 Jim Meyering + + maint: manually correct formatting in dfa.c's cpp definitions + * src/dfa.c: Adjust formatting in cpp definitions. + + maint: indent dfa.c + * src/dfa.c: Filter through indent like this: + HOME=. indent -Tsize_t -l79 --leave-preprocessor-space \ + --dont-format-comments --no-tabs < dfa.c > k && mv k dfa.c + + doc: correct grep.1's descriptions of \w and \W (they omitted "_") + * doc/grep.in.1: Fix descriptions of \w and \W. + They did not mention "_". + * doc/grep.texi (The Backslash Character and Special Expressions): + [\w, \W]: List the "_" before the char class, not after: [_[:alnum:]], + for readability and to be consistent with the man page. + +2012-03-01 Paul Eggert + + maint: spelling fixes + + grep: fix integer-overflow issues in main program + * NEWS: Document this. + * bootstrap.conf (gnulib_modules): Add inttypes, xstrtoimax. + Remove xstrtoumax. + * src/main.c: Include , for INTMAX_MAX, PRIdMAX. + (context_length_arg, prtext, grepbuf, grep, grepfile) + (get_nondigit_option, main): + Use intmax_t, not int, for line counts. + (context_length_arg, main): Silently ceiling line counts + to maximum value, since there's no practical difference between + doing that and using infinite-precision arithmetic. + (out_before, out_after, pending): Now intmax_t, not int. + (max_count, outleft): Now intmax_t, not off_t. + (prepend_args, prepend_default_options, main): + Use size_t, not int, for sizes. + (prepend_default_options): Check for int and size_t overflow. + + grep: avoid mishandling of long lines + * src/pcresearch.c (Pexecute): Do not pass a line longer than + INT_MAX to pcre_exec, since its API does not permit that. + + grep: remove no-longer-used setrlimit code + This code has been unused and obsolescent ever since the regex + code stopped using the stack for large regular expressions. + * src/main.c [HAVE_SETRLIMIT]: Do not include or + or ; no longer needed. + (set_rlimits): Remove. All callers changed. + + grep: fix some core dumps with long lines etc. + These problems mostly occur because the code attempts to stuff + sizes into int or into unsigned int; this doesn't work on most + 64-bit hosts and the errors can lead to core dumps. + * NEWS: Document this. + * src/dfa.c (token): Typedef to ptrdiff_t, since the enum's + range could be as small as -128 .. 127 on practical hosts. + (position.index): Now size_t, not unsigned int. + (leaf_set.elems): Now size_t *, not unsigned int *. + (dfa_state.hash, struct mb_char_classes.nchars, .nch_classes) + (.nranges, .nequivs, .ncoll_elems, struct dfa.cindex, .calloc, .tindex) + (.talloc, .depth, .nleaves, .nregexps, .nmultibyte_prop, .nmbcsets): + (.mbcsets_alloc): Now size_t, not int. + (dfa_state.first_end): Now token, not int. + (state_num): New type. + (struct mb_char_classes.cset): Now ptrdiff_t, not int. + (struct dfa.utf8_anychar_classes): Now token[5], not int[5]. + (struct dfa.sindex, .salloc, .tralloc): Now state_num, not int. + (struct dfa.trans, .realtrans, .fails): Now state_num **, not int **. + (struct dfa.newlines): Now state_num *, not int *. + (prtok): Don't assume 'token' is no wider than int. + (lexleft, parens, depth): Now size_t, not int. + (charclass_index, nsubtoks) + (parse_bracket_exp, addtok, copytoks, closure, insert, merge, delete) + (state_index, epsclosure, state_separate_contexts) + (dfaanalyze, dfastate, build_state, realloc_trans_if_necessary) + (transit_state_singlebyte, match_anychar, match_mb_charset) + (check_matching_with_multibyte_ops, transit_state_consume_1char) + (transit_state, dfaexec, free_mbdata, dfaoptimize, dfafree) + (freelist, enlist, addlists, inboth, dfamust): + Don't assume indexes fit in 'int'. + (lex): Avoid overflow in string-to-{hi,lo} conversions. + (dfaanalyze): Redo indexing so that it works with size_t values, + which cannot go negative. + * src/dfa.h (dfaexec): Count argument is now size_t *, not int *. + (dfastate): State numbers are now ptrdiff_t, not int. + * src/dfasearch.c: Include "intprops.h", for TYPE_MAXIMUM. + (kwset_exact_matches): Now size_t, not int. + (EGexecute): Don't assume indexes fit in 'int'. + Check for overflow before converting a ptrdiff_t to a regoff_t, + as regoff_t is narrower than ptrdiff_t in 64-bit glibc (contra POSIX). + Check for memory exhaustion in re_search rather than treating + it merely as failure to match; use xalloc_die () to report any error. + * src/kwset.c (struct trie.accepting): Now size_t, not unsigned int. + (struct kwset.words): Now ptrdiff_t, not int. + * src/kwset.h (struct kwsmatch.index): Now size_t, not int. + + tests: test for problems with long matches + The new test is expensive, so add a category of expensive tests, + which are normally not run, and put the new test in this new + category. The idea of having expensive tests is taken from coreutils. + * HACKING: Mention RUN_EXPENSIVE_TESTS and similar env vars. + * Makefile.am (check-expensive): New rule. + * tests/Makefile.am (TESTS): Add big-match. + * tests/init.cfg (expensive_): New function, from coreutils. + * tests/big-match: New file. + +2012-02-29 Paul Eggert + + maint: use gnulib _Noreturn rather than __attribute__ ((noreturn)) + * src/grep.h (__attribute__): Remove. + * src/dfa.h (__attribute__): Likewise. + (dfaerror): Use noreturn rather than __attribute__ ((noreturn)). + * src/main.c (usage): Likewise. + +2012-02-26 Jim Meyering + + build: update submodule, bootstrap, tests/init.sh from gnulib + * gl/lib/regcomp.c.diff: Adjust. + * bootstrap: Update from gnulib. + * tests/init.sh: Update from gnulib. + +2012-02-26 Paolo Bonzini + + dfa: merge calls to SUCCEEDS_IN_CONTEXT + * src/dfa.c (state_index): use a single call to SUCCEEDS_IN_CONTEXT. + + dfa: fix a subtle constraint encoding bug + * src/dfa.c (SUCCEEDS_IN_CONTEXT, PREV_NEWLINE_DEPENDENT, + PREV_LETTER_DEPENDENT): Rewrite to handle all 3*3=9 possible + combinations of previous and next character contexts. + (MATCHES_NEWLINE_CONTEXT, MATCHES_LETTER_CONTEXT): Remove. + (NO_CONSTRAINT, BEGLINE_CONSTRAINT, ENDLINE_CONSTRAINT, + BEGWORD_CONSTRAINT, ENDWORD_CONSTRAINT, LIMWORD_CONSTRAINT, + NOTLIMWORD_CONSTRAINT): Switch to new encoding. + * NEWS: Document resulting bugfix. + * tests/spencer1.tests: Add regression test. + + dfa: do not use MATCHES_*_CONTEXT directly + * src/dfa.c (dfastate): Use SUCCEEDS_IN_CONTEXT. + + dfa: change meaning of a state context + * src/dfa.c (MATCHES_NEWLINE_CONTEXT, MATCHES_LETTER_CONTEXT): New. + (state_separate_contexts): Remove second argument. + (state_index): Do not mask away CTX_NONE. + (dfaanalyze): Adjust call to state_index and state_separate_contexts. + (dfastate): Adjust calls to state_index and state_separate_contexts. + +2012-02-13 Paul Eggert + + tests: fix loop in epipe test + * tests/epipe: Don't loop forever if the bug is present. + Problem reported by Jaroslav Skarvada. + +2012-02-08 Paul Eggert + + tests: work portably even if SIGPIPE is ignored + * tests/epipe: Don't rely on "trap - PIPE"; that's not portable. + Problem reported by Eric Blake in + . + Also, use "ls -al" rather than "echo", in case "echo" is done by a + buggy shell that ignores write errors. And close grep's fd 3, as + a sanity check. + +2012-02-07 Paul Eggert + + tests: work even if SIGPIPE is ignored + * tests/epipe: Do not infinite-loop if SIGPIPE is already ignored. + It could be that the invoker of 'make check' ignores SIGPIPE, + for example. + +2012-02-05 Jim Meyering + + build: accommodate -Wshadow and -Werror=suggest-attribute=pure + * src/dfa.c (state_separate_contexts): Add _GL_ATTRIBUTE_PURE. + (dfaexec): Rename parameter, s/newline/allow_nl/, to avoid + shadowing the global. + +2012-02-05 Paolo Bonzini + + dfa: refactor common context computations + * src/dfa.c (CTX_ANY, charclass_context, state_separate_contexts): New. + (dfaanalyze): Use state_separate_contexts. + (dfastate): Use charclass_context and state_separate_contexts. Rename + prev_context to separate_contexts. + + dfa: change newline/letter to a single context value + * src/dfa.c (MATCHES_NEWLINE_CONTEXT, MATCHES_LETTER_CONTEXT, + SUCCEEDS_IN_CONTEXT, ACCEPTS_IN_CONTEXT): Take a single context value + for prev and curr. + (struct dfa_state): Replace newline and letter with context. + (wchar_context): New. + (state_index): Replace newline and letter with context. Compare + context values in the state struct. Adjust calls to pass contexts. + (wants_newline): Replace with wanted_context. Adjust calls to pass + contexts. + (dfastate): Replace wants_newline and wants_letter with wanted_context. + Adjust calls to pass contexts. + (build_state): Adjust calls to pass contexts. + (match_anychar, match_mb_charset, transit_state): Use wchar_context. + Adjust calls to pass contexts. + +2012-02-05 Paolo Bonzini + + dfa: introduce contexts for the values in d->success + Also initialize all tables in a single place in dfasyntax. + + * src/dfa.c (CTX_NONE, CTX_LETTER, CTX_NEWLINE, char_context): New. + (sbit, letters, newline): New. + (dfasyntax): Fill them. + (dfastate): Remove letters, newline, initialized. + (build_state): Use CTX_* constants. + (dfaexec): Remove sbit and sbit_init. + +2012-02-05 Paolo Bonzini + + dfa: remove useless check + * src/dfa.c (state_index): There is nothing that is a newline *and* + a letter. Remove redundant call to SUCCEEDS_IN_CONTEXT. + +2012-01-22 Jim Meyering + + build: update bootstrap from gnulib and adapt + * bootstrap: Update from gnulib. + * tests/init.sh: Update from gnulib. + * bootstrap.conf (bootstrap_epilogue): Remove now-unnecessary, + snippet that edited gnulib-tests/gnulib.mk. + (gnulib_tool_option_extras): Add both --symlink and + --makefile-name=gnulib.mk. Remove use of $bt. + * lib/Makefile.am: Initialize numerous automake variables so that + generated code in gnulib.mk may use += to append to them. + + maint: convert `this' to 'this' quoting style in diagnostics + Now that gnulib's quote and quotearg modules use 'this' style, + change the few explicit uses in diagnostics to conform. + * src/egrep.c (after_options): Use 'this' style of quotes. + * src/fgrep.c (after_options): Likewise. + * src/grep.c (after_options): Likewise. + * src/main.c (usage): Likewise. + + build: update gnulib to latest; adjust quoting in tests + * gnulib: Update. + * tests/in-eq-out-infloop: Convert expected diagnostics to match + new quoting. + +2012-01-22 Paul Eggert + + doc: document recent diagnostics-related changes + * NEWS: Document changes re diagnostics related to GREP_COLORS, + directory loops, -s, "write error". + + grep: be quiet about GREP_COLORS syntax + * src/main.c (struct color_cap): fct now returns void, + since there's no longer need to use what it returns. + (color_cap_mt_fct, color_cap_rv_fct, color_cap_ne_fct): Return void. + (parse_grep_colors): Do not output diagnostics and then exit with + status 0. Instead, ignore errors in GREP_COLORS. This is more + consistent with programs that (e.g.) ignore errors in termcap entries, + and it's more internally-consistent as some GREP_COLORS errors + were ignored but not others. + + grep: exit with nonzero status if directory loop + * src/main.c (grepdir): Exit with status 2 if a directory loop is + found, since the output might not be "right" (i.e., infinite...). + + grep: suppress read errors if -s + * src/main.c (reset, grep, grepfile): Do not report an input error + if -s is given. + + grep: don't say "write error" over and over + Problem reported by Travis Gummels in + . + * src/main.c (write_error_seen): New static var. + (clean_up_stdout): New function. + (prline): Do not output 'write error' more than once; exit + after the first one. Use the same wording for the diagnostic + that close_stdout uses. + (main): Clean up with clean_up_stdout, not close_stdout, so that + grep doesn't output multiple "write error" diagnostics. + * tests/Makefile.am (TESTS): Add epipe. + * tests/epipe: New file. + +2012-01-12 Paul Eggert + + dfa: non-glibc word-constituent unibyte fix + * src/dfa.c (is_valid_unibyte_character): Fix typo that caused + this to incorrectly return 0 on unibyte non-glibc systems. + Problem reported by Aharon Robbins in + . + +2012-01-04 Paul Eggert + + doc: document empty pattern better + * doc/grep.texi (Top, Fundamental Structure, Usage): + Explain how grep deals with the empty pattern. + Problem spotted by Bernhard Voelker in + . + + grep: with no args, search "." only if command-line -r + * NEWS: Document this. + * doc/grep.texi (Environment Variables, grep Programs): Likewise. + * src/main.c (usage): Likewise. + (main): Implement this. + (prepend_default_options): Return a count of prepended options. + * tests/r-dot: Test the above. + +2012-01-03 Jim Meyering + + tests: adjust test to match code, now that --mmap writes to stderr + * tests/ignore-mmap: Separate stdout and stderr; test both. + + deprecate the --mmap option + * src/main.c (main): Deprecate the --mmap option: issue a warning + when it is used. + (usage): Change description. + * doc/grep.texi (Other Options): Document the new behavior. + * NEWS (Changes in behavior): Mention it. + +2012-01-03 Paolo Bonzini + + dfa: fix incorrect comment + * src/dfa.c (dfastate): Fix comment for newline. + + dfa: fix rebase conflict + * src/dfa.c (dfaanalyze): Fix reference to nalloc. + + dfa: automatically resize position_sets + * src/dfa.c (insert, copy, merge): Resize arrays here. + (dfaanalyze): Do not track number of allocated elements here. + (dfastate): Allocate mbps with only one element. + + dfa: change position_set nelem to size_t + * src/dfa.c (REALLOC_IF_NECESSARY): Disable assertion, to avoid + warnings from -Wtype-limits. + (position_set): Change nelem to a size_t. + + dfa: move nalloc to position_set structure + * src/dfa.c (position_set): Add alloc. + (alloc_position_set): Initialize it. + (dfaanalyze): Use it instead of the nalloc array or nelem. + + dfa: remove dead assignment + * src/dfa.c (transit_state): transit_state_consume_1char will clear follows, + do not do this ourselves. + + dfa: introduce alloc_position_set + * src/dfa.c (alloc_position_set): New function, use it throughout. + + dfa: use a more compact data type for grps + * src/dfa.c (leaf_set): New. + (dfastate): Use the smaller type, leaf_set, for grps. Its prior type + contained an unused constraint field. + + dfa: use MALLOC/REALLOC always + src/dfa.c (dfastate, enlist, dfamust): Use MALLOC and REALLOC. + + dfa: remove unnecessary braces + * src/dfa.c (dfastate): Remove unnecessary braces. + + dfa: x2nrealloc starting from a NULL pointer works + * src/dfa.c (parse_bracket_exp): Do not MALLOC mbcset parts the first time + they are encountered. Initialize chars_al correctly. + +2012-01-03 Jim Meyering + + build: avoid build failure with --enable-gcc-warnings and recent gcc + * lib/colorize-posix.c: Disable -Wsuggest-attribute=const, to avoid + warning about this empty init_colorize function. + +2012-01-03 Paolo Bonzini + + remove lib/ms/ + * configure.ac: Create lib/colorize.c as a symbolic link. + * lib/colorize-posix.c: New name of lib/colorize-impl.c. + * lib/colorize-w32.c: New name of lib/ms/colorize-impl.c. + * lib/colorize.c: Delete. + * lib/Makefile.am (EXTRA_DIST): Adjust. + * .gitignore: Adjust. + * cfg.mk: Adjust syntax-check exclusions. + + unify colorize.h headers + * lib/Makefile.am (EXTRA_DIST): Adjust. + * lib/colorize.h: Remove inline functions. + * lib/colorize-impl.c: Move them here as functions. + * lib/ms/colorize.h: Remove. + * src/Makefile.am (DEFAULT_HEADERS): Remove. + +2012-01-02 Paolo Bonzini + + colorize: use isatty module + * bootstrap.conf: Add isatty module. + * gnulib: Update to latest. + * lib/colorize.h: Remove argument from should_colorize. + * lib/ms/colorize.h: Likewise. + * lib/colorize-impl.c: Factor isatty call out of here... + * lib/ms/colorize-impl.c: ... and here... + * src/main.c: ... into here. + +2012-01-02 Jim Meyering + + tests: avoid minor "make check" failure + * tests/r-dot: Make executable, to avoid triggering a failed + consistency test in "make check". + +2012-01-02 Paul Eggert + + grep: -r with no args now searches "." + This is a patch I've been meaning to put in for years. + When I added support for "grep -r", I forgot to have "grep -r PAT" + search the working directory by default, instead of searching + standard input (which makes no sense, even if stdin is a directory). + This is not an upward compatible change, since "grep -r PAT + + grep: check stdin like other files + * NEWS: Document this. + * src/main.c (grepfile): Revamp tests for input files so that + standard input is tested like other files. For example, report + an error if standard input equals standard output. + Prefer open+fstat to stat+open if possible, as open+fstat is + usually a bit faster and avoids a race condition. + * tests/in-eq-out-infloop: Add tests for cases like + 'grep pat >file'. + +2012-01-01 Jim Meyering + + maint: update all copyright year number ranges + Run "make update-copyright". + +2011-12-31 Paul Eggert + + grep: lower-case function names + These names used to be macros, but they're functions now. + All callers changed. + * src/main.c (pr_sgr_start): Rename from PR_SGR_START. + (pr_sgr_end): Rename from PR_SGR_END. + (pr_sgr_start_if): Rename from PR_SGR_START_IF. + (pr_sgr_end_if): Rename from PR_SGR_END_IF. + + ms: move Microsoft-specific stuff to lib/ms + * cfg.mk (exclude_file_name_regexp--sc_prohibit_strcmp) + (exclude_file_name_regexp--sc_require_config_h) + (exclude_file_name_regexp--sc_require_config_h_first): + New rules. + * lib/colorize.c, lib/colorize.h, lib/colorize-impl.c: + * lib/ms/colorize.h, lib/ms/colorize-impl.c: New files. + * configure.ac (GREP_SRC_INCLUDES): New macro. + * lib/Makefile.am (libgreputils_a_SOURCES): Add colorize.[ch]. + (EXTRA_DIST): New macro. + * src/Makefile.am (DEFAULT_INCLUDES): New macro. + * src/main.c: Include colorize.h. + (PR_SGR_START, PR_SGR_END, PR_SGR_START_IF, PR_SGR_END_IF): + Now static functions, not macros. + (hstdout, norm_attr, w32_console_init, w32_sgr2attr) + (w32_clreol) [__MINGW32__]: Move to lib/ms/colorize-impl.c. + (pr_sgr_start, pr_sgr_end): Remove; callers changed to use new + print_start_colorize, print_end_colorize from colorize.h. + (init_colorize): Rename from w32_console_init and move to + colorize module; caller changed. + (should_colorize): Move to colorize module. + + grep: do input==output check more like dir loop check + * src/main.c (grepfile): Just use SAME_INODE; don't bother + with SAME_REGULAR_FILE. This works better on properly-working + POSIX hosts, since it handles the case where the file is changing + as we grep it. It works worse on hosts that don't support st_ino + properly, but in practice this isn't that much of a problem here. + * src/system.h (same_file_attributes, SAME_REGULAR_FILE): + Remove; no longer needed. + + build: update gnulib submodule to latest + +2011-12-28 Paul Eggert + + maint: remove now-unused/obsolete files + * README.DOS: Remove file. + * m4/djgpp.m4: Likewise. + * .gitignore: Remove reference to m4/djgpp.m4. + +2011-12-28 Jim Meyering + + maint: distribute ChangeLog-2009 + * Makefile.am (EXTRA_DIST): Add ChangeLog-2009. + Spotted by Eli Zaretskii. + +2011-12-28 Jim Meyering + + main.c: add some 'const' directives + * src/main.c (color_dict, fg_color, bg_color, cap): Declare const. + + No semantic change. + +2011-12-28 Jim Meyering + + main.c: correct indentation and formatting style + * src/main.c: Correct many formatting inconsistencies. + No semantic change. + + avoid new syntax-check failures + * cfg.mk (old_NEWS_hash): Update, to accommodate old NEWS modification. + * src/main.c: Indent solely with spaces, never with TABs. + (should_colorize): Remove useless parens in #if directive. + +2011-12-28 Eli Zaretskii + + Fix whitespace, indentation and documentation + * src/main.c (parse_grep_colors): Fix indentation. + (usage): Mention MS-Windows in help text for -U and -u options. + + update NEWS for MS-Windows changes + * NEWS: Mention MS-Windows related bugfixes and enhancements. + + Fix the test suite for MS-Windows. + * tests/include-exclude: Use --directories=skip, to avoid + gratuitous failures on systems that cannot grep directories. + * tests/reversed-range-endpoints: Don't reject program names with + leading directories and drive letters. + * tests/warn-char-classes: Likewise. + + Support color highlighting on MS-Windows + * src/main.c (SGR_START, SGR_END, PR_SGR_FMT, PR_SGR_FMT_IF): Remove. + (PR_SGR_START, PR_SGR_START_IF): Replace with pr_sgr_start. + (PR_SGR_END, PR_SGR_END_IF): Replace with pr_sgr_end. + (pr_sgr_start, pr_sgr_end, should_colorize): New functions. + (w32_console_init, w32_sgr2attr, w32_clreol) [__MINGW32__]: New functions. + (main): Use should_colorize. Invoke w32_console_init. + +2011-12-24 Paul Eggert + + don't ignore errors when reading a directory + grep no longer silently suppresses errors when reading a directory + as if it were a text file. For example, "grep x ." now reports a + read error on most systems; formerly, it ignored the error. + Problem reported as an aside by Bob Proulx (Bug#10355). + * NEWS: Document this. + * src/main.c (grep, grepfile): Implement this. Simplify the code + considerably. + * src/system.h (is_EISDIR): Remove; no longer needed. + + --include etc. now work on command-line args more consistently + --include and --exclude apply only to non-directories and + --exclude-dir applies only to directories. "-" (standard input) + is never excluded, since it is not a file name. + This bug was discovered while fixing a read-directory bug (Bug#10355). + * NEWS: Document this. + * src/main.c (main): Implement this. + * tests/include-exclude: Test for it. + +2011-12-24 Jim Meyering + + build: update gnulib submodule to latest + +2011-12-12 Arnold D. Robbins + + doc: improve grep.texi + * doc/grep.texi: General editing for improved aesthetics. + Also fix a few problems. + +2011-12-12 Jim Meyering + + build: use gnulib's iswctype wcscoll + * bootstrap.conf (gnulib_modules): Add iswctype and wcscoll. + * configure.ac: Remove explicit checks for those functions. + * src/mbsupport.h (MBS_SUPPORT): Define to 1 if not already defined. + Remove the conditional, now that we're guaranteed by gnulib to have + wcscoll and iswctype. + Suggested by Alan Hourihane in http://savannah.gnu.org/bugs/?34930 + + disable the new input==output guard for additional options + * src/main.c (grepfile): Do not reject input == output also + when using a few other options. + * tests/in-eq-out-infloop: Test these new cases. + * NEWS (Bug fixes): Mention it + +2011-12-11 Nicolas Vigier + + do not reject "grep -qr . > out" + The recent fix to avoid an infinite disk-filling loop, commit 5e20a38a, + introduced a minor regression. If you use grep with -q and -r, and + redirect output to a file that will be traversed, then grep would + reject the command, even though it will generate no output. + In that case, there is no risk of an infinite loop. + * src/main.c (grepfile): Do not reject input == output when + using --quiet/--silent (-q). + Reported by J H Wilson in http://bugs.mageia.org/show_bug.cgi?id=3501 + forwarded by Nicolas Vigier to https://savannah.gnu.org/bugs/?34917 + +2011-11-29 Arnold Robbins + + dfa: do not call nl_langinfo in !MBS_SUPPORT mode + * src/dfa.c (using_utf8) [!MBS_SUPPORT]: Remove erroneous "defined" + in cpp test for MBS_SUPPORT. Since commit a163349d, MBS_SUPPORT is 0/1. + This error caused trouble only in the !MBS_SUPPORT case. + + dfa: avoid warning from deficient compiler in !MBS_SUPPORT mode + * src/dfa.c (setbit_wc) [!MBS_SUPPORT]: Add explicit "return false;" + after "abort ();", to avoid a warning from deficient compilers. + +2011-11-29 Jim Meyering + + tests: use "compare exp out", not "compare out exp" + Likewise, when an empty file is expected, use "compare /dev/null out", + not "compare out /dev/null". I.e., specify the expected/desired contents + via the first file name. Prompted by a suggestion from Bruno Haible + in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154 + + Run these commands: + + git grep -l -E 'compare [^ ]+ exp' \ + |xargs perl -pi -e 's/(compare) (\S+) (exp\S*)/$1 $3 $2/' + git grep -l -E 'compare [^ ]+ /dev/null' \ + |xargs perl -pi -e 's/(compare) (\S+) (\/dev\/null)/$1 $3 $2/' + +2011-11-29 Jim Meyering + + build: update gnulib submodule to latest + +2011-11-28 Jim Meyering + + build: accommodate -Werror=suggest-attribute=pure + Now that we're using the latest manywarnings module from gnulib, + accommodate gcc's -Werror=suggest-attribute=pure option by marking + suggested functions with gnulib-defined _GL_ATTRIBUTE_PURE. + * src/kwset.c (hasevery): Mark function with pure attribute. + (bmexec): Likewise. + * src/dfa.c (nsubtoks, istrstr, find_pred, dfamusts): Likewise. + * configure.ac: Disable (for lib/) options that seem not to be worth + the trouble: -Wunsuffixed-float-constants and -Wformat-nonliteral. + +2011-11-21 Bruno Haible + + build: fix "make check" error on OSF/1 + * tests/Makefile.am (TESTS_ENVIRONMENT): Test the value of the variable + BASH_VERSION, not the literal ASH_VERSION. + +2011-11-21 Jim Meyering + + portability: work consistently on *BSD systems + * src/dfa.c (is_valid_unibyte_character): Define. + (IS_WORD_CONSTITUENT): Use it here, to make grep work consistently + even on *BSD systems, which use different tables for ctype macros + like isalpha. http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4022 + With help from Bruno Haible. + +2011-11-20 Jim Meyering + + maint: consistently use NULL, not 0, when comparing pointers + * src/dfa.c (dfaanalyze): Compare trans[s] with NULL, not 0. + + maint: remove an avoidable #ifdef/#endif pair + * src/dfa.c (dfaanalyze): Remove avoidable #ifdef around "{". + + tests: fix typo in last change + * tests/word-delim-multibyte: Use double quotes around $e_acute, + not single quotes. Spotted by Bruno Haible. + This and the preceding change do not resolve the XPASS failure + on OpenBSD 4.9 after all. See the explanation at + http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4022 + + tests: avoid unwarranted test failure on *BSD-based systems + * tests/word-delim-multibyte (e_acute): Use a more portable + representation of e-acute. Reported by Bruno Haible. + +2011-11-19 Jim Meyering + + maint: accommodate -Wdeclaration-after-statement, but only in dfa.c, + and because doing so does not impact readability/maintainability. + This is solely to accommodate gawk users who are stuck with ancient gcc. + This is no excuse to change any other code in grep. + * src/dfa.c (dfaoptimize, parse_bracket_exp): Move declaration + to precede first statement in block. + +2011-11-16 Jim Meyering + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.10 + * NEWS: Record release date. + + build: update gnulib submodule to latest + +2011-11-13 Jim Meyering + + maint: update bootstrap and init.sh from gnulib + * tests/init.sh: Update from gnulib. + * bootstrap: Likewise. + +2011-11-12 Jim Meyering + + build: update gnulib for exclude-test fixes + + tests: make our "export" replacement efficient with modern shells + * tests/Makefile.am (TESTS_ENVIRONMENT): Use a trivial and efficient + implementation with a shell that supports "export var=val". + Use the sed-invoking replacement only when necessary. + Improved by Stefano Lattarini. + + tests: make the replacement export function more robust + * tests/Makefile.am (sed_quote_value): Also quote single quotes. + Remove sed's -e options. Not needed. + +2011-11-12 Bruno Haible + + tests: fix test suite execution failure on OSF/1 5.1 + * tests/Makefile.am (TESTS_ENVIRONMENT): Use a shell function to + ensure that we use only the portable form of the 'export' shell + built-in. + + tests: don't assume that /bin/bash exists + * tests/fedora: Run using /bin/sh, not /bin/bash. + + tests: avoid unwarranted failures due to SATAN's timeout + * tests/init.cfg (require_timeout_): Also ensure that + timeout exits with its child's exit status. + + build: fix compilation error on MSVC 9 to due Pexecute() declaration + * src/pcresearch.c (WITHOUT_PCRE_NORETURN): Remove macro. + (Pexecute): Replace abort() call with code that does not trigger GCC + warnings. + + tests: fix high-bit-range test failure on OSF/1 5.1 + * tests/high-bit-range: Use octal escape instead of hexadecimal escape + sequence. + +2011-11-11 Jim Meyering + + build: update gnulib for solaris test fix + +2011-11-10 Jim Meyering + + build: update gnulib submodule to latest + + maint: adjust the URL that will appear in the generated announcement + * cfg.mk (url_dir_list): Use this http://ftp.gnu.org/gnu/$(PACKAGE) + for the first link listed in the generated announcement. + announce-gen now provides the faster mirror link automatically. + +2011-11-06 Jim Meyering + + build: stop distributing gzip'd releases; xz is enough + * configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip. + * NEWS (Build-related): Mention that we're dropping .tar.gz. + + build: update gnulib submodule to latest + +2011-10-14 Stefano Lattarini + + distcheck: ensure dist-hook fails if syntax-check fails + * Makefile.am (run-syntax-check): Fix logic, to ensure that + the recipe of this target returns a non-zero exit status if + "make syntax-check" fails. + +2011-10-12 Jim Meyering + + build: update gnulib submodule to latest + This should fix a few portability problems, including one on HP-UX + and a test-float failure on PPC, reported by Andreas Metzler. + +2011-10-10 Stefano Lattarini + + gitignore: merge top-level and tests/ .gitignore files + * tests/.gitignore: Remove; what little remained of its + contents has been moved ... + * .gitignore: ... here. + + tests: tiny simplification in TESTS_ENVIRONMENT definition + * tests/Makefile.am (TESTS_ENVIRONMENT): Remove redundant use of + `export'. + +2011-10-10 Stefano Lattarini + + tests: support development version of automake too + This change implements a more correct and idiomatic use of the + features of the Automake-provided 'parallel-tests' harness. + Moreover, this change is required in order for the testsuite to + continue to work with the new testsuite harness that is planned + to be introduced in Automake 1.12 (which, as of the writing date, + is still under development and in late alpha state). + + * tests/Makefile.am (TESTS_ENVIRONMENT): The development version of + automake dos not support setting the interpreter delegated to run + the tests scripts in this variable; instead, use ... + (LOG_COMPILER): ... this variable. + * .gitignore: Ignore `.trs' files in directory `tests/'. + * build-aux/.gitignore: Ignore `test-driver' script. + +2011-10-03 Eli Zaretskii + + dfa: don't mishandle high-bit bytes in a regexp with signed-char + This appears to arise only on systems for which "char" is signed. + * src/dfa.c (FETCH_WC, FETCH): Produce an unsigned value, rather + than a sign-extended one. Fixes a bug on MS-Windows with compiling + patterns that include characters with the 8-th bit set. + (to_uchar): Define. From coreutils. + Reported by David Millis . + See http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3893 + * NEWS (Bug fixes): Mention it. + +2011-09-16 Jim Meyering + + maint: dfa: simplify multi-byte-related conditionals + * src/dfa.c (setbit_case_fold_c, parse_bracket_exp, lex): + (addtok_mb, dfaparse): Change each "MBS_SUPPORT && MB_CUR_MAX > 1" + test to just "MB_CUR_MAX > 1". + * src/dfasearch.c (kwsincr_case, EGexecute): Likewise. + * src/kwsearch.c (Fcompile, Fexecute): Likewise. + * src/searchutils.c (kwsinit): Likewise. + * src/dfa.c (parse_bracket_exp): Convert + "if (!MBS_SUPPORT || MB_CUR_MAX == 1)" to + "if (MB_CUR_MAX == 1)" and do this: + - assert(!MBS_SUPPORT || MB_CUR_MAX == 1); + + assert(MB_CUR_MAX == 1); + + maint: dfa: simplify several expressions + * src/dfa.c (dfainit): Set d->mb_cur_max unconditionally, now + that MB_CUR_MAX is always usable. With that, simplify all + "MBS_SUPPORT && d->mb_cur_max > 1" to simply "d->mb_cur_max > 1". + (dfastate, dfaexec, dfainit, dfafree): Simplify, removing each + now-unnecessary "MBS_SUPPORT &&". + + maint: dfa: avoid in-function "#if MBS_SUPPORT" tests + * src/dfa.c (setbit_case_fold_c): Remove "#if MBS_SUPPORT" in favor + of simple "if (MBS_SUPPORT ...". + (dfaexec, addtok): Likewise. + + maint: ensure that MB_CUR_MAX is defined even when !MBS_SUPPORT + * src/mbsupport.h [!MBS_SUPPORT] (MB_CUR_MAX): Define to 1. + + build: fix compilation failure when MBS_SUPPORT is 0 + * src/dfa.c (add_utf8_anychar): Always compile this function, + but when MBS_SUPPORT is 0, give it an empty body. + (prepare_wc_buf): Likewise. + [! MBS_SUPPORT] (setbit_wc): Define to always abort. + + maint: dfa: simplify dfaoptimize + * src/dfa.c (dfaoptimize): Simplify. + (dfacomp): Remove now-redundant "if (MBS_SUPPORT)" guard, + since dfaoptimize does nothing if !MBS_SUPPORT. + + maint: dfa: remove some #if MBS_SUPPORT guards + * src/dfa.c: Replace a few "#if MBS_SUPPORT" directives with + "if (MBS_SUPPORT)". Remove some altogether. + + maint: dfa: convert #if-MBS_SUPPORT (dfastate) + * src/dfa.c (dfastate): Use regular "if", not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (dfastate) + * src/dfa.c (dfastate): Use regular "if", not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (state_index) + * src/dfa.c (state_index): Use regular "if", not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (dfaparse) + * src/dfa.c (dfaparse): Use regular "if", not #if MBS_SUPPORT.' + + maint: dfa: convert #if-MBS_SUPPORT (copytoks) + * src/dfa.c (copytoks): Use regular "if", not #if MBS_SUPPORT.' + + maint: dfa: convert #if-MBS_SUPPORT (lex) + * src/dfa.c (lex): Use regular "if", not #if MBS_SUPPORT.' + + maint: dfa: convert #if-MBS_SUPPORT (parse_bracket_exp) + * src/dfa.c (parse_bracket_exp): Use regular "if", not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (parse_bracket_exp) + * src/dfa.c (parse_bracket_exp): Use regular "if", not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (parse_bracket_exp) + * src/dfa.c (parse_bracket_exp): Use regular "if", not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (dfaexec) + * src/dfa.c (dfaexec): Use regular "if", not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (dfaexec) + * src/dfa.c (dfaexec): Use regular "if", not #if MBS_SUPPORT. + Also add curly braces around multi-line if/else blocks. + + maint: dfa: remove #if-MBS_SUPPORT (free_mbdata) + * src/dfa.c (free_mbdata): Remove the #if guard altogether. + + maint: dfa: convert #if-MBS_SUPPORT (dfaoptimize, dfacomp) + * src/dfa.c (dfaoptimize, dfacomp): Use regular "if", + not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (dfafree) + * src/dfa.c (dfafree): Use regular "if", not #if MBS_SUPPORT. + + maint: dfa: convert #if-MBS_SUPPORT (parse_bracket_exp, part1) + * src/dfa.c (parse_bracket_exp): Remove in-function #if MBS_SUPPORT. + + maint: remove #if-MBS_SUPPORT declaration guards + * src/search.h: Don't bother to #if-out declarations. + + maint: convert #if-MBS_SUPPORT (EGexecute) + * src/dfasearch.c (EGexecute): Remove in-function #if MBS_SUPPORT. + + maint: convert #if-MBS_SUPPORT (kwsincr_case) + * src/dfasearch.c (kwsincr_case): Remove in-function #if MBS_SUPPORT. + Move decl's down. + + maint: convert #if-MBS_SUPPORT (Fcompile, etc.) + * src/kwsearch.c (Fcompile, Fexecute): Remove in-function #if MBS_SUPPORT. + (Fcompile): Rearrange some declarations. No semantic change. + + maint: convert #if-MBS_SUPPORT (kwsinit) + * src/searchutils.c (kwsinit): Remove in-function #if MBS_SUPPORT. + + maint: dfa: remove case-guarding #if-MBS_SUPPORT + * src/dfa.c [DEBUG] (prtok): Remove now-useless #if-MBS_SUPPORT. + +2011-09-15 Jim Meyering + + maint: remove #if MBS_SUPPORT around member declaration + * src/dfa.c (dfastate): Don't #ifdef-out "mbps" position_set member. + + maint: dfa: remove #if MBS_SUPPORT around struct definition + * src/dfa.c (struct mb_char_classes): Don't #ifdef-out declarations. + + build: avoid compilation failure when building without PCRE support + * src/pcresearch.c [!HAVE_LIBPCRE] (WITHOUT_PCRE_NORETURN): Define + to _Noreturn, not obsoleted-by-gnulib _GL_ATTRIBUTE_NORETURN. + Reported by Eric Blake. + + tests: stop using skip_test_; use skip_ instead + * tests/init.cfg (skip_test_): Remove definition. Use the improved + skip_ function from init.sh, now that it has the same feature. + * tests/euc-mb: s/skip_test_/skip_/ + * tests/sjis-mb: Likewise. + * tests/fmbtest: Likewise. + + tests: skip tests that require MBS support + * tests/init.cfg (require_compiled_in_MB_support): New function. + * tests/char-class-multibyte: Use it here, since this test cannot + succeed without MBS support. + * tests/equiv-classes: Likewise. + * tests/euc-mb: Likewise. + * tests/fgrep-infloop: Likewise. + * tests/init.cfg: Likewise. + * tests/prefix-of-multibyte: Likewise. + * tests/turkish-I: Likewise. + * tests/sjis-mb: Likewise. + + tests: make fmbtest explain (to stderr, not log) why it is skipped + * tests/fmbtest: Use skip_ and fail_ to give better diagnostics. + + maint: dfa: improve comments + * src/dfa.c (match_mb_charset, match_anychar): Improve comments. + +2011-09-14 Jim Meyering + + build: update gnulib submodule to newer + + maint: correct indentation + * src/dfa.c (dfaexec): Reposition curly braces to match indentation style. + Remove useless comment. + + maint: move declaration "down" to inner scope where it is used + * src/dfa.c (dfaexec): Move decl of local down into scope where used. + +2011-09-07 Jim Meyering + + doc: use "file name" consistently in grep's --help output + * src/main.c (usage): Use "file name", not "filename" in descriptions + of --with-filename (-H), --no-filename (-h) and --label=LABEL. + Suggested by Sequoia McDowell. + + bug: requires ru_RU.KOI8-R". [bug introduced in grep-2.9] + +2011-08-31 Matthew Burgess + + tests: remove debug code that would cp to /t + * tests/unibyte-bracket-expr: Remove debug artifact introduced + by 2011-06-02 commit de5f7000, "tests: exercise a uni-byte [...] + bug: requires ru_RU.KOI8-R". [bug introduced in grep-2.9] + +2011-08-20 Jim Meyering + + build: use largefile module and update to latest gnulib + * configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ... + * bootstrap.conf (gnulib_modules): ...this. Use largefile module. + * gnulib: Update to latest. + + maint: clean up and plug a leak-on-OOM + * src/dfa.c (icatalloc): Clean up; use xrealloc in place of malloc + and realloc; remove conditionals that are unnecessary, now that + failed allocation results in exit. + (enlist): Use xrealloc in place of realloc; remove conditional. + (comsubs): Avoid leak upon failed enlist call. + (dfamust): Use xmalloc in place of malloc. + Remove conditionals, now that icpyalloc and icatalloc never return NULL. + + maint: use x2nrealloc, not xrealloc + * src/main.c (main): Use x2nrealloc, not xrealloc + +2011-07-24 Jim Meyering + + tests: add a test to trigger the bug + * tests/Makefile.am (TESTS): Add it. + * tests/in-eq-out-infloop: Exercise the bug/fix. + + exit 2 (rather than infloop) when an input file is also on stdout + This avoids a potential "infinite" disk-filling loop. + Reported in http://savannah.gnu.org/patch/?5316 + and http://savannah.gnu.org/bugs/?17457. + * src/main.c: Include "quote.h". + (out_stat): New global. + (grepfile): Compare each regular file's dev/ino/etc. + with those from the file on stdout (if it too is regular). + (main): Set out_stat, if stdout is a regular file. + * src/system.h: Include "same-inode.h". + (same_file_attributes): Define. From diffutils. + (SAME_REGULAR_FILE): Define. + * bootstrap.conf (gnulib_modules): Use quote, not quotearg. + Use same-inode. + * NEWS (Bug fixes): Mention it. + +2011-07-15 Reuben Thomas + + doc: improve documentation of character classes in the man page + * doc/grep.in.1: Reword documentation of character classes. + +2011-07-12 Jim Meyering + + dfa: remove unnecessary inclusion of verify.h + * src/dfa.c: Don't include "verify.h". + + dfa: simplify use of *ALLOC macros + * src/dfa.c (XNMALLOC, XCALLOC): Redefine without outer cast-to-(t *). + (CALLOC, MALLOC, REALLOC): Remove type "t" parameter and adjust callers. + + dfa: change semantics of REALLOC_IF_NECESSARY's 3rd parameter + * src/dfa.c (REALLOC_IF_NECESSARY): Change meaning of 3rd param, + from "maximum index" to 1 greater than that: the required number + of *P-sized elements. Note that only some of the uses of + REALLOC_IF_NECESSARY needed to be adjusted, the others had already + required an extra element. + + dfa: rename REALLOC_IF_NECESSARY param/local for clarity + * src/dfa.c (REALLOC_IF_NECESSARY): Rename nalloc and new_nalloc + to n_alloc and new_n_alloc. + + dfa: prepare for a semantic change in REALLOC_IF_NECESSARY + * src/dfa.c (REALLOC_IF_NECESSARY): Remove "t" (type) parameter. + Use (*p) instead. Adjust all callers. + + dfa: add braces to REALLOC_IF_NECESSARY definition + * src/dfa.c (REALLOC_IF_NECESSARY): Add curly braces; use TABs + to right-indent. + +2011-06-28 Paolo Bonzini + + doc: improve documentation of character classes + * doc/grep.texi (Character classes): Mention explicitly when + examples refer to the C locale, explain better the general + meaning of character classes. + +2011-06-28 Jim Meyering + + dfa: fix the root cause of the heap overrun + dfa's "insert" function was supposed to be maintaining the position + list sorted on *decreasing* index, but since the 2009-12-09 "Speed + up insert" commit, 62458291, it was using code that assumed the data + were sorted on *increasing* index. As such, sometimes it would no + longer merge constraints (not finding a match) and would append + entries that normally would have matched and been merged. Those + erroneous append operations resulted in the heap overrun fixed by + 2011-06-17 commit 0b91d692 by doubling the array size. + * src/dfa.c (insert): Fix the comparison. + (dfaanalyze): Now that that's fixed, revert commit 0b91d692, + allocating space for only d->nleaves entries, not double that. + As far as I can tell, this change has no effect other than + decreased memory usage, although it may improve performance + slightly, since the resulting list of positions is half as long + as it used to be. + +2011-06-28 Paolo Bonzini + + dfa: use memcpy to copy position_sets + * src/dfa.c (copy): Use memcpy. + + dfa: use copyset to copy charclasses + * src/dfa.c (add_utf8_anychar): Change memcpy to copyset. + + gnulib: Update + Fixes mmap-anon.m4 conflict with fn_grep, reported by Rainer Orth. + +2011-06-21 Jim Meyering + + maint: update bootstrap from gnulib + * bootstrap: Update to latest, so it no longer inserts empty lines + in .gitignore files. + * .gitignore: Let bootstrap move "!..." lines to end of file. + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.9 + * NEWS: Record release date. + + build: avoid a warning when building with --disable-perl-regexp... + and --enable-gcc-warnings. + * src/pcresearch.c (WITHOUT_PCRE_NORETURN): Define. + Remove the unreachable return statement. + Reported by Eric Blake. + + tests: ensure that each test script is executable + This adds a rule run at "make check" time to ensure that + test scripts are consistently executable. + This change is not required for "make check", but makes it easier + for people to run scripts manually, but that is discouraged because + doing so makes it easy to omit important variable settings that + are normally provided via TESTS_ENVIRONMENT. + This change also makes each of the existing TESTS executable. + * tests/Makefile.am (check_executable_TESTS): New rule. + (check): Depend on it. + * tests/{all_scripts}: chmod 755. + Prompted by a report from Eric Blake. + + maint: update bootstrap from gnulib + * bootstrap: Update from gnulib. + + maint: update po/POTFILES.in + * po/POTFILES.in: Remove dfasearch.c, now that it no longer + contains a translatable diagnostic. + + tests: include-exclude: avoid false positive failure on FreeBSD + * tests/include-exclude: Avoid false-positive failure due to + matching "a" in a directory on FreeBSD, when searching a directory + without "-r". Search for '^aaa$' rather than just 'a'. + Adjust test inputs and expected output files accordingly. + + dfa: remove some useless casts + * src/dfa.c (icatalloc): Change type of "old" parameter + from "char const *" to "char *". + Don't cast-away const on realloc argument. + Remove now-unnecessary const-discarding cast. + Don't (void)-cast strcpy result. + * src/dosbuf.c (undossify_input): Remove anachronistic + cast-to-"char *" of realloc argument. + + dfa: more heap-allocation-related overflow protection + * src/dfa.c (enlist): Use xnrealloc, not realloc. + Also, remove unnecessary cast-to-(char *). + (dfamust): Use xnmalloc, not malloc. Before, this code would + return upon malloc failure (xnmalloc exits upon failure), but + later, via the *ALLOC macros, it could already exit, so this + new potential exit point is nothing new. The same applies + to enlist, since it is called only through dfamust. + + tests: update init.sh; simplify TESTS_ENVIRONMENT + * tests/init.sh: Update from coreutils. + * tests/Makefile.am (TESTS_ENVIRONMENT): Remove shell_or_perl_ + function. Instead, just use $(SHELL), since grep has no test + that starts with #!/usr/bin/perl. + +2011-06-20 Jim Meyering + + build: update gnulib submodule to latest + + build: avoid configure/gnulib-related errors + * bootstrap.conf: Remove now-unnecessary code to exclude + gettext/intl-related m4 tests. + +2011-06-19 Jim Meyering + + maint: tighten up superfluous code + * src/main.c (parse_grep_colors): Use xstrdup in place of xmalloc, + a useless test, strlen, and strcpy. + +2011-06-19 Paul Eggert + + dfa: avoid possibility of overflow + * src/dfa.c (REALLOC_IF_NECESSARY, CALLOC, MALLOC, REALLOC): + Use functions from xalloc.h to avoid overflow. + * src/dfasearch.c (GEAcompile): Use xnrealloc rather than realloc. + * src/pcresearch.c (Pcompile): Use xnmalloc, not xmalloc. + +2011-06-17 Jim Meyering + + build: update gnulib submodule to latest + + dfa: correct two uses of btowc + * src/dfa.c (setbit_c, setbit_case_fold_c): Compare the btowc + return value against WEOF, not EOF. Suggested by Eli Zaretskii. + On a system like MinGW with unsigned wint_t, comparing a btowc + return value against EOF (-1) would always be false. + + dfa: don't overrun a malloc'd buffer for certain regexps + * src/dfa.c (dfaanalyze): Allocate space for twice as many + positions as there are leaves. Before this change, for some + regular expressions, DFA analysis would have inserted far more + "positions" than dfa->nleaves (up to double). + Reported by Raymond Russell in http://savannah.gnu.org/bugs/?33547 + * tests/dfa-heap-overrun: Trigger the overrun. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + +2011-06-08 Jim Meyering + + tests: don't ignore sjis-mb test failure + I made changes that caused grep to segfault during "make check" -- + as seen in dmesg output -- yet no test failed(!), and there was no + trace of the segfault in the logs. + * tests/sjis-mb (test_grep_reject): Ensure that output is empty. + Don't ignore test failure. + +2011-06-07 Paolo Bonzini + + dfa: optimize wide characters in a bracket expression + * src/dfa.c (addtok): Compile characters to an alternation. Handle the + case when nothing else remains in the MBCSET. + + dfa: refactor to prepare for upcoming optimizations + * src/dfa.c (parse_bracket_exp): Move optimization of MBCSET from here... + (addtok): ... to here. + +2011-06-07 Paolo Bonzini + + dfa: correct handling of single-byte character ranges + This provides a better fix for the unibyte-bracket-expr and high-bit-range + testcases, and fixes the latent bug tested by bogus-wctob. + + * src/dfa.c (setbit_case_fold): Remove, replace with... + (setbit_wc, setbit_c, setbit_case_fold_c): ... these. + (parse_bracket_exp): Use setbit_case_fold_c when iterating over + single-byte sequences. Use setbit_wc for multi-byte character sets, + and setbit_case_fold_c for single-byte character sets. + (lex): Use setbit_case_fold_c for single-byte character sets. + +2011-06-07 Paolo Bonzini + + tests: exercise latent bug in character ranges + * tests/bogus-wctob: New. + * Makefile.am (TESTS): Add it. + +2011-06-07 Jim Meyering + + tests: exercise a uni-byte [...] bug: requires ru_RU.KOI8-R + * tests/unibyte-bracket-expr: New file. + * tests/Makefile.am (TESTS): Add it. + * init.cfg (require_ru_RU_koi8_r): New function. + + fix the [...] bug also for relatively unusual uni-byte encodings + * src/dfa.c (setbit_case_fold): Also handle uni-byte locales + like the one mentioned in the original report: see 2011-05-07 + commit d98338eb. Re-reported by Santiago Ruano Rincón. + Note that most uni-byte locales are not affected. + * NEWS (Bug fixes): Mention it. + + tests: use skip_test_, not skip_ + Use skip_test_, not skip_. The former prints its message both to + the log file and to FD 9 (redirected to tty via tests/Makefile.am), + while skip_ prints only to stderr, which goes to the log file. + * tests/init.cfg (skip_test_): New function. + Use skip_test_ in place of skip_ everywhere. + * tests/fmbtest: s/skip_/skip_test_/ + * tests/sjis-mb: Likewise. + * tests/euc-mb: Likewise. + + tests: fmbtest: factor + * tests/fmbtest: Factor out locale-name duplication. + + tests: fix skip-inducing typo in fmbtest + * tests/fmbtest: Fix locale name typo (s/cz_CZ/cs_CZ/) + that would cause this test to be skipped every time. + +2011-06-07 Paolo Bonzini + + gnulib: adjust included modules + * bootstrap.conf (gnulib_modules): Drop strtoul, rename wctype to + wctype-h. + +2011-05-21 Jim Meyering + + grep -P: don't abort upon exceeding PCRE's backtracking limit + * src/pcresearch.c (Pexecute): Handle PCRE_ERROR_MATCHLIMIT. + * tests/Makefile.am (XFAIL_TESTS): Remove pcre-abort. + * tests/pcre-abort: Expect failure, no output, and increase + the length of the input string, in case the backtracking limit + is ever raised. Adjust comment. + * NEWS (Bug fixes): Mention it. + + tests: show how to make grep -P abort + * tests/pcre-abort: New file. + Minimal testcase by Paolo Bonzini, derived from a report + by www.beaver@list.ru. + * tests/Makefile.am (TESTS): Add it. + (XFAIL_TESTS): Add it here, too, since this test always fails, for now. + + tests: fix oddities in pcre-z + * tests/pcre-z: Redirect stderr inside $(), not outside. + Remove double quotes around $REGEX (which is just 'a') within + double-quoted "$(...)". Split a long line. + + tests: factor out a new require_pcre_ function + * tests/init.cfg (require_pcre_): New function, factored out of... + * tests/pcre-z: ...here. Use the function. + * tests/pcre: Likewise. + + tests: clean up pcre + * tests/pcre: Skip (don't pass) the test when PCRE support is disabled. + Don't redirect so much to /dev/null, now that all test output goes to + pcre.log. Remove unnecessary braces and diagnostic about failing test. + +2011-05-13 Jim Meyering + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.8 + * NEWS: Record release date. + + build: update gnulib, for fixed getcwd test + + build: update gnulib submodule to latest + + maint: remove syntax-checking sc_tight_scope rule + * src/Makefile.am (sc_tight_scope): Remove rule. + Now it's provided via gnulib's maint.mk. + * cfg.mk (sc_tight_scope): Likewise. + +2011-05-08 Jim Meyering + + maint: use consistent declaration syntax + * src/grep.h (matchers): Declare consistently, so the sc_tight_scope + rule detects this as an extern-marked variable. + +2011-05-07 Jim Meyering + + maint: use gnulib's new readme-release module + * bootstrap.conf (gnulib_modules): Add readme-release. + (bootstrap_epilogue): Add the recommended perl one-liner. + * README-release: Remove file; it is now generated from gnulib. + * .gitignore: Add it. + * gnulib: Update submodule to latest. + + tests: exercise bug with 0x80..0xff in [...] + * tests/high-bit-range: New test, inspired by an example in the + report by Igor O. Ladygin: http://bugs.debian.org/624387, + via Santiago Ruano Rincón's http://savannah.gnu.org/bugs/?33198 + * tests/Makefile.am (TESTS): Add it. + + fix a bug whereby echo c|grep '[c]' would fail for any c in 0x80..0xff + * src/dfa.c (setbit_case_fold) [MBS_SUPPORT]: Set the bit also + when wctob returns EOF. + * NEWS (Bug fixes): Mention it. + +2011-05-02 Reuben Thomas + + doc: correct comment about mmap + * doc/grep.texi (Other Options) [--mmap]: This option is now + ignored, so using it can have no effect on performance. + +2011-05-02 Arnold D. Robbins + + build: move add_utf8_anychar into MBS ifdef + +2011-05-01 Arnold D. Robbins + + maint: remove GAWK ifndef; no longer needed + +2011-05-01 Jim Meyering + + maint: remove now-unnecessary use of gnulib's strtol module + * bootstrap.conf (gnulib_modules): Remove now-obsolete "strtol". + +2011-04-29 Jim Meyering + + maint: tweak README-release + * README-release: Add note to check the NixOS/Hydra autobuilder results. + +2011-04-28 Jim Meyering + + build: update gnulib submodule to latest + + maint: add the tight_scope syntax-checking rule + This ensures that the only externally scoped symbols are ones + that are explicitly marked as "extern" or white-listed like "main". + * src/Makefile.am (sc_tight_scope): New rule, copied from coreutils. + * cfg.mk (sc_tight_scope): Define, to hook to it from the top level. + + maint: mark some function declarations as extern + * src/search.h: Add "extern" keyword to each function declaration. + +2011-04-23 Jim Meyering + + maint: fix doubled-word typos in comments + * src/dfa.c (SUCCEEDS_IN_CONTEXT): Remove doubled "a". + * src/dfa.c (BACKREF): s/it it/it is/ + +2011-04-09 Jim Meyering + + maint: fix typos in comments: s/can not/cannot/ + * src/dfa.c (check_matching_with_multibyte_ops, dfastate): As above. + +2011-03-19 Jim Meyering + + maint: stop using .x-sc_* files to list syntax-check exemptions + Instead, use the new mechanism with which you merely use a + variable (derived from the rule name) defined in cfg.mk to an ERE + matching the exempted file names. + * gnulib: Update to latest, to get maint.mk that implements this. + * .x-sc_bindtextdomain: Remove file. + * .x-sc_prohibit_tab_based_indentation: Likewise. + * .x-sc_prohibit_xalloc_without_use: Likewise. + * .x-sc_space_tab: Likewise. + * cfg.mk: Define variables to exempt the same files. + + build: correct my change of 2011-01-28 + Do not override original dist-hook rule. + * Makefile.am (run-syntax-check): Rename from overriding dist-hook. + (dist-hook): Depend on run-syntax-check. + +2011-02-27 Jim Meyering + + maint: update from gnulib + * bootstrap: Update from gnulib. + * tests/init.sh: Likewise. + * gnulib: Update to latest. + +2011-01-27 Jim Meyering + + build: update gnulib submodule to latest + + build: run syntax-check rules as part of "make dist" + * Makefile.am (dist-hook): Depend on syntax-check. + Suggested by Reuben Thomas. + +2011-01-26 Jim Meyering + + maint: remove unneeded #include directives + * lib/savedir.c: Don't include . Not needed. + * src/dfa.c: Likewise. + +2011-01-22 Jim Meyering + + build: avoid new syntax-check failures + * .x-sc_bindtextdomain: New file, used to avoid a spurious + failure from the new syntax-check rule. + * NEWS: Remove a trailing space. + +2011-01-19 Jim Meyering + + tests: add a known-to-fail test + * tests/turkish-I: New test. + * tests/Makefile.am (TESTS): Add it. + (XFAIL_TESTS): Add here, too. + Reported by Ilya Basin. + + maint: sort test names in Makefile.am + * tests/Makefile.am (TESTS): Sort test names. + +2011-01-05 Jim Meyering + + doc: remove erroneous "{,m}" item from grep man page + * doc/grep.in.1: Remove item describing bogus {,m} regex notation. + Reported by Fernando Basso. + +2011-01-03 Jim Meyering + + maint: update copyright year ranges to include 2011 + Run "make update-copyright", so "make syntax-check" works in 2011. + + build: update gnulib submodule to latest + +2010-12-20 Paolo Bonzini + + main: fix exit status on xmalloc failures + * NEWS: Update. + * src/main.c (main): Set exit_failure. Reported by Guy Shaw. + + add comment above fn_grep + * configure.ac (fn_grep): Add comment suggested by Bruno Haible. + +2010-11-14 Paolo Bonzini + + grep: add include guards + * src/system.h: Add multiple inclusion guards. + * src/grep.h: Likewise. + + configure: fix M4 quotation + * configure.ac: Add extra brackets around [...] patterns. + + configure: remove dependency on grep that supports long lines and -e + * configure.ac (fn_grep): New. Set GREP and EGREP to it, replace + with newly-built grep before AC_OUTPUT. Reported by Florin Iucha + . + +2010-11-04 Jim Meyering + + build: update gnulib to latest + + tests: don't hard-code a 5-second timeout; that's not always enough + Instead, time the command in the C locale and use 10 times that + duration -- rounded up to whole seconds -- as the timeout when running + it in the UTF-8 locale. + * tests/backref-multibyte-slow: Compute a performance-relative timeout. + Reported by Gilles Espinasse, regarding an imac 400. For more details, + see http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3360 + +2010-10-09 Jim Meyering + + maint: describe policy on copyright year number ranges + * README: Mention coreutils' long-standing policy on use of M-N + ranges in copyright year lists. Requested by Richard Stallman. + +2010-10-04 Dmitry V. Levin + + build: compile gnulib without -Wcast-align to avoid warnings on ARM + * configure.ac (GNULIB_WARN_CFLAGS): Remove -Wcast-align. + +2010-09-30 Jim Meyering + + maint: don't define a gpg_key_ID. now it's obtained automatically + * cfg.mk (gpg_key_ID): Remove definition. No longer needed. + +2010-09-23 Paolo Bonzini + + tests: add testcase for previous fix + * tests/inconsistent-ranges: New. + * tests/Makefile.am (TESTS): Add it. + +2010-09-23 Paolo Bonzini + + dfa: process range expressions consistently with system regex + The actual meaning of range expressions in glibc is not exactly strcoll, + which makes the behavior of grep hard to predict when compiled with the + system regex. Leave to the system regex matcher the decision of which + single-byte characters are matched by a range expression. + + This partially reverts a change made in commit 0d38a8bb (which made + sense at the time, but not now that src/dfa.c is not doing multibyte + character set matching anymore). + + * src/dfa.c (in_coll_range): Remove. + (parse_bracket_exp): Use system regex to find which single-char + bytes match a range expression. + +2010-09-23 Bruno Haible + + build: fix link error on systems that have libiconv but not libintl + * src/Makefile.am (LDADD): Add $(LIBICONV). + +2010-09-21 Jim Meyering + + build: avoid compilation failure on the Hurd + * src/dfasearch.c (dfawarn): Rename enum symbols to use DW_ prefix, + so as not to collide with "GNU", which is defined by the Hurd. + Reported by Matthias Lanzinger in http://savannah.gnu.org/bugs/?31096 + +2010-09-20 Jim Meyering + + maint: avoid obsolete gnulib modules + * bootstrap.conf (gnulib_modules): Don't use obsolete atexit module. + Use malloc-gnu and realloc-gnu -- malloc and realloc are obsolete. + + maint: update README-release + * README-release: Reflect changes in coreutils' version of this file. + +2010-09-20 Aharon Robbins + + dfa: fix compilation when not using MBS + * src/dfa.c (prepare_wc_buf) [!MBS_SUPPORT]: Do not compile this + function. + +2010-09-16 Jim Meyering + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.7 + * NEWS: Record release date. + +2010-09-13 Paolo Bonzini + + tests: add equiv-classes + * configure.ac (USE_INCLUDED_REGEX): Add Automake conditional. + * tests/equiv-classes: New test. + * tests/Makefile.am (TESTS): Add it. + (XFAIL_TESTS) [USE_INCLUDED_REGEX]: Mark it as expected failure. + +2010-09-13 Paolo Bonzini + + dfa: fall back to glibc matcher if a MBCSET is found + This patch enables full support of equivalence classes and multicharacter + collation symbols. It can also improve performance problems in some + cases for multibyte grep. Both of these changes however depend on the + glibc version installed in the system. + + For UTF-8 it will trigger only in the presence of MBCSET, e.g. [a-z]. + For other character sets all brackets and `.` as well will trigger it. + + * NEWS: Document this. + * src/dfa.c (dfaexec): Fall back to glibc for multibyte matches, + if possible. + +2010-09-13 Paolo Bonzini + + build: update gnulib submodule to latest + This is done to include commit "regex: Pass the system regex if its only + problem is 32-bit regoff_t". + + * gnulib: Update to e2b0e1a. + +2010-09-12 Jim Meyering + + build: update gnulib submodule to latest + + tests: update init.sh from gnulib + * tests/init.sh: Update from gnulib. + +2010-09-08 Patrick Boyd + + dfa: reduce stack usage + * src/dfa.c (dfaanalyze): Allocate GRPS and LABELS arrays from heap, + not on the stack. With this change, grep can now run in these UEFI + simulators: + http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=EDK + http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=EDK2 + +2010-09-08 Jim Meyering + + tests/portability: avoid spurious failure with OpenBSD's /bin/sh + * tests/warn-char-classes: Don't use "set -x" here. It causes + a spurious test failure on openbsd 4.7 when using its /bin/sh, + since the command, /bin/sh -xc 'P=1 : 2> err' emits "P=1" into err. + To enable set -x, run the test with "VERBOSE=yes", e.g., + make check -C tests TESTS=warn-char-classes VERBOSE=yes + +2010-09-07 Jim Meyering + + build: update gnulib submodule to latest + +2010-09-03 Jim Meyering + + tests: remove .sh suffix from remaining test scripts. + * tests/backref: Rename from backref.sh. + * tests/bre: Rename from bre.sh. + * tests/ere: Rename from ere.sh. + * tests/file: Rename from file.sh. + * tests/khadafy: Rename from khadafy.sh. + * tests/options: Rename from options.sh. + * tests/pcre: Rename from pcre.sh. + * tests/spencer1: Rename from spencer1.sh. + * tests/spencer2: Rename from spencer2.sh. + * tests/status: Rename from status.sh. + * tests/yesno: Rename from yesno.sh. + * tests/Makefile.am: Reflect renamings. + + tests: convert remaining tests to use init.sh + * tests/file.sh: Use init.sh. Use Exit, not exit. Use grep, not ${GREP}. + * tests/khadafy.sh: Likewise. + * tests/options.sh: Likewise. + * tests/spencer1.sh: Likewise. + * tests/spencer2.sh: Likewise. + * tests/status.sh: Likewise. + * tests/spencer1.awk: Use grep, not ${GREP}. + Don't ignore failure to generate intermediate shell script. + * tests/Makefile.am (CLEANFILES): Remove altogether, now that + all tests use init.sh. + (TESTS_ENVIRONMENT): Don't set GREP. It's no longer used. + + tests: remove warning.sh + * tests/warning.sh: Remove file. All it did was print a warning. + * tests/Makefile.am (TESTS): Remove warning.sh. + + tests: convert pcre.sh to use init.sh + * tests/pcre.sh: Use init.sh. Use Exit, not exit. Use grep, not ${GREP}. + + tests: convert bre.sh to use init.sh + * tests/bre.sh: Use init.sh. + Use Exit, not exit. + Use "$abs_top_srcdir/tests/", not "$srcdir/" to specify inputs. + Source generated bre.script, rather than invoking $SHELL. + * tests/ere.sh: Likewise. + * tests/bre.awk: Use grep, not ${GREP}. + * tests/ere.awk: Likewise. + * tests/Makefile.am (CLEANFILES): Remove bre.script and ere.script. + + tests: convert to use init.sh + * tests/yesno.sh: Use init.sh. + Use Exit, not exit. + Use grep, not $GREP. + * tests/backref.sh: Likewise. + * tests/Makefile.am (CLEANFILES): Remove yesno.txt. + + build: update gnulib submodule to latest + + build: update build/test tools from gnulib + * bootstrap: Update from gnulib. + * tests/init.sh: Likewise. + +2010-09-01 Jim Meyering + + maint: add lib/version-etc.c to the list in POTFILES.in + * po/POTFILES.in: Add lib/version-etc.c. + +2010-09-01 Jim Meyering + + grep: diagnose and exit-2 for bogus REs like [:space:], [:digit:], etc. + When I make a mistake like this: + grep '[:lower:]' ... + be it in a script or on the command line, I want to know about + it as soon as possible. I don't want grep to print a mere warning + that it is interpreting this suspicious and almost guaranteed-wrong + regular expression as a set of just 6 bytes. And I certainly don't + want grep to silently do the wrong thing, even if that would be + officially standards-conforming. It's obvious that I intended + [[:lower:]], and I want my error to be diagnosed in a way that is + most likely to get my attention. Thus, with this change, grep now + prints a diagnostic and exits with status 2 the moment it + encounters an offending [:char_class:] construct. + + This changes the way grep works by default, rather than + putting this new behavior on an option. A new option + would seldom be used in scripts (not portable), and would + probably be used only rarely by those who need it the most. + This new functionality provides a valuable safety measure + and incurs truly negligible risk. + + For strict POSIX compliance, set POSIXLY_CORRECT in + your environment. That disables this new feature. + + Revert the changes from commit 2cd3bcea, "grep: add + --warnings={always,never,auto}.", and then do the following: + + * src/dfasearch.c (dfawarn): Call getenv("POSIXLY_CORRECT") here; + Remove "warning: " from the diagnostic, now that it's more than + a warning, and exit with status 2. + * NEWS (New features): Describe the new semantics. + * tests/warn-char-classes: Adjust one test to accommodate this change. + * doc/grep.texi (Character Classes and Bracket Expressions): Document. + (Environment Variables): Cross-reference it. + Remove reference to obsolete getopt illegal vs. invalid difference. + Thanks to Paul Eggert for suggestions and an initial prod. + +2010-08-30 Jim Meyering + + maint: use gnulib's standard --version-printing code + This includes author names and keeps the copyright year up to date. + * bootstrap.conf (gnulib_modules): Add propername and version-etc-fsf. + * src/main.c (AUTHORS): Define. + (main): Use version_etc, rather than hard-coding the copyright text. + Prompted by a patch from Paolo Bonzini. + +2010-08-27 Paolo Bonzini + + dfa: warn on [:space:] and similar + * src/dfa.c (parse_bracket_exp): Warn on regular expressions such as + [:space:]. + * src/dfa.h (dfawarn): New prototype. + * src/dfasearch.c (dfawarn): New. + * NEWS: Document. + + tests: add test for warnings + * tests/Makefile.am (TESTS): Add warn-char-class. + * tests/warn-char-class: New. + + grep: add --warnings={always,never,auto}. + * src/grep.h (no_warnings): New declaration. + * src/main.c (no_warnings): New. + (WARNINGS_OPTION): Add to enum. + (main): Add --warnings. Handle color_option == 2 together with it. + + tests: add failing test for grep from a directory + * tests/Makefile.am (TESTS, XFAIL_TESTS): Add grep-dir. + * tests/grep-dir: New. + + tests: add test for previous commit + * tests/Makefile.am (TESTS): Add grep-dev-null. + * tests/grep-dev-null: New. + + search: fix "grep -Fif /dev/null" + * bootstrap.conf: Include gnulib module minmax. + * src/searchutils.c (mbtolower): Handle *N == 0 case. + * src/system.h: Include minmax.h from gnulib. + +2010-08-27 Adam Katz + + Remove declaration after statement in dfa.c + * dfa.c (dfaexec): Declare saved_end at the beginning of the function. + +2010-08-13 Jim Meyering + + make --include=FILE work once again + The semantics of excluded_file_name changed (when operating on + an "included" file name list). + * src/main.c (main): Adjust for changed semantics of excluded_file_name + simply by removing a negation. + * NEWS (Bug fixes): Mention this fix. + * tests/include-exclude: Add a test for this. + Reported by Joe Perches in http://savannah.gnu.org/bugs/?29876. + +2010-07-16 Paolo Bonzini + + doc: document \s and \S + * doc/grep.texi (The Backslash Character and Special Expressions): + Document \s and \S escapes. + +2010-05-29 Karl Berry + + doc: discuss matches that span two or more lines + * doc/grep.texi (Usage): Discuss matching across lines. + (Character Classes and Bracket Expressions) <[:space:]>: refer to it. + +2010-05-25 Jim Meyering + + build: use latest gettext: 0.18 + * configure.ac: Use gettext-0.18. + * bootstrap.conf (gnulib_modules): Use gettext-h, not gettext. + since the latter drags in a depedency on gettext 0.18. + Suggested by Bruno Haible. + + maint: update helper scripts from gnulib + * tests/init.sh: Update from gnulib. + * bootstrap: Likewise. + + build: update gnulib submodule to latest + + maint: don't emit an extra newline in each of two diagnostics + * src/main.c (context_length_arg, grepdir): Remove a stray \n in + each of two diagnostics. + +2010-05-24 Bruno Haible + + search: Avoid out-of-bounds access. + * src/dfasearch.c (EGexecute): Avoid access beyond end of buffer + that could happen if start != beg - buf. + +2010-05-23 Aharon Robbins + + dfa: fix signedness warnings + * src/dfa.c (dfaexec): Cast p when passing it to prepare_wc_buf. + +2010-05-09 Jim Meyering + + tests: update init.sh + * tests/init.sh: Update from gnulib. + + tests: normalize init.sh-sourcing code + * tests/backref-multibyte-slow: Use one-line idiom. + * tests/backref-word: Likewise. + * tests/case-fold-backref: Likewise. + * tests/case-fold-backslash-w: Likewise. + * tests/case-fold-char-class: Likewise. + * tests/case-fold-char-range: Likewise. + * tests/case-fold-char-type: Likewise. + * tests/char-class-multibyte: Likewise. + * tests/dfaexec-multibyte: Likewise. + * tests/empty: Likewise. + * tests/euc-mb: Likewise. + * tests/fedora: Likewise. + * tests/fgrep-infloop: Likewise. + * tests/fmbtest: Likewise. + * tests/foad1: Likewise. + * tests/ignore-mmap: Likewise. + * tests/include-exclude: Likewise. + * tests/max-count-vs-context: Likewise. + * tests/pcre-z: Likewise. + * tests/prefix-of-multibyte: Likewise. + * tests/reversed-range-endpoints: Likewise. + * tests/sjis-mb: Likewise. + * tests/spencer1-locale: Likewise. + * tests/word-delim-multibyte: Likewise. + * tests/word-multi-file: Likewise. + + tests: update help-version + * tests/help-version: Update from coreutils. + +2010-05-06 Jim Meyering + + tests: enable glibc's malloc-perturbing option + * tests/Makefile.am (MALLOC_PERTURB_): Define, in case it's not already + set in your environment. + (TESTS_ENVIRONMENT): Propagate MALLOC_PERTURB_ setting to test scripts. + +2010-05-06 Paolo Bonzini + + dfa: speed up [[:digit:]] and [[:xdigit:]] + There's no "multibyte pain" in these two classes, since POSIX + and ISO C99 mandate their contents. + + Time for "./grep -x '[[:digit:]]' /usr/share/dict/linux.words" + Before: 1.5s, after: 0.07s. (sed manages only 0.5s). + + * src/dfa.c (predicates): Declare struct dfa_ctype separately + from definition. Add sb_only. + (find_pred): Return const struct dfa_ctype *. + (parse_bracket_exp): Return const struct dfa_ctype *. Do + not fill MBCSET for sb_only character types. + +2010-05-05 Jim Meyering + + tests: readability: use awk rather than obfuscated sed + * tests/backref-multibyte-slow: Generate input using an awk for-loop + rather than expensive and harder-to-read sed pipes. + Remove stray "set -x" and "wc -l in". + + dfa: avoid segfault when processing an invalid multi-byte sequence + * src/dfa.c (dfaexec): Handle the cases in which mbrtowc returns + (size_t)-1 or (size_t)-2, rather than setting mblen_buf[i] to an + outrageously large value. + +2010-05-05 Paolo Bonzini + + grep: remove redundant syntax bit + * grep.c (Gcompile): Remove RE_HAT_LISTS_NOT_NEWLINE. + + tests: add test for newly-fixed performance problem + * tests/backref-multibyte-slow: New. + * tests/Makefile.am: Add it. + +2010-05-05 Paolo Bonzini + + dfa: convert to wide character line-by-line + This provides a nice speedup for -m in general, but especially + it avoids quadratic complexity in case we have to go to glibc. + + * NEWS: Document change. + * src/dfa.c (prepare_wc_buf): Extract out of dfaexec. Convert + only up to the next newline. + (dfaexec): Exit multibyte processing loop if past buf_end. + Call prepare_wc_buf again after processing a newline. + +2010-05-01 Jim Meyering + + maint: remove useless #if HAVE_STDLIB_H + * src/mbsupport.h: Don't test HAVE_STDLIB_H. + +2010-04-20 Jim Meyering + + dfa: don't #ifdef-out member declarations + * src/dfa.c (struct dfa): Remove "#if MBS_SUPPORT" guard that made + several member declarations conditional on this cpp definition. + (token): Likewise. + Reported by Anders Wallin. + + tests: ensure that the --mmap option is ignored + * tests/ignore-mmap: New file. + * tests/Makefile.am (TESTS): Add it. + Reported by Jaroslav Škarvada in + +2010-04-20 Paolo Bonzini + + dfa: honor RE_DOT_NEWLINE and RE_DOT_NOT_NULL in UTF-8 period optimization + * src/dfa.c (add_utf8_anychar): Check for RE_DOT_NEWLINE and + RE_DOT_NOT_NULL. + + grep: fix --mmap not being ignored + * NEWS: Document bugfix. + * main.c (main): Ignore MMAP_OPTION. + +2010-04-19 Jim Meyering + + maint: avoid syntax-check failure due to indentation via TABs + * src/dfa.c (atom): Expand TABs in indentation. + + build: update gnulib submodule to latest + + maint: restrict scope of two globals to dfasearch.c + * src/dfasearch.c (patterns, pcount): Declare these file-scoped + globals to be static. + +2010-04-19 Paolo Bonzini + + dfa: optimize UTF-8 period + * NEWS: Document improvement. + * src/dfa.c (struct dfa): Add utf8_anychar_classes. + (add_utf8_anychar): New. + (atom): Simplify if/else nesting. Call add_utf8_anychar for ANYCHAR + in UTF-8 locales. + (dfaoptimize): Abort on ANYCHAR. + + dfa: drop ORTOP + * src/dfa.c (token, prtok, addtok_mb, nsubtoks, dfaanalyze, dfamust): + Remove ORTOP. + (regexp): Remove parameter, always add OR at the end, adjust callers. + (atom): Adjust caller. + (dfaparse): Adjust caller. Always add OR at the end. + + dfa: fix {0,0} + * NEWS: Document change. + * src/dfa.c (struct dfa): Remove "broken" field. + (lex): Do not set it. + (closure): On {0,0}, backup and lex another closure without + adding a CAT. + (dfabroken): Remove. + * src/dfa.h (dfabroken): Remove. + * tests/spencer1.tests: Add testcases for {m,n}. + + dfa: simplify dfainit + * src/dfa.c (dfainit): Use memset. + +2010-04-17 Jim Meyering + + doc: fix a nit in HACKING + * HACKING: Correct size of .git/ dir: 9MB, not 30MB. + + tests: add an expected-to-fail test using \< in a multi-byte locale + * tests/word-delim-multibyte: New test. Currently failing. + * tests/Makefile.am (TESTS): Add it. + (XFAIL_TESTS): Define, temporarily. + Reported by Jaroslav Škarvada in http://savannah.gnu.org/bugs/?29537. + +2010-04-16 Paolo Bonzini + + test: cover just-fixed bug + * tests/empty: Test -Fw too. + + grep: fix matching the empty string with grep -Fw + * NEWS: Document fix. + * src/kwsearch.c (Fexecute): The empty string is a valid match if it is + a whole word. + +2010-04-15 Jim Meyering + + maint: update init.sh and HACKING + * HACKING: Sync from coreutils. + * tests/init.sh: Update from gnulib. + +2010-04-13 Jim Meyering + + build: update gnulib submodule to latest; adapt + * COPYING: Remove empty line. + * README: Likewise. + * doc/fdl.texi: Likewise. + * tests/backref-word: Likewise. + +2010-04-11 Stefano Lattarini + + tests: accept the Debian timeout program + * tests/init.cfg: test timeout with `timeout 10s true' + +2010-04-08 Jim Meyering + + dfa: convert "cannot happen" code/comment to use assert + * src/dfa.c (dfamust): There were numerous "cannot happen" comments, + some associated with "if (expr) goto done;". Replace each with an + equivalent "assert (!expr);". + + build: use gnulib's isblank module + * bootstrap.conf (gnulib_modules): Use gnulib's isblank module, + now that we rely on the function by that name. + + maint: undo TAB-conversion change to gl/lib/*.c.diff + This fixes a bootstrap failure due to the patches not applying. + * .x-sc_prohibit_tab_based_indentation: Add ^gl/lib/.*\.c\.diff$ + * gl/lib/regcomp.c.diff: Revert today's TAB->space change. + * gl/lib/regex_internal.c.diff: Likewise. + * gl/lib/regexec.c.diff: Likewise. + +2010-04-08 Arnold D. Robbins + + dfa: fix declaration of dfabroken in dfa.h + * dfa.h (dfabroken) [GAWK]: Fix declaration to match that in dfa.c. + +2010-04-08 Jim Meyering + + maint: add syntax-check rule to enforce the new no-leading-TABs policy + * cfg.mk (sc_prohibit_tab_based_indentation): New rule, from coreutils. + (sc_prohibit_emacs__indent_tabs_mode__setting): Likewise. + (old_NEWS_hash): Update. + * .x-sc_prohibit_tab_based_indentation: List exempt files. + +2010-04-08 Jim Meyering + + convert all TABs to equivalent spaces in indentation + Using this file, + + cat > leading-blank.exempt <<\EOF + (?:^|\/)ChangeLog[^/]*$ + (?:^|\/)(?:GNU)?[Mm]akefile[^/]*$ + \.(?:am|mk)$ + EOF + + run this command to convert all non-conforming leading white + space to be all spaces: + + git ls-files \ + | pcregrep -vf leading-blank.exempt \ + | xargs pcregrep -l '^ *\t' \ + | xargs perl -MText::Tabs -ni -le \ + '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_' + +2010-04-08 Jim Meyering + + build: include cfg.mk in the distribution tarball + * Makefile.am (EXTRA_DIST): Add cfg.mk. + +2010-04-08 Jim Meyering + + maint: Makefile.am tweak (no semantic change) + * Makefile.am (EXTRA_DIST): List one per line. Sort. + + build: include cfg.mk in the distribution tarball + * Makefile.am (EXTRA_DIST): Add cfg.mk. + +2010-04-08 Jim Meyering + + dfa: move definition of __attribute__ back into dfa.h + * src/dfa.c (__attribute__): Move definition back to... + * src/dfa.h: ... this file. It is essential for non-gcc compilers. + Reported by Arnold Robbins. + +2010-04-07 Arnold D. Robbins + + dfa: move internals from dfa.h to dfa.c + * src/dfa.h: Move internals into dfa.c. + * src/dfa.c: The dfa internals are now totally local to this file. + (dfaalloc, dfamusts, dfabroken): New functions to access features. + * src/dfasearch.c (dfa): Change this global variable from struct to pointer. + Adapt to that change, and use new functions, dfamusts and dfaalloc. + +2010-04-07 Jim Meyering + + mbtolower: avoid potential NULL-dereference + * src/searchutils.c: Include . + (mbtolower): Assert that 0 < *n, to avoid possibility of NULL-deref. + Remove dead increment. + + maint: tell git to ignore more build products + * .gitignore: Also ignore results of "make ID" and "make tags". + + build: update gnulib submodule to latest + + tests: use init.sh consistently + * tests/euc-mb: Call "path_prepend_ ." on a line by itself, + and with a comment. This makes it so all of the srcdir/init.sh + lines are consistent, project-wide, and so that the addition of "." + to PATH for this test is properly documented. + * tests/sjis-mb: Likewise. + + maint: avoid new syntax-check failure, ... + ...now that the sole use of xmalloc no longer matches the + regular expression used by the syntax-check rule. + * .x-sc_prohibit_xalloc_without_use: Exempt src/kwset.c. + + grep: make kwset's obstack use xmalloc, not malloc + This insidious bug could make grep fail to diagnose a failed malloc, + and then proceed to dereference the resulting NULL pointer. + Note that this bug was unlikely ever to cause real trouble; without + the fix, grep would segfault upon OOM, now it exits with a diagnostic. + * src/kwset.c (malloc) [GREP]: Define without the "(s)" macro + parameter, so that unadorned uses of malloc are also mapped to xmalloc. + One such use is in the expansion of obstack_init. + Report and patch by Nelson H. F. Beebe, in + http://thread.gmane.org/gmane.comp.gnu.grep.bugs/2995 + + tests: improve help-version (sync from gzip's version) + * tests/help-version: Cross-check $VERSION and --version output. + * tests/Makefile.am (TESTS_ENVIRONMENT): Export VERSION=$(VERSION). + +2010-04-06 Jim Meyering + + doc: update THANKS + * THANKS: Update. + +2010-04-06 Aharon Robbins + + build: avoid conflict with WCHAR definition from Cygwin's + * src/dfa.h (enum token): Remove the definition from this file. + Replace with a declaration and typedef. Moved to ... + * src/dfa.c (enum token): ... here. + Reported by Corinna Vinschen. + +2010-04-06 Jim Meyering + + doc: add HACKING + * HACKING: New file. Copied from coreutils, with s/coreutils/grep/ + and a few minor edits. + +2010-04-05 Jim Meyering + + tests: pull fixed init.sh from gnulib + * tests/init.sh: Update from gnulib. + + maint: fix new argmatch-related syntax-check failures + * configure.ac (ARGMATCH_DIE): Use usage(EXIT_FAILURE), not exit(1). + * po/POTFILES.in: Add lib/argmatch.c. + + maint: update cfg.mk to work with gnulib's newer "make syntax-check" + * cfg.mk: Update to use new _sc_search_regexp interface. Run this: + perl -pi -e 's/\b_prohibit_regexp\b/_sc_search_regexp/;' + -e 's/\bmsg=/halt=/; s/\bre=/prohibit=/;' cfg.mk + and then adjust backslashes so they still line up. + + maint: update tests/init.sh from gnulib + This ensures that the explanation for any skipped or failed test + is printed on stderr, not buried in each .log file. + * tests/init.sh: Update from gnulib. + * tests/init.cfg (stderr_fileno_): Define to 9, to match the + literal 2>&9 in tests/Makefile.am + + build: update gnulib submodule to latest + +2010-04-04 Jim Meyering + + maint: use argmatch, for better --directories=INVAL diagnostics + Before, you'd see this: + grep: unknown directories method + + Now, you'll see this: + grep: invalid argument `INVAL' for `--directories' + Valid arguments are: + - `read' + - `recurse' + - `skip' + Usage: src/grep [OPTION]... PATTERN [FILE]... + Try `src/grep --help' for more information. + + * bootstrap.conf: Add argmatch. + * configure.ac: Define ARGMATCH_DIE and ARGMATCH_DIE_DECL. + * src/main.c (directories_type): Define. + (directories_args, directories_types) Define. + All of the above so we can... + (main): Use XARGMATCH. + (usage): Declare extern, now that argmatch calls it via ARGMATCH_DIE. + +2010-04-04 Jim Meyering + + dfa.c: const correctness; and remove useless casts of realloc and malloc + * src/dfa.c (icatalloc, icpyalloc, istrstr, enlist): As above. + (inboth, dfamust, comsubs): Likewise. + + dfa.c: use a better (unsigned) type for an index: int->unsigned int + * src/dfa.c (dfaexec): Use "unsigned int" for a logically unsigned index. + + maint: style: use sizeof VAR, rather than sizeof TYPE, where possible + * src/dfa.c (copyset, zeroset): Prefer sizeof EXPR, over sizeof TYPE, + for improved readability/maintainability. + (equal, parse_bracket_exp, addtok_wc, dfaparse, dfaexec): Likewise. + +2010-04-02 Jim Meyering + + dfa.c: use a better (unsigned) type for an index: int->size_t + * src/dfa.c (parse_bracket_exp): Use size_t as type of index, not int. + + maint: const-correctness + * src/dfa.c (tstbit, copyset, equal, charclass_index): Declare read-only + "charclass" parameters to be "const". No semantic change. + + maint: include and unconditionally + * src/main.c: Include and unconditionally. + Their presence/usefulness are assured by gnulib. + * src/dfa.c: Likewise. + * src/search.h: Likewise. + + maint: MBS_SUPPORT: define to 0/1, not undef/1 + Prepare to remove many of these #ifdefs. + * src/mbsupport.h (MBS_SUPPORT): Define to 0/1, not undef/1. + Change each "#ifdef MBS_SUPPORT" to "#if MBS_SUPPORT". Use this: + perl -pi -e 's/ifdef (MBS_SUPPORT)/if $1/' $(g grep -l ifdef.MBS_SUPPO) + * src/dfa.c: s/#ifdef MBS_SUPPORT/#if MBS_SUPPORT/ + * src/dfa.h: Likewise. + * src/dfasearch.c: Likewise. + * src/kwsearch.c: Likewise. + * src/main.c: Likewise. + * src/search.h: Likewise. + * src/searchutils.c: Likewise. + +2010-04-02 Jim Meyering + + maint: use STREQ in place of strcmp + perl -pi -e 's/\bstrcmp *\((.*?)\) == 0/STREQ ($1)/' src/main.c + perl -pi -e 's/\bstrcmp *\((.*?)\) != 0/!STREQ ($1)/' src/main.c + + * src/dfa.c (STREQ): Define. + Use it instead of strcmp. + * src/main.c (STREQ): Likewise. + * cfg.mk (local-checks-to-skip): Remove sc_prohibit_strcmp, + to enable the strcmp-prohibition. + +2010-04-02 Jim Meyering + + maint: enable the useless_cpp_parens syntax check + * cfg.mk (local-checks-to-skip): Remove sc_useless_cpp_parens. + * src/main.c (devices, fillbuf, exit_on_match): Remove useless parens. + (print_line_head, grepfile, set_limits, main): Likewise. + * src/vms_fab.h: Likewise. + * vms/config_vms.h: Likewise. + * src/mbsupport.h: Likewise. + + cleanup and improvement: parse command line arguments consistently + * src/main.c: Include c-ctype.h, for this: + (prepend_args): Use c_isspace, not ISSPACE. + This is important so that we parse arguments consistently, + and independently of the current locale. + * bootstrap.conf (gnulib_modules): Add c-ctype. + * src/system.h: Remove IS* definitions here, too. + * src/dfasearch.c (WCHAR): Use isalnum, not ISALNUM. + * src/kwsearch.c (WCHAR): Likewise. + * src/searchutils.c (kwsinit): Use tolower, not TOLOWER. + + cleanup: rely on gnulib's ctype.h functions; remove IS* macros and is_* + * src/dfa.c (setbit_case_fold, prednames): Use official names. + (IS_WORD_CONSTITUENT, lex): Likewise. + (ISALNUM, ISALPHA, ISCNTRL, ISDIGIT, ISGRAPH): Remove definitions. + (ISLOWER, ISPRINT, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT): Likewise. + (is_alnum, is_alpha, is_blank, is_cntrl, is_digit, is_graph): Likewise. + (is_lower, is_print, is_punct, is_space, is_upper, is_xdigit): Likewise. + (isgraph): Likewise. + + build: update gnulib submodule to latest, and adjust + * src/main.c (parse_grep_colors): Adjust diagnostics not to trigger + the sc_error_message_period and sc_error_message_uppercase + syntax-check rules. + + maint: remove all VMS-related code + * configure.ac (AC_CONFIG_FILES): Remove vms/Makefile + * Makefile.am (SUBDIRS): Remove vms. + * src/Makefile.am (EXTRA_DIST): Remove vms_fab.c and vms_fab.h. + * src/vms_fab.c, src/vms_fab.h, vms/make.com: Remove files. + * vms/Makefile.am, vms/README, vms/config_vms.h: Likewise. + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.6.3 + * NEWS: Record release date. + +2010-04-02 Jim Meyering + + grep: avoid used-undefined error with truncated multibyte input + * src/dfa.c (addtok_wc): Don't use buf[0] (it's undefined) when + wcrtomb returns <= 0. + + MBS_SUPPORT-removal: * src/dfa.c (dfastate): + +2010-04-01 Jim Meyering + + maint: avoid unnecessary 2nd getenv("TERM") + * src/main.c (main): Don't call getenv("TERM") twice -- in the same + expression, even. + + tests: remove all unportable uses of echo + * src/main.c: Use printf rather than echo -ne in a comment. + * tests/fedora: Use printf (not echo) also in ok/fail functions. + * cfg.mk (sc_prohibit_echo_minus_en): New rule, to prohibit + any future introduction. + + tests: add explicit requirement for en_US.UTF-8 + * tests/char-class-multibyte: Use require_en_utf8_locale_, + rather than open-coding it. + * tests/prefix-of-multibyte: Require the locale explicitly. + * tests/fgrep-infloop: Likewise. + This fixes test failures that would arise on systems without + that particular locale. Reported by Ludovic Courtès. + + tests: new function, to require an en_US UTF8 locale + * tests/init.cfg (require_en_utf8_locale_): New function. + + tests: use printf, not echo -n, echo -e, or any combination + * tests/fedora: Using printf is more portable. + + grep: remove unnecessary code + * src/main.c (print_line_middle): Now that we use RE_ICASE + (enabled in commit 70e23616, "dfa: rewrite handling of multibyte + case_fold lexing"), this case-conversion code is useless and wasteful. + Remove it. + + doc: fix typo: s/AM_V_AT/AM_V_at/ + * doc/Makefile.am (egrep.1 fgrep.1): The former has case consistent + with its sister variable, AM_V_GEN, but the latter is the one that + actually works. + + doc: generated files are best made read-only, ... + ...to minimize risk of accidentally modifying the generated file + rather than its template. These are tiny, so no risk, but it's + a good to be consistent, so generated files are easier to spot. + * doc/Makefile.am (egrep.1 fgrep.1): When generating these files, + ensure that they too are created read-only. + + doc: generate grep.1 from template + * doc/Makefile.am (grep.1): New rule. + (CLEANFILES): Add grep.1 to the list. + * .gitignore: Add /doc/grep.1 + * doc/grep.in.1: Replace hard-coded "2.5.1-cvs" with @VERSION@. + Update copyright year list. + Omit the line-splitting \(co directive so that update-copyright + will perform future updates automatically. + Egmont Koblinger reported the outdated version string + and copyright year list in the man page: + http://savannah.gnu.org/bugs/?29390 + + doc: prepare to generate grep.1 + * doc/grep.1: Rename to... + * doc/grep.in.1: ...this. + +2010-03-31 Eric Blake + + build: avoid another warning + Noticed on cygwin: + get-mb-cur-max.c: In function 'main': + get-mb-cur-max.c:27: error: unused parameter 'argc' [-Wunused-parameter] + + * tests/get-mb-cur-max.c (main): Use argc. + +2010-03-31 Paolo Bonzini + + tests: fix on systems with broken sh + * tests/Makefile.am (TESTS_ENVIRONMENT): Adjust coreutils remnants. + * tests/bre.sh: Invoke script with $SHELL if defined. + * tests/ere.sh: Likewise. + * tests/spencer1-locale: Likewise. + * tests/spencer1.sh: Likewise. + + tests: improve empty test + * tests/empty: Add more tests, note expected failure. + + tests: improve empty test with respect to locales + * tests/empty: Add tests for multiple locales. + + grep: fix grep -F against empty string + * src/searchutils.c (is_mb_middle): Do not return true for empty matches + when p == buf. + + tests: rename empty.sh to empty + * tests/empty.sh: Rename to... + * tests/empty: ... this. + * tests/Makefile.am (TESTS): Adjust. + + tests: convert empty.sh to new style + * tests/empty.sh: Convert to init.sh, add 10-second timeout. + + tests: use get-mb-cur-max in char-class-multibyte + * tests/char-class-multibyte: Use get-mb-cur-max to detect UTF-8 support. + Rewrite previous locale detection code as a grep test. + + tests: fix -Wformat failure + * tests/get-mb-cur-max (main): Cast MB_CUR_MAX to int. + +2010-03-30 Jim Meyering + + doc: add a "Reply-To" to the suggested announcement mail header + * README-release: Add "Reply-To" with the list address, + to minimize risk of replies to the other announcement recipients. + Suggestion from Eric Blake. + +2010-03-29 Jim Meyering + + build: avoid compiler warning when building test program + * tests/Makefile.am (AM_CPPFLAGS, AM_CFLAGS, AM_LDFLAGS): Define, + so that all the usual C compile-and-link machinery comes into play. + * tests/get-mb-cur-max.c: Include "progname.h". + Remove unnecessary inclusion of . + Mike Frysinger reported the "implicit decl of set_program_name" warning. + + build: detect PCRE support also when is the header + * m4/pcre.m4: Also check for . + * src/pcresearch.c: Include , if needed. + Guard inclusions with HAVE_PCRE_H and HAVE_PCRE_PCRE_H, not HAVE_LIBPCRE. + * NEWS (Bug fixes): Mention it. + Dmitry V. Levin reported that PCRE support was not detected + on systems with not in the default include path. + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.6.2 + * NEWS: Record release date. + +2010-03-29 Eric Blake + + build: avoid warnings on cygwin + * lib/savedir.c (isdir): Avoid shadowing a declaration. + * src/main.c (get_nondigit_option): Cast away const to avoid + compiler warning. + + maint: ignore new test executable + * .gitignore: Enhance. + +2010-03-29 Jim Meyering + + doc: consolidate redundant-looking entries + * NEWS: Consolidate the two --include/exclude-related entries. + Suggested by Eric Blake. + +2010-03-29 Paolo Bonzini + + tests: use $(...) consistently + * tests/backref.sh: Use `...' instead of ``...'' in comments. + * tests/bre.awk: Use $(...) instead of `...`. + * tests/ere.awk: Use $(...) instead of `...`. + * tests/euc-mb: Use $(...) instead of `...`. + * tests/fmbtest: Use $(...) instead of `...`. + * tests/foad1: Use $(...) instead of `...`. + * tests/pcre-z: Use $(...) instead of `...`. Quote output of grep. + * tests/spencer1-locale.awk: Use $(...) instead of `...`. + * tests/spencer1.awk: Use $(...) instead of `...`. + * tests/yesno.sh: Use $(...) instead of `...`. + +2010-03-29 Jim Meyering + + build: make doc/Makefile.am cleaner and more robust + * doc/Makefile.am (egrep.1 fgrep.1): Generate robustly, i.e., + do not redirect directly to $@. + Use $(AM_V_GEN). + Do not distribute intermediate files like fgrep.man and egrep.man. + Likewise, do not use them to generate their %.1 images. + Instead, generate the .1 files directly. + +2010-03-29 Paolo Bonzini + + tests: add program to detect locales + * tests/Makefile.am (check_PROGRAMS): Add get-mb-cur-max. + * tests/get-mb-cur-max.c: New. + * tests/euc-mb: Use it. Fail if the former detection test fails. + * tests/sjis-mb: Use it. Fail if the former detection test fails. Expand + comments. + +2010-03-29 Paolo Bonzini + + tests: add tests for SJIS character sets + The attached test will be skipped unless (on a glibc system) you run + something like + + mkdir /usr/lib/locale/ja_JP.SHIFT_JIS + zcat /usr/share/i18n/charmaps/SHIFT_JIS.gz | \ + localedef \ + -f - \ + -i /usr/share/i18n/locales/ja_JP \ + /usr/lib/locale/ja_JP.SHIFT_JIS + + * tests/Makefile.am: Add sjis-mb. + * tests/sjis-mb: New. + +2010-03-29 Paolo Bonzini + + grep -F: fix a bug with SJIS character sets + Commit db9d6 would erroneously skip matches in SJIS character sets. In + this character set low bytes (i.e. ASCII bytes) are also valid second + bytes in a double-byte character, so you have to continue looking for + a match, even if you match in the middle of a double-byte character. + + * src/kwsearch.c: Ensure that beg is advanced by at least one byte, + but do not fail immediately after matching in the middle of a double-byte + character. + +2010-03-28 Bruno Haible + + build: update after change in gnulib's lib-ignore module + * src/Makefile.am (AM_LDFLAGS): Define. Use gnulib's new + $(IGNORE_UNUSED_LIBRARIES_CFLAGS). + +2010-03-28 Jim Meyering + + tests: disable new texinfo-acronym syntax-check from gnulib + * cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it. + +2010-03-28 Norihiro Tanaka + + tests: exercise fix for improper match of incomplete MB char prefix + * tests/prefix-of-multibyte: New file. + * tests/Makefile.am (TESTS): Add it. + +2010-03-28 Jim Meyering + + grep -F: fix a multi-byte erroneous-match-in-middle bug + Just as Perl prints nothing in this case, + printf '\357\274\241\n' | perl -CIO -lne '/\357/ and print' + + grep should also print nothing when used as follows. + However, these would mistakenly match with grep prior to 2.6.2: + printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\357' + printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\357\274' + + * src/searchutils.c (is_mb_middle): New parameter: the length of the + match, in bytes, as determined by kwsexec. Use this to detect when + the nominal match found by kwsexec must be skipped because it is for + an incomplete multi-byte character that is a prefix of a character + in the input. + * src/dfasearch.c (EGexecute): Update caller. + * src/kwsearch.c (Fexecute): Likewise. + * src/search.h: Update prototype. + * NEWS (Bug fixes): Mention it. + Report and analysis by Norihiro Tanaka. + +2010-03-28 Norihiro Tanaka + + tests: add tests for the fgrep-infloop bug + * tests/init.cfg (require_timeout_): New function. + * tests/fgrep-infloop: New file. Test for the above fix. + * tests/Makefile.am (TESTS): Add it. + +2010-03-28 Jim Meyering + + grep -F: avoid infinite loop when searching for incomplete MB character + Searching for an incomplete non-prefix of a multi-byte character + should find no match. + + Just as these print nothing, + printf '\357\274\241\357\274\241\n' \ + | perl -CIO -ne '/\241\357/ and print' + printf '\357\274\241\n' | perl -CIO -ne '/\274\241/ and print' + printf '\357\274\241\n' | perl -CIO -ne '/\241/ and print' + printf '\357\274\241\n' | perl -CIO -ne '/\274/ and print' + + These should also print nothing, but with grep-2.6 and grep-2.6.1, + they would infloop: + printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\241' + printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\274' + printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\274\241' + + * src/kwsearch.c (Fexecute): Don't infloop when searching for + an incomplete non-prefix part of a multi-byte character. + * NEWS (Bug fixes): Mention it. + Reported and diagnosed by Norihiro Tanaka. + +2010-03-28 Jim Meyering + + tests: rename: fmbtest.sh -> fmbtest + * tests/fmbtest.sh: Rename to ... + * tests/fmbtest: ...this, dropping the .sh suffix. + * tests/Makefile.am (TESTS): Reflect renaming. + + tests: convert fmbtest.sh to use init.sh + * tests/fmbtest.sh: Use init.sh and adapt accordingly: + Use "grep", not ${GREP}. Use Exit, not exit. + + tests: also exercise the --include + glob path + * tests/include-exclude: Exercise Javier's fix. + +2010-03-28 Javier Villavicencio + + grep -r: fix --include with globs, too + The previous fix addressed only the non-glob case. + * src/main.c (main): Use add_exclude's EXCLUDE_WILDCARDS option, + to enable the use of fnmatch with --include=GLOB. + gnulib: Update to latest, for the fixed exclude.c. + +2010-03-28 Jim Meyering + + grep -r: fix --include with non-globs + * lib/savedir.c (savedir): Fix logic error. Introduced by commit + bf3bd92c, "build: adapt to the newer exclude API we now get from gnulib" + * tests/include-exclude: Test for this bug by exercising --include, too. + * NEWS (Bug fixes): Mention it. + Reported by Philipp Kohlbecher in http://savannah.gnu.org/bugs/?29358 + +2010-03-27 Jim Meyering + + kwset: correct comments; require non-NULL kwsmatch argument + * src/kwset.c (kwsexec): Correct comments. This function has been + returning an offset, not a pointer, for 9 years. + Do not test for kwsmatch == NULL. All callers pass non-NULL. + (cwexec): Likewise. + * src/kwset.h (kwsexec): Mark the 4th parameter, kwsmatch, as non-NULL. + Include "arg-nonnull.h". + + build: add -I$(top_builddir)/lib so we also find generated .h files + * src/Makefile.am (AM_CPPFLAGS): Rename from INCLUDES to avoid + warning from automake -Wall. + Add -I$(top_builddir)/lib, so we find generated .h files like + getopt.h in a non-srcdir build. + + build: remove superfluous LOCALEDIR definition + * src/Makefile.am (INCLUDES): Remove unnecessary definition of + LOCALEDIR here. Now, it's defined via gnulib's configmake.h. + * src/system.h: Include "configmake.h" for its LOCALEDIR definition. + + grep: don't segfault upon use of --include or --exclude* options + * lib/savedir.c (isdir1): Fix fatal typo: deref "dir" argument, + not the global (initially-NULL) "path". Reported by Standish Parsley. + * tests/include-exclude: New file. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + +2010-03-26 Jim Meyering + + tests: rename: foad1.sh -> foad1 + * tests/foad1.sh: Rename to ... + * tests/foad1: ...this, dropping the .sh suffix. + * tests/Makefile.am (TESTS): Reflect renaming. + + tests: convert foad1.sh to use init.sh + This fixes a spurious test failure when "make check" is run with + certain envvars set, e.g., "make check GREP_COLOR=always" + * tests/foad1.sh: Use init.sh and adapt accordingly: + Use "grep", not ${GREP}. Test VERBOSE against "yes", not "1", + to be consistent with init.sh. + Use Exit, not exit. + Reported by Nelson H. F. Beebe. + + tests: insulate tests from envvar settings + * tests/init.cfg (vars_): Unset each envvar that can affect how + grep works. This protects only those tests that have been + converted to use init.sh. + +2010-03-25 Eric Blake + + maint: ignore 'make dist pdf' droppings + * .gitignore: Add more exemptions. + +2010-03-25 Jim Meyering + + tests: avoid spurious test failure due to lack of a French UTF8 locale + * tests/init.cfg: New file. If either $LOCALE_FR or $LOCALE_FR_UTF8 + is set to "none", reset it to the empty string. + Reported by Mike Frysinger and Sven Joachim. + * tests/Makefile.am (EXTRA_DIST): Add init.cfg. + + build: do not use pkg-config to test for PCRE support + * configure.ac: Do not use PKG_PROG_PKG_CONFIG or PKG_CHECK_MODULES. + Do not modify CPPFLAGS; that belongs to those who invoke make. + Instead, use autoconf's AC_CHECK_HEADERS and AC_SEARCH_LIBS via the + new macro, gl_FUNC_PCRE, defined in... + * m4/pcre.m4 (gl_FUNC_PCRE): New macro, to handle pcre-related + configure-time tests. + * src/Makefile.am (grep_LDADD): Use LIB_PCRE, not PCRE_LIBS. + * src/pcresearch.c: Test HAVE_LIBPCRE via "#if", not "#ifdef". + All other cpp tests of this symbol used "#if". + Prompted by a suggestion from Bruno Haible. + * NEWS (Build-related): Mention this. + + doc: correct and amend NEWS entries for 2.6.1 + * NEWS (Bug fixes): Correct character ranges bug description. + Add an example from Dmitry V. Levin. + Add that the word-with-backref bug was introduced in 2.5.1. + * cfg.mk (old_NEWS_hash): Update to match. + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.6.1 + * NEWS: Record release date. + +2010-03-25 Tony Abou-Assaleh + + tests: use awk's -v option more portably + * tests/spencer1-locale: Add a space between awk's "-v" option and + the following VAR=value string, to avoid test failure on Mac OS X. + +2010-03-25 Norihirio Tanaka + + dfa/grep: fix compilation with MBS_SUPPORT + * src/dfa.c (cur_mb_len): Initialize to 1 and always make it available. + (setbit_case_fold): Do not use wint_t in prototype if !MBS_SUPPORT. + (parse_bracket_exp): Fix compilation with !MBS_SUPPORT. + * src/kwsearch.c (kwsinit): Do not use mbtolower and MB_CUR_MAX + if !MBS_SUPPORT. + * src/searchutils.c (kwsinit): Do not refer to MB_CUR_MAX if !MBS_SUPPORT. + + * tests/char-class-multibyte: Skip if UTF-8 matching does not work. + * tests/fmbtest.sh: Likewise. + +2010-03-25 Jim Meyering + + build: avoid warnings about unnecessary use of "return" + * src/grep.c (Gcompile, Ecompile, Acompile): Do not "return X" + from a function returning void, not even when X itself is a + function returning void. This avoids warnings from Sun Studio 11 + reported by Dagobert Michelsen. + * src/egrep.c (Ecompile): Likewise. + +2010-03-25 Norihirio Tanaka + + grep: fix printing when -w is used and regex is needed for matching + * NEWS: Document bugfix. + * src/dfasearch.c (EGexecute): After assess_pattern_match len, is either + invalid or end-beg; jump to success. + * tests/Makefile.am (TESTS): Add new test. + * tests/backref-word: New. + +2010-03-25 Paolo Bonzini + + dfa: fix single byte character ranges + * src/dfa.c (in_coll_range): Fix ordering for second strcoll. Reported + by Dmitry V. Levin. + * tests/spencer1-locale.awk: Also test single-byte character sets. + * NEWS: Add a note about this bugfix. + * THANKS: Add Dmitry. + +2010-03-25 Norihirio Tanaka + + grep: reset state after truncated or invalid multibyte sequences + * src/searchutils.c (is_mb_middle): When treating an invalid sequence + or a truncated multibyte character as a single byte character, reset + mbstate + + grep: do lowercase conversion in print_line_middle only for single-byte case + * src/main.c (print_line_middle): Restrict match_icase code + to MB_CUR_MAX == 1. Adjust comments. + +2010-03-25 Jim Meyering + + tests: provide framework_failure_ function + The shell function "framework_failure" was called in the unusual + event that some fundamental test set-up operation would fail. + However it was not defined. Define it, but with a trailing underscore + to impinge less on the test writer's name space. Adjust all uses. + * tests/init.sh (framework_failure_): New function. + * tests/case-fold-backref: s/framework_failure/framework_failure_/ + * tests/case-fold-char-class: Likewise. + * tests/case-fold-char-range: Likewise. + * tests/case-fold-char-type: Likewise. + * tests/char-class-multibyte: Likewise. + * tests/dfaexec-multibyte: Likewise. + * tests/max-count-vs-context: Likewise. + * tests/word-multi-file: Likewise. + +2010-03-24 Jim Meyering + + doc: tweak THANKS + * THANKS: Update Arnold's name and address, per request. + + portability: use gnulib's lseek wrapper + * bootstrap.conf (gnulib_modules): Use gnulib's lseek wrapper, + for improved portability. lseek does not fail with ESPIPE on + pipes on some systems. + + build: avoid link failure on Solaris 8 + * bootstrap.conf (gnulib_modules): Add wctob. + * NEWS (Portability): Mention this. + Reported by Dagobert Michelsen in . + +2010-03-24 Petr Písař + + doc: translate new --help message + * src/main.c: Translate "after_options". + +2010-03-24 Jim Meyering + + doc: NEWS make it clear that the bug was introduced in 2.6 + * NEWS: Clarify. + +2010-03-24 Paolo Bonzini + + tests: fix char-class-multibyte + * tests/char-class-multibyte: Make it pass. + +2010-03-23 Jim Meyering + + build: avoid compilation failure when MBS_SUPPORT not defined + * src/dfa.c (setbit_case_fold) [!MBS_SUPPORT]: Fix curly brace mismatch. + +2010-03-23 Paolo Bonzini + + dfa: fix sigsegv on multibyte character classes + Reported by Jaroslav Škarvada . This is + unfortunate. grep needs an automatic testcase generator. + + * NEWS: Document bug. + * THANKS: Mention reporter. + * src/dfa.c (set_bit_casefold): Change type of first argument for + self-documentation. + (parse_bracket_exp): Fix call. + * tests/Makefile.am: Add new testcase. + * tests/char-class-multibyte: New testcase. + +2010-03-23 Jim Meyering + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 2.6 + * NEWS: Record release date. + + build: avoid warnings: tell gcc and clang that dfaerror never returns + * src/dfa.h (__attribute__): Define. + (dfaerror): Declare with the "noreturn" attribute. + * src/dfasearch.c (dfaerror): Add an unreachable use of abort. + +2010-03-22 Eric Blake + + build: fix cygwin build + Portions of gnulib depend on -lintl, and cygwin does not allow + lazy linking. + + * src/Makefile.am (LDADD): Include libraries in correct order. + +2010-03-22 Paolo Bonzini + + grep: remove --mmap + mmap is a bad idea for sequentially accessed file because it will cause + a page fault for every read page. Just consider it a failed experiment, + and ignore --mmap while accepting it for backwards compatibility. + + * configure.ac (AC_FUNC_MMAP): Remove. + * doc/grep.texi (Other options): Say --mmap is ignored. + * src/grep.c (mmap_option): Remove. + (long_options): Do not reference it. + (bufmapped, initial_bufoffset): Remove. + (reset, fillbuf): Remove HAVE_MMAP code. + (grepfile): Remove bufmapped reference. + (usage): Say --mmap is ignored. + +2010-03-22 Paolo Bonzini + + grep: rename files for intuitiveness + * Makefile.am (libgrep_a_SOURCES, grep_SOURCES, egrep_SOURCES, + fgrep_SOURCES): Adjust. + * grep.c: Rename to main.c. + * esearch.c: Rename to egrep.c. + * fsearch.c: Rename to fgrep.c. + * gsearch.c: Rename to grep.c. + + grep: kill GREP_PROGRAM/EGREP_PROGRAM/FGREP_PROGRAM + * NEWS: Document slight semantic change. + * TODO: #ifdefs are gone. + * po/POTFILES.in: Update. + * src/Makefile.am (grep_SOURCES, egrep_SOURCES, fgrep_SOURCES): Remove + grep.c/egrep.c/fgrep.c. + (noinst_LIBRARIES): Change libsearch.a to libgrep.a. + (libsearch_a_SOURCES): Rename to libgrep_a_SOURCES, add grep.c + (LDADD): Change libsearch.a to libgrep.a. + * src/esearch.c: Add before_options and after_options. + * src/fsearch.c: Likewise. + * src/gsearch.c: Likewise. + * src/grep.c (short_options, long_options): Remove GREP_PROGRAM + special-casing. + (usage): Use before_options and after_options, look at matchers. + (setmatcher): Merge with install_matcher. + (main): Call setmatcher (NULL) instead of install_matcher. + * src/grep.h (GREP_PROGRAM): Remove. + (before_options, after_options): Add. + + thank Eric Blake + * THANKS: Add Eric Blake, who reported the warning fixed by 774d0ee. + + grep: libify *search.c + * src/Makefile.am (libsearch_a_SOURCES): Add dfasearch.c, kwsearch.c, + pcresearch.c. + * src/esearch.c, src/fsearch.c, * src/gsearch.c: Only include search.h. + * src/dfasearch.c (GEAcompile, EGexecute): Export. + * src/kwsearch.c (Fcompile, Fexecute): Export. + * src/pcresearch.c (Pcompile, Pexecute): Export. + * src/search.h: Add new exported functions. + + grep: prepare for libification of *search.c + * src/dfasearch.c (Ecompile): Remove. + * src/esearch.c: Place it here... + * src/gsearch.c: ... and here. + + grep: split search.c + * po/POTFILES.in: Update. + * src/Makefile.am (grep_SOURCES, egrep_SOURCES, fgrep_SOURCES): Move + kwset.c and dfa.c to libsearch.a. Add searchutils.c there too. + * src/search.h, src/dfasearch.c, src/pcresearch.c, src/kwsearch.c, + src/searchutils.c: New files, split out of src/search.c. + * src/esearch.c, src/fsearch.c: Include the new files instead of search.c. + * src/gsearch.c: Likewise, plus move Gcompile/Acompile here. + + grep: remove one #ifdef + * search.c (GEAcompile) [EGREP_PROGRAM]: Use common code. Inline IF_BK. + +2010-03-22 Paolo Bonzini + + grep: eliminate {COMPILE,EXECUTE}_{RET,ARGS,FCT} + Modern compilers warn about type mismatches. + + * src/grep.c (do_execute): Write full declaration. + * src/grep.h (COMPILE_RET, COMPILE_ARGS, COMPILE_FCT, EXECUTE_RET, + EXECUTE_ARGS, EXECUTE_FCT): Remove. + (compile_fp_t, execute_fp_t): Write full declaration. + * src/search.c (GEAcompile, Gcompile, Acompile, Ecompile, EGexecute, + Fcompile, Fexecute, Pcompile, Pexecute): Write full declaration. + +2010-03-22 Paolo Bonzini + + grep: make egrep/fgrep use struct matcher + * Makefile.am (grep_SOURCES): Add gsearch.c. + (EXTRA_DIST): Add search.c. + * esearch.c (matchers): New. + * fsearch.c (matchers): New. + * gsearch.c: New. + * search.c (matchers): Remove. + * grep.c: Always compile most !GREP_PROGRAM sections. + (main): Use first matcher if none is explicitly provided. Remove + "default" matcher. + * grep.h (struct matcher): Adjust comments. + + grep: change struct matcher termination + * src/grep.c (setmatcher): Look for NULL matchers[i].name. + * src/grep.h (struct matcher): Change name to pointer. Adjust comments. + * src/search.c (matchers): Terminate with three NULLs. + + grep: remove one #ifdef + * search.c (Ecompile): Always go through GEAcompile to use same code path + for both grep and egrep. + + grep: remove getpagesize.h + * src/getpagesize.h: Remove. + * src/Makefile.am (noinst_HEADERS): Remove getpagesize.h. + +2010-03-21 Jim Meyering + + build: use the fcntl-h module, not "fcntl" + * bootstrap.conf (gnulib_modules): We might need fcntl.h somewhere, + but don't use the fcntl function. Reported by Bruno Haible. + + build: avoid link failure on systems using gnulib's fcntl but not open + * bootstrap.conf (gnulib_modules): Using gnulib's fcntl module + and including , but not also using gnulib's "open" module + would result in link failure due to references to rpl_open + on systems requiring the replacement (e.g., Cygwin and Darwin). + + build: avoid compilation failure on systems using rpl_open + This new build failure has arisen as a result of using gnulib's + "fcntl" module. Now that an inadequate "open" syscall is replace + by gnulib's wrapper, it is essential to include . + * src/grep.c: Include . + This is required, for grepfile's use of open, at least on + Cygwin and Darwin. + + maint: use gnulib's fcntl module, just in case + * bootstrap.conf (gnulib_modules): Add fcntl. + Grep uses at least O_BINARY, which may be defined therein. + + maint: remove TYPE_* definitions from src/system.h + * src/system.h (TYPE_MAXIMUM, TYPE_MINIMUM, TYPE_SIGNED): Remove + definitions. They are provided by intprops.h. + * src/grep.c: Include "intprops.h" + * bootstrap.conf (gnulib_modules): Add intprops. + + maint: alphabetize #include directives + * src/grep.c: Alphabetize #include directives. + +2010-03-20 Jim Meyering + + build: stop using gnulib's memmove module + * bootstrap.conf (gnulib_modules): Remove obsolete module: memmove + + build: reinstate gnulib's fcntl-h-tests + * bootstrap.conf (gnulib_tool_option_extras): Do not avoid + the fcntl-h-tests. I cannot reproduce the failure. + +2010-03-20 Eric Blake + + build: allow compilation on cygwin + Gnulib is incompatible with -Wunused-macros. Addtionally, + cygwin 1.7.1 coupled with --enable-gcc-warnings tripped on: + + grep.c: In function 'print_line_middle': + grep.c:805: error: array subscript has type 'char' [-Wchar-subscripts] + grep.c: In function 'main': + grep.c:1833: error: 'optarg' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] + grep.c:1834: error: 'optind' redeclared without dllimport attribute after being referenced with dll linkage + + * configure.ac (GNULIB_WARN_FLAGS): Disable -Wunused-macros. + * src/grep.c (print_line_middle): Use correct type to tolower. + (main): Drop useless redeclarations. + * .gitignore: Ignore more built files. + +2010-03-20 Jim Meyering + + tests: ensure that all programs handle [b-a] consistently + * tests/reversed-range-endpoints: New test. + * tests/Makefile.am (TESTS): Add it. + +2010-03-20 Jim Meyering + + build: update gnulib submodule to latest + This pulls in the latest regex module from gnulib, including a fix + to make it honor the RE_NO_EMPTY_RANGES syntax bit. + + tests: temporarily disable irrelevant-to-grep failing C++ fcntl-h-tests + * bootstrap.conf (gnulib_tool_option_extras): Temporarily add + --avoid=fcntl-h-tests, until the C++ part of that test is fixed. + +2010-03-20 Jim Meyering + + reject reversed-endpoint ranges, with all regex variants + * src/search.c: Add RE_NO_EMPTY_RANGES to the syntax bits + in three places, so that all of grep, egrep, and grep -E reject + a range with reversed endpoints like '[b-a]'. This is required, + when using the latest version of gnulib's regex module, since it + now honors the RE_NO_EMPTY_RANGES flag, rather than acting as if + it were always set. + Based on a change by Matthew Burgess. + +2010-03-19 Jim Meyering + + maint: correct macro parameter parentheses + * src/dfa.c (FETCH_WC, FETCH): Parenthesize macro parameters. + +2010-03-19 Paolo Bonzini + + tests: change help-version to per-program functions + * help-version: Change each *_args variable to a *_setup function. + + dfa: fix wchar_t/wint_t type mismatch + * src/dfa.c (FETCH_WC): Pass a local wchar_t variable to mbrtowc. + (FETCH): Rename temporary second argument to FETCH_WC. + (parse_bracket_exp): Always use FETCH_WC. + +2010-03-19 Jim Meyering + + doc: add README-prereq, referenced from README-hacking + * README-prereq: New file. Cloned from coreutils, s/coreutils/grep/ + Reported by Tony Abou-Assaleh. + +2010-03-19 Arnold Robbins + + maint: sync dfa comments from gawk + * src/dfa.h (struct dfa) [newlines]: Amend comment. + * src/dfa.c: Update copyright year list to include gawk's. + +2010-03-17 Jim Meyering + + maint: remove obsolete "cvs-clean" make target + * Makefile.am (cvs-clean): Remove obsolete target. + +2010-03-17 Paolo Bonzini + + dfa: initialize struct mbcset using memset + * src/dfa.c (parse_bracket_exp): Use memset to initialize workmbc. + + dfa: spell out "unsigned int" + * dfa.c (setbit, tstbit, clrbit, setbit_case_fold, lex, dfaoptimize, + free_mbdata): Put "int" after unsigned. + * dfa.h (struct position, struct dfa): Likewise. + +2010-03-17 Paolo Bonzini + + dfa: optimize simple character sets under UTF-8 charsets + Only use a bitset when possible without involving MBCSET. Testcase: + yes 'the quick brown fox jumps over the lazy dog' | sed 100000q | \ + time grep -c [ABCDEFGHIJKLMNOPQRSTUVWXYZ,] + + Before: 51ms (best of three runs); after: 16ms(best of three runs). + + * src/dfa.c (parse_bracket_exp): For simple bracket expressions + under UTF-8, use a CSET. + +2010-03-17 Paolo Bonzini + + dfa: speed up handling of brackets + This patch has two sides. One is to fold the parsing of brackets in the + single- and multi-byte cases. The second is to leverage this change, + and use a bitset to test for single-byte characters in the charset. + Splitting the two would be very hard. + + Testcase: + yes 'the quick brown fox jumps over the lazy dog' | sed 100000q | \ + time grep -c [ABCDEFGHIJKLMNOPQRSTUVWXYZ,] + + Before: 59ms (best of three runs); after: 51ms (best of three runs). + Nice, but mostly providing infrastructure for the next patch. + + * src/dfa.c (setbit_case_fold): Try applying towlower/towupper. + (looking_at): Remove. + (FETCH_WC): New. + (fetch_wc): Merge into FETCH_WC [MBS_SUPPORT]. + (FETCH) [MBS_SUPPORT]: Call FETCH_WC. + (prednames, find_pred, is_blank and other predicates): Move above, + remove K&R syntax support. + (parse_bracket_exp): New name of parse_bracket_exp_mb, rewritten to + include single-byte character set parsing of brackets. + (lex): Adjust for fetch_wc->FETCH_WC change, remove single-byte + character set parsing of brackets. + (match_mb_charset): Test against work_mbc->cset. + * src/dfa.h (struct mb_char_classes): Add cset. + +2010-03-17 Paolo Bonzini + + syntax-check: remove space-tab exception + * .x-sc_space_tab: Remove. + * src/dfa.c: Fix space-tab occurrence. + + THANKS: fix Jim Meyering's email address + * THANKS: Jim is now with Red Hat. + + dfa: add missing function + * src/dfa.c (using_utf8): New. + (addtok_wc, free_mbdata, dfaoptimize) [!MBS_SUPPORT]: Do not define. + (dfacomp) [!MBS_SUPPORT]: Do not call dfaoptimize. + + tests: fix typo + * fedora: Fix typo. + + tests: use Exit + * euc-mb: exit with "Exit 0". + + grep: remove more register keywords + * dosbuf.c: Remove register keywords. + * grep.c: Remove register keywords. + * kwset.c: Remove register keywords. + * search.c: Remove register keywords. + +2010-03-17 Paolo Bonzini + + dfa: run simple UTF-8 regexps as a single-byte character set + This provides a speedup whenever fgrep is "almost" sufficient but + not quite (e.g. grep ^abc). This affects test cases such as + https://savannah.gnu.org/bugs/?29117, which are already worked around + by the line-by-line matching patch c32c04; without that patch the + speedup can reach 1000x even on non-contrived testcases. + + * src/dfa.c (dfaoptimize): New. + (dfacomp): Call it. + +2010-03-17 Paolo Bonzini + + tests: fix syntax-check failures + * tests/case-fold-backref: Use "foo" instead of "the". + * tests/dfaexec-multibyte: Remove trailing blanks. + +2010-03-17 Paolo Bonzini + + grep: remove check_multibyte_string, fix non-UTF8 missed match + Avoid computing ahead something that can be computed lazily as efficiently + (or more efficiently in the case of UTF-8, though this is left as TODO). + At the same time, "soften" the rejection condition for matching in the + middle of a multibyte sequence to fix bug 23814. + + Multibyte "grep -i" would still be very slow if it wasn't for the workaround + patch c32c042 (grep: match multibyte charsets line-by-line when using -i, + 2010-03-08). + + * NEWS: Document bugfix. + * src/search.c (check_multibyte_string): Rewrite as... + (is_mb_middle): ... this. + (EGexecute, Fexecute): Adjust. + * tests/Makefile.am (TESTS): Add euc-mb. + * tests/euc-mb: New testcase. + +2010-03-17 Paolo Bonzini + + dfa: cache MB_CUR_MAX for dfaexec + * src/dfa.c (state_index, dfaexec): Use d->mb_cur_max. + (dfainit): Initialize it. + (free_mbdata): New, extracted out of dfafree. + (dfafree): Use it. + + dfa: improve documentation of struct dfa + * src/dfa.h (struct dfa): Reword some comments. + + tests: factor name of output files into a variable + * tests/case-fold-backref, tests/case-fold-char-class, + tests/case-fold-char-range, tests/case-fold-char-type, + tests/dfaexec-multibyte: Use a variable for the output filename, + as it is common to the grep and compare invocations. + + tests: use different output files to simplify reading failed .log files + * tests/case-fold-backref, tests/case-fold-char-class, + tests/case-fold-char-range, tests/case-fold-char-type: Use a different + name for each output file from grep. + * tests/dfaexec-multibyte: Likewise, and merge some grep invocations. + + tests: add another grep -i testcase, from bug 16179 + * tests/case-fold-backref: New. + * tests/Makefile.am (TESTS): Add it. + +2010-03-16 Paolo Bonzini + + dfa: rewrite handling of multibyte case_fold lexing + Let dfacomp do the folding to lowercase of multibyte input strings, + and remove it from grep.c. Input strings to kwset.c are still folded + outside kwset.c, so we still need to do mbtolower in search.c. + + * NEWS: Document bugfixes. + * .x-sc_cast_of_argument_to_free: Remove. + * src/dfa.c (wctok, addtok_wc): New. + (cur_mb_index, update_mb_len_index): Remove. + (FETCH): Do not call it. + (parse_bracket_exp_mb) [GREP]: Disable case-folding of ranges and + characters. + (addtok): Extract part to... + (addtok_mb): ... this new function. + (lex): Call fetch_wc in the main loop for MB_CUR_MAX > 1. Return WCHAR + for normal characters if MB_CUR_MAX > 1. + (atom): Handle WCHAR instead of treating multibyte characters specially. + Do case folding of multibyte characters here. + (dfacomp): Remove case_fold special casing. + * src/dfa.h (WCHAR): New. + * src/grep.c (mb_icase_keys): Remove. + (main): Do not call it. + * src/search.c (kwsinit): Init transition table only for MB_CUR_MAX == 1. + (mbtolower): New. + (kwsincr_case): New. + (kwsmusts): Call it instead of kwsincr. + (check_multibyte_string): Remove. + (check_multibyte_string_no_icase): Rename to check_multibyte_string. + (GEAcompile, EGexecute, Fcompile): Use mbtolower instead of the old + check_multibyte_string. + * tests/Makefile.am (TESTS): Add case-fold-backslash-w. + * tests/foad1.sh: Enable fixed tests. + * tests/case-fold-backslash-w: New. + +2010-03-16 Paolo Bonzini + + grep: match multibyte charsets line-by-line when using -i + The turtle combination -i + MB_CUR_MAX>1 requires case conversion ahead + of time. Avoid doing this repeatedly when many matches succeed. Together + with the previous changes, this fixes https://savannah.gnu.org/bugs/?29117 + and https://savannah.gnu.org/bugs/?14472. + + * NEWS: Document new speedup. + * src/grep.c (do_execute): New. + (grepbuf): Use it. + +2010-03-15 Paolo Bonzini + + dfa: fix handling of ranges in multibyte character sets + * src/dfa.c (parse_bracket_exp_mb): Add separate ranges for + lowercase and uppercase endpoints if folding case. + * tests/Makefile.am (TESTS): Add case-fold-char-range. + * tests/case-fold-char-range: New. + + tests: add more UTF-8 test cases + * tests/Makefile.am (TESTS): Add spencer1-locale. + (EXTRA_DIST): Add spencer1-locale.awk. + * tests/spencer1-locale.awk: New. + * tests/spencer1-locale: New. + +2010-03-15 Jim Meyering + + tests: complete the renaming fedora.sh -> fedora + * tests/Makefile.am (TESTS): Rename fedora.sh -> fedora here, too. + +2010-03-15 Jim Meyering + + * tests/fedora.sh: Rename to... + * tests/fedora: ...this, to reflect new convention: + Use the lack of a suffix to indicate we've converted to the new + init.sh-using test framework. + + tests: adjust fedora.sh to handle traps more portably + +2010-03-15 Jim Meyering + + tests: adjust fedora.sh to handle traps more portably + * tests/fedora.sh: Use "Exit", not "exit". + + tests: for each test, set an envvar to its name + * tests/Makefile.am (TESTS_ENVIRONMENT): Set GREP_TEST_NAME for + each test. This is used to help make the output of hundreds of + independent, often-parallel valgrind runs more manageable. + +2010-03-14 Jim Meyering + + tests: clean up fedora.sh + * tests/fedora.sh: Use "grep", not ${GREP}. + Use init.sh. + Use timeout 10, not sleep 1 (three times). + The latter would always sleep for 3 seconds, and the test would + fail with a false positive on a slow system or with a heavily + instrumented (valgrind) executable. + +2010-03-12 Jim Meyering + + build: avoid build failure with --enable-gcc-warnings + * src/dfa.c: Don't include , now that it is not used. + [DEBUG]: Remove #ifdef block. + +2010-03-12 Paolo Bonzini + + syntax-check: enable space-tab + * cfg.mk (local-checks-to-skip): Enable space-tab. + * .x-sc_space_tab: Add exceptions. + * tests/status.sh: Fix occurrence. + + syntax-check: enable m4-quote-check + * cfg.mk (local-checks-to-skip): Enable m4-quote-check. + * configure.ac: Fix occurrence. + + syntax-check: enable makefile-TAB-only-indentation + * cfg.mk (local-checks-to-skip): Enable makefile-TAB-only-indentation. + * Makefile.am: Fix only occurrence. + + grep: fix error-message-uppercase + * cfg.mk (local-checks-to-skip): Enable error-message-uppercase. + * src/dfa.c (parse_bracket_exp_mb, lex, dfaparse): Fix occurrences. + * src/search.c (Pcompile, Pexecute): Fix occurrences. + + dfa, grep: cleanup if-before-free and cast-of-argument-to-free + * .x-sc_avoid_if_before_free: Remove. + * .x-sc_cast_of_alloca_return_value: Remove. + * .x-sc_cast_of_x_alloc_return_value: Remove. + * .x-sc_cast_of_argument_to_free: Temporarily add src/search.c. + * cfg.mk (local-checks-to-skip): Remove sc_cast_of_argument_to_free. + * src/dfa.c (ifree): Remove. + (dfamust, build_state, transit_state, dfafree): Do not do if-before-free, + do not cast free argument to ptr_t or char *. + (freelist): Call free instead of ifree. + * src/dfa.h (ptr_t): Remove. + +2010-03-12 Paolo Bonzini + + dfa: remove CRANGE dead code + The only use of CRANGE was removed by commit 193830d. In theory it is + more correct to do what CRANGE did, but in practice it seems like it did + not work. + + * src/dfa.h (token): Remove CRANGE. + * src/dfa.c (atom): Do not handle CRANGE. + (prtok): Likewise. + +2010-03-12 Paolo Bonzini + + dfa: get rid of x*alloc + * src/dfa.c: Include xalloc.h. + (xmalloc, xrealloc, xcalloc): Remove. + + grep: cleanup one const cast + * src/search.c (GEAcompile): Do not reuse motif when operating on the + (const) pattern, so we can make it non-const. Remove cast from free. + + kwset/system: remove ptr_t + * src/kwset.h: Declare kwset using an incomplete struct type. + * src/system.h (ptr_t): Remove. + +2010-03-12 Jim Meyering + + tests: add test cases for dfaexec bug + * tests/dfaexec-multibyte: New test. + * tests/Makefile.am (TESTS): Add it. + Reported by Paolo Bonzini in http://bugzilla.redhat.com/544407 + and http://bugzilla.redhat.com/544406 . + +2010-03-12 Jim Meyering + + dfa: manually merge gawk's dfaexec + * src/dfa.c (dfaexec): Adjust API: return pointer, not offset, and + take an "end" pointer parameter, rather than integral "size". + Adjust comment accordingly. + (build_state): Maintain d->newlines. + (copytoks): Update multibyte_prop indices. + (SKIP_REMAINS_MB_IF_INITIAL_STATE): Update a cast. + Return NULL, rather than (size_t) -1. + (realloc_trans_if_necessary): Realloc d->newlines. + * src/dfa.h (struct dfa): New member, "newlines". + (struct dfa) [GAWK]: New member, "broken". + (dfaexec): Update prototype and copy the new comment from dfa.c. + + dfa: make search.c use the new dfaexec API + + * src/search.c: Adjust to new dfaexec API. + Now, dfaexec returns a pointer, not an integer, + and the third parameter is END, not buffer size. + * src/dfa.c (dfaexec): Rewrite the function's comment. + Don't just clobber *END. While doing that happens to be + fine for gawk's usage, in grep, *END usually points to the + first byte of the next buffer. Save the initial value, + and restore it just before returning. + * src/dfa.h (dfaexec): Update comment; include parameter names. + +2010-03-12 Jim Meyering + + dfa: appease static analyzers + * src/dfa.c (transit_state_singlebyte): Call abort rather + than returning in a "can't happen" scenario. + This stops clang from emitting a false-positive report (I think it + was used-uninitialized) about a caller. + +2010-03-11 Jim Meyering + + dfa: do not accept [[:UPPER:]] or [[:LOWER:]] internally + * src/dfa.c (parse_bracket_exp_mb): Those class names are not + valid, and rejected elsewhere, so there is no point in allowing + upper or mixed-case versions here. + +2010-03-11 Jim Meyering + + maint: remove a trailing space + * src/search.c (EXECUTE_FCT): Remove trailing space. + + maint: remove all uses of PARAMS + Remove most with this: + git grep -lw PARAMS |xargs perl -pi -e 's/\bPARAMS *\((.*)\);/$1;/' + Remove the remainder manually. + +2010-03-11 Jim Meyering + + maint: remove all uses of PARAMS + * lib/savedir.h (PARAMS): Remove definitions manually. + Remove the remaining ones via this command: + git grep -l define.PARAMS |xargs perl -ni -e '/define PARAMS/ or print' + * src/dfa.h (PARAMS): Remove definitions. + * src/system.h (PARAMS): Likewise. + Remove most uses with this: + git grep -lw PARAMS |xargs perl -pi -e 's/\bPARAMS *\((.*)\);/$1;/' + Remove the remainder manually. + + maint: remove now-useless prototypes + * src/dfa.c: Remove the prototype of each static, non-recursive + function whose definition precedes first use. + + grep: plug an inconsequential leak + * src/grep.c (main): Plug a leak: free "keys". + + grep: avoid useless allocations for empty GREP_OPTIONS + * src/grep.c (prepend_default_options): Ignore GREP_OPTIONS + when it's empty, not just when it's undefined. + There are still relatively harmless leaks when GREP_OPTIONS + is set and non-empty. We'll address those, eventually. + +2010-03-09 Jim Meyering + + build: record build-from-clone tool requirements + * bootstrap.conf (buildreq): This makes bootstrap fail with + a clear explanation of the problem. Otherwise, you'd get into + the build process and fail with something far more cryptic. + + dfa: remove a trailing blank + * src/dfa.c (dfaexec): No trailing blanks allowed. + + dfa: sync a tiny change from gawk + * src/dfa.c (state_index) [MBS_SUPPORT]: Initialize .mpbs.nelem member + unconditionally. Also initialize .mbps.elems. + + dfa: avoid a leak (work_mbc->chars) + * src/dfa.c (parse_bracket_exp_mb): Remove useless (and leaked MALLOC). + + doc+bootstrap: document build-from-git-clone process + * bootstrap: Update from coreutils/gnulib. + * README-hacking: New file, nearly identical to the one in coreutils. + +2010-03-08 Paolo Bonzini + + more work on TODO + * TODO: More work on the first section. Use clearer section headers. + +2010-03-08 Reuben Thomas + + bring TODO up-to-date + * TODO: merge with TODO section of http://www.gnu.org/software/grep/devel.html + and remove done items. Some small bits of tidying also. + +2010-03-07 Paolo Bonzini + + simplify parsing of [a-z] + * src/dfa.c (in_coll_range): New. + (lex): Use it instead of regcomp/regexec. + + Small refactoring in src/dfa.c + * src/dfa.c (parse_bracket_exp_mb): Return MBCSET. + (lex): Assign return value of parse_bracket_exp_mb to lasttok, return it. + + use do...while(0) idiom + * dfa.c (FETCH): Wrap with do...while(0). + +2010-03-06 Paolo Bonzini + + extract common code from if/else + * dfa.c (dfaexec): Simplify logic for MB_CUR_MAX > 1 case. + + remove register variable hacks + * dfa.c (dfaexec): We can extract the address of a variable without fearing + performance problems, modern compilers know better. + + remove register keywords + * dfa.c (dfaexec): Modern compilers just ignore it. + + allow grep -Pz + * NEWS: Document grep -P improvements. + * src/search.c (Pcompile): Remove restriction on grep -Pz. + * tests/pcre-z: New. + * tests/Makefile.am (TESTS): Add pcre-z. + + fix cross-line matching in PCRE backend + * search.c (Pexecute): Split the buffer in lines and match each line + separately. + * tests/fedora.sh: Add regression testsuite. + + fix formatting of NEWS + * NEWS: fix formatting of 2.6 entries. + + fix a bug in handling of -i and character type + * dfa.c (parse_bracket_exp_mb): Convert [[:lower:]] and [[:upper]] to + [[:alpha:]] when folding case. + * tests/case-fold-char-type: New file. Test for the bug. + * tests/Makefile.am (TESTS): Add it. + * NEWS (Bug fixes): Mention it. + + fix previous test case change + * tests/case-fold-char-class: Do not reset fail to 0 after first test. + +2010-03-06 Mike Frysinger + + grep(1) man page: touchup --label option + * doc/grep.1 (--label): Don't italicize ending period. Point to -H + option. + +2010-03-06 Paolo Bonzini + + augment case-fold-char-class test case + * tests/case-fold-char-class: Test matching lowercase against uppercase + as well as vice versa. + +2010-03-05 Reuben Thomas + + doc: improve the discussion of PCRE + * doc/grep.1: Add a sentence about Perl regular expressions, + and point to pcresyntax(3) and pcrepattern(3). + * doc/grep.texi: Likewise. + +2010-03-05 Jim Meyering + + maint: dfa-sync: comment and dead-to-grep code: no semantic change + * src/dfa.c: Sync a comment and some #ifdef GAWK code. + + maint: dfa-sync: don't malloc zero + * src/dfa.c (dfacomp): Skip case_fold logic when length is zero. + This probably "no semantic change", but does improve efficiency in + a degenerate case. + + maint: dfa-sync: use CALLOC rather than equiv. MALLOC+initialize-loop + * src/dfa.c (dfaanalyze): Sync from gawk. No semantic change. + + dfa.c: add support for \s and \S + * src/dfa.c (lex): Sync from gawk's dfa.c. + + maint: dfa-sync: add omitted array initializer + * src/dfa.c (prednames): Add a "0" to final initializer. + No semantic change. + + fix a bug in handling of -i and character classes + * dfa.c (parse_bracket_exp_mb): Sync one part of this function + from gawk's dfa.c, which was patched by Arnold D. Robbins. + * tests/case-fold-char-class: New file. Test for the bug. + * tests/Makefile.am (TESTS): Add it. + (TESTS_ENVIRONMENT): Propagate LOCALE_FR and LOCALE_FR_UTF8 + definitions into tests. + * NEWS (Bug fixes): Mention it. + +2010-03-05 Paolo Bonzini + + Fedora Grep regression test suite + * tests/Makefile.am (TESTS): Add fedora.sh. + (CLEANFILES): Add several new files. + * tests/fedora.sh: New file, originally by Lubomir Rintel but somewhat + rewritten to avoid bashisms. + +2010-03-05 Paolo Bonzini + + convert AUTHORS file to UTF-8 + * AUTHORS: Convert to UTF-8. + + eliminate invalid "ptr += (ptr2 - ptr1)" + * lib/savedir.c (savedir): new_name_space and name_space do not point into + the same object, so computing their difference is invalid. Similarly, + summing the difference to namep is invalid because namep and the result + point into different objects. Avoid this. + + fix for bug 21276 + * lib/savedir.c (isdir1): Use realloc instead of calloc. Remove + dead code. + (savedir): Do not leak name_space if allocation of new_name_space fails. + +2010-03-04 Jim Meyering + + tests: add a test based on an example from Paolo Bonzini + * tests/word-multi-file: New test. + * tests/Makefile.am (TESTS): Add it. + + doc: document release procedure + * README-release: New file. + + build: update gnulib submodule to latest + +2010-02-22 Paolo Bonzini + + add --group-separator=FOO and --no-group-separator + * src/grep.c (group_separator): New. + (long_options): Add --group-separator=FOO and --no-group-separator. + (prtext): Print group_separator instead of SEP_STR_GROUP. Optionally + suppress the separator altogether. + (main) Handle GROUP_SEPARATOR_OPTION. + * doc/grep.texi (Context control): Document it. + * NEWS: Mention it. + * tests/yesno.sh: Add testcases. + +2010-02-21 Jim Meyering + + tests: don't use "echo -n" + * tests/foad1.sh: Use printf, not echo -n. The latter is not portable. + Reported by Daniel Richman. + +2010-02-08 Jim Meyering + + remove useless DJGPP-specific code + * src/grep.c (grepfile): Remove now-useless DJGPP-specific code. + Now, all S_IS* macros are guaranteed to be defined via gnulib. + +2010-02-07 Jim Meyering + + tests: add help-version sanity tests from coreutils + * tests/help-version: New test, from coreutils. + * tests/Makefile.am (TESTS): Add it. + (TESTS_ENVIRONMENT) [built_programs]: Define it. + + tests: correct TESTS_ENVIRONMENT's PATH setting + * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH to start with + $(abs_top_builddir)/src, so that we test the programs we've just built. + + grep: use the correct exit status (2) upon write failure, not 1 + * src/grep.c (main): Initialize exit_failure to EXIT_TROUBLE. + * NEWS (Bug fixes): Mention this fix. + + maint: enable the prohibit_magic_number_exit syntax check + * cfg.mk (local-checks-to-skip): Remove sc_prohibit_magic_number_exit, + to enable that check. + * src/system.h (EXIT_TROUBLE): Define. + * src/grep.c: Use symbolic names, EXIT_SUCCESS, EXIT_FAILURE, and + EXIT_TROUBLE, not 0, 1, 2. + * src/search.c: Likewise. + * src/vms_fab.c (string): Likewise. + +2010-02-04 Jim Meyering + + doc: adjust NEWS item + * NEWS: Correct a description. + +2010-02-03 Jim Meyering + + tests: exercise surprising -m1 vs. --context behavior + * tests/max-count-vs-context: New test. Exercise the surprising, + but documented, behavior reported by Markus Jochim in + http://savannah.gnu.org/bugs/?28588. + * tests/Makefile.am (TESTS): Add it. + + tests: use init.sh from gnulib + * tests/init.sh: New file, from gnulib. + * tests/Makefile.am (EXTRA_DIST): Add it. + (TESTS_ENVIRONMENT): Add variables and features. + (VERBOSE): Define. + + maint: remove unused Makefile rule + * tests/Makefile.am (dist-hook): Remove rule. No longer needed. + + maint: adjust formatting in tests/Makefile.am + * tests/Makefile.am (TESTS, CLEANFILES): Align and sort. + + build: avoid warnings in gnulib-supplied regex files + Now that we enable more warnings in lib/, we choose + to avoid some via patches applied by bootstrap, using + files in the gl/ hierarchy. Other, less-important + warnings are avoided simply by turning off the + -Wold-style-definition option and using a slightly + relaxed set of warnings $(GNULIB_WARN_CFLAGS) in lib/. + * gl/lib/regcomp.c.diff: Avoid warnings. + * gl/lib/regex_internal.c.diff: Likewise. + * gl/lib/regex_internal.h.diff: Likewise. + * gl/lib/regexec.c.diff: Likewise. + * configure.ac (GNULIB_PORTCHECK): Disable only -Wold-style-definition. + * lib/Makefile.am (AM_CFLAGS): Use $(GNULIB_WARN_CFLAGS) rather + than the slightly more strict $(WARN_CFLAGS). + + tests: adjust spencer #37 to pass with gnulib's regex code + * tests/spencer1.tests: Change #37 to expect an exit status of 2, not 1. + grep 'a[b-a]' reports "Invalid range end". + + maint: use regex from gnulib, rather than our bit-rotting one + * bootstrap.conf (gnulib_modules): Add regex. + * configure.ac: Don't use jm_INCLUDED_REGEX. + Update use of cache variable. + * lib/regex.c: Remove file. + * lib/regex.h: Likewise. + * m4/regex.m4: Likewise. + * POTFILES.in: Update to match. + + build: update gnulib submodule to latest + +2010-01-28 Jim Meyering + + maint: update to latest gnulib; adjust cfg.mk + * gnulib: Update submodule to latest. + * cfg.mk (old_NEWS_hash): Update to reflect NEWS Copyright line change. + +2010-01-06 Jim Meyering + + maint: avoid old jm_* macros + There were jm_* macros here, until very recently. + * cfg.mk (sc_prohibit_jm_in_m4): New rule, from coreutils. + + maint: remove decl.m4 + * m4/decl.m4: Remove unused file. + + maint: rely on gnulib's new isdir.h + * src/grep.c: Include "isdir.h". + * src/system.h: Remove declaration of isdir. + + build: rename local to avoid shadowing global, dfa + * src/dfa.c (dfamust): Rename parameter: s/dfa/d/. + + build: avoid warning from -Wmissing-prototypes + * src/dfa.c (match_mb_charset): Declare to be static. + + build: avoid shadowing warning for "link" + * src/kwset.c (link): Define to kwset_link, to avoid shadowing + the function. + + build: avoid shadowing warning for unused "rs" + * src/dfa.c (transit_state): Remove dead stores; + move a declaration "down". + Ignore transit_state_consume_1char return value. + + build: avoid shadowing warnings + * src/dfa.c (match_mb_charset): Rename parameter: s/index/idx/. + (check_matching_with_multibyte_ops, match_anychar): Likewise. + + build: avoid warning about unused definition of N_ + * src/dfa.c (N_): Remove unused definition. + + build: avoid format-string warnings + * src/search.c (dfaerror): Use literal "%s" as format string. + (kwsmusts, GEAcompile): Likewise. + (Pcompile): Likewise. + + build: add configure-time --enable-gcc-warnings option; avoid warnings + * bootstrap.conf (gnulib_modules): Add "manywarnings" module. + * configure.ac: Add --enable-gcc-warnings, derived from code in bison. + * src/Makefile.am (AM_CFLAGS): Set to $(WARN_CFLAGS) $(WERROR_CFLAGS) + * lib/Makefile.am (AM_CFLAGS): Likewise, but append. + + build: remove now-useless -I../intl option + * src/Makefile.am (INCLUDES): Remove -I../intl, now that intl is gone. + + maint: avoid more warnings + * src/grep.c (MAX): Remove definition of unused macro. + (usage): Declare with __attribute__ ((noreturn)). + Split long strings into chunks of length < 509. + + fix a possible bug: remove errant semicolon + * src/grep.c (prline): Remove erroneous semicolon-after-if-expr. + + maint: avoid compilation warnings + * bootstrap.conf (gnulib_modules): Add ignore-value. + * src/search.c (check_multibyte_string_no_icase): A variant of + check_multibyte_string that does *not* convert case, and hence + does not modify its BUF parameter. + (check_multibyte_string): Use xcalloc in place of xmalloc+memset. + Use ignore_value to ignore the return value from wcrtomb. This is + ok, since we know the input is a valid upper case wide character. + (Fexecute, EGexecute): Update callers of check_multibyte_string + to use both it and check_multibyte_string_no_icase. + + maint: avoid warnings about unused fwrite return value + * bootstrap.conf (gnulib_modules): Add unlocked-io. + * src/system.h: Include "unlocked-io.h". + + maint: remove {m4,lib}/.gitignore; they were undergoing too much churn + * .gitignore: Ignore all of m4/* except m4/djgpp.m4 + and all of lib/* except Makefile.am, savedir.c and savedir.h. + * m4/.gitignore: Remove file. + * lib/.gitignore: Remove file. + +2010-01-05 Jim Meyering + + build: run gnulib's tests, too + * Makefile.am (SUBDIRS): Add gnulib-tests. + * gnulib-tests/Makefile.am: New file. + * bootstrap.conf (bootstrap_epilogue): New function, from coreutils. + (gnulib_tool_option_extras): Define. + * configure.ac: Add gnulib-tests/Makefile. + +2010-01-03 Jim Meyering + + maint: record update-copyright options for this package + * cfg.mk: Next time, just run "make update-copyright". + +2010-01-01 Jim Meyering + + maint: update all FSF copyright year lists to include 2010 + Use this command: + git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \ + env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright + +2009-12-23 Jim Meyering + + fix multi-byte-locale read-beyond-end-of-buffer error + Avoid read-beyond-end-of-buffer errors, evoked by running this: + LC_ALL=en_US.UTF-8 valgrind src/grep -f <(printf 'a\nb\n') <(echo c) + + Conditional jump or move depends on uninitialised value(s) + at 0x78136D: __gconv_transform_utf8_internal (in /lib/libc-2.11.so) + by 0x7E7232: mbrtowc (in /lib/libc-2.11.so) + by 0x8055773: dfaexec (dfa.c:2816) + by 0x804D7B0: EGexecute (search.c:353) + by 0x804ACD8: grepbuf (grep.c:1036) + by 0x804B023: grep (grep.c:1156) + by 0x804B460: grepfile (grep.c:1287) + by 0x804CF0D: main (grep.c:2282) + + Conditional jump or move depends on uninitialised value(s) + at 0x7E7248: mbrtowc (in /lib/libc-2.11.so) + by 0x8055773: dfaexec (dfa.c:2816) + by 0x804D7B0: EGexecute (search.c:353) + by 0x804ACD8: grepbuf (grep.c:1036) + by 0x804B023: grep (grep.c:1156) + by 0x804B460: grepfile (grep.c:1287) + by 0x804CF0D: main (grep.c:2282) + + * src/dfa.c (dfaexec) [MBS_SUPPORT]: Do not access one byte beyond + end of buffer. + +2009-12-23 Jim Meyering + + build: update gnulib submodule to latest + +2009-12-23 Paolo Bonzini + + Speed up insert. + Suggested by Johan Walles (bug 23354). + + * src/dfa.c (insert): Use binary search. + +2009-12-23 Johan Walles + + Decrease epsclosure memory usage + Fixes bug 23321. + + * src/dfa.c (epsclosure): Make visited an array of char. + +2009-12-22 Paolo Bonzini + + Make 'grep -1 -2' and 'grep -1v2' equivalent to grep -2 + Fixes bug 12128. + + * src/grep.c (get_nondigit_option): Reset the buffer every time + a non-digit option is found or a new argument is started. + +2009-12-22 Paolo Bonzini + + Improve description of --label + Fixes bug 22681. + + * doc/grep.1 (--label): Use -H in the example, improve wording. + * doc/grep.texi (Output Line Prefix Control): Likewise. + +2009-12-22 Paolo Bonzini + + Avoid using an invalid memchr result. + Related to bug 13161. I cannot find a testcase, but it is better to be + defensive considering that these bug were found in the past. + + * src/search.c (EGexecute, Fexecute): Check for memchr return values. + +2009-12-11 Jim Meyering + + build: update gnulib submodule to latest + +2009-12-04 Jim Meyering + + maint: enable prohibit_have_config_h check + * cfg.mk (local-checks-to-skip): Enable sc_prohibit_have_config_h + * lib/regex.c: Remove useless cpp test of HAVE_CONFIG_H. + * lib/savedir.c: Likewise. + * src/grep.c: Likewise. + * src/kwset.c: Likewise. + * src/search.c: Likewise. + + maint: enable cast_of_x_alloc_return_value check + * cfg.mk (local-checks-to-skip): Enable sc_cast_of_x_alloc_return_value. + * .x-sc_cast_of_x_alloc_return_value: + * src/dfa.c (CALLOC, MALLOC, REALLOC): Remove casts. + * src/dosbuf.c (undossify_input): Likewise. + * src/grep.c (print_line_middle, prepend_default_options): Likewise. + + maint: enable cast_of_alloca_return_value check + * cfg.mk (local-checks-to-skip): Enable sc_cast_of_alloca_return_value. + * .x-sc_cast_of_alloca_return_value: New file. + +2009-12-04 Paolo Bonzini + + fix "grep -Ff" on CRLF-terminated files + * src/search.c (Fcompile) [HAVE_DOS_FILE_CONTENTS]: Recognize \r\n as + a line terminator. + + fix compilation with included regex + * Makefile.am (libgreputils_a_DEPENDENCIES): New. + + switch to pkg-config for PCRE detection + * configure.ac: use pkg-config to detect PCRE + * src/Makefile.am (grep_LDADD): link grep with PCRE_LIBS + +2009-12-04 Jim Meyering + + maint: remove "missing" script + * missing: Remove now-unused file. + + maint: make .gitignore ignore more + * .gitignore: Ignore more. + + maint: enable useless-if-before-free check + * cfg.mk (local-checks-to-skip): Enable sc_avoid_if_before_free. + * .x-sc_avoid_if_before_free: New file. Exempt regex.c and dfa.c, + in case anyone ever tries to merge their contents with other versions. + * src/grep.c (print_line_middle, grepdir): Remove useless if-before-free. + * src/search.c (IF_BK, EXECUTE_FCT): Likewise. + + maint: enable po-check + * cfg.mk (local-checks-to-skip): Enable sc_po_check. + * po/POTFILES.in: Sort and update. + +2009-12-03 Paolo Bonzini + + update gnulib, fixing missing inclusion of stdbool.h + * gnulib: Update. + +2009-11-30 Jim Meyering + + maint: enable two checks + * cfg.mk (local-checks-to-skip): Enable two: + sc_prohibit_xalloc_without_use sc_two_space_separator_in_usage + * src/grep.c (usage): Conform: use two spaces, not 1. + * src/kwset.c (malloc): Define as a function-macro so that the + syntax-check rule sees that we are indeed using xmalloc here. + + maint: enable makefile_path_separator check + * cfg.mk (local-checks-to-skip): Enable sc_makefile_path_separator_check, + now that the sole offender, an old po/Makefile.in.in, is gone. + + maint: remove now-generated file: po/Makefile.in.in + * po/Makefile.in.in: Remove file, now generated via bootstrap. + + maint: enable makefile @...@ check + * cfg.mk (local-checks-to-skip): Enable sc_makefile_check. + * lib/Makefile.am (libgreputils_a_LIBADD): Use $(...), rather than + anachronistic @...@ notation. + * src/Makefile.am (LDADD): Likewise. + * tests/Makefile.am (AWK): Remove definition. + + maint: enable trailing_blank check + * cfg.mk (local-checks-to-skip): Enable sc_trailing_blank. + * AUTHORS: Remove trailing blanks. + * COPYING: Likewise. + * README: Likewise. + * README-alpha: Likewise. + * README-boot: Likewise. + * THANKS: Likewise. + * TODO: Likewise. + * src/dfa.c: Likewise. + * src/mbsupport.h: Likewise. + * tests/backref.sh: Likewise. + * tests/file.sh: Likewise. + * tests/options.sh: Likewise. + * tests/tests: Likewise. + * vms/README: Likewise. + * vms/make.com: Likewise. + + maint: enable unmarked_diagnostics check + * cfg.mk (local-checks-to-skip): Enable sc_unmarked_diagnostics + * src/grep.c (fillbuf): Mark a diagnostic for translation. + (reset): Likewise. + + maint: enable require_config_h checks + * cfg.mk (local-checks-to-skip): Enable sc_require_config_h + and sc_require_config_h_first. + * src/dosbuf.c: Include . + * src/vms_fab.c: Likewise. + * .x-sc_require_config_h: New file: list the exceptions. + * .x-sc_require_config_h_first: Likewise. + + maint: use gnulib's progname module; enable set_program_name check + * bootstrap.conf (gnulib_modules): Add progname. + * src/grep.c: Include "progname.h". + (program_name): Remove declaration. + (main): Call set_program_name. + * cfg.mk (local-checks-to-skip): Add sc_program_name. + + maint: enable "file system" check + * cfg.mk (local-checks-to-skip): Enable sc_file_system. + * lib/savedir.c (savedir): Tweak spelling. Remove trailing blanks. + + maint: enable immutable_NEWS check + * NEWS: Move copyright to the bottom. + Use the format required by release-related tools. + * .prev-version: New file. + * cfg.mk (old_NEWS_hash): Define. + (local-checks-to-skip): Enable check: sc_immutable_NEWS. + + maint: disable the many failing syntax-checks + * cfg.mk: New file. + (local-checks-to-skip): Define to the list of disabled rules. + Subsequent change-sets will enable them, one by one. + + build: require automake-1.11, enable silent-rules, parallel tests, xz + * configure.ac (AM_INIT_AUTOMAKE): Create xz-compressed tarballs, + not bzip2-compressed ones. Enable automake's silent-rules, + parallel tests, and test PASS/FAIL coloring options. + Use AC_CONFIG_HEADERS, not AM_CONFIG_HEADER. Quote the argument. + + build: use git-version-gen for inter-release version strings + * configure.ac (AC_INIT): Use git-version-gen. + + build: add several build- and release-related gnulib modules + * bootstrap.conf (gnulib_modules): Add announce-gen update-copyright + do-release-commit-and-tag git-version-gen gnu-web-doc-update + gnupload maintainer-makefile useless-if-before-free + + build: adapt to the newer closeout module from gnulib + * src/grep.c: Include "exitfail.h". + (main) [-q]: Set the global variable, exit_failure, rather than + calling the now-removed close_stdout_set_file_name function. + + build: adapt to the newer exclude API we now get from gnulib + * src/grep.c (main): Adapt to newer exclude.c: add EXCLUDE_WILDCARDS as + the new "option" argument in calls to add_exclude and add_exclude_file. + + build: get more lib/* files from gnulib, adjust savedir + * bootstrap.conf (gnulib_modules): Add the following: + closeout exclude hard-locale isdir strtoumax. + * lib/.gitignore, m4/.gitignore: Update. + * lib/closeout.c, lib/closeout.h: Remove. + * lib/exclude.c, lib/exclude.h: Remove. + * lib/hard-locale.c, lib/hard-locale.h: Remove. + * lib/strtoumax.c: Remove. + * lib/isdir.c: Remove. + * lib/Makefile.am: Remove here, too. + * lib/savedir.c: Adapt to new exclude module: + s/excluded_filename/excluded_file_name/ and remove 3rd argument. + + build: update gnulib submodule to latest + + maint: generate ChangeLog from git logs + * Makefile.am (dist-hook, gen-ChangeLog): New rules. + * bootstrap.conf (gnulib_modules): Add gitlog-to-changelog. + Ensure that ChangeLog exists. + * ChangeLog-2009: Rename from ChangeLog + * ChangeLog: Remove file. + * .gitignore: Add ChangeLog. + + maint: list gnulib modules one per line + * bootstrap.conf (gnulib_modules): List them one per line. + +2009-11-29 Tony Abou-Assaleh + + Acknowledge new maintainers, update README-alpha + * AUTHORS: new maintainers added + * THANKS: same + * README-alpha: change CVS references to Git diff --git a/ChangeLog-2009 b/ChangeLog-2009 new file mode 100644 index 0000000..e86c46c --- /dev/null +++ b/ChangeLog-2009 @@ -0,0 +1,3653 @@ +2009-11-26 Paolo Bonzini + + * bootstrap.conf: Add binary-io, dirname. + * configure.ac: Remove check for setmode, AC_DOSFILE. + * m4/dosfile.m4: Remove. + * src/grep.c: Adjust for dirname.h. + * src/system.h: Adjust for new gnulib modules. + +2009-11-26 Paolo Bonzini + + * bootstrap.conf: Add gnulib modules for replacement functions and + headers. + * configure.ac: Remove macros subsumed by gnulib. + * lib/hard-locale.c: Remove guards for headers/functions provided by gnulib. + * lib/regex.c: Likewise. + * lib/savedir.c: Likewise. + * src/dfa.c: Likewise. + * src/grep.c: Likewise. + * src/mbsupport.h: Likewise. + * src/system.h: Likewise. + + * src/dfa.h: Do not look at PROTOTYPES. + + * m4/mbstate_t.m4: Remove. + * src/getpagesize.h: Remove. + +2009-11-26 Paolo Bonzini + + * bootstrap.conf: Add gnulib modules and build libgreputils.a. + * configure.ac: Remove macros subsumed by gnulib. + * lib/Makefile.am: Remove files subsumed by gnulib. + * lib/alloca.c: Remove. + * lib/atexit.c: Remove. + * lib/error.c: Remove. + * lib/error.h: Remove. + * lib/fnmatch.c: Remove. + * lib/fnmatch.h: Remove. + * lib/getopt.c: Remove. + * lib/getopt.h: Remove. + * lib/getopt1.c: Remove. + * lib/gettext.h: Remove. + * lib/malloc.c: Remove. + * lib/memchr.c: Remove. + * lib/obstack.c: Remove. + * lib/obstack.h: Remove. + * lib/quotearg.c: Remove. + * lib/quotearg.h: Remove. + * lib/realloc.c: Remove. + * lib/stpcpy.c: Remove. + * lib/strtol.c: Remove. + * lib/strtoul.c: Remove. + * lib/strtoull.c: Remove. + * lib/xalloc.h: Remove. + * lib/xmalloc.c: Remove. + * lib/xstrtol.c: Remove. + * lib/xstrtol.h: Remove. + * lib/xstrtoumax.c: Remove. + * m4/error.m4: Remove. + * m4/inttypes_h.m4: Remove. + * m4/malloc.m4: Remove. + * m4/realloc.m4: Remove. + * m4/uintmax_t.m4: Remove. + * m4/ulonglong.m4: Remove. + * m4/xstrtoumax.m4: Remove. + * src/system.h: Remove strerror, sys_nerr, sys_errlist. + +2009-11-26 Paolo Bonzini + + * bootstrap: Use gnulib's build-aux/bootstrap. + * configure.ac: Add gl_INIT and gl_EARLY. + +2009-11-26 Paolo Bonzini + + * configure.ac: Bump AC_PREREQ to 2.59. + +2009-11-26 Paolo Bonzini + + * lib/savedir.c: Do not use NAMLEN. + +2009-11-21 Paolo Bonzini + + * configure.ac: Remove AC_SEP. + * m4/envsep.m4: Remove. + +2009-11-20 Paolo Bonzini + + * configure.ac: Do not generate lib/posix/Makefile. + * lib/Makefile.am: Remove SUBDIRS. + * lib/posix/Makefile.am: Remove. + * lib/posix/regex.h: Overwrite... + * lib/regex.h: ... this. + +2009-11-20 Paolo Bonzini + + * doc/Makefile.am: Remove AUTOMAKE_OPTIONS. + * lib/posix/Makefile.am: Remove AUTOMAKE_OPTIONS. + * vms/Makefile.am: Remove AUTOMAKE_OPTIONS. + +2009-11-20 Paolo Bonzini + + * Makefile.cvs: Remove. + +2009-11-20 Paolo Bonzini + + * m4/largefile.m4: Remove. + * m4/lib-ld.m4: Remove. + * m4/lib-prefix.m4: Remove. + * m4/missing.m4: Remove. + * m4/nls.m4: Remove. + * m4/progtest.m4: Remove. + +2009-11-20 Paolo Bonzini + + * bootstrap: Add autopoint invocation and fetching of .po files. + * configure.ac: Bump to GNU gettext 0.17. + + * ABOUT-NLS: Remove. + * m4/gettext.m4: Remove. + * m4/iconv.m4: Remove. + * m4/lib-link.m4: Remove. + * m4/po.m4: Remove. + * po/*.po: Remove. + +2009-11-20 Paolo Bonzini + + * autogen.sh: Rename to... + * bootstrap: ... this. + +2009-11-20 Paolo Bonzini + + * bootstrap/*: Remove. + * configure.ac: Do not create bootstrap/Makefile. + * Makefile.am: Do not recurse into bootstrap, distribute new files. + * Makefile.boot: Move from bootstrap/Makefile.try. + * README-boot: Move from bootstrap/README. + +2009-11-20 Paolo Bonzini + + * lib/Makefile.am: Distribute gettext.h. + * lib/closeout.c: Use it. + * lib/gettext.h: New. + * lib/quotearg.c: Use it. + * lib/xmalloc.c: Use it. + * src/dfa.c: Use it. + * src/system.h: Use it. + +2009-11-20 Paolo Bonzini + + * configure.ac.in: Rename... + * configure.ac: ... to this. Remove ALL_LINGUAS definition. + * autogen.sh: Generate po/LINGUAS instead of configure.ac. + +2009-11-20 Paolo Bonzini + + * configure.ac.in: Remove pointless (?) stamp-h rule. + +2009-11-20 Paolo Bonzini + + * configure.ac.in: Remove m4/Makefile creation. + * Makefile.am: Remove m4 subdirectory. + * m4/Makefile.am: Remove. + * m4/codeset.m4: Remove. + * m4/glibc.m4: Remove. + * m4/glibc21.m4: Remove. + * m4/header.m4: Remove. + * m4/install.m4: Remove. + * m4/isc-posix.m4: Remove. + * m4/lcmessage.m4: Remove. + * m4/sanity.m4: Remove. + +2009-11-20 Paolo Bonzini + + * configure.ac.in (AM_GNU_GETTEXT_VERSION): Bump to 0.17. + * Makefile.am (EXTRA_DIST): Add build-aux/config.rpath. + * intl/*: Remove. + * m4/gettext.m4: Upgrade to gettext-0.17. + * m4/iconv.m4: Upgrade to gettext-0.17. + * m4/lib-ld.m4: New file, from gettext-0.17. + * m4/lib-link.m4: New file, from gettext-0.17. + * m4/lib-prefix.m4: New file, from gettext-0.17. + * m4/nls.m4: New file, from gettext-0.17. + * m4/po.m4: New file, from gettext-0.17. + * m4/progtest.m4: Upgrade to gettext-0.17. + * m4/Makefile.am (EXTRA_DIST): Add the new files. + * po/Makefile.in.in: Upgrade to gettext-0.17. + * po/Makevars: New. + * po/cat-id-tbl.c: New. + * src/Makefile.am: Replace @INTLLIBS@ with @LIBINTL@. + +2009-11-20 Paolo Bonzini + + * configure.ac.in: Test for limits.h, locale.h, stddef.h, mempcpy + and setlocale, though already done implicitly via AM_GNU_GETTEXT. + +2009-11-20 Paolo Bonzini + + * bootstrap/Makefile.try: Adjust. + * lib/savedir.c: Avoid using stpcpy, so that bootstrapping does not + need it. + +2009-11-20 Paolo Bonzini + + * configure.ac: Slightly modernize. + * Makefile.am: Modernize, use dependencies. + * Makefile.am: Modernize, use dependencies. + * lib/Makefile.am: Remove ansi2knr. + * src/Makefile.am: Remove ansi2knr. + + * .gitignore: Add INSTALL + * build-aux/.gitignore: New. + +2009-11-20 Paolo Bonzini + + * autogen.sh: Remove what is useless with git. + +2009-02-10 Tony Abou-Assaleh + + * po/*.po: update from the Translation Project + + * configure.ac.in: update version to 2.6-cvs + +2009-02-02 Karl Berry + + * configure.ac.in (pcre): set CPPFLAGS, not CFLAGS. + +2009-02-01 Tony Abou-Assaleh + + * po/*.po: update from the Translation Project + + * po/Makefile.in.in: Remove deleted file ChangeLog from DISTFILES + + * configure.ac.in: Replace obsolete macro AC_OUTPUT with modern equivalent + +2009-02-01 Karl Berry + + * missing: re-add (from gnulib), since it's missing. + + * src/grep.c (usage): consistent punctuation. + +2009-01-31 Tony Abou-Assaleh + + * m4/*.m4: quote underquoted definitions + * m4/codeset.m4: serial AM1 -> serial 1 + * m4/iconv.m4: serial AM2 -> serial 2 + * m4/header.m4: m4_regexp -> m4_bregexp, m4_patsubst -> m4_bpatsubst + +2009-01-29 Karl Berry + + * src/grep.c (usage): mention gnu.org/s/grep and gnu.org/gethelp. + + Update and/or add copyright notices: + * ABOUT-NLS + * AUTHORS + * ChangeLog + * Makefile.am + * NEWS + * README + * README-alpha + * README.DOS + * THANKS + * autogen.sh + * configure.ac.in + * bootstrap/Makefile.am + * bootstrap/Makefile.try + * bootstrap/README + * doc/Makefile.am + * doc/grep.texi + * lib/Makefile.am + * m4/Makefile.am + * po/POTFILES.in + * src/Makefile.am + * src/dfa.h + * src/dosbuf.c + * src/grep.h + * src/kwset.c + * src/kwset.h + * src/mbsupport.h + * src/search.c + * src/system.h + * src/vms_fab.c + * src/vms_fab.h + * tests/Makefile.am + * tests/backref.sh + * tests/bre.awk + * tests/bre.sh + * tests/empty.sh + * tests/ere.awk + * tests/ere.sh + * tests/file.sh + * tests/fmbtest.sh + * tests/foad1.sh + * tests/khadafy.sh + * tests/options.sh + * tests/pcre.sh + * tests/spencer1.awk + * tests/spencer1.sh + * tests/spencer2.sh + * tests/status.sh + * tests/tests + * tests/warning.sh + * tests/yesno.sh + * vms/Makefile.am + * vms/config_vms.h + + * po/ChangeLog: remove this file, just a bit of ancient cruft. + +2009-01-25 Tony Abou-Assaleh + + * README: updated "KNOWN BUGS" section + +2009-01-24 Bruno Haible + + * lib/posix/regex.h (__restrict, __restrict_arr): Remove macros. + (_Restrict_, _Restrict_arr_): New macros. From gnulib/lib/regex.h. + (regcomp, regexec): Update declarations to use them. + + * lib/savedir.c (isdir): New declaration. + + * src/dfa.c (update_mb_len_index): Change argument type to + 'char const *'. + (match_mb_charset): Cast argument to strncpy. + (dfaexec): Add pointer cast. + + * src/grep.c (parse_grep_colors): Add braces for disambiguation. + + * src/kwset.c: Include xalloc.h instead of declaring xmalloc manually. + +2009-01-20 Tony Abou-Assaleh + + * tests/foad1.sh: disable tests that fail under cs_CZ.UTF-8. + * tests/fmbtest.sh: likewise + * README: added "KNOWN BUGS" section + * src/grep.c: updated copyright year + +2008-12-12 Karl Berry + + * doc/grep.texi (Exit Status, grep Programs): move these + nodes to under Invoking. + + * doc/grep.texi: remove all remaining node pointers; + downcase cindex entries. + +2008-12-11 Karl Berry + + * doc/grep.texi (Copying): update url's. + (GNU General Public License): remove node. + (GNU Free Documentation License): @include fdl.texi instead. + (@copying): update to v1.3 or later. + * doc/fdl.texi: new file, copied from + http://www.gnu.org/licenses/fdl.texi. + * doc/Makefile.am (grep_TEXINFOS): new variable to get fdl.texi. + Also add usual GPL license statement. + + * doc/grep.texi (Index): Merge in Concept Index node, + to have only one index. Arrange @syncodeindex's accordingly. + +2008-12-10 Karl Berry + + * doc/grep.texi (@copying): use @copying; move @contents to + beginning; rearrange other frontmatter in the conventional ways. + +2008-06-15 Tony Abou-Assaleh + + * src/ansi2knr.[1c]: Remove generated files (installed by + automake). Thanks to Emanuele Giaquinta for this. + +2008-02-14 Tony Abou-Assaleh + + * src/grep.c: Factor out copyright year in --version. Thanks to + Karl Berry for this. + * src/grep.c: Update copyright years + + * po/POTFILES.in: +src/system.h +lib/closeout.c +lib/regex.c + +lib/xmalloc.c -lib/getopt1.c + +2008-02-09 Tony Abou-Assaleh + + * src/dfa.c: Replace a MALLOC and for loop with a CALLOC. Thanks to + Johan Walles for this. Patch #6288 + + * README-alpha: more info about CVS code + * README: pointer to README-alpha + + * src/grep.c: Update grep copyright year + +2008-02-08 Reuben Thomas (tiny change) + + * .cvsignore: add configure.ac + * src/.cvsignore: add .deps + +2008-02-06 Tony Abou-Assaleh + + * tests/foad1.sh: Comment out cases that are known to fail. These + should be uncommented after the 2.5.4 release. + * tests/yesno.sh: Likewise. + * doc/grep.1: Update description of -e PATTERN; from Benno Schulenberg + * doc/grep.texi: Likewise. + +2007-11-19 Tony Abou-Assaleh + + * m4/Makefile.am: Remove reference strerror_r.m4 + +2007-11-16 Tony Abou-Assaleh + + * po/sk.po: updated from the translation project + +2007-11-03 Tony Abou-Assaleh + + * po/*.po: get latest translations + * po/no.po: removed + * po/ky.po: added + * po/sk.po: added + +2007-10-10 Tony Abou-Assaleh + + * configure.ac.in: update version to 2.6-dev + + * src/grep.c: update --version message + +2007-10-07 Tony Abou-Assaleh + + * src/grep.c: When -h and -H are combined, use the last specified, + Bug #15620, Patch #4866 + * tests/foad1.sh: add tests for -h and -H + + * ChangeLog: Add a copyright notice (years taken from commit logs), + add a license notice (taken from gnulib ChangeLog) + + * TODO: update the link to a list of other grep implementations + +2007-06-29 Bernhard Rosenkraenzer + + * all files: GPLv3 + * configure.ac.in: Change version number + +2006-11-25 Bernhard Rosenkraenzer + + * configure.ac.in: Update version number for post-2.5.2 development + +2006-11-25 Bernhard Rosenkraenzer + + * configure.ac.in, grep.spec: Update version number + + * Makefile.cvs: Update to work with current autoconf scripts + + * po/Makefile.in.in: Adjust to work with automake 1.1x + +2006-08-19 Bernhard Rosenkraenzer + + * po/*: Sync with translation project + + * doc/*: Assorted documentation updates, Patch #4610 + + * autogen.sh, configure.in, configure.ac.in: Autogenerate + ALL_LINGUAS variable + + * m4/strerror_r.m4, configure.ac.in: Fix detection of strerror_r + + * lib/error.c: Remove bogus warning + + * lib/savedir.c, lib/savedir.h, src/grep.c, doc/*: + Add --exclude-dir option (patch #5051) + +2005-11-18 Charles Levert + + * tests/foad1.sh: Use ": ${VERBOSE=}" so that the caller can + set it without modifying the script; the usual caller (Makefile) + still leaves it untouched (usually unset, so it's off by default). + Modify "-m1 -A99 '^...$'" tests that failed so that their + expectation now corresponds to the output currently produced + by grep. Those tests used to expect that two selected (or + selectable) lines be output, even with -m1. Nothing was + modified with other similar tests that output _context_ lines + after one selected line has been output with -m1; they used to + and still succeed. Although tests/yesno.sh now provides a more + comprehensive framework for testing -m/-C feature interaction, + it doesn't exercise mixing them with anchors so the whole + relevant tests/foad1.sh test group is kept, notably to check + that grep doesn't crash when it is run. + +2005-11-17 Charles Levert + + On 2005-06-21, many changes were made that affected --color, + --only-matching, and --invert-match. Some of them introduced a + misunderstanding between the concepts of matched/non-matched and + selected/rejected lines. Furthermore, a few bugs with -v sneaked + in stemming from this. This set of changes aims to rectify most + of this situation. Some GREP_COLORS capabilities are also added + as a result of the clarification. (Further issues with -v/-o/-C + feature interaction still remain to be sorted out.) + + * src/grep.c: Rename/add global variables, macros, and capabilities: + SEP_CHAR_MATCH --> SEP_CHAR_SELECTED + SEP_CHAR_CONTEXT --> SEP_CHAR_REJECTED + SEP_STR_CHUNK --> SEP_STR_GROUP + grep_color --> selected_match_color + context_match_color + mlines_color --> selected_line_color + context_color --> context_line_color + "ml" --> "sl" + "mt" --> "mt" = "ms" + "mc" + --> "rv" (reverse "sl"/"cx" when -v) + * src/grep.c (color_cap_mt_fct, color_cap_rv_fct): New functions. + * src/grep.c (print_line_tail): Renamed color argument to line_color. + * src/grep.c (print_line_middle, prline): Revert part of the logic to + a pre-2005-06-21 one so that lines with matches have their matched + parts properly handled again ("m?" colors or --only-matching), + whether or not -v is specified. Whole line colors ("sl", "cx") + follow a selected / rejected(context) logic, as opposed to a + matched / non-matched one (unless "rv"). Matched text colors ("ms", + "mc") always follow a selected / rejected(context) logic, + regardless of "rv", because only matched lines use them anyway. + pr_line_middle() now takes additional line_color and match_color + arguments computed by prline() prior to calling that function. + The old logic was a buggy hybrid matched / rejected(context) one. + * src/grep.c (prpending, prtext, grepfile): Renamed macro invocations. + * src/grep.c (parse_grep_colors): Update top comment. + * src/grep.c (main): GREP_COLOR (singular) now sets both + selected_match_color and context_match_color. + +2005-11-16 Charles Levert + + * src/search.c (Pcompile): Clarify message for the -P option + not being supported so that users don't assume it's a run-time + problem, but know that it's a compile-time configuration choice. + Based on an idea by: Benno Schulenberg . + +2005-11-13 Charles Levert + + * tests/yesno.sh: New file. Test feature interaction + of -C, -v, -o, and -m. This reveals bugs, including some I + introduced on 2005-06-21, but also others. + * tests/Makefile.am (TESTS): Add yesno.sh. + * tests/Makefile.am (CLEANFILES): Add cspatfile and csinput, as + created by fmbtest.sh. Add yesno.txt, as created by yesno.sh. + +2005-11-11 Charles Levert + + * configure.in (ALL_LINGUAS): Add languages that were missing + from this variable (bg, ca, da, nb, tr), but that GNU grep supports + with a po/xx.po file. Reported by Tony Abou-Assaleh . + + * src/search.c (Pcompile): Abort in error if -P and multiple patterns + are specified, with an error message explaining the situation. + Fixing this won't be simple; the '\n' characters separating the + patterns cannot just be replaced by '|' to create an alternation as + back-references are assumed to be local to each individual pattern. + + * src/grep.c (parse_grep_colors, main): Replace all uses of + fprintf(stderr, _("%s: foo\n"), program_name, ...) with + error(0, 0, _("foo"), ...) for uniformization and simplification + of warning messages that will be up for localization. (My bad.) + +2005-11-10 Charles Levert + + The introduction of the --only-matching and --color GNU extensions + to grep added the requirement that each execute() implementation + not only be able to identify matching lines as a whole, but also + individual "exact" matches within a line known to be matching, + from leftmost to rightmost match, when the output from matching + lines is actually produced. The interface and implementations + of execute() were not up to it. This set of changes aims to + rectify that situation. Previously failing tests relative to + left anchors (^ and \<) and -w should now pass. This fixes + , + , + , + and possibly part of other, bigger, pending patches. The problem + was also compounded by the POSIX requirement to support a pattern + list instead of just an individual pattern (for -G and -E as well). + + * tests/foad1.sh: Test for increasing/decreasing-length word + matches, given pattern order, and leftmost/longest match. + * tests/fmbtest.sh: Modify test #6 according to new expectations. + Better document what tests #6 and #7 are actually for. Eliminate + test #5 in favor of bringing tests #6 and #7 within the F G E loop. + * src/grep.h (EXECUTE_ARGS): Change last argument from "int exact" + to "char const *start_ptr". Testing for "start_ptr" being non-NULL + retains the same semantics as testing for "exact" being non-zero. + * src/grep.c (print_line_middle): Call execute() with whole + buffer to work on, but using current position as start_ptr. + * src/grep.c (prpending, grepbuf): Call execute() with NULL + as start_ptr. + * src/search.c (EGexecute, Fexecute, Pexecute): When start_ptr is + non-NULL, return first match from it as an offset relative to buf. + * src/search.c (EGexecute): Consider all patterns if many and, + for an exact match, return the best one (leftmost, then longest). + Don't explore worst solutions, of course (branch and bound). + +2005-11-10 Charles Levert + + * src/grep.c (main): Fix a subtle memory allocation bug introduced + with the mb_icase_keys() function, which can call xrealloc() or + free() on keys, by making sure keys is always dynamically allocated. + +2005-11-09 Charles Levert + + * doc/grep.1, doc/grep.texi: Advise users to test for + "exit_status > 1" instead of "exit_status == 2" in order to + detect errors, for portability with other POSIX-compliant + implementations. + +2005-11-09 Charles Levert + + The following set of changes aims to make "egrep" and "fgrep" + minimal executable programs for legacy applications, instead of + shell scripts. This "fgrep" is much smaller than "grep". + This set of changes appears more daunting than it really is. + + * src/egrep.c, src/fgrep.c, src/esearch.c, src/fsearch.c: New files + that #define either EGREP_PROGRAM or FGREP_PROGRAM and #include + the corresponding generic (i.e., non e or f specific) *.c file. + * src/grepmat.c: Remove whole file. + * src/Makefile.am: Remove no-dependencies from AUTOMAKE_OPTIONS. + Add definitions to make "egrep" and "fgrep" specific standalone + executable programs that only use the source files they need. + Remove rules for "egrep" and "fgrep" shell scripts. + * src/grep.h: #define GREP_PROGRAM if both EGREP_PROGRAM and + FGREP_PROGRAM are #undef. Only declare matchers[] in this case + along with the compile_fp_t and execute_fp_t function pointers + typedefs, otherwise declare prototypes for straight compile() + and execute() functions for the specialized "egrep" and "fgrep" + programs. Remove the extern declaration for matcher. + Define COMPILE_RET, COMPILE_ARGS, EXECUTE_RET, EXECUTE_ARGS, + COMPILE_FCT, and EXECUTE_FCT helper preprocessor macros. + * src/grep.c (short_options, long_options, usage, main): Only + support -G, -E, -F, -P, and -X for GREP_PROGRAM, but not for + EGREP_PROGRAM or FGREP_PROGRAM. Customize usage messages. + * src/grep.c (set_limits): New function with unchanged code, + called from main(), because it shouldn't be in install_matcher() + since it was already matcher-independent. + * src/grep.c (matcher): Add as static, only for GREP_PROGRAM. + * src/grep.c (setmatcher, install_matcher): Only for GREP_PROGRAM. + * src/grep.c (main): Remove any tweaking and dependence on argv[0]. + * src/grep.c (print_line_middle, prpending, grepbuf, main): Call + compile() and execute() directly, not through a function + pointer dereferencing notation, so that it works with both + straight functions (in EGREP_PROGRAM and FGREP_PROGRAM) and + function pointers (in GREP_PROGRAM). + * src/search.c (, "dfa.h", dfa, pattern0, patterns, + pcount, dfaerror, kwset_exact_matches, kwsmusts): Only + include/declare/define if not FGREP_PROGRAM. + * src/search.c: Remove function prototypes for all functions + that are not used before their definition, since this is just + a hassle now with their varying names and conditional definition. + * src/search.c (GEAcompile): Rename from Ecompile(). Add new + syntax_bits argument/variable. Use as compile() for EGREP_PROGRAM. + Put in the needed RE_ICASE fix, albeit commented-out for now. + Make sure to free() modified word/line pattern after use, if any. + * src/search.c (Gcompile): Merge with GEAcompile() then remove. + * src/search.c (Gcompile, Acompile, Ecompile): New small functions + that call GEAcompile(), now that matcher is not an extern variable. + * src/search.c (GEAcompile, Gcompile, Acompile, Ecompile, + Fcompile, Pcompile, EGexecute, Fexecute, Pexecute, matchers): + Only define when needed according to *GREP_PROGRAM, and rename + to just compile() and execute() when appropriate. + * grep/bootstrap/Makefile.try: Similar changes. + +2005-11-08 Charles Levert + + * README.DOS, TODO, grep.spec, doc/grep.1, doc/grep.texi, + src/grep.h, po/da.po, po/nb.po, po/no.po, po/sv.po: + Replace all capitalized "Grep" by a lowercase "grep", except + in citations. Reported by Benno Schulenberg + from the + entry in the Debian bug tracker. + * doc/grep.1, doc/grep.texi: Explain that the "egrep" and "fgrep" + commands are deprecated and provided for historical applications. + Replace some "egrep" uses by "grep -E" to promote the newer usage. + Typeset "zgrep" as a command. Fix some spacing and punctuation bugs. + +2005-11-08 Julian Foad + + * doc/grep.texi: Rewrite a poorly written usage example about + back-references, and tweak another. New text by Benno Schulenberg. + +2005-11-04 Charles Levert + + * src/grep.c (mb_icase_keys): New function to properly lowercase + keys if match_icase. The problem was that some multi-octet + characters can get longer or shorter upon this conversion, so that + it cannot just naively be done in place on the same memory buffer. + * src/grep.c (main): Call mb_icase_keys (and remove in-line code). + + * tests/foad1.sh: Duplicate three "-o -b" tests for the "-F" + mode because it relies on a different code path that deserves + the same kind of testing. + +2005-09-27 Stepan Kasal + + * doc/grep.1: Fix a typo. + +2005-08-24 Charles Levert + + * src/grep.c (print_line_middle): In case of an empty match, + make minimal progress and continue instead of aborting process + of the remainder of the line, in case there's still an upcoming + non-empty match. + * tests/foad1.sh: Add two tests for this. + * doc/grep.texi, doc/grep.1: Document this behavior, since + --only-matching and --color are GNU extensions which are + otherwise unspecified by POSIX or other standards. + +2005-07-26 Charles Levert + + * tests/pcre.sh: New file. Add test 1. + * tests/Makefile.am: Add pcre.sh to TESTS. + +2005-07-07 Charles Levert + + * src/grep.c: Remove all xm capability code. + +2005-07-05 Charles Levert + + * doc/grep.texi: Add missing green color in GREP_COLORS description. + * doc/grep.1: Fix typo and reorganize GREP_COLORS documentation. + + * src/kwset.c (DEPTH_SIZE): New macro to anticipate + architectures/compilers where CHAR_BIT is not 8 (we assume it + won't be less than 4, which would be non-standard and unlikely). + Checked to hold for CHAR_BIT up to 1023 (and maybe more)! + * src/kwset.c (kwsincr): Use DEPTH_SIZE in two array declarations. + + * src/kwset.c (kwsincr): When a second obstack_alloc() call fails, + free what the first one successfully allocated by popping it + off the top of the obstack, before returning in error, just + to keep things clean. + * src/kwset.c (kwsprep): Verify return value of obstack_alloc() + and return a memory exhausted error if so. This function had + a prototype to return such errors, but never did. + +2005-07-04 Charles Levert + + * src/kwset.c: Readability changes. + Replace uses of 0 for pointer values by NULL. + Generalize use of existing U() macro to whole file. + + * src/kwset.c (kwsprep): Use memset() and memcpy() when appropriate. + + * src/kwset.c (kwsprep): Move three variable declarations to + the single {}-block where they are used. + + * src/kwset.c (kwsprep): Optimize search for mind2 value by + starting from the end of the target[] array. + +2005-06-22 Charles Levert + + * grep/autogen.sh, grep/src/Makefile.am, grep/tests/backref.sh, + grep/tests/bre.sh, grep/tests/empty.sh, grep/tests/ere.sh, + grep/tests/file.sh, grep/tests/fmbtest.sh, grep/tests/foad1.sh, + grep/tests/khadafy.sh, grep/tests/options.sh, + grep/tests/spencer1.sh, grep/tests/spencer2.sh, + grep/tests/status.sh, grep/tests/warning.sh: As per autoconf's + "Portable Shell Programming" guidelines, replace all instances + of "#!/bin/sh" by "#! /bin/sh" (notice the space). + +2005-06-21 Charles Levert + + * src/grep.c (nlscan): Make this function more robust by removing + the undocumented assumption that its "lim" argument points + right after a line boundary. This will be used later to fix + --byte-offset's broken behavior. Patch #3769. + + * src/grep.c (main): Add a test to check if -o/--only-matching + and context lines are both specified and if so, set both context + specifications (before and after) to zero then print an explicit + warning to stderr explaining what was done and why (as opposed + to drastically aborting the process in error). Patch #3768. + Other code needs this zero setting to work correctly without + having to repeatedly test for this conflictual condition. + + * tests/foad1.sh: Add tests combining -o, -n/-b/-H, and -i, + since there are separate code paths for -i. Add tests combining + -o, -n/-b/-H, and -3, since any context line specification + should be ignored when combined with -o. + * src/grep.c (print_line_head): New function, culled off the + top content of prline(). Adds a guard against "lastnl" having + already reached "lim", which can happen when if the function + is called more than once per line. + * src/grep.c (prline): Now calls print_line_head(), not only at + the beginning to replace the moved code when -o is not + specified, but also for each match when -o is specified (two + code paths with this). Patch #3770, more or less. This makes + all tests combining -o and -n/-b/-H pass, which they didn't + before. Fixes bug #12727. + + * src/grep.c (SEP_CHAR_MATCH, SEP_CHAR_CONTEXT, SEP_STR_CHUNK): + New macros for ':', '-', and "--". Used throughout the file. + Will be used even more in upcoming updates, so good to have now. + + * src/grep.c: The new GREP_COLORS (plural) framework, only + partially used at this point to make for a simpler initial + patch in CVS. A subset of patch #3644 on Savannah. + * src/grep.c (color_cap_ne_fct, color_cap_xm_fct, print_filename, + print_sep, parse_grep_colors): New functions. + * src/grep.c (prtext, grepfile, main): Existing functions modified + to use the new framework. + * doc/grep.texi, doc/grep.1: Document GREP_COLORS. + + * src/grep.c: The new -T/--initial-tab framework, only + partially used at this point to make for a simpler initial + patch in CVS. A subset of patch #3644 on Savannah. + The option name/calling convention is the same as for GNU diff. + * doc/grep.texi, doc/grep.1: Document -T/--initial-tab. + + * src/grep.c (print_offset): Renamed print_offset_sep() to better + represent its new functionality; new calling convention. + * src/grep.c (print_offset, print_line_head): Use and implement + missing parts of the GREP_COLORS and -T/--initial-tab frameworks. + + * src/grep.c (print_line_middle, print_line_tail): New functions, + unused for now, intended to allow a simplifying rewrite of + prline(). Adding them first will make for cleaner CVS patches. + + * src/grep.c (prline): Simplifying rewrite using + print_line_middle() and print_line_tail(). No longer attempts + to find matches to colorize in context lines, thus avoiding + costly calls to (*execute)(), since we know by then that they + can't contain any by definition. There are no longer four + different code paths whether -o and -i are each specified + or not; they have been unified into one, which should help + avoid bugs similar to previous ones due to not updating all + code paths in a synchronized fashion. The -i code has been + explicitly marked since it doesn't belong there and should + be removed as soon as other -i code elsewhere is fixed. + The remaining GREP_COLORS functionality is implemented. + Savannah patch #3771 and patch #3644, heavily reworked. + + * src/grep.c (color_cap_ne_fct, color_cap_xm_fct, + print_line_middle, print_line_tail): Make these four functions + static. + +2005-06-20 Charles Levert + + * src/grep.c: Extensively document the SGR/EL-to-Right issue. + + * src/grep.c: Explain the context and logic for choosing default + --color screen attributes (SGR parameters). + +2005-06-15 Charles Levert + + * tests/foad1.sh: Since this script is run by /bin/sh, it + must work under posix mode. That means not using assignment + statements right before a function call (LC_ALL=... grep_test, + in this case), because it won't do the expected thing. + +2005-06-14 Charles Levert + + Fix bug #11022 (Line wrapping causes GREP_COLOR background + color to "smear") by outputting a "clear to end of line" + control sequence after each SGR (Select Graphic Rendition) + control sequence (START and END). This also avoid similar + problems with HT (tab) characters. + + * src/grep.c (SGR_START, SGR_END, PR_SGR_FMT, PR_SGR_FMT_IF, + PR_SGR_START, PR_SGR_END, PR_SGR_START_IF, PR_SGR_END_IF): + New macros. + * src/grep.c (prline): Use the new macros. + * tests/fmbtest.sh, tests/foad1.sh: Adjust the regression tests + to expect the new control sequences. + +2005-05-06 Charles Levert + + * TODO: Add a few more projects and derived versions to check out. + +2005-05-05 Charles Levert + + * README-alpha: Document grep-commit mailing list. + * TODO: Add various stuff culled from the mailing list. + +2005-05-02 Charles Levert + + * 78 files: Update FSF's civic address, zip code, + and citizen relocation code. + +2005-04-29 Charles Levert + + * tests/foad1.sh: Add -b and tricky UTF-8 tests. + Display LC_ALL when its value is special. Patch #3962. + + * ABOUT-NLS: Sync with CVS revision 1.9 + of 2005-04-13T11:21:55Z from GNU gettext + on ":pserver:anoncvs@sources.redhat.com:/cvs/gettext", + file "gettext/gettext-runtime/ABOUT-NLS". + +2005-04-29 Julian Foad + + * Makefile.am: Remove reference to long-gone files PATCHES.AC and + PATCHES.AM. Thanks to Tony Abou-Assaleh for this. Patch #3961. + +2005-04-29 Charles Levert + + * src/grep.c: Fix typo in prline()'s --only-matching --ignore-case + code path; this fixes bug #9768 and passes one more test + in tests/foad1.sh. This whole code path should be removed in + the future, when other --ignore-case issues are dealt with. + +2005-04-28 Julian Foad + + * tests/foad1.sh: Remove Bash-specific syntax. + + * src/dfa.c: Fix a DFA bug whereby a bracket "[" was matched by the + pattern "[[:alpha:]]" in UTF-8 locales. Patch #3800, by Tim Waugh. + * tests/foad1.sh: Add a regression test for that. + +2005-04-27 Julian Foad + + Fix a bug reported by Elliott Hughes in patch #1834 whereby "grep -Fw" + would miss matches after a non-word occurrence of the pattern. Fix by + Gordon Lack; tests based on reproduction recipes by Gordon Lack. + + * src/search.c (Fexecute): Fix the "match_words" case. + * tests/foad1.sh: Modify the test framework so that the "PATTERN" + argument is optional. Add a regression test and a test for + a similar case that other proposed patches have got wrong. + + Add more tests, some initially failing. + + * tests/foad1.sh: Add tests for "--color", most initially failing. + * tests/fmbtest.sh: New file of tests for "grep -i" with multi-byte + chars, by Jakub Jelinek, from patch #3808: Red Hat's "tests" patch. + Initially, test #4 fails (in all three modes). + * tests/Makefile.am: Include the new tests file "fmbtest.sh". + +2005-04-12 Julian Foad + + * tests/bre.tests: Enable a regression test for bug #9519. + * src/grep.c: Fix a seg-fault in "-o -i": patch #1939. + * tests/foad1.sh: New tests for "-o", initially all failing. + * tests/Makefile.am: Include the new tests file "foad1.sh". + * tests/spencer2.sh: Be consistent with "spencer1.sh" in the + naming of associated files. + * src/grep.c: Fix off-by-one error in prpending(). + Patch #3840 by Claudio Fontana. + * tests/foad1.sh: Add tests by Pavol Gono for patch #3840. + Some of them still fail, but no longer seg-fault due to that bug. + +2005-04-11 Julian Foad + + * doc/grep.texi, doc/grep.1: Document USG grep -s too. + Based on a patch by Paul Eggert; suggested by Keith Marshall. + * src/dfa.c (lex): Fix bug #9519: "echo do^re | grep do^re" was + failing to find a match. + +2005-03-09 Stepan Kasal + + * src/search.c (EGexecute, Fexecute): Use xmalloc, not malloc. + (EGexecute): Handle the failure in one place, goto there. + +2005-02-26 Stepan Kasal + + * src/grep.c (get_nondigit_option): Don't give up too early. + * src/search.c (Pexecute): Add a comment explaining that this + situation should not happen. + +2005-02-22 Claudio Fontana (tiny change) + + * src/search.c (Pexecute): Consider eof case when delimiting + matching line. Fixes bug #4531. + +2005-02-23 Julian Foad + + * po/ko.po: Fix email address. + * README-alpha: Fix email addresses and clarify the notes. + * tests/backref.sh: Fix trivial typos. + +2005-02-08 Bruno Haible (tiny change) + + * src/kwset.h (kwsincr, kwsprep): Change return type to 'const char *'. + * src/kwset.c (kwsincr, kwsprep): Likewise. + +2005-02-08 Arnold D. Robbins + Stepan Kasal + + * src/mbsupport.h: Don't say the file is part of GAWK. + Make wording in explanatory comment more generic. + +2005-02-07 Stepan Kasal + + * src/grep.c: Document that -X is undocumented. + +2005-01-16 Bruno Haible (tiny change) + Stepan Kasal + + * configure.in: Add tests for iswctype, mbrlen, wcrtomb, wcscoll; + use AC_FUNC_MBRTOWC to check for mbrtowc and mbstate_t; move + AC_MBSTATE_T below it. + * src/grep.c: Include mbsupport.h to define MBS_SUPPORT uniformly. + * src/mbsupport.h: Don't test for HAVE_WCTYPE_T. + +2005-01-13 Arnold D. Robbins + + * src/dfa.c (dfaparse): Use LC_COLLATE whenever it is defined; + ENABLE_NLS has nothing to do with this. + +2005-01-07 Stepan Kasal + + * tests/status.sh: Added two tests--option '-s' should have no + influence on the exit status. + +2004-12-16 Stepan Kasal + + Cosmetic changes, mostly imported from gawk: + + * src/dfa.c (lexstart): Removed unused variable. + (parse_bracket_exp_mb): Don't initialize different pointers in one + assignment + (lex): Don't initialize automatic arrays, it's invalid in pre-C89 + compilers. + Various other typos. + * src/dfa.h, src/grep.c, src/search.c: Typos. + +2004-12-16 Isamu Hasegawa + + From http://oss.software.ibm.com/linux/patches/?patch_id=25 + + * src/search.c: Patch for i18n correctness. + * src/grep.c: Likewise. + * src/dfa.c: Likewise. + * lib/regex.c: Likewise. + +2004-12-15 Julian Foad + + Changes to documentation and help text, mostly from Stepan Kasal. + + * doc/grep.texi: Minor fixes of phrasing. + * doc/grep.1: Likewise. + * src/grep.c: Likewise. + +2004-12-01 Stepan Kasal + + * src/grep.c (usage): Use "FILE_PATTERN" for --include and --exclude, + change "only print" to "print only". + * doc/grep.1: Likewise; state that wildcard matching is used. + Move some options so that they are sorted alphabetically. + * dfa.c, NEWS: Fix typos. + +2004-11-28 Benno Schulenberg (tiny change) + + * src/grep.c (usage): Clean up several details in the usage string. + * doc/grep.1: Fix descriptions of --include and --exclude. + * doc/grep.texi: Likewise. + +2004-11-23 Stepan Kasal + + * src/Makefile.am: The egrep and fgrep script now use their own + path to construct the full pathname of grep. + +2004-11-23 Stepan Kasal + + * src/Makefile.am: Merged the rules for creating the egrep and + fgrep script. + +2004-11-23 Stepan Kasal + + * src/grep.c (usage): Make sure both copies of the "usage" + strings match. Add "(C)" to the copyright notice. + * src/dfa.c: Changed "out of memory" to "memory exhausted" to + match messages elsewhere in the source. + +2004-11-22 Stepan Kasal + + * src/search.c: Use mbsupport.h . + * src/dfa.c: Move the inclusion of mbsupport.h lower. + +2004-11-22 Stepan Kasal + + * src/grep.c (main): Use PACKAGE_STRING for --version. + +2004-11-20 Benno Schulenberg (tiny change) + + * src/grep.c (reset): Move the stat check ... + (grepfile): ... here, and also check for a fifo. + +2004-11-20 Stepan Kasal + + This change is based on a suggestion by Elliott Hughes. + + * src/grep.c (usage): Use PACKAGE_BUGREPORT. + * po/*.po: Hacked the current translation again. + +2004-11-20 Stepan Kasal + + * configure.in: Added a copyright notice (using gawk as a template). + (AC_INIT, AM_INIT_AUTOMAKE): Changed to the "new" form so that + the PACKAGE_* symbols get defined correctly in config.h. + +2004-11-20 Stepan Kasal + + * ./cvsignore: Amended several .cvsignore files and + removed *.gmo, acinclude.m4 and stamp-h.in from the root one. + * m4/init.m4: Nuked, it was breaking current automake. + * m4/Makefile.m4: Removed init.m4. + * autogen.m4: Drop support for legacy autoconf; tell whether the + auto tools exited successfully or not; fix the permissions of + tests/*.sh--CVS doesn't provide a way to fix it. + +2004-11-19 Stepan Kasal + + * src/dfa.c: Removed old version of gofast patch, from 2003-05-30. + * src/search.c (check_multibyte_string): Likewise. + +2004-11-19 Stepan Kasal + + * src/dfa.c: Added some simple changes from gawk. + * src/mbsupport.h: Imported from gawk. + +2004-11-11 Stepan Kasal + + * tests/spencer1.awk: Use only lines with 3 fields. + * tests/spencer1.tests: Disable #55 for now. + * tests/ere.tests, tests/bre.tests: Add "TO CORRECT" to disabled + tests which had empty $4. + * tests/backref.sh: Modify #2 so that current glibc regex can + handle it in finite time. + +2004-11-12 Stepan Kasal + + Change bug-gnu-utils address to bug-grep, on many places; there + is no need to have the word "grep" in subject then. + Thanks to Tony Abou-Assaleh and Benno Schulenberg for pointing + out this. + +2004-11-02 Stepan Kasal + + * README-alpha: Remove obsolete instructions about CVS, redirect + the reader to savannah web. + +2004-09-26 Stepan Kasal + + * src/search.c (check_multibyte_string, Gcompile, Ecompile): Replace + malloc with xmalloc. + * src/dfa.c (dfamust): Replace two calls to 'malloc' by MALLOC. + +2003-07-23 Stepan Kasal + + * src/Makefile.am: Add the egrep and fgrep scripts to CLEANFILES. + +2003-07-23 Stepan Kasal + * tests/backref.sh: Messages fixed. + +2003-07-08 David Kaelbling (tiny change) + * src/dfa.c: remove non-constant initializers from dfa.c + +2003-06-16 Stepan Kasal + * doc/grep.1: two typos "--line-buffered [...] penalty" + * doc/grep.texi: a typo + +2003-06-12 Bernhard Rosenkraenzer + * README-alpha: Mention bug tracking system and grep-devel-list + * tests/spencer1.tests: Fix test 55, as noted by Tim Waugh + * src/search.c: Speed up multibyte support (Patch from Tim Waugh) + +2003-06-05 Stepan Kasal + * tests/formatbre.awk, tests/formatere.awk: probably unused, so + I've removed them. + +2003-06-05 Stepan Kasal + * intl/Makefile: remove generated file. + +2003-06-04 Stepan Kasal + * src/dfa.c: typos fixed. + +2003-05-30 Bernhard Rosenkraenzer + * src/dfa.c: Speed up multibyte support (Patch from Tim Waugh) + +2003-01-18 Bernhard Rosenkraenzer + * src/grep.c: Fix -i -o combination (Patch from Tim Waugh) + +2002-03-26 Bernhard Rosenkraenzer + + * 2.5.1 Release. + +2002-03-26 Bernhard Rosenkraenzer + * src/grep.c: Don't fail if we don't have an stdout fd and -q + is used (happens e.g. on calls from hotplug scripts) + * src/grep.c: Don't hang forever if fed with an empty string to + grep for and --color enabled + * src/grep.c: Fix infinite loop on + echo "1 one" | grep -E "[0-9]*" -o + echo "1 one" | grep -E "[0-9]*" --color + * po/*: Sync with translation project + * src/grep.c, src/Makefile.am, configure.in: Add patch from + Paul Eggert to comply with ridiculous + guidelines (don't act differently if invoked as egrep or fgrep) + * configure.in: Bump version number, require a recent autoconf + +2002-03-14 Bernhard Rosenkraenzer + * src/Makefile.am, po/Makefile.in.in: Support DESTDIR properly + * tests/bre.tests: Add fix from + Peter Breitenlohner + +2002-03-13 Bernhard Rosenkraenzer + * configure.in, m4/regex.m4, m4/malloc.m4, m4/realloc.m4: + Don't set LIBOBJS directly, autoconf 2.53 doesn't like it + * intl/*: Sync with gettext 0.11 + * po/*: Sync with translation project + * configure.in, src/Makefile.am: Don't duplicate code - make + egrep and fgrep links to grep and set matcher based on + application name, suggestion from + Guillaume Cottenceau + * src/grep.c: (prline) Add fix for -i --color from + Jim Meyering + * configure.in: Version 2.5; release + +2002-01-23 Bernhard Rosenkraenzer + * configure.in: Version 2.5g + * Makefile.cvs, grep.spec: Add packaging tools + Merge djgpp changes from Andrew Cottrell : + * src/grep.c: Added conditional compilation for DJGPP + * djgpp: remove directory as it is no longer required with DJGPP 2.03 + (or 2.04 when released) + * README.DOS: Moved djgpp/readme to readme.dos + * PATCHES.AC, PATCHES.AM: delete files - redundant + * configure.in, Makefile.am: remove djgpp directory from list + +2002-01-22 Bernhard Rosenkraenzer + * doc/grep.texi, doc/grep.1, NEWS: Document --label + * po/ru.po: Sync with translation project + * po/grep.pot: Sync with source + +2002-01-18 Bernhard Rosenkraenzer + * src/grep.c: Add --label, based on patch from Stepan Koltsov + +2001-11-20 Bernhard Rosenkraenzer + * autogen.sh: Don't hardcode aclocal dir + +2001-11-19 Bernhard Rosenkraenzer + * src/grep.c: Add --only-matching (-o) switch (see NEWS) + * doc/grep.texi, doc/grep.1, NEWS: Document changes + * configure.in, lib/Makefile.am: Don't use internal getopt if + we're on a system that provides a working getopt function + +2001-09-25 Bernhard Rosenkraenzer + * configure.in: Detect pcre correctly even when it's in + non-standard locations, using pcre-config + * src/grep.c: Add --color={always,never,tty} argument (like in ls) + * src/grep.c: Turn off blinking in the default colorization + * src/grep.c: Add --devices (-D) switch (analogous to --directories) + * src/dfa.c: Fix an i18n bug: echo "A" | grep '[A-Z0-9]' wouldn't work + in non-C-Locales on systems using current versions of glibc. + * AUTHORS: Change maintainer, credit Alain for his work until now + * configure.in, m4/decl.m4, m4/dosfile.m4, m4/gettext.m4, + m4/init.m4, m4/install.m4, m4/largefile.m4, m4/lcmessage.m4, + m4/header.m4, m4/isc-posix.m4, m4/missing.m4, m4/progtest.m4, + m4/sanity.m4: + Fix build with autoconf 2.5x, retain 2.1x compatibility for now + * autogen.sh: Add some crude hacks to make it possible to build with + both autoconf 2.5x and 2.1x + * acconfig.h: removed (no longer required) + * Makefile.am: add cvs-clean target + * doc/grep.texi, doc/grep.1, NEWS: Document changes + (--color, --devices, -D) + * src/dfa.c, src/grep.c: Add vim modelines + +2001-08-30 Alain Magloire + + * configure.in: Add gl in ALL_LINGUAS. + +2001-08-30 Kurt D Schwehr + + * doc/grep.1: Warn that grep insert a "--" between groups of matches, + when using the context options. + * doc/grep.texi: Likewised. + +2001-08-25 Heikki Korpela + + * doc/grep.texi: Point out that some Platforms do not support + reading of directories and silently ignore them. + +2001-08-21 Alain Magloire + + * lib/malloc.c: New file: + * lib/realloc.c: New file: + * lib/Makefile.am: Add malloc.c and realloc.c in EXTRA_DIST. + +2001-07-31 Alain Magloire + + * po/*.po: New files from the translation team: + grep-2.5e.de.po grep-2.5e.el.po grep-2.5e.eo.po grep-2.5e.es.po + grep-2.5e.et.po grep-2.5e.fr.po grep-2.5e.gl.po grep-2.5e.it.po + grep-2.5e.pl.po grep-2.5e.sl.po + +2001-07-31 Andreas Schwab + + * src/grep.c: Fix all uses of error to pass a proper format + string. + +2001-07-29 Alain Magloire + + * grep/src/grep.c (usage): Typos corrected. + Patches from Santiago Vila. + +2001-07-29 Alain Magloire + + David Clissold, wrote: + a small bug in the GNU grep 2.4.2, which may have gone unnoticed + because it only causes a failure if building on a system with large + files enabled (e.g. an "off_t" is a "long long" rather than a "long"). + savedir() takes on off_t argument, but in grepdir() the parameter + is cast to an (unsigned). Well, if an off_t is larger than an int, + the value gets truncated. This would not normally have an effect on a + little-endian platform (unless the file is >2GB), but on a big-endian + system it will always fail. The external effect is that + "grep -r foo dir_name" fails with ENOMEM (from malloc() within + savedir()). + + * grep/src/grep.c (grepdir): Remove the (unsigned) cast when calling + savedir(). + Patch from David Clissold. + +2001-07-29 Alain Magloire + + * grep/doc/grep.texi: In Bugs report use {n,m} for consistency. + * grep/doc/grep.1: Likewised. + Noted by Steven Lucy. + +2001-04-27 Isamu Hasegawa + + * dfa.c (mblen_buf) : New variable contains the amount of remain + byte of corresponding multibyte character in the input string. + (SKIP_REMAIN_MB_IF_INITIAL_STATE) : Use mblen_buf. + (match_anychar) : Use mblen_buf. + (match_mb_charset) : Use mblen_buf. + (transit_state_consume_1char) : Use mblen_buf. + (transit_state) : Use inputwcs to get current (multibyte) character. + (dfaexec) : Add initialization of mblen_buf. + +2001-04-27 Isamu Hasegawa + + * dfa.c (addtok) : Set appropriate value to multibyte_prop. + (dfastate) : Add the initialization of the variable. + (dfaexec) : Call transit_state if d->fail may transit by + multibyte characters. + (transit_state_singlebyte) : Clean up unnecessary code. + (transit_state_consume_1char) : Likewise. + (transit_state) : Add checking for word and newline. + +2001-04-19 Isamu Hasegawa + + * search.c (check_multibyte_string) : Check the case when mbclen == 0. + +2001-04-11 Isamu Hasegawa + + * search.c (check_multibyte_string) : Check the head of multibyte + characters, and optimize a bit. + (EGexecute) : Optimize a bit. + (Fexecute) : Fix the index. + +2001-04-02 Alain Magloire + + * lib/regex.c: Update from GNU lib C, with the changes + provided by Paul Eggert. + * lib/posix/regex.h: Likewise. + +2001-02-17 Paul Eggert + + Stop trying to support hosts that have nonstandard declarations for + mbrtowc and/or mbstate_t. It's not worth the portability hassle. + + * lib/quotearg.c (mbrtowc, mbsinit): Remove workaround macros + for hosts that have mbrtowc but not mbstate_t, as we now + insist on proper declarations for both before using mbrtowc. + +2001-03-18 Alain Magloire + + * configure.in: Call AC_MBSTATE_T. + * Makefile.am: Add mbstate_t.m4 + * m4/Makefile.am: Add mbstate_t.m4 + * m4/mbstate_t.m4: New m4 macro. + * lib/strtol.c: Define CHAR_BITS. + Uwe H. Steinfeld, Ruslan Ermilov, Volkert Bochert, noted + that mbstate_t was not define for certain platforms. + +2001-03-18 Paul Eggert + + * src/grep.c (fillbuf): Fix storage allocation performance + bug: buffer was doubling in size in many cases where it didn't + have to. + +2001-03-17 Paul Eggert + + * src/grep.c (fillbuf): Avoid unnecessary division by 2. + Don't check xrealloc return value; it's guaranteed to be nonzero. + (fillbuf, grepdir): Use xalloc_die rather than error; it's shorter. + +2001-03-17 Alain Magloire + + * src/grep.c (context_length_arg): error () passing wrong format. + Spotted by Jim Meyering. + +2001-03-07 Alain Magloire + + * README-alpha: Removed reference to GNU tar, add the location + of the CVSROOT. + +2001-03-06 Alain Magloire + + Only the Regex patterns should be split in an array, patterns[]. + The dfa and KWset compiled patterns should remain global and the + patterns compiled all at once. + + * src/search.c: include "error.h" and "xalloc.h" to get prototyping + of x*alloc() and error(). + (kwsinit): Reverse to previous behaviour and takes no argument. + (kwsmusts): Likewised. + (Gcompile): For the regex pattern, split them and each pattern + is put in different compiled structure patterns[]. The patterns + are given to dfacomp() and kwsmusts() as is. + (Ecompile): Likewised. + (Fcompile): Reverse to the old behaviour of compiling the enire + patterns in one shot. + (EGexecute): If falling to GNU regex for the matching, loop in the + array of compile patterns[] to find a match. + (error): Many error () were call with arguments in the wrong order. + * tests/file.sh: Simple test to check for pattern in files. + + Reaction to bug report fired by Greg Louis + +2001-03-06 Isamu Hasegawa + + In multibyte environments, handle multibyte characters as single + characters in bracket expressions. + + * src/dfa.h (mb_char_classes) : new structure. + (mbcsets): new variable. + (nmbcsets): new variable. + (mbcsets_alloc) : new variable. + * src/dfa.c (prtok) : handle MBCSET. + (fetch_wc): new function to fetch a wide character. + (parse_bracket_exp_mb) : new function to handle multibyte character + in lex(). + (lex): invoke parse_bracket_exp_mb() for multibyte bracket expression. + (atom): handle MBCSET. + (epsclosure): likewise. + (dfaanalyze): likewise. + (dfastate): likewise. + (match_mb_charset): new function to judge whether a bracket match + with a multibyte character. + (check_matching_with_multibyte_ops) : handle MBCSET. + (dfainit): initialize new variables. + (dfafree): free new variables. + +2001-03-04 Alain Magloire + + To get more in sync with other GNU utilities like GNU tar and fetish + all the supporting functions are now under lib. + Thanks to Jim Meyering, Volkert Bochert and Paul Eggert for + the code and the reminders. + + * src/grep.c (fatal): Function removed, using error () from + lib/error.c instead. + (usage): Copyright updated. + (error): Function removed, using error () from lib/error.c instead, + adjust prototypes. + (prog): Global variable rename to program_name, to work with new + lib/error.c. + (xrealloc): Removed using lib/xmalloc.c. + (xmalloc): Removed using lib/xmalloc.c + (main): Register with atexit() to check for error on stdout. + * configure.in: Check for atexit(), call jm_MALLOC, jm_RELLOC and + jm_PREREQ_ERROR. + * tests/bre.awk: Removed the hack to drain the buffer since we + always fclose(stdout) atexit. + * tests/ere.awk: Likewise. + * tests/spencer1.awk: Likewise. + * bootstrap/Makefile.try: Update the Makefile to reflect the changes + in the new hierarchy. + + * README-alpha: New File. + * m4/realloc.m4: New File. + * m4/malloc.m4: New File. + * m4/error.m4: New File. + * m4/Makefile.am: Updated. + * lib: New directory. + * lib/Makefile.am: New file. + * lib/closeout.c: New file. + * lib/closeout.h: New file. + * lib/fnmatch.c: New file. + * lib/fnmatch.h: New file. + * lib/atexit.c: New file. + * lib/error.c: New file. + * lib/error.h: New file. + * lib/quotearg.h: New file. + * lib/quotearg.c: New file. + * lib/xmalloc.c: New file. + * lib/posix: New directory. + * lib/posix/Makefile.am: New file. + * src/getopt.c: Moved to lib. + * src/getopt1.c: Moved to lib. + * src/getopt.h: Moved to lib. + * src/alloca.c: Moved to lib. + * src/exclude.c: Moved to lib. + * src/exclude.h: Moved to lib. + * src/hard-locale.h: Moved to lib. + * src/hard-locale.c: Moved to lib. + * src/isdir.c: Moved to lib. + * src/mechr.c: Moved to lib. + * src/obstack.c: Moved to lib. + * src/obstack.h: Moved to lib. + * src/regex.c: Moved to lib. + * src/regex.h: Moved to lib. + * src/posix: Moved to lib. + * src/posix/regex.h: Moved to lib. + * src/savedir.h: Moved to lib. + * src/savedir.c: Moved to lib. + * src/stpcpy.c: Moved to lib. + * src/strtoul.c: Moved to lib. + * src/strtol.c: Moved to lib. + * src/strtoull.c: Moved to lib. + * src/strtoumax.c: Moved to lib. + * src/xstrtol.c: Moved to lib. + * src/xstrtol.h: Moved to lib. + * src/xstrtoumax.c: Moved to lib. + +2001-03-01 Isamu Hasegawa + + Implement the mechanism to match with multibyte characters, + and use it for 'period' in multibyte environments. + + * dfa.h (mbps): new variable. + * dfa.c (prtok): handle ANYCHAR. + (lex): use ANYCHAR for 'period' in multibyte environments. + (atom): handle ANYCHAR. + (state_index): initialize mbps in multibyte environments. + (epsclosure): handle ANYCHAR. + (dfaanalyze): handle ANYCHAR. + (dfastate): handle ANYCHAR. + (realloc_trans_if_necessary): new function. + (transit_state_singlebyte): new function. + (match_anychar): new function. + (check_matching_with_multibyte_ops): new function. + (transit_state_consume_1char): new function. + (transit_state): new function. + (dfaexec): invoke transit_state if expression can match with + a multibyte character in multibyte environments. + (dfamust): handle ANYCHAR. + +2001-03-01 Alain Magloire + + * src/exclude.c: New file. + * src/exclude.h: New file. + * src/grep.c (main): Took the GNU tar code to handle + the option --include, --exclude, --exclude-from. + Files are check for a match, with exlude_filename (). + New option --exclude-from. + * src/savedir.c: Call exclude_filename() to check for + file pattern exclusion or inclusion. + * configure.in: --disable-pcre rename to --disable-perl-regexp. + + +2001-02-25 Alain Magloire + + * src/dfa.c: Typo corrected. + Noted by Isamu Hasegawa. + * src/savedir.c: Typos corrected. + +2001-02-22 Alain Magloire + + * src/savedir.c (isdir1): New function, calling isdir with + the correct pathname. + +2001-02-19 Isamu Hasegawa + + Avoid incorrect state transition in multibyte environments. + + * dfa.h (nmultibyte_prop): new variable. + (multibyte_prop): new variable. + * dfa.c (addtok): set inputwcs. + (dfastate): avoid incorrect state transition in multibyte + environments. + (dfaexec): likewise. + (dfainit): init multibyte_prop. + (dfafree): free multibyte_prop. + (inputwcs): new variable. + +2001-02-19 Isamu Hasegawa + + Handle a multibyte character followed by '*', '+', and '{n,m}' + correctly. + + * dfa.c (update_mb_len_index): new function. + Support for multibyte string. + (FETCH): call update_mb_len_index. + (lex): check cur_mb_index not to misunderstand multibyte characters. + (atom): make a tree from a multibyte character. + (dfaparse): initialize new variables. + (mbs): new variable. + (cur_mb_len): new variable. + (cur_mb_index): new variable. + +2001-02-18 Jim Meyering + + * m4/dosfile.m4 (AC_DOSFILE): Move AC_DEFINEs out of AC_CACHE_CHECK. + +2001-02-17 Alain Malgoire + + * doc/grep.texi: Document the new options and the new behaviour + back-references are local. Use excerpt from Karl Berry regex + texinfo. + + * bootstrap/Makefile.try: Added xstrtoumax.o xstrtoul.o hard-local.o + +2001-02-17 Alain Magloire + + From Guglielmo 'bond' Bondioni : + The bug was that using a multi line file that contained REs (one per + line), backreferences in the REs were considered global (to the file) + and not local (to the line). + That is, \1 in line n refers to the first \(.\) in the whole file, + rather than in the line itself. + + From Tapani Tarvainen : + # Re: grep -e '\(a\)\1' -e '\(b\)\1' + That's not the way it should work: multiple -e arguments + should be treated as independent patterns and back references + should not refer to previous ones. + + From Paul Eggert : + GNU grep currently does not issue + diagnostics for the following two cases, both of which are erroneous: + grep -e '[' -e ']' + grep '[ + ]' + POSIX requires a diagnostic in both cases because '[' is not a valid + regular expression. + + To overcome those problems, grep no longer pass the concatenate + patterns to GNU regex but rather compile each patterns separately + and keep the result in an array. + + * src/search.c (patterns): New global variable; a structure array + holding the compiled patterns. + Declare function prototypes to minimize error. + (dfa, kswset, regexbuf, regs): Removed, no longer static globals, but + rather fields in patterns[] structure per motif. + (Fcompile): Alloc an entry in patterns[] to hold the regex. + (Ecompile): Alloc an entry per motif in the patterns[] array. + (Gcompile): Likewise. + (EGexecute): Loop through of array of patterns[] for a match. + +2001-02-17 Alain Magloire + + From Bernd Strieder : + # tail -f logfile | grep important | do_something_urgent + # tail -f logfile | grep important | do_something_taking_very_long + If grep does full buffering in these cases then the urgent operation + does not happen as it should in the first case, and in the second case + time is lost due to waiting for the buffer to be filled. + This is clearly spoken not grep's fault in the first place, but libc's. + There is a heuristic in libc that make a stream line-buffered only if a + terminal is on the other end. This doesn't take care of the cases where + this connection is somehow indirect. + + * src/grep.c (line_buffered): new option variable. + (prline): if line_buffered is set fflush() is call. + (usage): line_buffered new option. + Input from Paul Eggert, doing setvbuf() may not be portable + and breaks grep -z. + +2001-02-16 Alain Magloire + + Patch from Isamu Hasegawa, for multibyte support. + This patch prevent kwset_matcher from following problems. + For example, in SJIS encoding, one character has the codepoint 0x895c. + So the second byte of the character can match with '\' incorrectly. + And in eucJP encoding, there are the characters whose codepoints are + 0xa5b9, 0xa5c8. On the other hand, there is one character whose + codepoint is 0xb9a5. So 0xb9a5 can match with 2nd byte of 0xa5b9 + and 1st byte of 0xa5c8. + + * configure.in: Add check for mbrtowc. + * src/search.c (check_multibyte_string): new function. + Support for multibyte string. + (EGexecute): call check_multibyte_string when kwset is set. + (Fexecute): call to check_multibyte_string. + (MBS_SUPPORT): new macro. + (MB_CUR_MAX): new macro. + +2001-02-16 Alain Magloire + + * djgpp/config.bat: Fix for 4dos.com. + * m4/dosfile.m4 (HAVE_DOS_FILE_CONTENTS): Was not set. + Bugs noted and patched by Juan Manuel Guerrero. + +2001-02-16 Alain Magloire + + A much requested feature, the possibility to select + files when doing recurse : + # find . -name "*.c" | xargs grep main {} + # grep --include=*.c main . + # find . -not -name "*.c" | xargs grep main {} + # grep --exclude=*.c main . + + * src/grep.c (short_options): -R equivalent to -r. + (#ifdef) : Fix some inconsistencies in the use of #ifdefs, prefer + #if defined() wen possible. + (long_options): Add --color, --include and exclude. + (Usage): Description of new options. + (color): Rename color variable to color_option. + Removed 'always|never|auto' arguments, not necessary for grep. + (exclude_pattern): new variable, holder for the file pattern. + (include_pattern): new variable, hoder for the file pattern. + * src/savedir.c: Signature change, take two new argmuments. + * doc/grep.texi: Document, new options. + * doc/grep.man: Document, new options. + +2001-02-09 Alain Magloire + + * src/grep.c (long_options): Added equivalent to -r with -R. + * src/grep.c (usage): added --color and --colour. + Noted with patch from, H.Merijn Brand and Wichert Akkerman. + +2001-02-09 Alain Magloire + + Patch from Ulrich Drepper to provide hilighting. + + * src/grep.c: New option --color. + (color): New static var. + (COLOR_OPTION): new constant. + (grep_color): new static var. + (prline): Now when color is set prline() will call the current matcher + to find the offset of the matching string. + * src/savedir.c: Take advantage of _DIRENT_HAVE_TYPE if supported. + * src/search.c (EGexecute, Fexecute, Pexecute): Take a new argument + when doing exact match for the color hiligting. + +2000-09-01 Brian Youmans + + * doc/grep.texi: Typo fixes. + +2000-08-30 Paul Eggert + + * doc/grep.texi (Usage): Talk about what "grep -r hello *.c" + means. + +2000-08-20 Paul Eggert + + Handle range expressions correctly even when they match + strings with two or more characters. + + * src/dfa.h (CRANGE): New enum value. Comment fix. + + * src/dfa.c: Include if HAVE_SETLOCALE. + Include "hard-locale.h". + (prtok): Print CRANGE. + (hard_LC_COLLATE): New static var. + (lex): Return CRANGE when parsing a character range in a hard locale. + Don't use strcoll; it's no longer needed and wasn't correct anyway. + Use unsigned rather than token to hold unsigned chars. + (addtok): Comment fix. + (atom): Treat a CRANGE as if it were (.\1), approximately. + (dfaparse): Initialize hard_LC_COLLATE. + + * src/Makefile.am (base_sources): Add hard-locale.c, hard-locale.h. + + * src/hard-locale.c, src/hard-locale.h: New files, taken from + textutils. + +2000-08-20 Paul Eggert + + * tests/Makefile.am (TESTS_ENVIRONMENT): Add LC_ALL=C, since + some of the tests assume the C locale. + +2000-08-16 Paul Eggert + + * src/search.c (Gcompile, Ecompile): -x overrides -w, for + consistency with fgrep. Don't assume that sizes fit in 'int'. + Fix comments to match code. + +2000-06-06 Paul Eggert + + * src/grep.c (grepdir): Don't look at st_dev when testing for + Mingw32 bug. + +2000-06-05 Paul Eggert + + Port to Mingw32, based on suggestions from Christian Groessler + . + + * src/isdir.c: New file, taken from fileutils. + + * src/Makefile.am (base_sources): Add isdir.c. + + * src/grep.c (grepfile): Use isdir instead of doing it inline. + (grepdir): Suppress ancestor check if the directory's inode and device + are both zero, as that occurs only on Mingw32 which doesn't support + inode or device. + + * src/system.h (isdir): New decl. + (is_EISDIR): Depend on HAVE_DIR_EACCES_BUG, not D_OK. + Use isdir, not access. + +2000-06-02 Paul Eggert + + Problen noted by Gerald Stoller + + * src/grep.c (main): POSIX says that -q overrides -l, which + in turn overrides the other output options. Fix grep to + behave that way. + +2000-05-27 Paul Eggert + + Simplify and tune the buffer allocation strategy. Do not reserve a + large save area: reserve only enough bytes to hold the residue, plus + page alignment. Put a newline sentinel before the buffer, for speed + when searching backwards for newline. + + * src/grep.c (ubuffer, bufsalloc, PREFERRED_SAVE_FACTOR, page_alloc): + Remove. All uses changed. + (INITIAL_BUFSIZE): New macro. + (reset, fillbuf): Use simpler buffer allocation strategy. + (reset): Check for preposterously large pagesize that would cause + later calculations to overflow. + (fillbuf): Do not resize buffer if there's room at the end for + at least one more page. This greatly increases performance when + reading from non-regular files that contain no newlines. + When growing the buffer, double its size instead of using a + more complicated algorithm. + (prtext, grep): Speed up by relying on the newline sentinel before the + start of the buffer. + (grep): When looking backwards for the last newline in a buffer, + stop when we hit the residue, since it can't contain a newline. + This avoids an O(N**2) algorithm when reading binary data from + a pipe. Use a sentinel to speed up the backward search for newline. + (nlscan): Undo previous change; it wasn't needed and just complicates + and slows down the code a tad. + +2000-05-24 Paul Eggert + + Handle very large input counts better. Bug noted by Jim Meyering. + + * src/grep.c (totalcc, totalnl): Use uintmax_t, not off_t. + (add_count): New function. + (nlscan, prline, grep): Use it to check line and byte count overflows. + (nlscan, grep): Don't keep track of counts when not asked to; this + avoids unnecessary overflow diagnostics. + (print_offset_sep): Now takes args of type uintmax_t and char, + not off_t and int. + +2000-05-16 Paul Eggert + + Problem reported by Bob Proulx , this patch + is base on his finding, with appropriate corrections. + + * src/grep.c (main): Fix bug: -x and -w matched even when no + patterns were specified. + * tests/empty.sh: Test for -x and -w bug in grep 2.4.2. + +2000-04-24 Paul Eggert + + POSIX conformance fixes: grep -q now exits with status zero + if an input line is selected, even if an error also occurs. + grep -s no longer affects exit status. + + * src/grep.c (suppress_errors): Move definition earlier so + that suppressible_error can use it. + (suppressible_error): New function. + (exit_on_match): New var. + (grepbuf): If exit_on_match is nonzero, exit with status zero + immediately. + (grep, grepfile, grepdir): Invoke suppressible_error. + (main): -q sets exit_on_match. + + * doc/grep.1, doc/grep.texi, NEWS: + Document -q's behavior as required by POSIX. + + * tests/status.sh: + Test for -q and -s behavior as conforming to POSIX. + +2000-04-20 Paul Eggert + + * tests/Makefile.am (TESTS_ENVIRONMENT): + Set GREP_OPTIONS to the empty string. + +2000-04-20 Paul Eggert + + * tests/status.sh: Fix typo: test -b -> test -r. + +2000-04-20 Paul Eggert + + * src/dfa.c (lex): + Do not assume that [c] is equivalent to [c-c]; this isn't true + if LC_COLLATE specifies that some characters are equivalent. + (setbit_case_fold): New function. + (lex): Use it to simplify the code a bit. + +2000-04-17 Paul Eggert + + Do CRLF munging only if HAVE_DOS_FILE_CONTENTS, instead of + having it depend on O_BINARY (which leads to incorrect results + on BeOS, VMS, and MacOS). + + * bootstrap/Makefile.try (DEFS): Add -DHAVE_DOS_FILE_CONTENTS. + * src/system.h (SET_BINARY): Define only if HAVE_DOS_FILE_CONTENTS. + (O_BINARY): Do not define. + + * m4/dosfile.m4: Define HAVE_DOS_FILE_CONTENTS if it appears we're + using DOS. + + * src/grep.c (undossify_input, fillbuf, dosbuf.c, prline, main): + Depend on HAVE_DOS_FILE_CONTENTS, not O_BINARY, when handling CRLF + matters. + (grepfile, main): Depend on SET_BINARY, not O_BINARY, when + handling binary files on hosts that care about text versus binary. + +2000-04-17 Paul Eggert + + * lib/getpagesize.h (getpagesize): Define to B_PAGE_SIZE if + __BEOS__ is defined. Based on a fix by Bruno Haible + . + +2000-04-17 Bruno Haible + + * src/system.h [BeOS]: Ignore O_BINARY. + * src/getpagesize.h [BeOS]: Define getpagesize() as B_PAGE_SIZE. + +2000-04-10 Paul Eggert + + * doc/grep.1, doc/grep.texi, NEWS: -C now requires an operand. + * src/grep.c (short_options, long_options, main, usage): Likewise. + (context_length_arg): Renamed from ck_atoi. Now reports an error + and exits if the number is out of range for a context length. + (get_nondigit_option): New function, which checks for overflow + correctly, and which does not parse nonadjacent strings of digits + into a single number. + (main): Use get_nondigit_option instead of doing the code inline. + With -A, -B, and -C, optarg is now guaranteed to be nonzero. + +2000-04-08 Paul Eggert + + Now that we know that the input is always terminated by a + newline before the matching algorithms see it, clean up the + matching algorithms so that they no longer need to modify the + input by inserting a sentinel newline, and no longer worry + about running off the end of the buffer due to a missing sentinel. + + * src/grep.c (nlscan, prpending, prtext, grepbuf): Do not + worry about running off the end of the input buffer, since + it's now guaranteed to end in the sentinel newline. + * src/search.c (EGexecute, Pexecute): Likewise. + + * src/dfa.c (prtok, dfasyntax, dfaparse, copy, merge, state_index, + epsclosure, dfaexec, dfacomp): + Change many instances of "T *" to "T const *", to catch + any inadvertent programming errors made during this conversion. + * src/dfa.h (dfacomp, dfaexec, dfaparse): Likewise. + * src/grep.c (struct stats.parent, long_options, grepdir, + compile, execute, fillbuf, lastnl, lastout, nlscan, prline, + prpending, prtext, grepbuf, grep, grepfile, grepdir): Likewise. + * src/grep.h (struct matcher.compile, struct matcher.execute): + Likewise. + * src/kwset.c (struct kwset.trans, kwsalloc, kwsincr, treefails, + treedelta, hasevery, treenext, bmexec, cwexec, kwsexec): Likewise. + * src/kwset.h (kwsalloc, kwsincr, kwsexec): Likewise. + * src/search.c (kwsmusts, Gcompile, Ecompile, EGexecute, Pcompile, + Pexecute): Likewise. + + * src/dfa.c (dfaexec): + Use size_t, not char *, to avoid worrisome casts to convert + char const * to char *. + * src/dfa.h (dfaexec): Likewise. + * src/grep.c (execute): Likewise. + * src/grep.h (execute): Likewise. + * src/kwset.c (bmexec, cwexec, kwsexec): Likewise. + * src/kwset.h (struct kwsmatch.offset, kwsalloc, kwsincr, + kwsexec): Likewise. + * src/search.c (EGexecute, Fexecute, Pexecute): Likewise. + + * src/dfa.h (_PTR_T): Depend on defined __STDC__, not __STDC__. + (PARAMS): Depend on PROTOTYPES, not __STDC__. + + * src/dfa.c (dfasyntax): Last arg is unsigned char, not int. + * src/dfa.h (dfasyntax): Likewise. + + * src/dfa.h (struct dfa): Remove member newlines; no longer needed. + * src/dfa.c (build_state, dfaexec, dfafree): Do not worry + about special newline state. + + * src/search.c (matchers): Move definition to end of file, so + that we don't need forward decls. + (lastexact): Remove. + (kwset_exact_matches): New var; subsumes old lastexact var. + All uses changed. + + * src/dfa.c (index): Remove macro. + (REALLOC_IF_NECESSARY): Skip unnecessary test. + (tstbit, setbit, clrbit): Declare arg to be unsigned, to help compiler. + (copyset, zeroset, equal): Use C builtin primitives, to help compiler. + (dfaexec): Do not modify input string. + Remove newline parameter; no longer needed. + (comsubs): Use strchr, not index. + + * src/grep.h (matchers): Use fixed name size, not pointer (as + there's no need for the extra flexibility). All uses changed. + + * src/kwset.h (struct kwsmatch.offset): Renamed from beg, with + change of type to size_t. All uses changed. + + * src/grep.c (reset): No longer need kludge for dfaexec. Simplify. + (reset, grepbuf): Adjust to new interface for 'execute'. + (install_matcher): List is now terminated by null compile, + not null name. + Do not invoke setrlimit if that wouldn't change the limit. + + * src/dfa.c (xcalloc, xmalloc, xrealloc, prtok, tstbit, setbit, + clrbit, copyset, zeroset, notset, equal, charclass_index, + looking_at, lex, addtok, atom, nsubtoks, copytoks, closure, + branch, regexp, copy, insert, merge, delete, state_index, + build_state, build_state_zero, icatalloc, icpyalloc, istrstr, + ifree, freelist, enlist, comsubs, addlists, inboth): + Remove forward decls; no longer needed. + * src/grep.c (ck_atoi, usage, error, setmatcher, + install_matcher, prepend_args, prepend_default_options, + page_alloc, reset, fillbuf, grepbuf, prtext, prpending, prline, + print_offset_sep, nlscan, grep, grepfile): Likewise. + * src/kwset.c (enqueue, treefails, treedelta, hasevery, + treenext, bmexec, cwexec): Likewise. + * src/search.c (Gcompile, Ecompile, EGexecute, Fcompile, Fexecute, + Pcompile, Pexecute, kwsinit): Likewise. + + * src/search.c (Pcompile): Do not assume newly allocated + storage is zeroed. + +2000-04-06 Paul Eggert + + * doc/grep.1, doc/grep.texi, NEWS: Improve the explanation of + locale-dependent behavior of range expressions. Mention + LC_COLLATE, since this affects range expressions. + +2000-03-26 Paul Eggert + + * Makefile.am (ACINCLUDE_INPUTS): Add decl.m4, inttypes_h.m4, + uintmax_t.m4, ulonglong.m4, xstrtoumax.m4. + * m4/Makefile.am (EXTRA_DIST): Likewise. + + * src/Makefile.am (base_sources): + Add xstrtol.c, xstrtol.h, xstrtoumax.c. + (EXTRA_DIST): Add strtol.c. + + * configure.in (jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX, + HAVE_DECL_STRTOUL, HAVE_DECL_STRTOULL): Add. + (AC_REPLACE_FUNCS): Add strtoul. + + * src/grep.c: Include xstrtol.h. + (ck_atio): Use xstrtoumax and do proper overflow checking. + (max_count, outleft): Now off_t, not int. + (main): Likewise. Use xstrtoumax to convert max_count from string. + + * acconfig.h (HAVE_DECL_STRTOUL, HAVE_DECL_STRTOULL): New #undefs. + (HAVE_STPCPY, ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, + HAVE_LC_MESSAGES): Remove. + + * m4/decl.m4, m4/inttypes_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4, + m4/xstrtoumax.m4, src/strtol.c, src/strtoul.c, src/strtoull.c, + src/strtoumax.c, src/xstrtol.c, src/xstrtol.h, src/xstrtoumax.c: + New files, taken unchanged from textutils, fileutils, sh-utils + and/or tar. + +2000-03-23 Paul Eggert + + * src/search.c (Pcompile): Add support for NUL bytes in + Perl regular expressions. + +2000-03-23 Paul Eggert + + * NEWS, doc/grep.1, doc/grep.texi: Change --pcre to --perl-regexp. + * src/grep.c (long_options, usage): Likewise. + + * doc/grep.1, doc/grep.texi: Remove pgrep program. + * src/Makefile.am (bin_PROGRAMS): Likewise. + (pgrep_SOURCES): Remove. + + * src/grep.c (main): Rename matcher from "pgrep" to "perl". + * src/search.c (matchers): Likewise. + + * src/search.c: Do not include stdio.h; no longer needed. + (NILP): Remove. + (sub): No longer static. + (n_pcre): Remove. + (cre): No longer an array. Present only if HAVE_LIBPCRE. + (extra): New variable. + (Pcompile): Use fatal to report errors. + This also removes a possible core dump. + Add checks (marked FIXME) for restrictions in pcre. + Use pcre_maketables for proper localized behavior. + (Pcompile, Pexecute): Use GNU coding style. + The argument is a single pattern, not a list of patterns separated + by newlines; this is for consistency with grep and egrep. + Use pcre_study for speed. + (Pexecute): Abort if we lack pcre. + Abort if pcre_exec reports an impossible error. + Use code similar to the rest of search.c + to narrow down to the line we've found. + +2000-03-21 Alain Magloire + + * configure.in: added AC_CHECK_LIB(pcre, pcre_exec) + * ChangeLog: Typos corrected. + * src/search.c: new MACRO HAVE_LIBPCRE + +2000-03-21 H.Merijn Brand + + * src/Makefile.am(bin_PROGRAMS): added pgrep and new macro + pgrep_SOURCES. + * src/search.c: new functions Pcompile() and Pexecute() + to support PCRE. Update matcher[] array for pgrep. + * src/grep.c: new short and long option --pcre and -P. + usage() updated. + +2000-03-21 Bastiaan Stougie + + Improvement of the -m or --max-count option. Now works for NUM > 1 and + prints trailing context for the last matching line. + + * src/grep.c + (after_last_match): Is a new off_t variable that replaces inputhwm + to retain the correct input offset even after a call to fillbuf. Note + that after_last_match has a different meaning than inputhwm: + it always points to the offset in the input of the first byte after + the last matching line, and is 0 if no matching line has been found + yet. + (grep): Print trailing context after the NUMth match when the -m NUM + option is used. + (grep): Added comment. Should have been commented already. + (grepbuf): Now updates outleft correctly. This fixes the bug that the + -m NUM option did not stop after NUM lines for NUM greater than 1. + (grepbuf, prtext): Now update after_last_match instead of inputhwm. + (fillbuf): No longer updates inputhwm. + (prpending): When outputting trailing context of the max_count-th + matching line, stop at the first matching line. + (grepfile): Seek to after_last_match or eof, depending on the values + of outleft and bufmapped. + (usage): added the -m or --max-count option to the help message. + * doc/grep.texi, doc/grep.1: Document the change of the -m option. + +2000-03-17 Paul Eggert + + Add new -m or --max-count option, based on a suggestion by + Bastiaan Stougie. + + * doc/grep.texi, doc/grep.1: Document it. + * src/grep.c (short_options, long_options, main): Add it. + (inputhwm): New variable. + (fillbuf, prtext, grepbuf): Set it. + (bufmapped): Now a macro (defined to zero) if HAVE_MMAP is not defined. + (max_count, outleft): New variables. + (prtext, grepbuf, grep): Don't output more than outleft lines. + (grepfile): If grepping standard input, seek to the limit of what + we've read before exiting. This fixes a bug with mmapped input, + and is needed for proper -m support. + (main): Exit immediately if -m 0 is specified. + +2000-03-08 Alain Magloire + + * configure.in: version 2.4.2 + +2000-03-07 Paul Eggert + + * Make intl subdirectory match fileutils, tar, etc.; + see intl/ChangeLog for details. + + * src/getpagesize.h: Reformat to match latest fileutils. + + * src/savedir.c (savedir): Work even if directory size is + negative; this can happen with some NFS screwups. + +2000-03-03 Jim Meyering + + * regex.m4: Make sure re_compile_pattern accepts patterns like '{1'. + +2000-03-02 Alain Magloire + + * 2.4.1 Release + +2000-02-25 Paul Eggert + + * configure.in (LIBOBJS): Work around automake 1.4 bug: + regex.c wasn't being passed through ansi2knr on pre-ANSI hosts. + (ac_use_included_regex): Fix typo in warning. + * src/Makefile.am (EXTRA_DIST): Remove regex.c, as the LIBOBJS + workaround means that automake now puts regex.c into DIST_COMMON. + +2000-02-25 Alain Magloire + + * po/*.po: update of the PO files. + +2000-02-22 Eli Zaretskii + + * doc/grep.1: Two small glitches(typos). + +2000-02-18 Eli Zaretskii + + * djgpp/config.site (prefix, INSTALL): Use /dev/env/DJDIR instead + of ${DJDIR}, so that the produced Makefile's work on any DJGPP + installation. + +2000-01-30 Alain Magloire + + * doc/grep.1: corrected typo. + Noted by Ruslan Ermilov. + +2000-01-30 Alain Magloire + + * vms/Makefile.am: added config_vms.h to EXTRA_DIST. + * vms/config_vms.h: New File, contains macros specific to VMS and + avoid namespace collision with operating system supplied C library. + * vms/make.com: Better compiler auto-detection; information for builds + on pre-OpenVMS 7.x systems; general overhaul. + * src/getpagesize.h: Reinstate support for different pagesizes on + VAX and Alpha. Work around problem with DEC C compiler. + * src/vms_fab.c: Cast to some assigments; fixed typo argcp vs. argp. + * src/vms_fab.h: Added new include files to avoid warnings about + undefined function prototypes. + Those patches were provided by Martin P.J. Zinser (zinser@decus.de). + +2000-01-30 Paul Eggert + + * src/grep.c (main): Update copyright notice. + +2000-01-28 Alain Magloire + + * src/grep.c (usage): The example "%s -i 'hello.*world' could + lead to confusion when progname is 'fgrep. + Noted by Akim Demaille. + + * configure.in: Reenable, jm_INCLUDE_REGEX() since we now + track GNU lib C. + * src/Makefile.am: EXTRA_DIST new macros with regex.c regex.h. + Requested By Ulrich Drepper. + +2000-01-25 Paul Eggert + + * src/grep.c (grep): If the final byte of an input file is not + a newline, grep now silently supplies one. + * doc/grep.texi, NEWS: Likewise. + +2000-01-25 Paul Eggert + + * NEWS, doc/grep.1, doc/grep.texi: Add -I option. + * src/grep.c (short_options, usage, main): Likewise. + + * doc/grep.texi: Fix some incorrect references to ASCII. + +2000-01-25 Paul Eggert + + * doc/grep.1: Simplify synopsis; sort options; mention + environment variables; clean up some minor gaffes. + +2000-01-25 Paul Eggert + + * doc/grep.texi: + Fix some errors in description of [:print:] and the like. + +2000-01-23 Paul Eggert + + * src/dfa.c (FETCH, lex): Put brackets around if-body to avoid + GCC warning about ambiguous if-then-else. + +2000-01-23 Paul Eggert + + * src/regex.c (GET_UNSIGNED_NUMBER): Allow only ASCII digits. + * src/dfa.c (ISASCIIDIGIT): New macro. + (lex): Use it instead of ISDIGIT. + +2000-01-23 Paul Eggert + + The bug is that regular expression ranges like [a-z] compare raw + byte codes to the range boundaries, whereas POSIX says that they + should use the current collating sequence instead. For example, + in Solaris 7 with LC_ALL=en_US, the command + echo x | grep '[ -~]' + outputs 'x', but it shouldn't output anything since ' ' and '~' + sort before all letters in that locale. + + * src/regex.c (compile_range): When matching a character + range, use the current collating sequence, as POSIX requires. + * src/dfa.c (lex): Likewise. + +2000-01-20 Alain Magloire + + * tests/Makefile.am (dist-hook): Added new rule to make sure + that the shell scripts have the right permissions. + * src/posix/Makefile.am (EXTRA_DIST): added regex.h in the + distribution. + * THANKS: updated. + +2000-01-18 Alain Magloire + + * Rectification the initial patch to add --binary-file option + was done by Ruslan Ermilov. + +2000-01-17 Paul Eggert + + Sync with sources of fileutils 4.0n, tar 1.13.17, glibc 2.1.3a1. + Convert to ANSI C prototypes (using ansi2knr for backwards + compatibility), as this makes it easier to sync. + + * configure.in (AC_OBJEXT): Spell in a funny way, to work around + a bug in automake 1.4 with ansi2knr. + (LIBOBJS): Add assignment so that .o files in LIBOBJS are also built + via the ANSI2KNR-filtering rules. + (AC_OUTPUT): Add src/posix/Makefile. + * src/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr. + (SUBDIRS): New macro. + * src/ansi2knr.1, src/ansi2knr.c, src/posix/Makefile.am: New files. + * src/dfa.c, src/dosbuf.c, src/grep.c, src/kwset.c, src/search.c, + src/vms_fab.c: + Use prototypes for function definitions. + * src/grep.c (main): Use int counter for default context, + fixing an ANSI portability bug uncovered by the above changes. + + * config.guess, config.sub, install-sh, missing, src/alloca.c, + src/getpagesize.h, src/memchr.c, src/savedir.c, src/savedir.h, + src/stpcpy.c: + Upgrade to latest version from fileutils 4.0n. + + * src/getopt.c, src/getopt.h, src/getopt1.c: Upgrade to latest + version from tar 1.13.17. + + * src/obstack.c, src/obstack.h, src/regex.c, src/regex.h: + Upgrade to glibc 2.1.3 alpha 1, with K&R C portability fix. + * src/posix/regex.h: New file, from glibc 2.1.3 alpha 1. + +2000-01-04 Paul Eggert + + Initial patch by Ruslan Ermilov. + + Add --binary-files option. + * NEWS, doc/grep.1, doc/grep.texi: Document it. + * src/grep.c (BINARY_FILES_OPTION): New constant. + (long_options, grep, usage, main): New --binary-files option. + (binary_files): New var. + * src/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, CHAR_MAX): + New macros. + (INT_MAX, UCHAR_MAX): Define in terms of TYPE_MAXIMUM. + +2000-01-04 Paul Eggert + + * savedir.c (savedir): Don't store past the end of an array if + name_size is zero and the directory is empty. + Reported by Dima Barsky . + +1999-12-03 Alain Magloire + + * 2.4 Release. + +1999-11-18 Paul Eggert + + * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a + problem with the QNX 4.25 shell, which doesn't propagate exit + status of failed commands inside shell assignments. + +1999-11-13 Eli Zaretskii + + * doc/grep.texi: Minor markup and spelling corrections. Use + @noindent where appropriate. + + * PATCHES-{AM,AC}: rename to PATCHES.{AM,AC} + +1999-11-12 Eli Zaretskii + + doc/grep.texi: Minor fixes and typos corrected. + djgpp/README: Updated version. + +1999-11-07 Paul Eggert + + * src/grep.c (usage): Fix misspelling. + +1999-11-07 Paul Eggert + + Don't assume that the C library has re_set_syntax and friends. + * src/Makefile.am (base_sources): Add regex.c, regex.h. + (EXTRA_DIST): Remove regex.c, regex.h. + + * src/grep.c (prtext): Use out_quiet, not not_text, to decide + whether to set pending to zero at the end. + (not_text): Remove static variable, undoing latest change. + (grep): Likewise. + + * doc/grep.texi: Tighten up the text, and fix some minor + spelling and usage errors. Use @enumerate rather than @table + @samp, since it's better for Q&A format. Add cross + references. + +1999-11-01 Alain Magloire + + * src/search.c: Use the more portable [[:alnum:]] + to define a word instead of Ascii dependent [0-9A-Za-z] + * src/grep.c: make not_text global to not display text when + the context switches -A/-B/-C are use on binary files. + * make grep-2.3g available for testing. + * configure.in: drop support for --without-included-regex. + This was generating bogus bug reports, since many GNU/Linux + users have different version of glibc. And glibc maintainers + decided to drop k&r support. + +1999-11-01 Arnold D. Robbins + + * regex.c (init_syntax_once): move below definition of + ISALNUM etc., then use ISALNUM to init the table, so that + the word ops will work if i18n'ed. + (SYNTAX): And subscript with 0xFF for Latin-1 characters. + +1999-10-26 Alain Magloire + + * src/regex.c: Merge changes from GNU lib C. + * Updated the *.po files + +1999-10-26 Paul Eggert + + * src/grep.c (fillbuf): Don't report buffer size overflow if + newalloc == save and maxalloc == save. This can happen + e.g. when reading a large page-aligned file that contains + no newlines. + +1999-10-21 Paul Eggert + + * src/grep.c (usage): Give example. Clarify -F. + Explain exit status more clearly. + +1999-10-12 Paul Eggert + + * doc/grep.texi: Shorten the commentary about egrep and {. + "BSD grep" -> "traditional grep". + * doc/grep.1: Match recent changes to grep.texi. + +1999-10-11 Paul Eggert + + * NEWS, doc/grep.1, doc/grep.texi: New option --mmap. + * src/grep.c (mmap_option): New variable. + (long_options, reset, usage): Add --mmap. + Default is now read, not mmap. + + * doc/grep.1: Document -Z or --null. + +1999-10-11 Paul Eggert + + * doc/grep.texi: Fix texinfo glitches. POSIX -> POSIX where + appropriate. + +1999-10-11 Paul Eggert + + * acconfig.h (ssize_t): New #undef. + + * configure.in (AC_CHECK_TYPE): Add ssize_t. + + * src/grep.c (PREFERRED_SAVE_FACTOR): New macro. + (reset): If the buffer has already been allocated, set bufsalloc to + be bufalloc / PREFERRED_SAVE_FACTOR. This avoids problems when + bufsalloc == bufalloc (possible after reading a large binary file). + (reset): Use PREFERRED_SAVE_FACTOR instead of magic constant. + Do not set bufbeg; nobody uses it. + Always set buflim. + Check for lseek error. + Use SEEK_CUR, not a magic constant. + (fillbuf): Return an error indication, not a count. + All callers changed. + Do not assume ssize_t fits in int. + Use PREFERRED_SAVE_FACTOR instead of magic constant. + Clean up mmap code. + Do not attempt to mmap zero bytes. + Check for lseek error. + Use SEEK_SET, not a magic constant. + Work correctly if read is interrupted. + (grepfile): Work correctly if open or close is interrupted. + + * src/system.h (SEEK_SET, SEEK_CUR): New macros. + +1999-10-02 Alain Magloire + + * src/regex.[ch]: upgrade from GNU lib C source tree. + + * make beta 2.3f available. + +1999-10-02 Paul Eggert + + * NEWS: egrep is now equivalent to 'grep -E'. + The lower bound of an interval is not optional. + You can specify a matcher multiple types without error. + -u and -U are now allowed on non-DOS hosts, and have no effect. + * doc/grep.texi: Likewise. + * doc/grep.1: Likewise. + Fix some troff bugs that prevented 'groff' from rendering the page. + + * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c (default_matcher): + Remove. + (matcher): Add. + * src/grep.h (default_matcher): Remove. + (matcher): Now exported from ?grepmat.c, not grep.c. + + * src/dfa.c (lex): If { would start an invalid interval specification, + treat it as a normal character. + Remove (broken) support for {,M} meaning {0,M}. + Diagnose bogus intervals like {1,0}. + (closure): maxrep is now -1 to indicate no limit, not zero; + zero is a valid value for maxrep, meaning an upper bound of zero. + + * src/grep.c (short_options): New constant. + (long_options, main): -u and -U are now supported on Unix, + with no effect. + (matcher): Removed; now defined by ?grepmat.c. + (install_matcher): Renamed from setmatcher. + (setmatcher): New function. + (usage): Report new, more uniform option scheme. + (main): Do not initialize matcher; ?grepmat.c now does this. + Rely on setmatcher to catch matcher conflicts. + Default matcher is "grep". + + * src/search.c (matchers): + Remove "posix-egrep" matcher; no longer needed. + (Ecompile): Likewise. + The egrep matcher now has POSIX behavior. + + * tests/bre.tests: grep '\{' is no longer an error. + Fix test for interval too large, and enable it. + * tests/ere.tests: grep -E {1 is no longer an error + Likewise for a{1, a{1a, a{1a}, a{1,x}. + +1999-09-22 Paul Eggert + + * largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around GCC + 2.95.1 bug with HP-UX 10.20. + +1999-09-12 Paul Eggert + + * src/grep.c (fillbuf): Fix typo: we sometimes reported + arithmetic overflow even when there wasn't any. + +1999-09-12 Paul Eggert + + * configure.in (AC_CHECK_FUNCS): Add memmove. + + * src/system.h (S_ISREG): New macro. + (memmove): Define if ! defined HAVE_MEMMOVE && ! defined memmove, + not if !defined STDC_HEADERS. This is needed for SunOS 4.1.4, + which defines STDC_HEADERS but lacks memmove. + + * src/grep.c (bufoffset): Needed even if !defined HAVE_MMAP. + (reset): Always fstat the file, since we always need its size if it is + regular. + Similarly, get the buffer offset of every regular file. + Set bufmapped to 0 if the file's initial offset is not a multiple + of the page size. + (fillbuf): Calculate an upper bound on how much memory we should + allocate only for regular files, since we don't know the sizes of + other files. + Don't bother to check whether the file offset is a multiple of the page + size, since we now do that just once in 'reset'. + When an mmapped area would fall past the end of the file, trim it to + just before instead of giving up immediately and doing a 'read'; + that avoids a worst-case behavior that could read half an mmapped file. + Fix bug when computing offsets on hosts that don't have mmap. + +1999-08-27 Paul Eggert + + * src/system.h (memmove): New macro. + + * src/grep.c (page_alloc): Reallocate the old buffer instead + of having both old and new buffers active simultaneously. + Remove valloc debugging variant, which no longer applies. + + (fillbuf): Rejigger the buffer allocation mechanism. The old + mechanism could allocate more than 10*N bytes for an N-byte + file, which was excessive. Check for arithmetic overflow a + bit more carefully. + +1999-08-25 Paul Eggert + + * src/grep.c (grepdir): + Don't assume that st_ino and st_dev must be integers; + POSIX allows them to be floating-point (!). + + * src/vms_fab.h (arr_ptr): ':' -> ';' to fix typo. + +1999-08-18 Alain Magloire + + * 2.3e snapshot. + +1999-08-18 Alain Magloire + + * src/search.c: On a CRAY J90 system running UNICOS 8.0. + Compilation of ./src/search.c failed because the declaration of + the variable "regex": + static struct re_pattern_buffer regex; + conflicted with a previous declaration search.c #includes "system.h", + which #includes , which declares : + extern char *regex __((char *_Re, char *_Subject, ...)); + The declaration in search.c is local to that one source file. + I just changed its name to something less likely to conflict. + (I called it "regexbuf", but you could pick any name you want.) + Excerpt email from Dean Kopesky. + +1999-08-16 Paul Eggert + + Upgrade large-file support to the version used in tar and + textutils. + + * Makefile.am (ACLOCAL_AMFLAGS): Define to be empty. + (M4DIR, ACINCLUDE_INPUTS): New macros. + ($(srcdir)/acinclude.m4): New rule. + + * configure.in (AC_CANONICAL_HOST, AM_C_PROTOTYPES): Add. + (AC_SYS_LARGEFILE): Renamed from AC_LFS, for compatibility + with what should appear in the next autoconf release. + + * m4/largefile.m4: Renamed from m4/lfs.m4. + + * src/ansi2knr.1, src/ansi2knr.c, config.guess, config.sub: + New files. config.guess and config.sub ar needed by the new + AC_SYS_LARGEFILE. ansi2knr is needed by AM_C_PROTOTYPES, + which in turn is needed by the new AC_SYS_LARGEFILE. + +1999-08-16 Alain Magloire + + * 2.3d snapshot on ftp server. + +1999-07-26 Paul Eggert + + Several GNU tools have options to process arbitrary file names, even + file names that contain newline characters. These include 'find + -print0', 'perl -0', 'sort -z', and 'xargs -0'. It'd be handy if GNU + grep also processed such file names. Here's a proposed patch to do + this, relative to grep 2.3c. This patch introduces two options, one + for the data, and one for the file names. (Sometimes one wants + null-terminated file names in the output, and sometimes one wants to + process lists of null-terminated strings, and these are orthogonal + axes.) + + * NEWS, doc/grep.texi: New -z or --null-data and -Z or --null options. + * src/grep.c (long_options, usage, main): Likewise. + + * src/dfa.h (dfasyntax): New eol parameter. + * src/dfa.c (eolbyte): New var. + (dfasyntax): Set it from new parameter. + (lex, dfastat, build_state, dfaexec): Use it instead of '\n'. + + * src/grep.h (eolbyte): New decl. + * src/grep.c (eolbyte): New var. + (nlscan, prpending, prtext, grepbuf, grep): Use it instead of '\n'. + (filename_mask): New var. + (prline, grepfile): Output NUL separator if filename_mask is zero. + (grep): Look for '\200' as the hallmark of a binary file, not '\0', + if -z or --null-data is specified, since it implies that '\0' is + expected as text. + + * src/search.c (Gcompile, Ecompile): Pass eolbyte to dfasyntax. + (EGexecute, Fexecute): Use eolbyte instead of '\n'. + +1999-06-15 Alain Magloire + + * src/grep.c, doc/grep{1,texi} : + --revert-match should be --invert-match. + Correction proposed by Karl Berry. + +1999-06-12 Alain Magloire + + * doc/grep.{1,texi}: add description for --with-filename. + Noted missing by UEBAYASHI Masao. + +1999-03-17 Paul Eggert + + * NEWS: Add GREP_OPTIONS. + + * doc/grep.texi: Document GREP_OPTIONS, and the other + environment variables. Fix doc for [:blank:], [:cntrl:], [:punct:]. + + * src/grep.c (prepend_args, prepend_default_options): New functions. + (main): Use them to implement GREP_OPTIONS. + * src/system.h (getenv): New decl. + +1999-03-16 Volker Borchert + + * configure.in: Use case case ... esac for checking Visual C++. + When ${CC} contains options it was not recognize. + +1999-03-07 Paul Eggert + + * src/grep.c (usage): Don't report -E, -F, and -G unless we're grep. + (main): Don't match options -E, -F, and -G unless we're grep. + Remove after-the-fact check for options -E, -F, and -G, since + they're no longer needed. + +1999-03-05 Eli Zaretskii + + * src/grep.c (main): Print the name of the default matcher instead + of just "grep". + +1999-02-06 Alain Magloire + + * tests/*.awk : Linux users are seeing "Broken Pipe" on make check. + The problem is that grep does not drain its stdin, thus the previous + process in the pipeline receives a SIGPIPE. Other shells are silent + about this. There is actually no failure, since the broken pipe is + expected. You can work around it by changing the pipeline, so that + the input is drained, like this: + status=`echo 'check' | { ${GREP} -E -e pattern >/dev/null 2>&1; + echo $?; cat >/dev/null; }`; if test $status -ne $errnu then ... fi + Excerpt email from Andreas Schwab. + +1999-02-23 Alain Magloire + + * src/grep.c : Restrict the use of -E, -F, -G + to only grep driver, Posix behaviour. {f,e}grep + the matcher is already set. This change may brake + scripts, warn in NEWS. + + * doc/grep.{1,texi} : -C takes arguments, upgrade manual. + + * beta 2.3a + +1999-02-23 Alain Magloire + + * configure.in : Change the configure VC test from + 'test x$ac_cv_prog_CC = xcl;' to 'test x"$ac_cv_prog_CC" = xcl;' + Email from Joshua R. Poulson. + +1999-02-23 Paul Eggert + + Fix porting bug reported by Amakawa Shuhei for SunOS 4.1.4-JL. + The btowc.c shipped with grep 2.3 is incorrect for Solaris + 2.5.1 and earlier, as it assumes UTF8, which these OSes do not + support. Solaris 7 supports btowc, so there's no need to ship + a substitute for it. The only questionable case is Solaris + 2.6, which lacks btowc but does support UTF8. However, 2.6 + supports UTF8 but only as a demonstration (for an English + locale!); Japanese Solaris 2.6 users typically use EUC, or + sometimes shift-JIS, but they cannot use UTF8 since Japanese + UTF8 is not supported. Hence there's no point to having grep + substitute a btowc that uses UTF8, as it is either redundant, + or it will almost invariably have incorrect behavior. + + * configure.in (AC_CHECK_HEADERS): Don't set USE_WCHAR. + (AC_CHECK_FUNCS): Add btowc, wctype. + (AC_REPLACE_FUNCS): Don't replace btowc; our replacement is + invariably doing the wrong thing anyway, at least on SunOS/Solaris. + Don't bother to check for wctype in -lw, as we don't support + wide characters on Solaris 2.5.1 or earlier anyway. + + * bootstrap/Makefile.try (OBJS): Remove btowc.$(OBJEXT). + + * src/btowc.c: Removed; no longer needed. + +1999-02-19 Paul Eggert + + * NEWS: Fix typo when talking about the old behavior of + silently skipping directories; it was grep 2.1, not grep 2.2. + +1999-02-15 Alain Magloire + + * bootstrap/Makefile.try : add DJGPP DEFS. + Done by Elie Zaretsckii. + +1999-02-14 Alain Magloire + + * m4/gettext.m4 : Guard [] with changequote. + From Elie Zaretskii. + + * djgpp/config.bat : Makefile.in.in --> Makefile.in-in + From Elie Zaretskii. + + * src/dosbuf: k&r function parameter. + + * release of 2.3. + +1999-02-10 Alain Magloire + + * bootstrap/{Makefile{try,am},REAMDE} : skeleton + provided for system lacking the tools to autoconfigure. + + * src/{e,f,}grepmat.c: added guard [HAVE_CONFIG_H] + +1999-02-10 Alain Magloire + + * PATCHES-AC, PATCHES-AM: updated. + + * m4/regex.m4 : updated. + +1999-02-05 Eli Zaretskii + + * m4/gettext.m4 : Support DOS-style D:/foo/bar absolute file + names. + + * aclocal.m4 (DJGPP) : Use $DJ_GPP instead, since changing the + latter prevents GCC from finding headers and libraries. + + * djgpp/config.bat: Make building from another directory work + + * djgpp/config.sed: Remove redundant command that edited path + separator: now done by configure. + + * src/grep.c [O_BINARY]: Add prototype for undossify_input. + + * doc/grep.texi (Introduction): Typo fixed. + +1999-02-03 Alain Magloire + + * grep-2.2f beta release. + +1999-02-02 Alain Magloire + + * m4/{djgpp,envsep,glibc,regex,dosfile,isc-posix}.m4 : + New files to aid configuration and unload configure.in. + * m4/Makefile.am : updated. + * src/btowc.c : protect for wchar.h + +1999-01-28 Alain Magloire + + * intl/Makefile.in: Replace .o with .${ac_objext} where necessary. + Work around a limitation of Visual C++ on Cygwin32. + * acconfig.h configure.in: Define 'alloca' as '_alloca' when CC=cl. + This little hack was suggested by Ian Roxborough . + Patch forwarded by Ben Elliston. + +1999-01-28 Alain Magloire + + * PATCHES-AM: New file. A small patch for automake-1.4, use $(sep) + as the path separator base on @SEP@. + * PATCHES-AC configure.in : updated for autoconf-13. + +1999-01-27 Volker Borchert + + * grep.c: fgrep -NUM not working correctly. + add the argument number to digit_args_val. + +1999-01-22 Paul Eggert + + Prevent grep -r from recursing infinitely through directory loops via + symbolic links. + + * grep.c (struct stats): New type. + (stats_base): New var. + (bufstat): Remove; subsumed by stats->stat. + (reset, fillbuf, grep, grepdir, grepfile): Pass struct stats * arg, + for directory loop checking; use this instead of the bufstat global. + All callers changed. + (grepfile): Stat the file before invoking grepdir. + (grepdir): Assume that the argument has already been statted. + No longer a need for a directory size argument, since it + can be gotten from the struct stats * argument. + Check for directory loops. + Create linked list of directories currently being visited, + to detect loops. + +1998-12-29 Kaveh R. Ghazi + + intl/localealias.c: When building grep-2.2e using cc on Irix4, + I needed the following patch to intl/localealias.c. + (Its the same patch used by fileutils-4.0.) The patch resolves + conflicts between char* and unsigned char* in the i18n code. + +1998-12-10 Alain Magloire + + * src/grep.c : Typo in contex -->context + Noted by Vladimir Michl. + +1998-12-01 Alain Magloire + + * doc/Makefile.am djgpp/Makefile.am m4/Makefile.am vms/Makefile.am: + New files. + + * m4/progtest.m4: proctect '[]' from m4. + Noted by Eli Z. + + * PATCHES-AC: New file, add the patch for autoconf in the dist. + + * acconfig.h: (HAVE_DOS_FILENAME) + + * TODO: updated. + + * src/search.c: remove obsolete 'gegrep,ggrep,gnugrep' + matchers. grep no longer depend on argv[0]. + + * grep-2.2e beta to test DJGPP port. + +1998-11-28 Paul Eggert + + Various portability enhancements: + - Don't assume that O_BINARY implies DOS. Use separate + macros D_OK (for DOS-like directory access) and + HAVE_DOS_FILE_NAMES (for DOS-like file names). + - Don't assume that off_t fits into long; it doesn't on Solaris 2.6. + - Have is_EISDIR set errno properly on hosts with screwed-up EISDIR. + - Treat ':' specially in DOS file names only if it's the end of a + drive specifier. + - Protect against errno < 0. + + * src/grep.c (is_EISDIR): Move defn to system.h. + (print_offset_sep): New function. + (fillbuf): Remove redundant test of O_BINARY. + (totalcc, totalnl): Now of type off_t. + (prline): Use print_offset_sep to print file offsets. + (grepfile): Don't set e to EISDIR; that's is_EISDIR's responsibility + on machines that don't work properly with EISDIR. + (grepdir): Don't assume ':' means slash on all DOS filenames; + it means it only in the file prefix. + + * src/system.h (strerror): Check for negative error numbers. + (is_EISDIR): Depend on D_OK, not O_BINARY. + (SET_BINARY): Depend on HAVE_SETMODE, not __DJGPP__. + (IS_SLASH, FILESYSTEM_PREFIX_LEN): Depend on HAVE_DOS_FILE_NAMES, + not O_BINARY. + (CHAR_BIT): New macro. + + * src/dosbuf.c (struct dos_map): + pos and add members are now of type off_t. + (dos_stripped_crs): Now of type off_t. + (dossified_pos): Now accepts arg and returns value of type off_t. + + * configure.in (AC_CHECK_FUNCS): Add setmode. + (HAVE_DOS_FILENAMES): New macro + +1998-11-27 Eli Zaretskii + + * djgpp/config.sed: New file, a Sed script to edit configure + script before running it on DOS/Windows. + * djgpp/config.bat: Updated to handle po2tbl.sed.in and + po/Makefile.in.in on DOS filesystems, and to run config.sed. + +1998-11-24 Jim Meyering + + * src/grep.c : Typo s/infalid/invalid/ + Also noted by Stanislav Brabec. + +1998-11-24 Eli Zaretskii + + * doc/grep.texi: I found and corrected several typos. + I believe the GNU standards require the section that describes the + options to the programs to be called "Invoking" or "Invoking + ". This is so users and programs can easily find + that node in any Info file. So I changed the name of the + "Options" chapter to "Invoking", and corrected the + cross-references accordingly. + I added some markup to things like file names and options. + I added some additional index entries where that seemed useful. + I also corrected some index entries, such as "@cindex [:alnum:]", + which used a colon in them (the colons confuse Info readers). + +1998-11-24 Alain Magloire + + * grep/doc/grep.texi : -h is not use for help. + Nit spotted by Jim Meyering. + +1998-11-23 Alain Magloire + + * doc: New directory, grep.1, {e,f}grep.man move here + * doc/grep.texi: New info manual + * doc/version.texi: New + * doc/Makefile.am: New + * tests/{ere,bre}.*: New files. The spencer2 test is split + in two ere/bre. + * config.hin: New, config.h.in rename to config.hin for OS + with limited file system aka DOS. + + * grep-2.2d release for beta. + +1998-11-18 Alain Magloire + + * src/regex.[ch] : Updated from GLibc, previous patches were + integrate by Ulrich Drepper and some added ones. + +1998-11-16 Paul Eggert + + * grep.h (__attribute__): New macro, if not GCC. + (fatal): Add __attribute__((noreturn)). + * grep.c (usage): Add __attribute__((noreturn)). + +1998-11-16 Paul Eggert + + Remove memory leak with valloced buffers, by invoking malloc instead. + + * configure.in (AC_CHECK_FUNCS), src/system.h (valloc): Remove. + * src/grep.c (page_alloc): New function. + (ubuffer, pagesize): New vars. + (ALIGN_TO): New macro. + (reset): Initialize new vars. Check for overflow in buffer size calc. + Use page_alloc instead of valloc. + (fillbuf): Likewise. Use memcpy to copy saved area. + +1998-11-15 Paul Eggert + + * dfa.c (dfacomp), search.c (EGexecute): Don't assume char is unsigned. + +1998-11-14 Paul Eggert + + * src/grep.c (grepdir): Fix bug: memory freed twice. + + * src/search.c (Gcompile, Ecompile): Don't invoke dfainit, + since dfacomp does it for us, and if we also do it then we + leak memory. + +1998-11-13 Eli Zaretskii + + * djgpp/config.bat: Rewrite to run the configure script via Bash. + * djgpp/config.site, djgpp/getconf: New files. + * djgpp/config.h, djgpp/*.mak, djgpp/po2tbl.sed: Remove. + * djgpp/README: Update instructions. + + * Makefile.am (EXTRA_DIST): Update the list of DJGPP files. + + * src/system.h (IS_SLASH): New macro. + (is_EISDIR): Define it here for DOS and Windows. + + * src/grep.c (main) [O_BINARY]: Set stdout to binary mode, so the + EOL formats of the input and output files match, unless stdout is + the console device. + (is_EISDIR): Don't define if already defined. Accept a second + argument, the file name; all callers changed. + (grepdir): Don't free 'file', inside the loop. Use IS_SLASH to + check whether 'dir' needs a slash. + (grepfile): If file is a directory, set e to EISDIR. + +1998-11-10 Alain Magloire + + * src/vms_fab.{c,h}: New file for VMS wildcard expansion + Written by Phillip C. Brisco. + + * vms/make.com : add line to compile vms_fab.c and + {e,f,}grepmat.c with link for each grep/fgrep/egrep. + Base on patch send by Phillib C. Brisco. + +1998-11-09 Alain Magloire + + * grep-2.2c on alpha for testing. + +1998-11-09 Paul Eggert + + * src/grep.1: Fix "Last Change" of output by generating the date + from the RCS Id. + + * src/grep.c (is_EISDIR): New macro. + (grep): If -s, suppress errors from trying to read directories. + (grepfile): Use is_EISDIR to simplify code. + (grepdir): If -s, suppress errors from trying to read directories. + + * src/grep.1: Fix -q -r -s problems; describe BSD grep better. + + * src/grep.c (main): Update copyright. + + Specify default matcher with default_matcher extern var, not + DEFAULT_MATCHER macro. This is more straightforward and means + we need to compile grep.c just once. + + * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c: New files. + + * src/Makefile.am (base_sources): New macro. + (egrep_SOURCES, fgrep_SOURCES, grep_SOURCES): Now consist of + $(base_sources) plus the single tailoring file. + (grep_LDADD, egrep_LDADD, fgrep_LDADD): Remove. + (EXTRA_DIST): Remove grep.c, regex.c. + (fgrep.o, egrep.o): Remove. + + * src/grep.h (matcher): Now char const *. + (default_matcher): New decl. + + * src/grep.c (matcher): Now char const *. + (setmatcher): Now accepts char const *. + (main): Default the matcher from default_matcher (linked externally) + rather than DEFAULT_MATCHER (a macro). + +1998-11-08 Alain Magloire + + * src/grep.1: 'prep.ai.mit.edu' should be replaced with 'gnu.org'. + Nit from Paul Eggert. + +1998-11-06 Alain Magloire + + * src/grep.c: The Matcher is not set to argv[0] but + explicitly by a #define MATCHER at compile time default is "grep". + + * aclocal/: NEW dir. provides our own *.m4 + + * configure.in: Move Paul's Large Files to AC_LFS.(aclocal/lfs.m4) + Taken from Jim Meyering fileutils. + +1998-11-05 Alain Magloire + + * src/grep.1: update the man pages according to the + changes make by Miles. + + * po/*.po: updated. + + * first beta release for 2.3 (2.2a). + +1998-11-04 Miles Bader + + * src/grep.c (main): Rationalize interaction of -C/-NUM/-A/-B + options, and allow -C to have an optional argument. -NUM can + now be mixed with -C, and -A, -B always take precedence over + -C/-NUM, regardless of order. + (long_options): Let -C/--context take an optional argument. + +1998-11-03 Alain Magloire + + * src/dfa.c: HP-UX define clrbit/setbit as macros in + #undef if defined. + Fixed by Andreas Ley and Philippe Defert. + + * src/grep.1 : mention that -s follows POSIX behavior. + Noted by Paul Eggert and others. + + * tests/khadafy.sh: a typo in failure(s). + Spotted By Sotiris Vassilopoulos. + +1998-11-01 Paul Eggert + + * src/system.h (IN_CTYPE_DOMAIN): New macro. + (ISALPHA, ISUPPER, ISLOWER, ISDIGIT, ISXDIGIT, ISSPACE, + ISPUNCT, ISALNUM, ISPRINT, ISGRAPH, ISCNTRL): Use + IN_CTYPE_DOMAIN instead of isascii. + +1998-08-18 Paul Eggert + + Add support for new -r or --recursive (or -d recurse or + --directories=recurse) option. + + * src/Makefile.am (grep_SOURCES): Add savedir.c, savedir.h, stpcpy.c. + + * src/grep.1: Describe new options. + + * src/grep.c: Include "savedir.h". + (long_options): Add -r or --recursive. + (RECURSE_DIRECTORIES): New enum value. + (IS_DIRECTORY_ERRNO): Remove. + (reset, grep): Add file name arg. + (grepdir, grepfile): New functions. + (initial_bufoffset): New var. + (reset): Initialize it. + (fillbuf): Use it. + (count_matches, list_files, no_filenames, suppress_errors): New static + vars; formerly were local to 'main'. + (grep): Recurse through directories if the user asks for this. + (usage, main): Add new options. + (main): Change some local vars to be static, as described above. + Move most of the guts into grepfile function. + so that it can be recursed through. + + * configure.in (AC_HEADER_DIRENT, AC_FUNC_CLOSEDIR_VOID): Add. + (AC_REPLACE_FUNCS): Add stpcpy. + + * src/savedir.c, src/savedir.h, src/stpcpy.c: New files; + taken from fileutils 3.16u. + +1998-08-11 Paul Eggert + + * src/system.h (initialize_main): New macro. + * src/grep.c (main): Invoke initialize_main first thing. + +1998-04-29 Paul Eggert + + * NEWS, src/grep.1: Describe new -a and -d options. + + * src/grep.c (long_options, usage, main): + New options -d or --directories and -a or --text. + (directories, always_text): New variables. + (IS_DIRECTORY_ERRNO): New macro. + (reset): Now returns value specifying whether to skip this file. + Stat the file if either mmap or directory-skipping is possible. + Skip the file if it's a directory and we're skipping directories. + (grep): Skip the file if 'reset' tells us to. + (main): If open fails because the file is a directory, and if we're + skipping directories, don't report an error. + Remove special case for DOS and Windows. + + * src/dosbuf.c (guess_type): Use the same method for guessing whether a + file is binary as grep.c's grep does. + There's no longer any need to declare 'bp' to be unsigned. + +1998-04-26 Alain Magloire + + * grep-2.2 release. + + * src/dfa.c: Wrong revision was pulled out + for beta 2.1.1d. + * src/search.c: Wrong revision was pulled out + for beta 2.1.1d. + + * src/grep.c: ck_atoi () added instead of atoi (). + Suggestion from Jim Meyering. + ck_atoi () pulled from diffutils-2.7, maintained by Paul Eggert. + + * AUTHORS: Rephrase of some sentences. + * README: Rewording. + Noted and patched by Joel N. Weber II. + +1998-04-17 Kaveh R. Ghazi + + * src/dfa.h: Don't define 'const', trust autoconf to handle it. + +1998-04-16 Alain Magloire + + * tests/{status,empty}.sh: wrong return status. + + * src/grep.c: Remove the REGEX part in usage (), it was + consider overkill by most. + +1998-04-14 Eli Zaretskii + + * djgpp/config.bat: Support file names with multiple dots on all + platforms. + + * djgpp/README: Add instructions about file names illegal on + MS-DOS. + +1998-04-13 Alain Magloire + + * src/dfa.c: by "popular" demand reverse + back to '_' not word-constituent. + + * grep-2.1.1c available for testing. + +1998-04-13 Karl Heuer + + * src/grep.c: (a) The directory check is done too early: + logically, if the argument is "-", then it refers to standard + input, regardless of whether there's something in the file + system answering to "-". + (b) The sh command "grep -l root /etc/passwd /etc/group 0<&-" + prints "(standard input)" instead of "/etc/passwd", because it + mistakenly believes that a named file will never be opened on fd + 0. The string "(standard input)" should be based on the file + having been originally specified as "-", rather than making + assumptions about the fd. + (c) the code that calls close(fd) is being done outside of the + test for a bad fd. Thus, if the open failed, this code will + attempt to close(-1). It should be done inside the "fd != -1" + branch. + This patch addresses all three of these problems. + +1998-04-13 Alain Magloire + + * configure.in: remove the deprecated AC_ISC_POSIX macro. + Spotted by Karl Heuer. + +1998-04-03 Eli Zaretskii + + * djgpp/main.mak, djgpp/src.mak, djgpp/tests.mak: Updated from the + relevant Makefile.in files. + + * djgpp/config.bat: Create files in intl directory like the + configure script does. + +1998-03-28 Eli Zaretskii + + * djgpp/main.mak, djgpp/src.mak, djgpp/tests.mak: Updated to track + changes in respective Makefile.in files. + + * src/dosbuf.c (guess_type): Avoid running off the end of the + buffer. Spotted by Paul Eggert. + +1998-03-27 Alain Magloire + + * grep-2.1.1b.tar.gz available. + + * src/regex.c: CLASS_CHAR_MAX set to 256 instead of 6 + when WCTYPE and WCHAR are not defined. When class names + where bigger then 6, it will not detect an error. + example '[[:alphabet:]]'. + + * Updated the copyright of the files with emacs. + With emacs Jim :). + +1998-03-26 Jim Meyering + + * src/dfa.c (IS_WORD_CONSTITUENT): Define. + (lex): Use IS_WORD_CONSTITUENT, not ISALNUM. + Don't special-case '_'. + (dfastate): Use IS_WORD_CONSTITUENT, not ISALNUM. + (dfaexec): Likewise. + +1998-03-25 Alain Magloire + + * tests/warning.sh: typos and replace the echos with + a simple cat. + Noted By Jim Meyering. + + * src/regex.c: #undef ISASCII and ISPRINT before defining + them(On Solaris it was define). + Pattern 'a[[:]:]]b' is an invalid char class and the error + from regex was 1(REG_NOMATCH) instead of 2 (REG_ECTYPE). + Fix with help from Ulrich Drepper. + + * src/grep.c (usage): Ulrich wrote: "A single printf should + not have more than 900 bytes. For translation reasons the + text shouldn't be split in too many pieces since this is + tiresome and also does not help to generate a consistent picture." + Noted by Ulrich Drepper. + * src/grep.c (usage): Dig out and old patch from + Franc,ois to explain the regex in usage(). + Ideas from Franc,ois Pinard. + +1998-03-23 Alain Magloire + + * testing: grep-2.1.1a for testing. + + * configure.in: Solaris needs '-lw' if we use wchar/wctype + functions. + * src/btowc.c: New file from GNU libc. Solaris 2.5 don't + have it define. + * configure.in : check for btowc (). + + * regex.c: Include before , to work around + a Solaris 2.5 bug. + Patch provided by Paul Eggert. + + * tests/status.sh: new file to check return status code. + * tests/empty.sh: new file to check for empty pattern. + * tests/warning.sh: new file to tell where to report errors. + + * configure.in: If available, prefer support for large files + unless the user specified one of the CPPFLAGS, LDFLAGS, or LIBS + variables. + Done by Paul Eggert. + + * src/grep.c (usage): change prep.ai.mit.edu for gnu.org. + +1998-03-18 Alain Magloire + + * src/grep.c (usage): Formating the --help message a bit off. + Noted by William Bader. + + * src/grep.c (main): When checking conflicting matcher for option -E the + matcher was to "egrep" instead of "posix-egrep". + Reported by kwzh@gnu.org. + + * src/grep.c: Typos and rewording the --help message. + Reported by Karl Heuer. + + * src/grep.1: The man page wording : + A regular expression matching a single character may be + followed by one of several repetition operators: + is unclear since 'x(yz)*z' is a valid regex. + Remove the "matching a single character". + Suggested by Harald Hanche-Olsen. + + * src/grep.c (main): '-f /dev/null' now specifies no patterns + and therfore matches nothing. + Reported by Jorge Stolfi. + Patched by Paul Eggert. + +1998-03-10 Alain Magloire + + * Ice storm 98(el nino). Lost grep repository disk, + and my $HOME directory, etc .. + Trying to get the emails/patch from dejanews.com + and start from grep-2.1. + sigh .... + +1997-11-01 Alain Magloire + + * src/grep.c: For the long options, the problems are: + --file appears in the option table as 'no_argument' + instead of 'required_argument'. + --files-with-matches is missing from the option table. + The help lists '--fixed-strings' as the long option for -F, + the table has '--fixed-regexp'. + --regexp appears in the option table as 'no_argument' + instead of 'required_argument'. + --with-filename is missing from the option table. + Reported by Grant McDorman and Krishna Sethuraman. + +1997-10-19 Alain Magloire + + * src/grep.c: the option "with-filename was not in the arg table. + Corrected by Jim Hand. + + * GNU gettext library from gettext-0.10.32. + + * src/grep.c: reverse back to greping directories, + One could skip the error message by defining + SKIP_DIR_ERROR. There is no clear way of doing + things, I hope to setle this on the next majore release + Thanks Paul Eggert, Eli Zaretskii and gnits for the + exchange. + + * tests/status.sh: add this check to make sure + That the return status code is ok. + +1997-10-10 Andreas Schwab + + * src/grep.1: Fix formatting. + + * configure.in: Check for wctype.h, wchar.h, libintl.h and + isascii, which are needed for regex.c. + +1997-10-01 Paul Eggert + + * src/grep.c (fillbuf): Don't warn about mmap failures. + +1997-09-7 Alain Magloire + + * src/grep.c: added code for -H --with-filename. + + * djgpp/*: patch wrongly apply + duplication of text in djgpp/{README,config.h}. + Filter djgpp/config.bat with unix2dos. + + * djgpp/make.mak: beautify + From Eli Zaretskii. + + * grep-2.1 release. + +1997-09-01 Alain Magloire + + * grep-2.0f out for testing. + + * update to GNU gettext library from gettext-0.10.31 + + * grep.c : have a nicer format for --version. + Noted by Ulrich Drepper. + + * obstack.[ch]: updated from GNU C library + * configure.in: look for stdlib.h [HAVE_STDLIB_H] + Comments from Ulrich Drepper. + +1997-08-25 Philippe De Muyter + + * src/dfa.c (sys/types.h): File included unconditionnaly. + +1997-08-16 Eli Zaretskii + + * grep.c (long_options) [O_BINARY]: Add DOS-specific options. + (fillbuf) [O_BINARY]: For DOS-style text files, strip CR + characters at end of line. + (prline) [O_BINARY]: Report correct byte offsets, even though CR + characters were stripped when reading the file. + (usage) [O_BINARY]: Add DOS-specific options. + (setmatcher) [HAVE_SETRLIMIT]: Set re_max_failures so that the + matcher won't ever overflow the stack. + (main) [__MSDOS__, _WIN32]: Handle backslashes and drive letters + in argv[0], remove the .exe suffix, and downcase the prgram name. + [O_BINARY]: Pass additional DOS-specific options to getopt_long + and handle them. Call stat before attempting to open the file, in + case it is a directory (DOS will fail the open call for + directories). Switch the input descriptor to binary mode, unless + it is a terminal device. + + * system.h [O_BINARY]: Define macros to switch a handle to binary + mode, so binary files could be grep'ed on MS-DOS and MS-Windows. + [HAVE_SETLOCALE]: Test for HAVE_SETLOCALE instead of + HAVE_LC_MESSAGES, to prevent compilation error in grep.c on + systems which don't define HAVE_LC_MESSAGES, but have setlocale. + + * dosbuf.c: New file, functions specific for MS-DOS/MS-Windows. + (guess_type, undossify_input, dossified_pos): New functions. + + * djgpp/config.h, djgpp/config.bat, djgpp/main.mak, djgpp/src.mak, + djgpp/po.mak, djgpp/intl.mak, djgpp/tests.mak, djgpp/po2tbl.sed: + New files, for building Grep with DJGPP tools for MS-DOS and + MS-Windows. + + * grep.1: Document DOS-specific switches. + +1997-08-08 Alain Magloire + + * grep-2.0e: available for testing + + * grep.c: change LC_MESSAGE to LC_ALL for (LC_CTYPE). + Suggested by Jochen Hein. + + * ABOUT-NLS: updated. + * grep.c: --version: more verbosity (COPYRIGHT). + * grep.c: --help: PATTERN, FILE instead of , . + * INSTALL.grep: not necessary removed. + * configure.in: --disable-regex rename --without-include-regex. + * THANKS: format: first row name, second email. + * ChangeLog: format ISO 8601. + Reported by Franc,ois Pinard. + + * grep.c: move dcl of struct stat st into "else" where it's used. + Reported by Jim Meyering. + + * grep.c: totalnl should be %u in printf. + Reported by Michael Aichlmay + Corrected with guidance from Ulrich Drepper + +1997-07-24 Alain Magloire + + * Makefile.am: corrected an error when installing {f,e}grep.1. + From Kaveh R. Ghazi . + From Ulrich Drepper . + + * Many files: use PARAMS instead of __STDC__ for prototypes. + From Jim Meyering . + Patch provided by Kaveh R. Ghazi . + + * dfa.[ch]: uses the one in gawk-3.0.3 with the patch from + Arnold (see Changelog: July 12 1997) + + * grep.1: a note to say -l, -L, -q stop on first match. + Noted by Andrew Beattie . + + * grep.c: refuse to scan if the file is a directory. + This was causing problems on SUNs. If the directory contains + a file that could match the pattern, garbage was display. + + * tests directory: added new set of tests from Henry Spencer + regex package. Change the way the tests were done to be more + conformant to automake. + + * configure.in: added --disable-regex for folks with their own fuctions. + + * grep-20d : available for testing + +1997-07-18 Alain Magloire + + * grep-2.0c: available for testing + +1997-07-17 Alain Magloire + + * src/grep.c: Cause grep to fail if 'fclose (stdout)' fails. + From Jim Meyering . + + * grep.c:usage() more consistency in the --help. + + * egrep, fgrep were links This is in violation of GNU standards: + "Please don't make the behavior of a utility depend on the name used + to invoke it. It is useful sometimes to make a link to a utility with + a different name, and that should not change what it does." + For now egrep and fgrep will be copies of grep. A better scheme + should be found later. + After discussion with Tom Tromey . + + * fgrep.man and egrep.man included: They are stubs that call grep.1. + * Makefile.am: modified to install {f,e,}grep[,.1]. + + * speed hack for -l, -L: bail out on first match. + From Scott Weikart . + + * *.[ch]: provided prototypes for strict argument checking + With the help of Stewart Levin . + +1997-07-16 Alain Magloire + + * configure.in: typo in the creation of po/Makefile + Noted by Volker Borchert bt@teknon.de. + + * grep-2.0b: make it available for testing. + +1997-07-15 Alain Magloire + + * src/grep.c usage(): cut the --help in smaller printf()'s + Noted by Ulrich Drepper . + +1997-07-14 Alain Magloire + + * grep-2.0a: make an alpha available for testing. + +1997-07-12 Alain Magloire + + * run gettextize: added the po directory filled with *.po files. + + * check.sh, scriptgen.awk: fix grep paths. + + * change the directory strucure: grep is now in src to comply with + gettext.m4. + + * grep.c version.c [VERSION]: got rid of version.c, + it is now define via config.h. + + * dfa.c: patch to speed up initialization. + Arnold Robbins (arnold@gnu.ai.mit.edu). + +1997-07-09 Alain Magloire + + * *.c [HAVE_CONFIG_H]: Macro defined. + + * support for I18N in Makefile.am and configure.in. + + * update all the string to use gettext(I18N). + Help from Franc,ois Pinard previous patch . + +1997-07-04 Alain Magloire + + * obstack.[ch]: updated from glibc. + Work of Ulrich Drepper . + + * regex.[ch]: updated from glibc. + Work of Ulrich Drepper . + + * grep.c: for option -e not counting '\n' for new keys. + From Mark Waite . + + * grep.c: for option -f allocating the right count. + From Andreas Schwab . + Mike Heartel (mike@cs.uoregon.edu). + + * kwset.c (bmexec): Cast tp[-2] to unsigned char before comparing. + From Jim Meyering . + + * grep.1: various typos. + From Keith Bostic . + Mike Heartel (mike@cs.uoregon.edu). + +1997-06-17 Alain Magloire + + * grep.c: support for long options. + patch done by Franc,ois Pinard . + + * add getopt1.c in Makefile.am. + Noted by Franc,ois Pinard + + * replace getopt.[ch] and add getopt1.c. + + * kwset.c: undef malloc before define it. + Franc,ois Pinard . + +1997-06-07 Alain Magloire + + * grep.c: format incorrect in + fprintf("%s: warning: %s: %s...", filename, strerror(errno)). + Mike Heartel (mike@cs.uoregon.edu). + +1996-11-19 David J MacKenzie + + * make.com: Set the logical SYS. From rdb@cocamrd.oz.au (Rodney Brown). + + * grep.c (S_ISREG): Define if not defined already, for e.g. + SunOS 4.0.3. + + * dfa.c (test_bit, set_bit, clear_bit): Renamed from tstbit, + setbit, clrbit to avoid conflict with HP-UX sys/param.h macros. + + * memchr.c: New file, from GNU libc. + * grep.c (memchr): Remove definition. + * configure.in: Use AC_REPLACE_FUNCS for memchr. + + * configure.in: Remove unused checks for memalign and unsigned char. + * grep.c: HAVE_WORKING_MMAP -> HAVE_MMAP. + + * system.h: New file. + * dfa.c, kwset.c, grep.c, search.c: Use it instead of duplicating + portability boilerplate. + + * grep.c: Include sys/types.h once, instead of three times + conditionally. + * dfa.c, kwset.c, search.c: Include sys/types.h unconditionally, + to always try to get size_t (needed on some old SysV's). + + * dfa.c: Define strchr in terms of index, not the other way around. + * search.c: Use memcpy instead of bcopy. + +1996-11-15 David J MacKenzie + + * Many files: Update FSF address. + Update configuration to use autoconf v2 and automake. + +1993-05-22 Mike Haertel + + * Version 2.0 released. + +Copyright (C) 1998-2017 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..a2f8111 --- /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-2017 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..8865734 --- /dev/null +++ b/INSTALL @@ -0,0 +1,368 @@ +Installation Instructions +************************* + + Copyright (C) 1994-1996, 1999-2002, 2004-2016 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..24b28c0 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,84 @@ +# Process this file with automake to create Makefile.in +# +# Copyright 1997-1998, 2005-2017 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 . +# +AUTOMAKE_OPTIONS = gnu 1.12 + +SUBDIRS = po lib doc src tests gnulib-tests + +EXTRA_DIST = \ + .mailmap \ + ChangeLog-2009 \ + dist-check.mk \ + README \ + README-alpha \ + THANKS.in \ + TODO \ + cfg.mk \ + thanks-gen + +# Shortcut targets to make it easier to run expensive tests. +.PHONY: check-expensive +check-expensive: + $(MAKE) check RUN_EXPENSIVE_TESTS=yes +.PHONY: check-very-expensive +check-very-expensive: check-expensive + +# Run syntax-check rules before creating a distribution tarball. +.PHONY: run-syntax-check +run-syntax-check: all + $(AM_V_GEN)test ! -d .git || $(MAKE) syntax-check + +# Arrange so that .tarball-version appears only in the distribution +# tarball, and never in a checked-out repository. +dist-hook: gen-ChangeLog run-syntax-check + $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version + +gen_start_date = 2009-11-27 +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d .git; then \ + log_fix="$(srcdir)/build-aux/git-log-fix"; \ + test -e "$$log_fix" \ + && amend_git_log="--amend=$$log_fix" \ + || amend_git_log=; \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + $$amend_git_log --since=$(gen_start_date) > $(distdir)/cl-t && \ + { rm -f $(distdir)/ChangeLog && \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ + fi + +# Sort in traditional ASCII order, regardless of the current locale; +# otherwise we may get into trouble with distinct strings that the +# current locale considers to be equal. +ASSORT = LC_ALL=C sort + +# Extract all lines up to the first one starting with "##". +prologue = perl -ne '/^\#\#/ and exit; print' $(srcdir)/THANKS.in + +THANKS: THANKS.in Makefile.am .mailmap thanks-gen + $(AM_V_GEN)rm -f $@-t $@; \ + { \ + $(prologue); echo; \ + { perl -ne '/^$$/.../^$$/ and !/^$$/ and s/ +/\0/ and print' \ + $(srcdir)/THANKS.in; \ + git log --pretty=format:'%aN%x00%aE' \ + | $(ASSORT) -u; \ + } | $(srcdir)/thanks-gen \ + | LC_ALL=en_US.UTF-8 sort -k1,1; \ + echo; \ + printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \ + } > $@-t && chmod a-w $@-t && mv $@-t $@ diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..e84499a --- /dev/null +++ b/Makefile.in @@ -0,0 +1,1745 @@ +# Makefile.in generated by automake 1.99a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2015 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + 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@ +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/assert.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 \ + $(top_srcdir)/m4/chdir-long.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/configmake.m4 \ + $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/cycle-check.m4 \ + $(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \ + $(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \ + $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \ + $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.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/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \ + $(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/i-ring.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconv_h.m4 \ + $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/isatty.m4 $(top_srcdir)/m4/isblank.m4 \ + $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswctype.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lcmessage.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/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localename.m4 $(top_srcdir)/m4/lock.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \ + $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \ + $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ + $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \ + $(top_srcdir)/m4/minmax.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/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \ + $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/onceonly.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \ + $(top_srcdir)/m4/opendir.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/pcre.m4 $(top_srcdir)/m4/perl.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \ + $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/read.m4 \ + $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \ + $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/safe-read.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/setenv.m4 \ + $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat.m4 $(top_srcdir)/m4/std-gnu11.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.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/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strstr.m4 \ + $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtoll.m4 \ + $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ + $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_types_h.m4 \ + $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/time_h.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/version-etc.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/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.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/xstrtol.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) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_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 = +SOURCES = +DIST_SOURCES = +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 +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 distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.hin +# 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 +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.hin \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \ + ChangeLog INSTALL NEWS README THANKS TODO build-aux/ar-lib \ + 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 +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" +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz +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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +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@ +COLORIZE_SOURCE = @COLORIZE_SOURCE@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +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@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DIRFD = @GNULIB_DIRFD@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +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_FDOPENDIR = @GNULIB_FDOPENDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +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_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_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +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_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +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_OPENDIR = @GNULIB_OPENDIR@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +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_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +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_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READDIR = @GNULIB_READDIR@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_REWINDDIR = @GNULIB_REWINDDIR@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANDIR = @GNULIB_SCANDIR@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +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_STRFTIME = @GNULIB_STRFTIME@ +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_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +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_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +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_WCSFTIME = @GNULIB_WCSFTIME@ +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_ALPHASORT = @HAVE_ALPHASORT@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CLOSEDIR = @HAVE_CLOSEDIR@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +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 = @HAVE_DECL_GETLOGIN@ +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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +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_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_DIRENT_H = @HAVE_DIRENT_H@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +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_FDOPENDIR = @HAVE_FDOPENDIR@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +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_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_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +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_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OPENDIR = @HAVE_OPENDIR@ +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_PREAD = @HAVE_PREAD@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READDIR = @HAVE_READDIR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_REWINDDIR = @HAVE_REWINDDIR@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCANDIR = @HAVE_SCANDIR@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +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_SLEEP = @HAVE_SLEEP@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_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_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TZSET = @HAVE_TZSET@ +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_WCSFTIME = @HAVE_WCSFTIME@ +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_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +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@ +LDFLAGS = @LDFLAGS@ +LIBGREPUTILS_LIBDEPS = @LIBGREPUTILS_LIBDEPS@ +LIBGREPUTILS_LTLIBDEPS = @LIBGREPUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMULTITHREAD = @LIBMULTITHREAD@ +LIBOBJS = @LIBOBJS@ +LIBPTH = @LIBPTH@ +LIBPTH_PREFIX = @LIBPTH_PREFIX@ +LIBS = @LIBS@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBTHREAD = @LIBTHREAD@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBPTH = @LTLIBPTH@ +LTLIBTHREAD = @LTLIBTHREAD@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@ +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_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_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_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_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_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_DIRENT_H = @NEXT_DIRENT_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_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_STDARG_H = @NEXT_STDARG_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_TYPES_H = @NEXT_SYS_TYPES_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_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CFLAGS = @PCRE_CFLAGS@ +PCRE_LIBS = @PCRE_LIBS@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +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_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DIRFD = @REPLACE_DIRFD@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +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_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +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_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_OPENDIR = @REPLACE_OPENDIR@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +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_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_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +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_STRFTIME = @REPLACE_STRFTIME@ +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_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +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_WCSFTIME = @REPLACE_WCSFTIME@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +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@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__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@ + +# Process this file with automake to create Makefile.in +# +# Copyright 1997-1998, 2005-2017 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 . +# +AUTOMAKE_OPTIONS = gnu 1.12 +SUBDIRS = po lib doc src tests gnulib-tests +EXTRA_DIST = \ + .mailmap \ + ChangeLog-2009 \ + dist-check.mk \ + README \ + README-alpha \ + THANKS.in \ + TODO \ + cfg.mk \ + thanks-gen + +gen_start_date = 2009-11-27 + +# Sort in traditional ASCII order, regardless of the current locale; +# otherwise we may get into trouble with distinct strings that the +# current locale considers to be equal. +ASSORT = LC_ALL=C sort + +# Extract all lines up to the first one starting with "##". +prologue = perl -ne '/^\#\#/ and exit; print' $(srcdir)/THANKS.in +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu 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__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(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): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.hin: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +# 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 + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @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-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) | eval GZIP= gzip $(GZIP_ENV) -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-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*) \ + eval GZIP= gzip $(GZIP_ENV) -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*) \ + eval GZIP= gzip $(GZIP_ENV) -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 +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: 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: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-lzip dist-xz dist-zip distcheck \ + distclean distclean-generic distclean-hdr distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Shortcut targets to make it easier to run expensive tests. +.PHONY: check-expensive +check-expensive: + $(MAKE) check RUN_EXPENSIVE_TESTS=yes +.PHONY: check-very-expensive +check-very-expensive: check-expensive + +# Run syntax-check rules before creating a distribution tarball. +.PHONY: run-syntax-check +run-syntax-check: all + $(AM_V_GEN)test ! -d .git || $(MAKE) syntax-check + +# Arrange so that .tarball-version appears only in the distribution +# tarball, and never in a checked-out repository. +dist-hook: gen-ChangeLog run-syntax-check + $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d .git; then \ + log_fix="$(srcdir)/build-aux/git-log-fix"; \ + test -e "$$log_fix" \ + && amend_git_log="--amend=$$log_fix" \ + || amend_git_log=; \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + $$amend_git_log --since=$(gen_start_date) > $(distdir)/cl-t && \ + { rm -f $(distdir)/ChangeLog && \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ + fi + +THANKS: THANKS.in Makefile.am .mailmap thanks-gen + $(AM_V_GEN)rm -f $@-t $@; \ + { \ + $(prologue); echo; \ + { perl -ne '/^$$/.../^$$/ and !/^$$/ and s/ +/\0/ and print' \ + $(srcdir)/THANKS.in; \ + git log --pretty=format:'%aN%x00%aE' \ + | $(ASSORT) -u; \ + } | $(srcdir)/thanks-gen \ + | LC_ALL=en_US.UTF-8 sort -k1,1; \ + echo; \ + printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \ + } > $@-t && chmod a-w $@-t && mv $@-t $@ + +# 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..2aaa855 --- /dev/null +++ b/NEWS @@ -0,0 +1,1115 @@ +GNU grep NEWS -*- outline -*- + +* Noteworthy changes in release 3.1 (2017-07-02) [stable] + +** Improvements + + grep '[0-9]' is now just as fast as grep '[[:digit:]]' when run + in a multi-byte locale. Before, it was several times slower. + +** Changes in behavior + + Context no longer excludes selected lines omitted because of -m. + For example, 'grep "^" -m1 -A1' now outputs the first two input + lines, not just the first line. This fixes a glitch that has been + present since -m was added in grep 2.5. + + The following changes affect only MS-Windows platforms. First, the + --binary (-U) option now governs whether binary I/O is used, instead + of a heuristic that was sometimes incorrect. Second, the + --unix-byte-offsets (-u) option now has no effect on MS-Windows too. + + +* Noteworthy changes in release 3.0 (2017-02-09) [stable] + +** Bug fixes + + grep without -F no longer goes awry when given two or more patterns + that contain no special characters other than '\' and also contain a + subpattern like '\.' that escapes a character to make it ordinary. + [bug introduced in grep 2.28] + + grep no longer fails to build on PCRE versions before 8.20. + [bug introduced in grep 2.28] + + +* Noteworthy changes in release 2.28 (2017-02-06) [stable] + +** Bug fixes + + When grep -Fo finds matches of differing length, it could + mistakenly print a shorter one. Now it prints a longest one. + [bug introduced in grep-2.26] + + When standard output is /dev/null, grep no longer fails when + standard input is a file in the Linux /proc file system, or when + standard input is a pipe and standard output is in append mode. + [bugs introduced in grep-2.27] + + Fix performance regression with multiple patterns, e.g., for -Fi in + a multi-byte locale, or for -Fw in a single-byte locale. + [bugs introduced in grep-2.19, grep-2.22 and grep-2.26] + +** Improvements + + Improve performance for -E or -G pattern lists that are easily + converted to -F format. + + +* Noteworthy changes in release 2.27 (2016-12-06) [stable] + +** Bug fixes + + grep no longer reports a false match in a multibyte, non-UTF8 locale + like zh_CN.gb18030, with a regular expression like ".*7" that just + happens to match the 4-byte representation of gb18030's \uC9, the + final byte of which is the digit "7". + [bug introduced in grep-2.19] + + Unless an early-exit option like -q, -l, -L, -m, or -f /dev/null is + specified, grep now reads all of a non-seekable standard input, + even if this cannot affect grep's output or exit status. This works + better with nonportable scripts that run "PROGRAM | grep PATTERN + >/dev/null" where PROGRAM dies when writing into a broken pipe. + [bug introduced in grep-2.26] + + grep no longer mishandles ranges in nontrivial unibyte locales. + [bug introduced in grep-2.26] + + grep -P no longer attempts multiline matches. This works more + intuitively with unusual patterns, and means that grep -Pz no longer + rejects patterns containing ^ and $ and works when combined with -x. + [bugs introduced in grep-2.23] A downside is that grep -P is now + significantly slower, albeit typically still faster than pcregrep. + + grep -m0 -L PAT FILE now outputs "FILE". [bug introduced in grep-2.5] + + To output ':' and tab-align the following character C, grep -T no + longer outputs tab-backspace-':'-C, an approach that has problems if + run inside an Emacs shell window. [bug introduced in grep-2.5.2] + + grep -T now uses worst-case widths of line numbers and byte offsets + instead of guessing widths that might not work with larger files. + [bug introduced in grep-2.5.2] + + grep's use of getprogname no longer causes a build failure on HP-UX. + +** Improvements + + grep no longer reads the input in a few more cases when it is easy + to see that matching cannot succeed, e.g., 'grep -f /dev/null'. + + +* Noteworthy changes in release 2.26 (2016-10-02) [stable] + +** Bug fixes + + Grep no longer omits output merely because it follows an output line + suppressed due to encoding errors. [bug introduced in grep-2.21] + + In the Shift_JIS locale, grep no longer mistakenly matches in the + middle of a multibyte character. [bug present since "the beginning"] + +** Improvements + + grep can be much faster now when standard output is /dev/null. + + grep -F is now typically much faster when many patterns are given, + as it now uses the Aho-Corasick algorithm instead of the + Commentz-Walter algorithm in that case. + + grep -iF is typically much faster in a multibyte locale, if the + pattern and its case counterparts contain only single byte characters. + + grep with complicated expressions (e.g., back-references) and without + -i now uses the regex fastmap for better performance. + + In multibyte locales, grep now handles leading "." in patterns more + efficiently. + + grep now prints a "FILENAME:LINENO: " prefix when diagnosing an + invalid regular expression that was read from an '-f'-specified file. + + +* Noteworthy changes in release 2.25 (2016-04-21) [stable] + +** Bug fixes + + In the C or POSIX locale, grep now treats all bytes as valid + characters even if the C runtime library says otherwise. The + revised behavior is more compatible with the original intent of + POSIX, and the next release of POSIX will likely make this official. + [bug introduced in grep-2.23] + + grep -Pz no longer mistakenly diagnoses patterns like [^a] that use + negated character classes. [bug introduced in grep-2.24] + + grep -oz now uses null bytes, not newlines, to terminate output lines. + [bug introduced in grep-2.5] + +** Improvements + + grep now outputs details more consistently when reporting a write error. + E.g., "grep: write error: No space left on device" rather than just + "grep: write error". + + +* Noteworthy changes in release 2.24 (2016-03-10) [stable] + +** Bug fixes + + grep -z would match strings it should not. To trigger the bug, you'd + have to use a regular expression including an anchor (^ or $) and a + feature like a range or a backreference, causing grep to forego its DFA + matcher and resort to using re_search. With a multibyte locale, that + matcher could mistakenly match a string containing a newline. + For example, this command: + printf 'a\nb\0' | LC_ALL=en_US.utf-8 grep -z '^[a-b]*b' + would mistakenly match and print all four input bytes. After the fix, + there is no match, as expected. + [bug introduced in grep-2.7] + + grep -Pz now diagnoses attempts to use patterns containing ^ and $, + instead of mishandling these patterns. This problem seems to be + inherent to the PCRE API; removing this limitation is on PCRE's + maint/README wish list. Patterns can continue to match literal ^ + and $ by escaping them with \ (now needed even inside [...]). + [bug introduced in grep-2.5] + + +* Noteworthy changes in release 2.23 (2016-02-04) [stable] + +** Bug fixes + + Binary files are now less likely to generate diagnostics and more + likely to yield text matches. grep now reports "Binary file FOO + matches" and suppresses further output instead of outputting a line + containing an encoding error; hence grep can now report matching text + before a later binary match. Formerly, grep reported FOO to be + binary when it found an encoding error in FOO before generating + output for FOO, which meant it never reported both matching text and + matching binary data; this was less useful for searching text + containing encoding errors in non-matching lines. + [bug introduced in grep-2.21] + + grep -c no longer stops counting when finding binary data. + [bug introduced in grep-2.21] + + grep no longer outputs encoding errors in unibyte locales. + For example, if the byte '\x81' is not a valid character in a + unibyte locale, grep treats the byte as binary data. + [bug introduced in grep-2.21] + + grep -oP is no longer susceptible to an infinite loop when processing + invalid UTF8 just before a match. + [bug introduced in grep-2.22] + + --exclude and related options are now matched against trailing + parts of command-line arguments, not against the entire arguments. + This partly reverts the --exclude-related change in 2.22. + [bug introduced in grep-2.22] + + --line-buffer is no longer ineffective when combined with -l. + [bug introduced in grep-2.5] + + -xw is now equivalent to -x more consistently, with -P and with backrefs. + [bug only partially fixed in grep-2.19] + + +* Noteworthy changes in release 2.22 (2015-11-01) [stable] + +** Improvements + + Performance has improved for patterns containing very long strings, + reducing preprocessing time for an N-byte regexp from O(N^2) to + only slightly superlinear for most patterns. Before, a command like + the following would take over a minute, but now, it takes less than + a second: + : | grep -f <(seq -s '' 99999) + + When building grep, 'configure' now uses PCRE's pkg-config module for + configuration information, rather than attempting to guess it by hand. + +** Bug fixes + + A DFA matcher bug made this command mistakenly print its input line: + echo axb | grep -E '^x|x$' + Likewise for this equivalent command: + echo axb | grep -e '^x' -e 'x$' + [bug introduced in grep-2.19 ] + + grep no longer reads from uninitialized memory or from beyond the end + of the heap-allocated input buffer. This fix addressed CVE-2015-1345. + [bug introduced in grep-2.19 ] + + With -z, '.' and '[^x]' in a pattern now consistently match newline. + Previously, they sometimes matched newline, and sometimes did not. + [bug introduced in grep-2.4] + + When the JIT stack is exhausted, grep -P now grows the stack rather + than reporting an internal PCRE error. + + 'grep -D skip PATTERN FILE' no longer hangs if FILE is a fifo. + [bug introduced in grep-2.12] + + --exclude and related options are now matched against entire + command-line arguments, not against command-line components. + [bug introduced in grep-2.6] + + Fix performance degradation of grep -Fw in unibyte locales. + [bug introduced in grep-2.19 ] + + +* Noteworthy changes in release 2.21 (2014-11-23) [stable] + +** Improvements + + Performance has been greatly improved for searching files containing + holes, on platforms where lseek's SEEK_DATA flag works efficiently. + + Performance has improved for rejecting data that cannot match even + the first part of a nontrivial pattern. + + Performance has improved for very long strings in patterns. + + If a file contains data improperly encoded for the current locale, + and this is discovered before any of the file's contents are output, + grep now treats the file as binary. + + grep -P no longer reports an error and exits when given invalid UTF-8 data. + Instead, it considers the data to be non-matching. + +** Bug fixes + + grep no longer mishandles patterns that contain \w or \W in multibyte + locales. + + grep would fail to count newlines internally when operating in non-UTF8 + multibyte locales, leading it to print potentially many lines that did + not match. E.g., the command, "seq 10 | env LC_ALL=zh_CN src/grep -n .." + would print this: + 1:1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + implying that the match, "10" was on line 1. + [bug introduced in grep-2.19] + + grep -F -x -o no longer prints an extra newline for each match. + [bug introduced in grep-2.19] + + grep in a non-UTF8 multibyte locale could mistakenly match in the middle + of a multibyte character when using a '^'-anchored alternate in a pattern, + leading it to print non-matching lines. [bug present since "the beginning"] + + grep -F Y no longer fails to match in non-UTF8 multibyte locales like + Shift-JIS, when the input contains a 2-byte character, XY, followed by + the single-byte search pattern, Y. grep would find the first, middle- + of-multibyte matching "Y", and then mistakenly advance an internal + pointer one byte too far, skipping over the target "Y" just after that. + [bug introduced in grep-2.19] + + grep -E rejected unmatched ')', instead of treating it like '\)'. + [bug present since "the beginning"] + + On NetBSD, grep -r no longer reports "Inappropriate file type or format" + when refusing to follow a symbolic link. + [bug introduced in grep-2.12] + +** Changes in behavior + + The GREP_OPTIONS environment variable is now obsolescent, and grep + now warns if it is used. Please use an alias or script instead. + + In locales with multibyte character encodings other than UTF-8, + grep -P now reports an error and exits instead of misbehaving. + + When searching binary data, grep now may treat non-text bytes as + line terminators. This can boost performance significantly. + + grep -z no longer automatically treats the byte '\200' as binary data. + +* Noteworthy changes in release 2.20 (2014-06-03) [stable] + +** Bug fixes + + grep --max-count=N FILE would no longer stop reading after the Nth match. + I.e., while grep would still print the correct output, it would continue + reading until end of input, and hence, potentially forever. + [bug introduced in grep-2.19] + + A command like echo aa|grep -E 'a(b$|c$)' would mistakenly + report the input as a matched line. + [bug introduced in grep-2.19] + +** Changes in behavior + + grep --exclude-dir='FOO/' now excludes the directory FOO. + Previously, the trailing slash meant the option was ineffective. + + +* Noteworthy changes in release 2.19 (2014-05-22) [stable] + +** Improvements + + Performance has improved, typically by 10% and in some cases by a + factor of 200. However, performance of grep -P in UTF-8 locales has + gotten worse as part of the fix for the crashes mentioned below. + +** Bug fixes + + grep no longer mishandles patterns like [a-[.z.]], and no longer + mishandles patterns like [^a] in locales that have multicharacter + collating sequences so that [^a] can match a string of two characters. + + grep no longer mishandles an empty pattern at the end of a pattern list. + [bug introduced in grep-2.5] + + grep -C NUM now outputs separators consistently even when NUM is zero, + and similarly for grep -A NUM and grep -B NUM. + [bug present since "the beginning"] + + grep -f no longer mishandles patterns containing NUL bytes. + [bug introduced in grep-2.11] + + Plain grep, grep -E, and grep -F now treat encoding errors in patterns + the same way the GNU regular expression matcher treats them, with respect + to whether the errors can match parts of multibyte characters in data. + [bug present since "the beginning"] + + grep -w no longer mishandles a potential match adjacent to a letter that + takes up two or more bytes in a multibyte encoding. + Similarly, the patterns '\<', '\>', '\b', and '\B' no longer + mishandle word-boundary matches in multibyte locales. + [bug present since "the beginning"] + + grep -P now reports an error and exits when given invalid UTF-8 data. + Previously it was unreliable, and sometimes crashed or looped. + [bug introduced in grep-2.16] + + grep -P now works with -w and -x and backreferences. Before, + echo aa|grep -Pw '(.)\1' would fail to match, yet + echo aa|grep -Pw '(.)\2' would match. + + grep -Pw now works like grep -w in that the matched string has to be + preceded and followed by non-word components or the beginning and end + of the line (as opposed to word boundaries before). Before, this + echo a@@a| grep -Pw @@ would match, yet this + echo a@@a| grep -w @@ would not. Now, they both fail to match, + per the documentation on how grep's -w works. + + grep -i no longer mishandles patterns containing titlecase characters. + For example, in a locale containing the titlecase character + 'Lj' (U+01C8 LATIN CAPITAL LETTER L WITH SMALL LETTER J), + 'grep -i Lj' now matches both 'LJ' (U+01C7 LATIN CAPITAL LETTER LJ) + and 'lj' (U+01C9 LATIN SMALL LETTER LJ). + + +* Noteworthy changes in release 2.18 (2014-02-20) [stable] + +** Bug fixes + + grep no longer mishandles patterns like [^^-~] in unibyte locales. + [bug introduced in grep-2.8] + + grep -i in a multibyte, non-UTF8 locale could be up to 200 times slower + than in 2.16. [bug introduced in grep-2.17] + + +* Noteworthy changes in release 2.17 (2014-02-17) [stable] + +** Improvements + + grep -i in a multibyte locale is now typically 10 times faster + for patterns that do not contain \ or [. + + grep (without -i) in a multibyte locale is now up to 7 times faster + when processing many matched lines. + +** Maintenance + + grep's --mmap option was disabled in March of 2010, and began to + elicit a warning in January of 2012. Now it is completely gone. + + +* Noteworthy changes in release 2.16 (2014-01-01) [stable] + +** Bug fixes + + Fix gnulib-provided maint.mk so that the release procedure described + in README-release actually does what we want. Before that fix, that + procedure resulted in a grep-2.15 tarball that would lead to a grep + binary whose --version-reported version number was 2.14.51... + + The fix to make \s and \S work with multi-byte white space broke + the use of each shortcut whenever followed by a repetition operator. + For example, \s*, \s+, \s? and \s{3} would all malfunction in a + multi-byte locale. [bug introduced in grep-2.15] + + The fix to make grep -P work better with UTF-8 made it possible for + grep to evoke a larger set of PCRE errors, some of which could trigger + an abort. E.g., this would abort: + printf '\x82'|LC_ALL=en_US.UTF-8 grep -P y + Now grep handles arbitrary PCRE errors. [bug introduced in grep-2.15] + + Handle very long lines (2GiB and longer) on systems with a deficient + read system call. + +* Noteworthy changes in release 2.15 (2013-10-26) [stable] + +** Bug fixes + + grep's \s and \S failed to work with multi-byte white space characters. + For example, \s would fail to match a non-breaking space, and this + would print nothing: printf '\xc2\xa0' | LC_ALL=en_US.UTF-8 grep '\s' + A related bug is that \S would mistakenly match an invalid multibyte + character. For example, the following would match: + printf '\x82\n' | LC_ALL=en_US.UTF-8 grep '^\S$' + [bug present since grep-2.6] + + grep -i would segfault on systems using UTF-16-based wchar_t (Cygwin) + when converting an input string containing certain 4-byte UTF-8 + sequences to lower case. The conversions to wchar_t and back to + a UTF-8 multibyte string did not take surrogate pairs into account. + [bug present since at least grep-2.6, though the segfault is new with 2.13] + + grep -E would segfault when given a regexp like '([^.]*[M]){1,2}' + for any multibyte character M. [bug introduced in grep-2.6, which would + segfault, but 2.7 and 2.8 had no problem, and 2.9 through 2.14 would + hit a failed assertion. ] + + grep -F would get stuck in an infinite loop when given a search string + that is an invalid byte sequence in the current locale and that matches + the bytes of the input twice on a line. Now grep fails with exit status 1. + + grep -P could misbehave. While multi-byte mode is only supported by PCRE + with UTF-8 locales, grep did not activate it. This would cause failures + to match multibyte characters against some regular expressions, especially + those including the '.' or '\p' metacharacters. + +** New features + + grep -P can now use a just-in-time compiler to greatly speed up matches, + This feature is transparent to the user; no flag is required to enable + it. It is only available if the corresponding support in the PCRE + library is detected when grep is compiled. + + +* Noteworthy changes in release 2.14 (2012-08-20) [stable] + +** Bug fixes + + grep -i '^$' could exit 0 (i.e., report a match) in a multi-byte locale, + even though there was no match, and the command generated no output. + E.g., seq 2 | LC_ALL=en_US.utf8 grep -il '^$' would mistakenly print + "(standard input)". Related, seq 9 | LC_ALL=en_US.utf8 grep -in '^$' + would print "2:4:6:8:10:12:14:16" and exit 0. Now it prints nothing + and exits with status of 1. [bug introduced in grep-2.6] + + 'grep' no longer falsely reports text files as being binary on file + systems that compress contents or that store tiny contents in metadata. + + +* Noteworthy changes in release 2.13 (2012-07-04) [stable] + +** Bug fixes + + grep -i, in a multi-byte locale, when matching a line containing a character + like the UTF-8 Turkish I-with-dot (U+0130) (whose lower-case representation + occupies fewer bytes), would print an incomplete output line. + Similarly, with a matched line containing a character (e.g., the Latin + capital I in a Turkish UTF-8 locale), where the lower-case representation + occupies more bytes, grep could print garbage. + [bug introduced in grep-2.6] + + --include and --exclude can again be combined, and again apply to + the command line, e.g., "grep --include='*.[ch]' --exclude='system.h' + PATTERN *" again reads all *.c and *.h files except for system.h. + [bug introduced in grep-2.6] + +** New features + + 'grep' without -z now treats a sparse file as binary, if it can + easily determine that the file is sparse. + +** Dropped features + + Bootstrapping with Makefile.boot has been broken since grep 2.6, + and was removed. + + +* Noteworthy changes in release 2.12 (2012-04-23) [stable] + +** Bug fixes + + "echo P|grep --devices=skip P" once again prints P, as it did in 2.10 + [bug introduced in grep-2.11] + + grep no longer segfaults with -r --exclude-dir and no file operand. + I.e., ":|grep -r --exclude-dir=D PAT" would segfault. + [bug introduced in grep-2.11] + + Recursive grep now uses fts for directory traversal, so it can + handle much-larger directories without reporting things like "File + name too long", and it can run much faster when dealing with large + directory hierarchies. [bug present since the beginning] + + grep -E 'a{1000000000}' now reports an overflow error rather than + silently acting like grep -E 'a\{1000000000}'. + + grep -E 'a{,10}' was not treated equivalently to grep -E 'a{0,10}'. + +** New features + + The -R option now has a long-option alias --dereference-recursive. + +** Changes in behavior + + The -r (--recursive) option now follows only command-line symlinks. + Also, by default -r now reads a device only if it is named on the command + line; this can be overridden with --devices. -R acts as before, so + use -R if you prefer the old behavior of following all symlinks and + defaulting to reading all devices. + + +* Noteworthy changes in release 2.11 (2012-03-02) [stable] + +** Bug fixes + + grep no longer dumps core on lines whose lengths do not fit in 'int'. + (e.g., lines longer than 2 GiB on a typical 64-bit host). + Instead, grep either works as expected, or reports an error. + An error can occur if not enough main memory is available, or if the + GNU C library's regular expression functions cannot handle such long lines. + [bug present since "the beginning"] + + The -m, -A, -B, and -C options no longer mishandle context line + counts that do not fit in 'int'. Also, grep -c's counts are now + limited by the type 'intmax_t' (typically less than 2**63) rather + than 'int' (typically less than 2**31). + + grep no longer silently suppresses errors when reading a directory + as if it were a text file. For example, "grep x ." now reports a + read error on most systems; formerly, it ignored the error. + [bug introduced in grep-2.5] + + grep now exits with status 2 if a directory loop is found, + instead of possibly exiting with status 0 or 1. + [bug introduced in grep-2.3] + + The -s option now suppresses certain input error diagnostics that it + formerly failed to suppress. These include errors when closing the + input, when lseeking the input, and when the input is also the output. + [bug introduced in grep-2.4] + + On POSIX systems, commands like "grep PAT < FILE >> FILE" + now report an error instead of looping. + [bug present since "the beginning"] + + The --include, --exclude, and --exclude-dir options now handle + command-line arguments more consistently. --include and --exclude + apply only to non-directories and --exclude-dir applies only to + directories. "-" (standard input) is never excluded, since it is + not a file name. + [bug introduced in grep-2.5] + + grep no longer rejects "grep -qr . > out", i.e., when run with -q + and an input file is the same as the output file, since with -q + grep generates no output, so there is no risk of infinite loop or + of an output-affecting race condition. Thus, the use of the following + options also disables the input-equals-output failure: + --max-count=N (-m) (for N >= 2) + --files-with-matches (-l) + --files-without-match (-L) + [bug introduced in grep-2.10] + + grep no longer emits an error message and quits on MS-Windows when + invoked with the -r option. + + grep no longer misinterprets some alternations involving anchors + (^, $, \< \> \B, \b). For example, grep -E "(^|\B)a" no + longer reports a match for the string "x a". + [bug present since "the beginning"] + +** New features + + If no file operand is given, and a command-line -r or equivalent + option is given, grep now searches the working directory. Formerly + grep ignored the -r and searched standard input nonrecursively. + An -r found in GREP_OPTIONS does not have this new effect. + + grep now supports color highlighting of matches on MS-Windows. + +** Changes in behavior + + Use of the --mmap option now elicits a warning. It has been a no-op + since March of 2010. + + grep no longer diagnoses write errors repeatedly; it exits after + diagnosing the first write error. This is better behavior when + writing to a dangling pipe. + + Syntax errors in GREP_COLORS are now ignored, instead of sometimes + eliciting warnings. This is more consistent with programs that + (e.g.) ignore errors in termcap entries. + +* Noteworthy changes in release 2.10 (2011-11-16) [stable] + +** Bug fixes + + grep no longer mishandles high-bit-set pattern bytes on systems + where "char" is a signed type. [bug appears to affect only MS-Windows] + + On POSIX systems, grep now rejects a command like "grep -r pattern . > out", + in which the output file is also one of the inputs, + because it can result in an "infinite" disk-filling loop. + [bug present since "the beginning"] + +** Build-related + + "make dist" no longer builds .tar.gz files. + xz is portable enough and in wide-enough use that distributing + only .tar.xz files is enough. + + +* Noteworthy changes in release 2.9 (2011-06-21) [stable] + +** Bug fixes + + grep no longer clobbers heap for an ERE like '(^| )*( |$)' + [bug introduced in grep-2.6] + + grep is faster on regular expressions that match multibyte characters + in brackets (such as '[áéíóú]'). + + echo c|grep '[c]' would fail for any c in 0x80..0xff, with a uni-byte + encoding for which the byte-to-wide-char mapping is nontrivial. For + example, the ISO-88591 locales are not affected, but ru_RU.KOI8-R is. + [bug introduced in grep-2.6] + + grep -P no longer aborts when PCRE's backtracking limit is exceeded + Before, echo aaaaaaaaaaaaaab |grep -P '((a+)*)+$' would abort. Now, + it diagnoses the problem and exits with status 2. + + +* Noteworthy changes in release 2.8 (2011-05-13) [stable] + +** Bug fixes + + echo c|grep '[c]' would fail for any c in 0x80..0xff, and in many locales. + E.g., printf '\xff\n'|grep "$(printf '[\xff]')" || echo FAIL + would print FAIL rather than the required matching line. + [bug introduced in grep-2.6] + + grep's interpretation of range expression is now more consistent with + that of other tools. [bug present since multi-byte character set + support was introduced in 2.5.2, though the steps needed to reproduce + it changed in grep-2.6] + + grep erroneously returned with exit status 1 on some memory allocation + failure. [bug present since "the beginning"] + + +* Noteworthy changes in release 2.7 (2010-09-16) [stable] + +** Bug fixes + + grep --include=FILE works once again, rather than working like --exclude=FILE + [bug introduced in grep-2.6] + + Searching with grep -Fw for an empty string would not match an + empty line. [bug present since "the beginning"] + + X{0,0} is implemented correctly. It used to be a synonym of X{0,1}. + [bug present since "the beginning"] + + In multibyte locales, regular expressions including backreferences + no longer exhibit quadratic complexity (i.e., they are orders + of magnitude faster). [bug present since multi-byte character set + support was introduced in 2.5.2] + + In UTF-8 locales, regular expressions including "." can be orders + of magnitude faster. For example, "grep ." is now twice as fast + as "grep -v ^$", instead of being immensely slower. It remains + slow in other multibyte locales. [bug present since multi-byte + character set support was introduced in 2.5.2] + + --mmap was meant to be ignored in 2.6.x, but it was instead + removed by mistake. [bug introduced in 2.6] + +** New features + + grep now diagnoses (and fails with exit status 2) commonly mistyped + regular expression like [:space:], [:digit:], etc. Before, those were + silently interpreted as [ac:eps] and [dgit:] respectively. Virtually + all who make that class of mistake should have used [[:space:]] or + [[:digit:]]. This new behavior is disabled when the POSIXLY_CORRECT + environment variable is set. + + On systems using glibc, grep can support equivalence classes. However, + whether they actually work depends on glibc's locale definitions. + +* Noteworthy changes in release 2.6.3 (2010-04-02) [stable] + +** Bug fixes + + Searching with grep -F for an empty string in a multibyte locale + would hang grep. [bug introduced in 2.6.2] + + PCRE support is once again detected on systems with + [bug introduced in 2.6.2] + + +* Noteworthy changes in release 2.6.2 (2010-03-29) [stable] + +** Bug fixes + + grep -F no longer mistakenly reports a match when searching + for an incomplete prefix of a multibyte character. + [bug present since "the beginning"] + + grep -F no longer goes into an infinite loop when it finds a match for an + incomplete (non-prefix of a) multibyte character. [bug introduced in 2.6] + + Using any of the --include or --exclude* options would cause a NULL + dereference. [bugs introduced in 2.6] + +** Build-related + + configure no longer relies on pkg-config to detect PCRE support. + + +* Noteworthy changes in release 2.6.1 (2010-03-25) [stable] + +** Bug fixes + + Character classes could cause a segmentation fault if they included a + multibyte character. [bug introduced in 2.6] + + Character ranges would not work in single-byte character sets other + than C (for example, ISO-8859-1 or KOI8-R) and some multi-byte locales. + For example, this should print "1", but would find no match: + $ echo 1 | env -i LC_COLLATE=en_US.UTF-8 grep '[0-9]' + [bug introduced in 2.6] + + The output of grep was incorrect for whole-word (-w) matches if the + patterns included a back-reference. [bug introduced in grep-2.5.2] + +** Portability + + Avoid a link failure on Solaris 8. + + +* Noteworthy changes in release 2.6 (2010-03-23) [stable] + +** Speed improvements + + grep is much faster on multibyte character sets, especially (but not + limited to) UTF-8 character sets. The speed improvement is also very + pronounced with case-insensitive matches. + +** Bug fixes + + Character classes would malfunction in multi-byte locales when using grep -i. + Examples which would print nothing for LC_ALL=en_US.UTF-8 include: + - for ranges, echo Z | grep -i '[a-z]' + - for single characters, echo Y | grep -i '[y]' + - for character types, echo Y | grep -i '[[:lower:]]' + + grep -i -o would fail to report some matches; grep -i --color, while not + missing any line containing a match, would fail to color some matches. + + grep would fail to report a match in a multibyte character set other than + UTF-8, if another match occurred earlier in the line but started in the + middle of a multibyte character. + + Various bugs in grep -P, caused by expressions such as [^b] or \S matching + newlines, were fixed. grep -P also supports the special sequences \Z and + \z, and can be combined with the command-line option -z to perform searches + on NUL-separated records. + + grep would mistakenly exit with status 1 upon error, rather than 2, + as it is documented to do. + + Using options like -1 -2 or -1 -v -2 results in two lines of + context (the last value that appears on the command line) instead + twelve (the concatenation of all the values). This is consistent + with the behavior of options -A/-B/-C. + + Two new command-line options, --group-separator=ARGUMENT and + --no-group-separator, enable further customization of the output + when -A, -B or -C is being used. + +** Other changes + + egrep accepts the -E option and fgrep accepts the -F option. If egrep + and fgrep are given another of the -E/-F/-G options, they print a more + meaningful error message. + +* Noteworthy changes in release 2.5.4 (2009-02-10) [stable] + + - This is a bugfix release. No new features. + +Version 2.5.3 + - The new option --exclude-dir allows to specify a directory pattern that + will be excluded from recursive grep. + - Numerous bug fixes + +Version 2.5.1 + - This is a bugfix release. No new features. + +Version 2.5 + - The new option --label allows to specify a different name for input + from stdin. See the man or info pages for details. + + - The internal lib/getopt* files are no longer used on systems providing + getopt functionality in their libc (e.g. glibc 2.2.x). + If you need the old getopt files, use --with-included-getopt. + + - The new option --only-matching (-o) will print only the part of matching + lines that matches the pattern. This is useful, for example, to extract + IP addresses from log files. + + - i18n bug fixed ([A-Z0-9] wouldn't match A in locales other than C on + systems using recent glibc builds + + - GNU grep can now be built with autoconf 2.52. + + - The new option --devices controls how grep handles device files. Its usage + is analogous to --directories. + + - The new option --line-buffered fflush on everyline. There is a noticeable + slow down when forcing line buffering. + + - Back references are now local to the regex. + grep -e '\(a\)\1' -e '\(b\)\1' + The last backref \1 in the second expression refer to \(b\) + + - The new option --include=PATTERN will search only matching files + when recursing in directories + + - The new option --exclude=PATTERN will skip matching files when + recursing in directories. + + - The new option --color will use the environment variable GREP_COLOR + (default is red) to highlight the matching string. + --color takes an optional argument specifying when to colorize a line: + --color=always, --color=tty, --color=never + + - The following changes are for POSIX conformance: + + . The -q or --quiet or --silent option now causes grep to exit + with zero status when a input line is selected, even if an error + also occurs. + + . The -s or --no-messages option no longer affects the exit status. + + . Bracket regular expressions like [a-z] are now locale-dependent. + For example, many locales sort characters in dictionary order, + and in these locales the regular expression [a-d] is not + equivalent to [abcd]; it might be equivalent to [aBbCcDd], for + example. To obtain the traditional interpretation of bracket + expressions, you can use the C locale by setting the LC_ALL + environment variable to the value "C". + + - The -C or --context option now requires an argument, partly for + consistency, and partly because POSIX recommends against + optional arguments. + + - The new -P or --perl-regexp option tells grep to interpret the pattern as + a Perl regular expression. + + - The new option --max-count=num makes grep stop reading a file after num + matching lines. + New option -m; equivalent to --max-count. + + - Translations for bg, ca, da, nb and tr have been added. + +Version 2.4.2 + + - Added more check in configure to default the grep-${version}/src/regex.c + instead of the one in GNU Lib C. + +Version 2.4.1 + + - If the final byte of an input file is not a newline, grep now silently + supplies one. + + - The new option --binary-files=TYPE makes grep assume that a binary input + file is of type TYPE. + --binary-files='binary' (the default) outputs a 1-line summary of matches. + --binary-files='without-match' assumes binary files do not match. + --binary-files='text' treats binary files as text + (equivalent to the -a or --text option). + + - New option -I; equivalent to --binary-files='without-match'. + +Version 2.4: + + - egrep is now equivalent to 'grep -E' as required by POSIX, + removing a longstanding source of confusion and incompatibility. + 'grep' is now more forgiving about stray '{'s, for backward + compatibility with traditional egrep. + + - The lower bound of an interval is not optional. + You must use an explicit zero, e.g. 'x{0,10}' instead of 'x{,10}'. + (The old documentation incorrectly claimed that it was optional.) + + - The --revert-match option has been renamed to --invert-match. + + - The --fixed-regexp option has been renamed to --fixed-string. + + - New option -H or --with-filename. + + - New option --mmap. By default, GNU grep now uses read instead of mmap. + This is faster on some hosts, and is safer on all. + + - The new option -z or --null-data causes 'grep' to treat a zero byte + (the ASCII NUL character) as a line terminator in input data, and + to treat newlines as ordinary data. + + - The new option -Z or --null causes 'grep' to output a zero byte + instead of the normal separator after a file name. + + - These two options can be used with commands like 'find -print0', + 'perl -0', 'sort -z', and 'xargs -0' to process arbitrary file names, + even those that contain newlines. + + - The environment variable GREP_OPTIONS specifies default options; + e.g. GREP_OPTIONS='--directories=skip' reestablishes grep 2.1's + behavior of silently skipping directories. + + - You can specify a matcher multiple times without error, e.g. + 'grep -E -E' or 'fgrep -F'. It is still an error to specify + conflicting matchers. + + - -u and -U are now allowed on non-DOS hosts, and have no effect. + + - Modifications of the tests scripts to go around the "Broken Pipe" + errors from bash. See Bash FAQ. + + - New option -r or --recursive or --directories=recurse. + (This option was also in grep 2.3, but wasn't announced here.) + + - --without-included-regex disable, was causing bogus reports .i.e + doing more harm then good. + +Version 2.3: + + - When searching a binary file FOO, grep now just reports + "Binary file FOO matches" instead of outputting binary data. + This is typically more useful than the old behavior, + and it is also more consistent with other utilities like 'diff'. + A file is considered to be binary if it contains a NUL (i.e. zero) byte. + + The new -a or --text option causes 'grep' to assume that all + input is text. (This option has the same meaning as with 'diff'.) + Use it if you want binary data in your output. + + - 'grep' now searches directories just like ordinary files; it no longer + silently skips directories. This is the traditional behavior of + Unix text utilities (in particular, of traditional 'grep'). + Hence 'grep PATTERN DIRECTORY' should report + "grep: DIRECTORY: Is a directory" on hosts where the operating system + does not permit programs to read directories directly, and + "grep: DIRECTORY: Binary file matches" (or nothing) otherwise. + + The new -d ACTION or --directories=ACTION option affects directory handling. + '-d skip' causes 'grep' to silently skip directories, as in grep 2.1; + '-d read' (the default) causes 'grep' to read directories if possible, + as in earlier versions of grep. + + - The MS-DOS and Microsoft Windows ports now behave identically to the + GNU and Unix ports with respect to binary files and directories. + +Version 2.2: + +Bug fix release. + + - Status error number fix. + - Skipping directories removed. + - Many typos fix. + - -f /dev/null fix(not to consider as an empty pattern). + - Checks for wctype/wchar. + - -E was using the wrong matcher fix. + - bug in regex char class fix + - Fixes for DJGPP + +Version 2.1: + +This is a bug fix release(see Changelog) i.e. no new features. + + - More compliance to GNU standard. + - Long options. + - Internationalization. + - Use automake/autoconf. + - Directory hierarchy change. + - Sigvec with -e on Linux corrected. + - Sigvec with -f on Linux corrected. + - Sigvec with the mmap() corrected. + - Bug in kwset corrected. + - -q, -L and -l stop on first match. + - New and improve regex.[ch] from Ulrich Drepper. + - New and improve dfa.[ch] from Arnold Robbins. + - Prototypes for over zealous C compiler. + - Not scanning a file, if it's a directory + (cause problems on Sun). + - Ported to MS-DOS/MS-Windows with DJGPP tools. + +See Changelog for the full story and proper credits. + +Version 2.0: + +The most important user visible change is that egrep and fgrep have +disappeared as separate programs into the single grep program mandated +by POSIX 1003.2. New options -G, -E, and -F have been added, +selecting grep, egrep, and fgrep behavior respectively. For +compatibility with historical practice, hard links named egrep and +fgrep are also provided. See the manual page for details. + +In addition, the regular expression facilities described in Posix +draft 11.2 are now supported, except for internationalization features +related to locale-dependent collating sequence information. + +There is a new option, -L, which is like -l except it lists +files which don't contain matches. The reason this option was +added is because '-l -v' doesn't do what you expect. + +Performance has been improved; the amount of improvement is platform +dependent, but (for example) grep 2.0 typically runs at least 30% faster +than grep 1.6 on a DECstation using the MIPS compiler. Where possible, +grep now uses mmap() for file input; on a Sun 4 running SunOS 4.1 this +may cut system time by as much as half, for a total reduction in running +time by nearly 50%. On machines that don't use mmap(), the buffering +code has been rewritten to choose more favorable alignments and buffer +sizes for read(). + +Portability has been substantially cleaned up, and an automatic +configure script is now provided. + +The internals have changed in ways too numerous to mention. +People brave enough to reuse the DFA matcher in other programs +will now have their bravery amply "rewarded", for the interface +to that file has been completely changed. Some changes were +necessary to track the evolution of the regex package, and since +I was changing it anyway I decided to do a general cleanup. + +======================================================================== +Copyright (C) 1992, 1997-2002, 2004-2017 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. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +Texts. A copy of the license is included in the "GNU Free +Documentation License" file as part of this distribution. diff --git a/README b/README new file mode 100644 index 0000000..7aadf0b --- /dev/null +++ b/README @@ -0,0 +1,59 @@ + Copyright (C) 1992, 1997-2002, 2004-2017 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 is GNU grep, the "fastest grep in the west" (we hope). All +bugs reported in previous releases have been fixed. Many exciting new +bugs have probably been introduced in this revision. + +GNU grep is provided "as is" with no warranty. The exact terms +under which you may use and (re)distribute this program are detailed +in the GNU General Public License, in the file COPYING. + +GNU grep is based on a fast lazy-state deterministic matcher (about +twice as fast as stock Unix egrep) hybridized with a Boyer-Moore-Gosper +search for a fixed string that eliminates impossible text from being +considered by the full regexp matcher without necessarily having to +look at every character. The result is typically many times faster +than Unix grep or egrep. (Regular expressions containing backreferencing +will run more slowly, however.) + +See the files AUTHORS and THANKS for a list of authors and other contributors. + +See the file INSTALL for compilation and installation instructions. +If there is no INSTALL file, this copy of the source code is intended +for expert hackers; please see the file README-hacking. + +See the file NEWS for a description of major changes in this release. + +See the file TODO for ideas on how you could help us improve grep. + +See the file README-alpha for information on grep development and the CVS + repository. + +Send bug reports to bug-grep@gnu.org. + +KNOWN BUGS: + +Several tests in fmbtest.sh and foad1.sh fail under the cs_CZ.UTF-8 locale +and have been disabled. + +The combination of -o and -i options is broken and the known failing cases +are disabled in foad1.sh + +The option -i does not work properly in some multibyte locales such as +tr_TR.UTF-8 where the upper case and lower case forms of a character are not +necessarily of the same byte length. + +A list of outstanding and resolved bugs can be found at: + + http://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep + +You can also browse the bug-grep mailing list archive at: + + http://lists.gnu.org/archive/html/bug-grep/ + +For any copyright year range specified as YYYY-ZZZZ in this package +note that the range specifies every single year in that closed interval. diff --git a/README-alpha b/README-alpha new file mode 100644 index 0000000..3d650d3 --- /dev/null +++ b/README-alpha @@ -0,0 +1,33 @@ + Copyright (C) 1992, 1997-2002, 2004-2017 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. + +The development source code is available via Git from Savannah: see +. The main project page is at +. + +The source code in the Git uses autotools to generate some files. Before +following the instructions in the INSTALL file for compiling grep, you +need to run the bootstrap script. + +Test releases are available at . + +Please submit bug reports to . + +If you are interested in the development of GNU grep, you may want to +subscribe to the development mailing list. To subscribe, send an email +message to with "subscribe" (without the +quotation marks) in the subject header field (or in the body) of the +email, or visit . + +To follow development more closely, there is also the grep-commit mailing +list to which log entries (one per commit) and diff output (one per +modified file) from CVS are automatically sent. To subscribe, send an +email message to with "subscribe" (without +the quotation marks) in the subject header field (or in the body) of +the email, or visit . + +A web page containing information for GNU grep developers is at +. diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..4d489b9 --- /dev/null +++ b/THANKS @@ -0,0 +1,138 @@ +These people have contributed to the GNU grep. Those contributions are +described in the version control logs. If your name has been left out, +if you'd rather not be listed, or if you'd prefer a different address +be used, please send a note to the bug-report mailing list (as seen at +end of e.g., grep --help). + +Adam Katz savannah@kopis.com +Aharon Robbins arnold@skeeve.com +Akim Demaille akim@epita.fr +Alain Magloire alainm@rcsm.ee.mcgill.ca +Allan McRae allan@archlinux.org +Andreas Ley andy@rz.uni-karlsruhe.de +Andreas Schwab schwab@suse.de +Arnold D. Robbins arnold@skeeve.com +Arnold Robbins arnold@skeeve.com +Bastiaan "Darquan" Stougie darquan@zonnet.nl +behoffski behoffski@grouse.com.au +Ben Elliston bje@cygnus.com +Benno Schulenberg bensberg@justemail.net +Bernd Strieder strieder@student.uni-kl.de +Bernhard Rosenkraenzer bero@arklinux.org +Bob Proulx rwp@hprwp.fc.hp.com +Brian Youmans 3diff@gnu.org +Bruno Haible bruno@clisp.org +Charles Levert charles_levert@gna.org +Christian Boltz grep-bug@cboltz.de +Christian Groessler cpg@aladdin.de +Corinna Vinschen vinschen@redhat.com +Dagobert Michelsen dam@opencsw.org +Daisuke GOTO gotoh@m-design.com +Dave Reisner d@falconindy.com +David Clissold cliss@austin.ibm.com +David J MacKenzie djm@catapult.va.pubnix.com +David O'Brien obrien@freebsd.org +Dmitry V. Levin ldv@altlinux.org +'Drake' Daham Wang drakewang@gmail.com +Egmont Koblinger egmont@gmail.com +Eli Zaretskii eliz@gnu.org +Eric Blake eblake@redhat.com +Fernando Basso fernandobasso.br@gmail.com +Florian La Roche laroche@redhat.com +François Pinard pinard@iro.umontreal.ca +Gerald Stoller gerald_stoller@hotmail.com +Grant McDorman grant@isgtec.com +Greg Boyd gboyd.ccsf@gmail.com +Greg Louis glouis@dynamicro.on.ca +Guglielmo 'bond' Bondioni g.bondioni@libero.it +H. Merijn Brand h.m.brand@hccnet.nl +Hans-Bernhard Broeker broeker@physik.rwth-aachen.de +Harald Hanche-Olsen hanche@math.ntnu.no +Heikki Korpela heko@iki.fi +Igor O. Ladygin assa@zabtrans.ru +Ilya Basin basinilya@gmail.com +Isamu Hasegawa isamu@yamato.ibm.com +Jaroslav Škarvada jskarvad@redhat.com +Javier Villavicencio the_paya@gentoo.org +Jeff Bailey jbailey@nisa.net +Jim Hand jhand@austx.tandem.com +Jim Meyering jim@meyering.net +Jochen Hein jochen.hein@delphi.central.de +Joel N. Weber II devnull@gnu.org +Johan Walles johan.walles@gmail.com +John Hughes john@nitelite.calvacom.fr +Jorge Stolfi stolfi@dcc.unicamp.br +Juan Manuel Guerrero juan.guerrero@gmx.de +Julian Foad julianfoad@btopenworld.com +Karl Berry karl@gnu.org +Karl Heuer kwzh@gnu.org +Kaveh R. Ghazi ghazi@caip.rutgers.edu +Kazuro Furukawa furukawa@apricot.kek.jp +Keith Bostic bostic@bsdi.com +Krishna Sethuraman krishna@sgihub.corp.sgi.com +Kurt D Schwehr kdschweh@insci14.ucsd.edu +Ludovic Courtès ludo@gnu.org +Marc Aldorasi m101010a@gmail.com +Mark Veltzer mark.veltzer@gmail.com +Mark Waite markw@mddmew.fc.hp.com +Martin P.J. Zinser zinser@decus.de +Martin Rex martin.rex@sap-ag.de +Matthew Burgess matthew@linuxfromscratch.org +Michael Aichlmayr mikla@nx.com +Mike Frysinger vapier@gentoo.org +Mike Haertel mike@ducky.net +Miles Bader miles@ccs.mt.nec.co.jp +Mirraz Mirraz mirraz1@rambler.ru +Nelson H. F. Beebe beebe@math.utah.edu +Nicolas Vigier boklm@mars-attacks.org +Nima Aghdaii naghdaii@fb.com +Norihiro Tanaka noritnk@kcn.ne.jp +Olaf Kirch okir@ns.lst.de +Pádraig Brady P@draigBrady.com +Paolo Bonzini bonzini@gnu.org +Patrick Boyd pboyd04@gmail.com +Paul Eggert eggert@cs.ucla.edu +Paul Kimoto kimoto@spacenet.tn.cornell.edu +Péter Radics mitchnull@gmail.com +Petr Písař petr.pisar@atlas.cz +Petr Pisar ppisar@redhat.com +Philip Hazel ph10@cus.cam.ac.uk +Philipp Kohlbecher xt28@gmx.de +Philippe Defert Philippe.Defert@cern.ch +Philippe De Muyter phdm@info.ucl.ac.be +Phillip C. Brisco phillip.craig.brisco@ccmail.census.gov +Rainer Orth ro@cebitec.uni-bielefeld.de +Reuben Thomas rrt@sc3d.org +Roland Roberts rroberts@muller.com +Ruslan Ermilov ru@freebsd.org +Santiago Ruano Rincón santiago@debian.org +Santiago Vila sanvila@unex.es +Shannon Hill hill@synnet.com +Sotiris Vassilopoulos Sotiris.Vassilopoulos@betatech.gr +Standish Parsley adsspamtrap01@yahoo.com +Stefano Lattarini stefano.lattarini@gmail.com +Stepan Kasal kasal@ucw.cz +Stephane Chazelas stephane.chazelas@gmail.com +Stewart Levin stew@sep.stanford.edu +Strahinja Kustudic kustodian@gmail.com +Sven Joachim svenjoac@gmx.de +Sydoruk Stepan step@unitex.kiev.ua +Tapani Tarvainen tt@mit.jyu.fi +Tim Waugh twaugh@redhat.com +Tom 'moof' Spindler dogcow@ccs.neu.edu +Tom Tromey tromey@creche.cygnus.com +Tony Abou-Assaleh taa@acm.org +UEBAYASHI Masao masao@nf.enveng.titech.ac.jp +Ulrich Drepper drepper@cygnus.com +Uwe H. Steinfeld usteinfeld@gmx.net +Volker Borchert bt@teknon.de +Wichert Akkerman wichert@cistron.nl +William Bader william@nscs.fast.net +Wolfgang Schludi schludi@syscomp.de +Yuliy Pisetsky ypisetsky@fb.com +Zev Weiss zev@bewilderbeest.net +Zoltan Herczeg hzmester@freemail.hu + +;; Local Variables: +;; coding: utf-8 +;; End: diff --git a/THANKS.in b/THANKS.in new file mode 100644 index 0000000..9872bfa --- /dev/null +++ b/THANKS.in @@ -0,0 +1,102 @@ +These people have contributed to the GNU grep. Those contributions are +described in the version control logs. If your name has been left out, +if you'd rather not be listed, or if you'd prefer a different address +be used, please send a note to the bug-report mailing list (as seen at +end of e.g., grep --help). +## +## There is no need to list here any name that appears as an Author in +## "git log" output. Those are automatically added when this template +## is used to generate the THANKS file. Note that numerous people listed +## here would have been listed as commit authors if we had been using git +## for version control when they contributed. + +Akim Demaille akim@epita.fr +Andreas Schwab schwab@suse.de +Andreas Ley andy@rz.uni-karlsruhe.de +Bastiaan "Darquan" Stougie darquan@zonnet.nl +Ben Elliston bje@cygnus.com +Bernd Strieder strieder@student.uni-kl.de +Bob Proulx rwp@hprwp.fc.hp.com +Brian Youmans 3diff@gnu.org +Christian Boltz grep-bug@cboltz.de +Christian Groessler cpg@aladdin.de +Dagobert Michelsen dam@opencsw.org +Daisuke GOTO gotoh@m-design.com +Dave Reisner d@falconindy.com +David Clissold cliss@austin.ibm.com +David J MacKenzie djm@catapult.va.pubnix.com +David O'Brien obrien@freebsd.org +'Drake' Daham Wang drakewang@gmail.com +Egmont Koblinger egmont@gmail.com +Fernando Basso fernandobasso.br@gmail.com +Florian La Roche laroche@redhat.com +François Pinard pinard@iro.umontreal.ca +Gerald Stoller gerald_stoller@hotmail.com +Grant McDorman grant@isgtec.com +Greg Boyd gboyd.ccsf@gmail.com +Greg Louis glouis@dynamicro.on.ca +Guglielmo 'bond' Bondioni g.bondioni@libero.it +H. Merijn Brand h.m.brand@hccnet.nl +Harald Hanche-Olsen hanche@math.ntnu.no +Hans-Bernhard Broeker broeker@physik.rwth-aachen.de +Heikki Korpela heko@iki.fi +Igor O. Ladygin assa@zabtrans.ru +Ilya Basin basinilya@gmail.com +Isamu Hasegawa isamu@yamato.ibm.com +Jeff Bailey jbailey@nisa.net +Jim Hand jhand@austx.tandem.com +Jochen Hein jochen.hein@delphi.central.de +Joel N. Weber II devnull@gnu.org +John Hughes john@nitelite.calvacom.fr +Jorge Stolfi stolfi@dcc.unicamp.br +Karl Heuer kwzh@gnu.org +Kaveh R. Ghazi ghazi@caip.rutgers.edu +Kazuro Furukawa furukawa@apricot.kek.jp +Keith Bostic bostic@bsdi.com +Krishna Sethuraman krishna@sgihub.corp.sgi.com +Kurt D Schwehr kdschweh@insci14.ucsd.edu +Ludovic Courtès ludo@gnu.org +Marc Aldorasi m101010a@gmail.com +Mark Waite markw@mddmew.fc.hp.com +Martin P.J. Zinser zinser@decus.de +Martin Rex martin.rex@sap-ag.de +Michael Aichlmayr mikla@nx.com +Miles Bader miles@ccs.mt.nec.co.jp +Mirraz Mirraz mirraz1@rambler.ru +Nelson H. F. Beebe beebe@math.utah.edu +Nima Aghdaii naghdaii@fb.com +Olaf Kirch okir@ns.lst.de +Paul Kimoto kimoto@spacenet.tn.cornell.edu +Péter Radics mitchnull@gmail.com +Phillip C. Brisco phillip.craig.brisco@ccmail.census.gov +Philipp Kohlbecher xt28@gmx.de +Philippe Defert Philippe.Defert@cern.ch +Philippe De Muyter phdm@info.ucl.ac.be +Philip Hazel ph10@cus.cam.ac.uk +Rainer Orth ro@cebitec.uni-bielefeld.de +Roland Roberts rroberts@muller.com +Ruslan Ermilov ru@freebsd.org +Santiago Vila sanvila@unex.es +Shannon Hill hill@synnet.com +Sotiris Vassilopoulos Sotiris.Vassilopoulos@betatech.gr +Standish Parsley adsspamtrap01@yahoo.com +Stewart Levin stew@sep.stanford.edu +Strahinja Kustudic kustodian@gmail.com +Sven Joachim svenjoac@gmx.de +Sydoruk Stepan step@unitex.kiev.ua +Tapani Tarvainen tt@mit.jyu.fi +Tim Waugh twaugh@redhat.com +Tom 'moof' Spindler dogcow@ccs.neu.edu +Tom Tromey tromey@creche.cygnus.com +Ulrich Drepper drepper@cygnus.com +UEBAYASHI Masao masao@nf.enveng.titech.ac.jp +Uwe H. Steinfeld usteinfeld@gmx.net +Volker Borchert bt@teknon.de +Wichert Akkerman wichert@cistron.nl +William Bader william@nscs.fast.net +Wolfgang Schludi schludi@syscomp.de +Zoltan Herczeg hzmester@freemail.hu + +;; Local Variables: +;; coding: utf-8 +;; End: diff --git a/TODO b/TODO new file mode 100644 index 0000000..cb953b3 --- /dev/null +++ b/TODO @@ -0,0 +1,339 @@ +Things to do for GNU grep + + Copyright (C) 1992, 1997-2002, 2004-2017 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. + +=============== +Short term work +=============== + +See where we are with UTF-8 performance. + +Merge Debian patches that seem relevant. + +Go through patches in Savannah. + +Fix --directories=read. + +Write better Texinfo documentation for grep. The manual page would be a +good place to start, but Info documents are also supposed to contain a +tutorial and examples. + +Some tests in tests/spencer2.tests should have failed! Need to filter out +some bugs in dfa.[ch]/regex.[ch]. + +Multithreading? + +GNU grep originally did 32-bit arithmetic. Although it has moved to +64-bit on 64-bit platforms by using types like ptrdiff_t and size_t, +this conversion has not been entirely systematic and should be checked. + +Lazy dynamic linking of libpcre. See Debian’s 03-397262-dlopen-pcre.patch. + +Check FreeBSD’s integration of zgrep (-Z) and bzgrep (-J) in one +binary. Is there a possibility of doing even better by automatically +checking the magic of binary files ourselves (0x1F 0x8B for gzip, 0x1F +0x9D for compress, and 0x42 0x5A 0x68 for bzip2)? Once what to do with +libpcre is decided, do the same for libz and libbz2. + + +=================== +Matching algorithms +=================== + +Take a look at these and consider opportunities for merging or cloning: + + -- http://osrd.org/projects/grep/global-regular-expression-print-tools-grep-variants + -- ja-grep’s mlb2 patch (Japanese grep) + + -- lgrep (from lv, a Powerful Multilingual File Viewer / Grep) + ; + -- cgrep (Context grep) + seems like nice work; + -- sgrep (Struct grep) ; + -- agrep (Approximate grep) , + from glimpse; + -- nr-grep (Nondeterministic reverse grep) + ; + -- ggrep (Grouse grep) ; + -- freegrep ; + +Check some new algorithms for matching. See, for example, Faro & +Lecroq (cited in kwset.c). + +Fix the DFA matcher to never use exponential space. (Fortunately, these +cases are rare.) + + +============================ +Standards: POSIX and Unicode +============================ + +For POSIX compliance issues, see POSIX 1003.1. + +Current support for the POSIX [= =] and [. .] constructs is limited to +platforms whose regular expression matchers are sufficiently +compatible with the GNU C library so that the --without-included-regex +option of ‘configure’ is in effect. Extend this support to non-glibc +platforms, where --with-included-regex is in effect, by modifying the +included version of the regex code to defer to the native version when +handling [= =] and [. .]. + +For Unicode, interesting things to check include the Unicode Standard + and the Unicode Technical +Standard #18 ( “Unicode Regular +Expressions”). Talk to Bruno Haible who’s maintaining GNU libunistring. +See also Unicode Standard Annex #15 ( +“Unicode Normalization Forms”), already implemented by GNU libunistring. + +In particular, --ignore-case needs to be evaluated against the standards. +We may want to deviate from POSIX if Unicode provides better or clearer +semantics. + +POSIX and --ignore-case +----------------------- + +For this issue, interesting things to check in POSIX include the +Open Group Base Specifications, Chapter “Regular Expressions”, in +particular Section “Regular Expression General Requirements” and its +paragraph about caseless matching (this may not have been fully +thought through and that this text may be self-contradicting +[specifically: “of either data or patterns” versus all the rest]). +See: + +http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_02 + +In particular, consider the following with POSIX’s approach to case +folding in mind. Assume a non-Turkic locale with a character +repertoire reduced to the following various forms of “LATIN LETTER I”: + + 0049;LATIN CAPITAL LETTER I;Lu;0;L;;;;;N;;;;0069; + 0069;LATIN SMALL LETTER I;Ll;0;L;;;;;N;;;0049;;0049 + 0130;LATIN CAPITAL LETTER I WITH DOT ABOVE;Lu;0;L;0049 0307;;;;N;\ + LATIN CAPITAL LETTER I DOT;;;0069; + 0131;LATIN SMALL LETTER DOTLESS I;Ll;0;L;;;;;N;;;0049;;0049 + +UTF-8 octet lengths differ between U+0049 (0x49) and U+0069 (0x69) +versus U+0130 (0xC4 0xB0) and U+0131 (0xC4 0xB1). This implies that +whole UTF-8 strings cannot be case-converted in place, using the same +memory buffer, and that the needed octet-size of the new buffer cannot +merely be guessed (although there’s a simple upper bound of five times +the size of the input, as the longest UTF-8 encoding of any character +is five bytes). + +We have + + lc(I) = i, uc(I) = I + lc(i) = i, uc(i) = I + lc(İ) = i, uc(İ) = İ + lc(ı) = ı, uc(ı) = I + +where lc() and uc() denote lower-case and upper-case conversions. + +There are several candidate --ignore-case logics. Using the + + if (lc(input_wchar) == lc(pattern_wchar)) + +logic leads to the following matches: + + \in I i İ ı + pat\ ---------- + I | Y Y Y n + i | Y Y Y n + İ | Y Y Y n + ı | n n n Y + +There is a lack of symmetry between CAPITAL and SMALL LETTERs with +this. Using the + + if (uc(input_wchar) == uc(pattern_wchar)) + +logic (which is what GNU grep currently does although this is not +documented or guaranteed in the future), leads to the following +matches: + + \in I i İ ı + pat\ ---------- + I | Y Y n Y + i | Y Y n Y + İ | n n Y n + ı | Y Y n Y + +There is a lack of symmetry between CAPITAL and SMALL LETTERs with +this. + +Using the + + if (lc(input_wchar) == lc(pattern_wchar) + || uc(input_wchar) == uc(pattern_wchar)) + +logic leads to the following matches: + + \in I i İ ı + pat\ ---------- + I | Y Y Y Y + i | Y Y Y Y + İ | Y Y Y n + ı | Y Y n Y + +There is some elegance and symmetry with this. But there are +potentially two conversions to be made per input character. If the +pattern is pre-converted, two copies of it need to be kept and used in +a mutually coherent fashion. + +Using the + + if (input_wchar == pattern_wchar + || lc(input_wchar) == pattern_wchar + || uc(input_wchar) == pattern_wchar) + +logic (a plausible interpretation of POSIX) leads to the following +matches: + + \in I i İ ı + pat\ ---------- + I | Y Y n Y + i | Y Y Y n + İ | n n Y n + ı | n n n Y + +There is a different CAPITAL/SMALL symmetry with this. But there’s +also a loss of pattern/input symmetry that’s unique to it. Also there +are potentially two conversions to be made per input character. + +Using the + + if (lc(uc(input_wchar)) == lc(uc(pattern_wchar))) + +logic leads to the following matches: + + \in I i İ ı + pat\ ---------- + I | Y Y Y Y + i | Y Y Y Y + İ | Y Y Y Y + ı | Y Y Y Y + +This shows total symmetry and transitivity (at least in this example +analysis). There are two conversions to be made per input character, +but support could be added for having a single straight mapping +performing a composition of the two conversions. + +Any optimization in the implementation of each logic must not change +its basic semantic. + + +Unicode and --ignore-case +------------------------- + +For this issue, interesting things to check in Unicode include: + + - The Unicode Standard, Chapter 3 + ( + “Conformance”), Section 3.13 (“Default Case Algorithms”) and the + toCasefold() case conversion operation. + + - The Unicode Standard, Chapter 4 + ( + “Character Properties”), Section 4.2 (“Case”) and + the + SpecialCasing.txt and + + CaseFolding.txt files. + + - The Unicode Standard, Chapter 5 + ( + “Implementation Guidelines”), Section 5.18 (“Case Mappings”), + Subsection “Caseless Matching”. + + - The Unicode case charts . + +Unicode uses the + + if (toCasefold(input_wchar_string) == toCasefold(pattern_wchar_string)) + +logic for caseless matching. Consider the “LATIN LETTER I” example +mentioned above. In a non-Turkic locale, simple case folding yields + + toCasefold_simple(U+0049) = U+0069 + toCasefold_simple(U+0069) = U+0069 + toCasefold_simple(U+0130) = U+0130 + toCasefold_simple(U+0131) = U+0131 + +which leads to the following matches: + + \in I i İ ı + pat\ ---------- + I | Y Y n n + i | Y Y n n + İ | n n Y n + ı | n n n Y + +This is different from anything so far! + +In a non-Turkic locale, full case folding yields + + toCasefold_full(U+0049) = U+0069 + toCasefold_full(U+0069) = U+0069 + toCasefold_full(U+0130) = + toCasefold_full(U+0131) = U+0131 + +with + + 0307;COMBINING DOT ABOVE;Mn;230;NSM;;;;;N;NON-SPACING DOT ABOVE;;;; + +which leads to the following matches: + + \in I i İ ı + pat\ ---------- + I | Y Y * n + i | Y Y * n + İ | n n Y n + ı | n n n Y + +This is just sad! + +Having toCasefold(U+0131), simple or full, map to itself instead of +U+0069 is in contradiction with the rules of Section 5.18 of the +Unicode Standard since toUpperCase(U+0131) is U+0049. Same thing for +toCasefold_simple(U+0130) since toLowerCase(U+0131) is U+0069. The +justification for the weird toCasefold_full(U+0130) mapping is +unknown; it doesn’t even make sense to add a dot (U+0307) to a letter +that already has one (U+0069). It would have been so simple to put +them all in the same equivalence class! + +Otherwise, also consider the following problem with Unicode’s approach +on case folding in mind. Assume that we want to perform + + echo 'AßBC' | grep -i 'Sb' + +which corresponds to + + input: U+0041 U+00DF U+0042 U+0043 U+000A + pattern: U+0053 U+0062 + +Following CaseFolding.txt, applying the toCasefold() transformation to +these yields + + input: U+0061 U+0073 U+0073 U+0062 U+0063 U+000A + pattern: U+0073 U+0062 + +so, according to this approach, the input should match the pattern. +As long as the original input line is to be reported to the user as a +whole, there is no problem (from the user’s point-of-view; +implementation is complicated by this). + +However, consider both these GNU extensions: + + echo 'AßBC' | grep -i --only-matching 'Sb' + echo 'AßBC' | grep -i --color=always 'Sb' + +What is to be reported in these cases, since the match begins in the +*middle* of the original input character ‘ß’? + +Unicode’s toCasefold() cannot be implemented in terms of POSIX’s +towctrans() since that can only return a single wint_t value per input +wint_t value. diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..70af004 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1299 @@ +# generated automatically by aclocal 1.99a -*- Autoconf -*- + +# Copyright (C) 1996-2015 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.185-b502e],, +[m4_warning([this file was generated for autoconf 2.69.185-b502e. +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-2015 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.99a' +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.99a], [], + [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.99a])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-2015 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-2015 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-2015 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_SUBST([DEPDIR], [.deps])]) + + +# 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-2015 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. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _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. +# This creates each '.Po' and '.Plo' makefile fragment that we'll 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" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2015 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 Without this, packages using Gettext 0.18.2 might break horribly. +AC_SUBST([mkdir_p], ['$(MKDIR_P)'])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 +# 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 +_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-2015 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])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2015 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 whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2015 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-2015 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-2015 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-2015 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-2015 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-2015 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-2015 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-2015 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-2015 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/assert.m4]) +m4_include([m4/btowc.m4]) +m4_include([m4/builtin-expect.m4]) +m4_include([m4/chdir-long.m4]) +m4_include([m4/close-stream.m4]) +m4_include([m4/close.m4]) +m4_include([m4/closedir.m4]) +m4_include([m4/closeout.m4]) +m4_include([m4/codeset.m4]) +m4_include([m4/configmake.m4]) +m4_include([m4/ctype.m4]) +m4_include([m4/cycle-check.m4]) +m4_include([m4/d-ino.m4]) +m4_include([m4/d-type.m4]) +m4_include([m4/dirent-safer.m4]) +m4_include([m4/dirent_h.m4]) +m4_include([m4/dirfd.m4]) +m4_include([m4/dirname.m4]) +m4_include([m4/double-slash-root.m4]) +m4_include([m4/dup.m4]) +m4_include([m4/dup2.m4]) +m4_include([m4/eealloc.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/extensions.m4]) +m4_include([m4/extern-inline.m4]) +m4_include([m4/fchdir.m4]) +m4_include([m4/fcntl-o.m4]) +m4_include([m4/fcntl-safer.m4]) +m4_include([m4/fcntl.m4]) +m4_include([m4/fcntl_h.m4]) +m4_include([m4/fdopen.m4]) +m4_include([m4/fdopendir.m4]) +m4_include([m4/filenamecat.m4]) +m4_include([m4/flexmember.m4]) +m4_include([m4/float_h.m4]) +m4_include([m4/fnmatch.m4]) +m4_include([m4/fpending.m4]) +m4_include([m4/fpieee.m4]) +m4_include([m4/fstat.m4]) +m4_include([m4/fstatat.m4]) +m4_include([m4/fts.m4]) +m4_include([m4/getcwd.m4]) +m4_include([m4/getdtablesize.m4]) +m4_include([m4/getopt.m4]) +m4_include([m4/getpagesize.m4]) +m4_include([m4/getprogname.m4]) +m4_include([m4/gettext.m4]) +m4_include([m4/glibc21.m4]) +m4_include([m4/gnulib-common.m4]) +m4_include([m4/gnulib-comp.m4]) +m4_include([m4/hard-locale.m4]) +m4_include([m4/i-ring.m4]) +m4_include([m4/iconv.m4]) +m4_include([m4/iconv_h.m4]) +m4_include([m4/iconv_open.m4]) +m4_include([m4/include_next.m4]) +m4_include([m4/inline.m4]) +m4_include([m4/intlmacosx.m4]) +m4_include([m4/intmax_t.m4]) +m4_include([m4/inttostr.m4]) +m4_include([m4/inttypes-pri.m4]) +m4_include([m4/inttypes.m4]) +m4_include([m4/inttypes_h.m4]) +m4_include([m4/isatty.m4]) +m4_include([m4/isblank.m4]) +m4_include([m4/iswblank.m4]) +m4_include([m4/iswctype.m4]) +m4_include([m4/langinfo_h.m4]) +m4_include([m4/largefile.m4]) +m4_include([m4/lcmessage.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/limits-h.m4]) +m4_include([m4/localcharset.m4]) +m4_include([m4/locale-fr.m4]) +m4_include([m4/locale-ja.m4]) +m4_include([m4/locale-tr.m4]) +m4_include([m4/locale-zh.m4]) +m4_include([m4/locale_h.m4]) +m4_include([m4/localeconv.m4]) +m4_include([m4/localename.m4]) +m4_include([m4/lock.m4]) +m4_include([m4/longlong.m4]) +m4_include([m4/lseek.m4]) +m4_include([m4/lstat.m4]) +m4_include([m4/malloc.m4]) +m4_include([m4/malloca.m4]) +m4_include([m4/manywarnings.m4]) +m4_include([m4/mbchar.m4]) +m4_include([m4/mbiter.m4]) +m4_include([m4/mbrlen.m4]) +m4_include([m4/mbrtowc.m4]) +m4_include([m4/mbsinit.m4]) +m4_include([m4/mbslen.m4]) +m4_include([m4/mbsrtowcs.m4]) +m4_include([m4/mbstate_t.m4]) +m4_include([m4/mbtowc.m4]) +m4_include([m4/memchr.m4]) +m4_include([m4/mempcpy.m4]) +m4_include([m4/memrchr.m4]) +m4_include([m4/minmax.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/nl_langinfo.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/nocrash.m4]) +m4_include([m4/obstack.m4]) +m4_include([m4/off_t.m4]) +m4_include([m4/onceonly.m4]) +m4_include([m4/open.m4]) +m4_include([m4/openat.m4]) +m4_include([m4/opendir.m4]) +m4_include([m4/pathmax.m4]) +m4_include([m4/pcre.m4]) +m4_include([m4/perl.m4]) +m4_include([m4/pipe.m4]) +m4_include([m4/pkg.m4]) +m4_include([m4/po.m4]) +m4_include([m4/printf.m4]) +m4_include([m4/progtest.m4]) +m4_include([m4/pthread_rwlock_rdlock.m4]) +m4_include([m4/putenv.m4]) +m4_include([m4/quote.m4]) +m4_include([m4/quotearg.m4]) +m4_include([m4/read.m4]) +m4_include([m4/readdir.m4]) +m4_include([m4/realloc.m4]) +m4_include([m4/regex.m4]) +m4_include([m4/safe-read.m4]) +m4_include([m4/save-cwd.m4]) +m4_include([m4/setenv.m4]) +m4_include([m4/setlocale.m4]) +m4_include([m4/size_max.m4]) +m4_include([m4/snprintf.m4]) +m4_include([m4/ssize_t.m4]) +m4_include([m4/stat.m4]) +m4_include([m4/std-gnu11.m4]) +m4_include([m4/stdalign.m4]) +m4_include([m4/stdarg.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/strdup.m4]) +m4_include([m4/strerror.m4]) +m4_include([m4/string_h.m4]) +m4_include([m4/strnlen.m4]) +m4_include([m4/strstr.m4]) +m4_include([m4/strtoimax.m4]) +m4_include([m4/strtoll.m4]) +m4_include([m4/strtoull.m4]) +m4_include([m4/strtoumax.m4]) +m4_include([m4/symlink.m4]) +m4_include([m4/sys_socket_h.m4]) +m4_include([m4/sys_stat_h.m4]) +m4_include([m4/sys_types_h.m4]) +m4_include([m4/threadlib.m4]) +m4_include([m4/time_h.m4]) +m4_include([m4/unistd-safer.m4]) +m4_include([m4/unistd_h.m4]) +m4_include([m4/unlocked-io.m4]) +m4_include([m4/vasnprintf.m4]) +m4_include([m4/version-etc.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/wcrtomb.m4]) +m4_include([m4/wctob.m4]) +m4_include([m4/wctomb.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/xstrtol.m4]) diff --git a/build-aux/announce-gen b/build-aux/announce-gen new file mode 100755 index 0000000..e789b13 --- /dev/null +++ b/build-aux/announce-gen @@ -0,0 +1,557 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' + & eval 'exec perl -wS "$0" $argv:q' + if 0; +# Generate a release announcement message. + +my $VERSION = '2016-01-12 23:09'; # 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-2017 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 +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <. +# +# 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 | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.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: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/config.guess b/build-aux/config.guess new file mode 100755 index 0000000..2193702 --- /dev/null +++ b/build-aux/config.guess @@ -0,0 +1,1473 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-05-27' + +# 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 +# +# 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-2017 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=`(uname -p 2>/dev/null || \ + /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 ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-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) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + 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 + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + 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/[-_].*//' | cut -d. -f1,2` + ;; + 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}${abi}" + 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 ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${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 ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + 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) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + 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 "[:upper:]" "[:lower:]"``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 ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-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 ;; + k1om: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; } + ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-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 ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-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}-pc-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 configure 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 ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-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 + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + 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 ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-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 ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&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..af3c415 --- /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-2017 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 + +# 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 or 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-2017 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* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + 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 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | 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 \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]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 \ + | wasm32 \ + | 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-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | 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-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | 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-* \ + | wasm32-* \ + | 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 + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + 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 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + 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 + ;; + nsx-tandem) + basic_machine=nsx-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) + 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) + 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 + ;; + wasm32) + basic_machine=wasm32-unknown + ;; + 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* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -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* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -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* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) + # 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*) + ;; + -ios) + ;; + -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 + ;; + pru-*) + os=-elf + ;; + *-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/depcomp b/build-aux/depcomp new file mode 100755 index 0000000..b687232 --- /dev/null +++ b/build-aux/depcomp @@ -0,0 +1,756 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1999-2017 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: "UTC0" +# 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..b72b15c --- /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=2016-12-31.14 # UTC + +# Note: this is a bash script (could be zsh or dash) + +# Copyright (C) 2009-2017 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" "$@"; 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: "UTC0" +# time-stamp-end: " # UTC" +# End: diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh new file mode 100755 index 0000000..3b71b36 --- /dev/null +++ b/build-aux/gendocs.sh @@ -0,0 +1,504 @@ +#!/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=2016-12-31.18 + +# Copyright 2003-2017 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 importing 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"} +: ${DOCBOOK2HTML="docbook2html"} +: ${DOCBOOK2PDF="docbook2pdf"} +: ${DOCBOOK2TXT="docbook2txt"} +: ${GENDOCS_TEMPLATE_DIR="."} +: ${PERL='perl'} +: ${TEXI2HTML="texi2html"} +unset CDPATH +unset use_texi2html + +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="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual" +infoarg=--no-split +generate_ascii=true +generate_html=true +generate_info=true +generate_tex=true +outdir=manual +source_extra= +split=node +srcfile= +texarg="-t @finalout" + +version="gendocs.sh $scriptversion + +Copyright 2017 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, + instead of '$htmlarg'. + --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. + --tex ARG pass ARG to texi2dvi for DVI and PDF, instead of -t @finalout. + + --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. +" + +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;; + --tex) shift; texarg=$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 $texarg \"$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 $texarg \"$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..079849d --- /dev/null +++ b/build-aux/git-version-gen @@ -0,0 +1,226 @@ +#!/bin/sh +# Print a version string. +scriptversion=2017-01-09.19; # UTC + +# Copyright (C) 2007-2017 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 timestamp 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: "UTC0" +# 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..cf16425 --- /dev/null +++ b/build-aux/gitlog-to-changelog @@ -0,0 +1,499 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' + & eval 'exec perl -wS "$0" $argv:q' + if 0; +# Convert git log output to ChangeLog format. + +my $VERSION = '2016-03-22 21:49'; # 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-2017 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. + --ignore-matching=PAT ignore commit messages whose first lines match PAT. + --ignore-line=PAT ignore lines of commit messages that match PAT. + --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 $ignore_matching; + my $ignore_line; + 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, + 'ignore-matching=s' => \$ignore_matching, + 'ignore-line=s' => \$ignore_line, + '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 = (); + my @skipshas = (); + 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"; + + my $skipflag = 0; + if (@skipshas) + { + foreach(@skipshas) + { + if ($sha =~ /^$_/) + { + $skipflag = $_; + last; + } + } + } + + # 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 /[ \t]*\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|Tiny-change):\s+[Yy]es$/, @line) + ? ' (tiny change)' : ''); + + my $date_line = sprintf "%s %s$tiny\n", + strftime ("%Y-%m-%d", 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:[ ] + |Tiny-change:[ ] + )/x, @line; + + # Remove leading and trailing blank lines. + if (@line) + { + while ($line[0] =~ /^\s*$/) { shift @line; } + while ($line[$#line] =~ /^\s*$/) { pop @line; } + } + + # Handle Emacs gitmerge.el "skipped" commits. + # Yes, this should be controlled by an option. So sue me. + if ( grep /^(; )?Merge from /, @line ) + { + my $found = 0; + foreach (@line) + { + if (grep /^The following commit.*skipped:$/, $_) + { + $found = 1; + ## Reset at each merge to reduce chance of false matches. + @skipshas = (); + next; + } + if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/) + { + push ( @skipshas, $1 ); + } + } + } + + # Ignore commits that match the --ignore-matching pattern, if specified. + if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/) + { + $skipflag = 1; + } + elsif ($skipflag) + { + ## Perhaps only warn if a pattern matches more than once? + warn "$ME: warning: skipping $sha due to $skipflag\n"; + } + + if (! $skipflag) + { + if (defined $ignore_line && @line) + { + @line = grep ! /$ignore_line/, @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/etc. 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: "UTC0" +# 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..a8ed609 --- /dev/null +++ b/build-aux/gnu-web-doc-update @@ -0,0 +1,210 @@ +#!/bin/sh +# Run this after each non-alpha release, to update the web documentation at +# http://www.gnu.org/software/$pkg/manual/ + +VERSION=2016-01-12.23; # UTC + +# Copyright (C) 2009-2017 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 + -m, --mirror remove out of date files from document server + --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= +rm_stale='echo' +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" "$@"; shift + ;; + esac + + case $1 in + --help|--version) ${1#--};; + -C|--builddir) shift; builddir=$1; shift ;; + -n|--dry-run) dryrun=echo; shift;; + -m|--mirror) rm_stale=''; 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" +builddir=$(pwd) + ./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 + # First add non empty dirs individually + find . -name CVS -prune -o -type d \! -empty -print \ + | $XARGS -n1 --no-run-if-empty -- $dryrun $CVS add -ko + # Now add all files + find . -name CVS -prune -o -type f -print \ + | $XARGS --no-run-if-empty -- $dryrun $CVS add -ko + + # Report/Remove stale files + # excluding doc server specific files like CVS/* and .symlinks + if test -n "$rm_stale"; then + echo 'Consider the --mirror option if all of the manual is generated,' >&2 + echo 'which will run `cvs remove` to remove stale files.' >&2 + fi + { find . \( -name CVS -o -type f -name '.*' \) -prune -o -type f -print + (cd "$builddir"/doc/manual/ && find . -type f -print | sed p) + } | sort | uniq -u \ + | $XARGS --no-run-if-empty -- ${rm_stale:-$dryrun} $CVS remove -f + + $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: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/gnupload b/build-aux/gnupload new file mode 100755 index 0000000..d4d95ee --- /dev/null +++ b/build-aux/gnupload @@ -0,0 +1,440 @@ +#!/bin/sh +# Sign files and upload them. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 2004-2017 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: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/install-sh b/build-aux/install-sh new file mode 100755 index 0000000..0360b79 --- /dev/null +++ b/build-aux/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2016-01-11.22; # 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: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/mdate-sh b/build-aux/mdate-sh new file mode 100755 index 0000000..f80075c --- /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=2016-01-11.22; # UTC + +# Copyright (C) 1995-2017 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: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/missing b/build-aux/missing new file mode 100755 index 0000000..594918c --- /dev/null +++ b/build-aux/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1996-2015 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: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/test-driver b/build-aux/test-driver new file mode 100755 index 0000000..d7eac82 --- /dev/null +++ b/build-aux/test-driver @@ -0,0 +1,148 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 2011-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 <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: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex new file mode 100644 index 0000000..b40a6e2 --- /dev/null +++ b/build-aux/texinfo.tex @@ -0,0 +1,11685 @@ +% 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{2017-06-04.19} +% +% 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, 2015, 2016, 2017 +% 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} + +% LaTeX's \typeout. This ensures that the messages it is used for +% are identical in format to the corresponding ones from latex/pdflatex. +\def\typeout{\immediate\write17}% + +\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 + +% Give the space character the catcode for a space. +\def\spaceisspace{\catcode`\ =10\relax} + +% Likewise for ^^M, the end of line character. +\def\endlineisspace{\catcode13=10\relax} + +\chardef\dashChar = `\- +\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 +} + +% 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} + +% Output routine +% + +% 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 } + +% 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. + +% \domark is called twice inside \chapmacro, to add one +% mark before the section break, and one after. +% In the second call \prevchapterdefs is the same as \lastchapterdefs, +% and \prevsectiondefs is the same as \lastsectiondefs. +% Then if the page is not broken at the mark, some of the previous +% section appears on the page, and we can get the name of this section +% from \firstmark for @everyheadingmarks top. +% @everyheadingmarks bottom uses \botmark. +% +% See page 260 of The TeXbook. +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top + \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom + \noexpand\else \the\toks8 % 2: color marks + }% +} + +% \gettopheadingmarks, \getbottomheadingmarks, +% \getcolormarks - extract needed part of mark. +% +% \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\lastsection{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\txipagewidth \newdimen\txipageheight + +% Main output routine. +% +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. +% \shipout a vbox for a single page, adding an optional header, footer, +% cropmarks, and footnote. This also causes index entries for this page +% to be written to the auxiliary files. +% +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Common context changes for both heading and footing. + % 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=\txipagewidth \texinfochars} + % + % Retrieve the information for the headings from the marks in the page, + % and call Plain TeX's \makeheadline and \makefootline, which use the + % values in \headline and \footline. + % + % This is used to check if we are on the first page of a chapter. + \ifcase1\topmark\fi + \let\prevchaptername\thischaptername + \ifcase0\firstmark\fi + \let\curchaptername\thischaptername + % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi + % + \ifx\curchaptername\prevchaptername + \let\thischapterheading\thischapter + \else + % \thischapterheading is the same as \thischapter except it is blank + % for the first page of a chapter. This is to prevent the chapter name + % being shown twice. + \def\thischapterheading{}% + \fi + % + \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% + \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% + % + {% + % Set context for writing to auxiliary files like index files. + % 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{{\indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\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 + +% Main part of page, including any footnotes +\def\pagebody#1{\vbox to\txipageheight{\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}} + + +% Argument parsing + +% 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. +% For example, \def\foo{\parsearg\fooxxx}. +% +\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. Also remove a @texinfoc +% comment (see \scanmacro for details). Pass the result on to \argcheckspaces. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} +\def\argremovetexinfoc#1\texinfoc#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 - define a command taking an argument on the line +% +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +\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. + \addgroupbox + \prevdepth = \dimen1 + \checkinserts +} + +\def\addgroupbox{ + % \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 = \txipageheight \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\txipageheight + \page + \fi + \fi + \box\groupbox +} + +% +% 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 +} + +% @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\c{\begingroup \catcode`\^^M=\active% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\cxxx} +{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} +% +\let\comment\c + +% @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 + +% @setfilename INFO-FILENAME - ignored +\let\setfilename=\comment + +% @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 +\newbox\boxB +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% +% For LuaTeX +% + +\newif\iftxiuseunicodedestname +\txiuseunicodedestnamefalse % For pdfTeX etc. + +\ifx\luatexversion\thisisundefined +\else + % Use Unicode destination names + \txiuseunicodedestnametrue + % Escape PDF strings with converting UTF-16 from UTF-8 + \begingroup + \catcode`\%=12 + \directlua{ + function UTF16oct(str) + tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377') + for c in string.utfvalues(str) do + if c < 0x10000 then + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', + (c / 256), (c % 256))) + else + c = c - 0x10000 + local c_hi = c / 1024 + 0xd800 + local c_lo = c % 1024 + 0xdc00 + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', + (c_hi / 256), (c_hi % 256), + (c_lo / 256), (c_lo % 256))) + end + end + end + } + \endgroup + \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}} + % Escape PDF strings without converting + \begingroup + \directlua{ + function PDFescstr(str) + for c in string.bytes(str) do + if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o', + c)) + else + tex.sprint(string.char(c)) + end + end + end + } + \endgroup + \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} + \ifnum\luatexversion>84 + % For LuaTeX >= 0.85 + \def\pdfdest{\pdfextension dest} + \let\pdfoutput\outputmode + \def\pdfliteral{\pdfextension literal} + \def\pdfcatalog{\pdfextension catalog} + \def\pdftexversion{\numexpr\pdffeedback version\relax} + \let\pdfximage\saveimageresource + \let\pdfrefximage\useimageresource + \let\pdflastximage\lastsavedimageresourceindex + \def\pdfendlink{\pdfextension endlink\relax} + \def\pdfoutline{\pdfextension outline} + \def\pdfstartlink{\pdfextension startlink} + \def\pdffontattr{\pdfextension fontattr} + \def\pdfobj{\pdfextension obj} + \def\pdflastobj{\numexpr\pdffeedback lastobj\relax} + \let\pdfpagewidth\pagewidth + \let\pdfpageheight\pageheight + \edef\pdfhorigin{\pdfvariable horigin} + \edef\pdfvorigin{\pdfvariable vorigin} + \fi +\fi + +% 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. + \xdef#1{#1}% + \else + % The expandable \pdfescapestring primitive escapes parentheses, + % backslashes, and other special chars. + \xdef#1{\pdfescapestring{#1}}% + \fi +} +\def\txiescapepdfutfsixteen#1{% + \ifx\pdfescapestrutfsixteen\thisisundefined + % No UTF-16 converting macro available. + \txiescapepdf{#1}% + \else + \xdef#1{\pdfescapestrutfsixteen{#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} + % + % rg sets the color for filling (usual text, etc.); + % RG 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\setpdfdestname#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 + \makevalueexpandable + \turnoffactive + \iftxiuseunicodedestname + \ifx \declaredencoding \latone + % Pass through Latin-1 characters. + % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode. + \else + \ifx \declaredencoding \utfeight + % Pass through Unicode characters. + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \fi + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + }} + % + \def\setpdfoutlinetext#1{{% + \indexnofonts + \makevalueexpandable + \turnoffactive + \ifx \declaredencoding \latone + % The PDF format can use an extended form of Latin-1 in bookmark + % strings. See Appendix D of the PDF Reference, Sixth Edition, for + % the "PDFDocEncoding". + \passthroughcharstrue + % Pass through Latin-1 characters. + % LuaTeX: Convert to Unicode + % pdfTeX: Use Latin-1 as PDFDocEncoding + \def\pdfoutlinetext{#1}% + \else + \ifx \declaredencoding \utfeight + \ifx\luatexversion\thisisundefined + % For pdfTeX with UTF-8. + % TODO: the PDF format can use UTF-16 in bookmark strings, + % but the code for this isn't done yet. + % Use ASCII approximations. + \passthroughcharsfalse + \def\pdfoutlinetext{#1}% + \else + % For LuaTeX with UTF-8. + % Pass through Unicode characters for title texts. + \passthroughcharstrue + \def\pdfoutlinetext{#1}% + \fi + \else + % For non-Latin-1 or non-UTF-8 encodings. + % Use ASCII approximations. + \passthroughcharsfalse + \def\pdfoutlinetext{#1}% + \fi + \fi + % LuaTeX: Convert to UTF-16 + % pdfTeX: Use Latin-1 as PDFDocEncoding + \txiescapepdfutfsixteen\pdfoutlinetext + }} + % + \def\pdfmkdest#1{% + \setpdfdestname{#1}% + \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. + \setpdfoutlinetext{#1} + \setpdfdestname{#3} + \ifx\pdfdestname\empty + \def\pdfdestname{#4}% + \fi + % + \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#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 + +% +% For XeTeX +% +\ifx\XeTeXrevision\thisisundefined +\else + % + % XeTeX version check + % + \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1 + % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307. + % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941). + % For avoiding PDF destination name replacement, we use this special + % instead of xdvipdfmx's command line option `-C 0x0010'. + \special{dvipdfmx:config C 0x0010} + % XeTeX 0.99995+ comes with xdvipdfmx 20160307+. + % It can handle Unicode destination names for PDF. + \txiuseunicodedestnametrue + \else + % XeTeX < 0.99996 (TeX Live < 2016) cannot use the + % `dvipdfmx:config' special. + % So for avoiding PDF destination name replacement, + % xdvipdfmx's command line option `-C 0x0010' is necessary. + % + % XeTeX < 0.99995 can not handle Unicode destination names for PDF + % because xdvipdfmx 20150315 has a UTF-16 conversion issue. + % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). + \txiuseunicodedestnamefalse + \fi + % + % Color support + % + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} + % + % 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 + } + % + % PDF outline support + % + % Emulate pdfTeX primitive + \def\pdfdest name#1 xyz{% + \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}% + } + % + \def\setpdfdestname#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 + \makevalueexpandable + \turnoffactive + \iftxiuseunicodedestname + % Pass through Unicode characters. + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + }} + % + \def\setpdfoutlinetext#1{{% + \turnoffactive + % Always use Unicode characters in title texts. + \def\pdfoutlinetext{#1}% + % For XeTeX, xdvipdfmx converts to UTF-16. + % So we do not convert. + \txiescapepdf\pdfoutlinetext + }} + % + \def\pdfmkdest#1{% + \setpdfdestname{#1}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + } + % + % by default, use black for everything. + \def\urlcolor{\rgbBlack} + \def\linkcolor{\rgbBlack} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + \def\dopdfoutline#1#2#3#4{% + \setpdfoutlinetext{#1} + \setpdfdestname{#3} + \ifx\pdfdestname\empty + \def\pdfdestname{#4}% + \fi + % + \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A + << /S /GoTo /D (\pdfdestname) >> >> }% + } + % + \def\pdfmakeoutlines{% + \begingroup + % + % For XeTeX, counts of subentries are not necessary. + % Therefore, we read toc only once. + % + % We use node names as destinations. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{1}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{2}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{3}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{4}{##3}{##4}}% + % + \let\appentry\numchapentry% + \let\appsecentry\numsecentry% + \let\appsubsecentry\numsubsecentry% + \let\appsubsubsecentry\numsubsubsecentry% + \let\unnchapentry\numchapentry% + \let\unnsecentry\numsecentry% + \let\unnsubsecentry\numsubsecentry% + \let\unnsubsubsecentry\numsubsubsecentry% + % + % For XeTeX, xdvipdfmx converts strings to UTF-16. + % Therefore, the encoding and the language may not be considered. + % + \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[}]% + ] + + \special{pdf:docview << /PageMode /UseOutlines >> } + % ``\special{pdf:tounicode ...}'' is not necessary + % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it. + % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, + % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. + % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). +% + \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 + } + % 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}% + \special{pdf:bann << /Border [0 0 0] + /Subtype /Link /A << /S /URI /URI (#1) >> >>}% + \endgroup} + \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} + \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{% + \special{pdf:bann << /Border [0 0 0] + /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +% + % + % @image support + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\doxeteximage#1#2#3{% + \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % XeTeX (and the PDF format) supports .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\xeteximgext=\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 + \errmessage{Could not find image file #1 for XeTeX}% + \else \gdef\xeteximgext{JPG}% + \fi + \else \gdef\xeteximgext{jpeg}% + \fi + \else \gdef\xeteximgext{jpg}% + \fi + \else \gdef\xeteximgext{png}% + \fi + \else \gdef\xeteximgext{PDF}% + \fi + \else \gdef\xeteximgext{pdf}% + \fi + \closein 1 + \endgroup + % + \def\xetexpdfext{pdf}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \def\xetexpdfext{PDF}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \XeTeXpicfile "#1".\xeteximgext "" + \fi + \fi + \ifdim \wd0 >0pt width \xeteximagewidth \fi + \ifdim \wd2 >0pt height \xeteximageheight \fi \relax + } +\fi + + +% +\message{fonts,} + +% 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\defsl\slshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\ttfont=\deftt \let\bffont = \defbf +\let\ttslfont=\defttsl \let\slfont=\defsl \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\secrmnotbold\rmshape{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 @acronym 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\defsl\slshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\ttfont=\deftt \let\bffont = \defbf +\let\slfont=\defsl \let\ttslfont=\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 @acronym 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 + +% 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} + + +% 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 +} + +% +% 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 #1font\endcsname % change the current font +} + +\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}} + +% 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}} + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% 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=\rmfont \textfont1=\ifont \textfont2=\syfont + \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont + \textfont\ttfam=\ttfont \textfont\sffam=\sffont +} + +% + +% The font-changing commands (all called \...fonts) redefine the meanings +% of \STYLEfont, 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 \STYLEfont 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\assignfonts#1{% + \expandafter\let\expandafter\rmfont\csname #1rm\endcsname + \expandafter\let\expandafter\itfont\csname #1it\endcsname + \expandafter\let\expandafter\slfont\csname #1sl\endcsname + \expandafter\let\expandafter\bffont\csname #1bf\endcsname + \expandafter\let\expandafter\ttfont\csname #1tt\endcsname + \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname + \expandafter\let\expandafter\sffont \csname #1sf\endcsname + \expandafter\let\expandafter\ifont \csname #1i\endcsname + \expandafter\let\expandafter\syfont \csname #1sy\endcsname + \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname +} + +\newif\ifrmisbold + +% Select smaller font size with the current style. Used to change font size +% in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for +% normal roman text, also use bold fonts for roman text in the smaller size. +\def\switchtolllsize{% + \expandafter\assignfonts\expandafter{\lllsize}% + \ifrmisbold + \let\rmfont\bffont + \fi + \csname\curfontstyle\endcsname +}% + +\def\switchtolsize{% + \expandafter\assignfonts\expandafter{\lsize}% + \ifrmisbold + \let\rmfont\bffont + \fi + \csname\curfontstyle\endcsname +}% + +\def\definefontsetatsize#1#2#3#4#5{% +\expandafter\def\csname #1fonts\endcsname{% + \def\curfontsize{#1}% + \def\lsize{#2}\def\lllsize{#3}% + \csname rmisbold#5\endcsname + \assignfonts{#1}% + \resetmathfonts + \setleading{#4}% +}} + +\definefontsetatsize{text} {reduced}{smaller}{\textleading}{false} +\definefontsetatsize{title} {chap} {subsec} {27pt} {true} +\definefontsetatsize{chap} {sec} {text} {19pt} {true} +\definefontsetatsize{sec} {subsec} {reduced}{17pt} {true} +\definefontsetatsize{ssec} {text} {small} {15pt} {true} +\definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false} +\definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false} +\definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false} + +\def\titlefont#1{{\titlefonts\rm #1}} +\let\subsecfonts = \ssecfonts +\let\subsubsecfonts = \ssecfonts + +% 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`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m + \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@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 + % For pdfTeX and LuaTeX + \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 + \ifx\XeTeXrevision\thisisundefined + \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \else + % For XeTeX + \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 + \fi + \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`\&=\active \catcode`\.=\active + \catcode`\#=\active \catcode`\?=\active + \catcode`\/=\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 + \ifx\XeTeXrevision\thisisundefined + \let\email=\uref + \else + \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} + \fi +\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} + +% @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{% + {\switchtolsize #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{% + \ifmmode\else % only go into math if not in math mode already + \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 + $\expandafter\finishmath\fi +} +\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{\switchtolllsize #1}}$}% +% +\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} +\def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #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. +\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} +\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} +\let\{=\lbracechar +\let\}=\rbracechar + +% @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{\switchtolllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \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. + \switchtolllsize A% + \fi + }% + \vss + }}% + \kern-.15em + \TeX +} + +% Some math mode symbols. Define \ensuremath to switch into math mode +% unless we are already there. Expansion tricks may not be needed here, +% but safer, and can't hurt. +\def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi} +\def\ensuredmath#1{$\relax#1$} +% +\def\bullet{\ensuremath\ptexbullet} +\def\geq{\ensuremath\ge} +\def\leq{\ensuremath\le} +\def\minus{\ensuremath-} + +% @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 +% +{\ttfont \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 European Computer Modern fonts (cm-super in outline format) +% for non-CM glyphs. That is ec* for regular text and tc* for the text +% companion symbols (LaTeX TS1 encoding). Both are part of the ec +% package and follow the same conventions. +% +\def\ecfont{\etcfont{e}} +\def\tcfont{\etcfont{t}} +% +\def\etcfont#1{% + % 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 = #1ctt\ecsize \space at \nominalsize + \else + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = #1c\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{\switchtolllsize 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 + +% @setcontentsaftertitlepage used to do an implicit @contents or +% @shortcontents after @end titlepage, but it is now obsolete. +\def\setcontentsaftertitlepage{% + \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo + command; move your @contents command if you want the contents + after the title page.}}% +\def\setshortcontentsaftertitlepage{% + \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo + command; move your @shortcontents and @contents commands if you + want the contents after the title page.}}% + +\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 +} + +\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. \par should +% be specified before the end of the \vbox, since a vbox is a group. +% +\def\raggedtitlesettings{% + \rm + \hyphenpenalty=10000 + \parindent=0pt + \tolerance=5000 + \ptexraggedright +} + +% Macros to be used within @titlepage: + +\let\subtitlerm=\rmfont +\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\rm \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 \makeheadline and \makefootline in Plain 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\txipageheight 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 + +% These define \getoddheadingmarks, \getevenheadingmarks, +% \getoddfootingmarks, and \getevenfootingmarks, each to one of +% \gettopheadingmarks, \getbottomheadingmarks. +% +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\parseargdef\everyfootingmarks{\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. + +\parseargdef\headings{\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{\thischapterheading\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{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\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{\thischapterheading\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\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}% + % + \ifinner\else + \vadjust{\penalty 1200}% not good to break after first line of item. + \fi + % We can be in inner vertical mode in a footnote, although an + % @itemize looks awful there. + }% + \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 +} + +% Like \expandablevalue, but completely expandable (the \message in the +% definition above operates at the execution level of TeX). Used when +% writing to auxiliary files, due to the expansion that \write does. +% If flag is undefined, pass through an unexpanded @value command: maybe it +% will be set by the time it is read back in. +% +% NB flag names containing - or _ may not work here. +\def\dummyvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \noexpand\value{#1}% + \else + \csname SET#1\endcsname + \fi +} + +% Used for @value's in index entries to form the sort key: expand the @value +% if possible, otherwise sort late. +\def\indexnofontsvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + ZZZZZZZ + \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 IX. +% It automatically defines \IXindex such that +% \IXindex ...rest of line... puts an entry in the index IX. +% It also defines \IXindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is IX. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \expandafter\chardef\csname#1indfile\endcsname=0 + \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{% + \expandafter\chardef\csname#1indfile\endcsname=0 + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + +% The default indices: +\newindex{cp}% concepts, +\newcodeindex{fn}% functions, +\newcodeindex{vr}% variables, +\newcodeindex{tp}% types, +\newcodeindex{ky}% keys +\newcodeindex{pg}% and programs. + + +% @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{% + \requireopenindexfile{#3}% + % 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 index macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is the two-letter name of the index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} +\def\doindexxxx #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} +\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} + + +% Used when writing an index entry out to an index file to prevent +% expansion of Texinfo commands that can appear in an index entry. +% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \definedummyletter\@% + \definedummyletter\ % + % + % For texindex which always views { and } as separators. + \def\{{\lbracechar{}}% + \def\}{\rbracechar{}}% + % + % Do the redefinitions. + \definedummies +} + +% Used for the aux and toc files, where @ is the escape character. +% +\def\atdummies{% + \definedummyletter\@% + \definedummyletter\ % + \definedummyletter\{% + \definedummyletter\}% + % + % Do the redefinitions. + \definedummies + \otherbackslash +} + +% \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. +% +% 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). +% +% For control letters, we have \definedummyletter, which omits the +% space. +% +\def\definedummyword #1{\def#1{\string#1\space}}% +\def\definedummyletter#1{\def#1{\string#1}}% +\let\definedummyaccent\definedummyletter + +% Called from \indexdummies and \atdummies, to effectively prevent +% the expansion of commands. +% +\def\definedummies{% + % + \let\commondummyword\definedummyword + \let\commondummyletter\definedummyletter + \let\commondummyaccent\definedummyaccent + \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\atchar + \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\mathopsup + \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\sub + \definedummyword\sup + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + \let\value\dummyvalue + % + \normalturnoffactive +} + +% \commondummiesnofonts: common to \definedummies and \indexnofonts. +% Define \commondummyletter, \commondummyaccent and \commondummyword before +% using. Used for accents, font commands, and various control letters. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \commondummyletter\!% + \commondummyaccent\"% + \commondummyaccent\'% + \commondummyletter\*% + \commondummyaccent\,% + \commondummyletter\.% + \commondummyletter\/% + \commondummyletter\:% + \commondummyaccent\=% + \commondummyletter\?% + \commondummyaccent\^% + \commondummyaccent\`% + \commondummyaccent\~% + \commondummyword\u + \commondummyword\v + \commondummyword\H + \commondummyword\dotaccent + \commondummyword\ogonek + \commondummyword\ringaccent + \commondummyword\tieaccent + \commondummyword\ubaraccent + \commondummyword\udotaccent + \commondummyword\dotless + % + % Texinfo font commands. + \commondummyword\b + \commondummyword\i + \commondummyword\r + \commondummyword\sansserif + \commondummyword\sc + \commondummyword\slanted + \commondummyword\t + % + % Commands that take arguments. + \commondummyword\abbr + \commondummyword\acronym + \commondummyword\anchor + \commondummyword\cite + \commondummyword\code + \commondummyword\command + \commondummyword\dfn + \commondummyword\dmn + \commondummyword\email + \commondummyword\emph + \commondummyword\env + \commondummyword\file + \commondummyword\image + \commondummyword\indicateurl + \commondummyword\inforef + \commondummyword\kbd + \commondummyword\key + \commondummyword\math + \commondummyword\option + \commondummyword\pxref + \commondummyword\ref + \commondummyword\samp + \commondummyword\strong + \commondummyword\tie + \commondummyword\U + \commondummyword\uref + \commondummyword\url + \commondummyword\var + \commondummyword\verb + \commondummyword\w + \commondummyword\xref +} + +% For testing: output @{ and @} in index sort strings as \{ and \}. +\newif\ifusebracesinindexes + +\let\indexlbrace\relax +\let\indexrbrace\relax + +{\catcode`\@=0 +\catcode`\\=13 + @gdef@backslashdisappear{@def\{}} +} + +{ +\catcode`\<=13 +\catcode`\-=13 +\catcode`\`=13 + \gdef\indexnonalnumdisappear{% + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else + % @set txiindexlquoteignore makes us ignore left quotes in the sort term. + % (Introduced for FSFS 2nd ed.) + \let`=\empty + \fi + % + \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else + \backslashdisappear + \fi + % + \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else + \def-{}% + \fi + \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else + \def<{}% + \fi + \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else + \def\@{}% + \fi + } + + \gdef\indexnonalnumreappear{% + \useindexbackslash + \let-\normaldash + \let<\normalless + \def\@{@}% + } +} + + +% \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\commondummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\commondummyletter##1{\let##1\empty}% + % All control words become @asis by default; overrides below. + \let\commondummyword\commondummyaccent + \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 + % + \uccode`\1=`\{ \uppercase{\def\{{1}}% + \uccode`\1=`\} \uppercase{\def\}{1}}% + \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{TH}% + \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{th}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. \defglyph gives the control sequence a + % definition that removes the {} that follows its use. + \defglyph\atchar{@}% + \defglyph\arrow{->}% + \defglyph\bullet{bullet}% + \defglyph\comma{,}% + \defglyph\copyright{copyright}% + \defglyph\dots{...}% + \defglyph\enddots{...}% + \defglyph\equiv{==}% + \defglyph\error{error}% + \defglyph\euro{euro}% + \defglyph\expansion{==>}% + \defglyph\geq{>=}% + \defglyph\guillemetleft{<<}% + \defglyph\guillemetright{>>}% + \defglyph\guilsinglleft{<}% + \defglyph\guilsinglright{>}% + \defglyph\leq{<=}% + \defglyph\lbracechar{\{}% + \defglyph\minus{-}% + \defglyph\point{.}% + \defglyph\pounds{pounds}% + \defglyph\print{-|}% + \defglyph\quotedblbase{"}% + \defglyph\quotedblleft{"}% + \defglyph\quotedblright{"}% + \defglyph\quoteleft{`}% + \defglyph\quoteright{'}% + \defglyph\quotesinglbase{,}% + \defglyph\rbracechar{\}}% + \defglyph\registeredsymbol{R}% + \defglyph\result{=>}% + \defglyph\textdegree{o}% + % + % 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 + \let\value\indexnofontsvalue +} +\def\defglyph#1#2{\def#1##1{#2}} % see above + + + + +\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}{}} + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. +% TODO: Two-level index? Operation index? + +% Workhorse for all indexes. +% #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 + {% + \requireopenindexfile{#1}% + % 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 +} + +% Check if an index file has been opened, and if not, open it. +\def\requireopenindexfile#1{% +\ifnum\csname #1indfile\endcsname=0 + \expandafter\newwrite \csname#1indfile\endcsname + \edef\suffix{#1}% + % A .fls suffix would conflict with the file extension for the output + % of -recorder, so use .f1s instead. + \ifx\suffix\indexisfl\def\suffix{f1}\fi + % Open the file + \immediate\openout\csname#1indfile\endcsname \jobname.\suffix + % Using \immediate above here prevents an object entering into the current + % box, which could confound checks such as those in \safewhatsit for + % preceding skips. + \typeout{Writing index file \jobname.\suffix}% +\fi} +\def\indexisfl{fl} + +% Output \ as {\indexbackslash}, because \ is an escape character in +% the index files. +\let\indexbackslash=\relax +{\catcode`\@=0 \catcode`\\=\active + @gdef@useindexbackslash{@def\{{@indexbackslash}}} +} + +% Definition for writing index entry text. +\def\sortas#1{\ignorespaces}% + +% Definition for writing index entry sort key. Should occur at the at +% the beginning of the index entry, like +% @cindex @sortas{september} \september +% The \ignorespaces takes care of following space, but there's no way +% to remove space before it. +{ +\catcode`\-=13 +\gdef\indexwritesortas{% + \begingroup + \indexnonalnumreappear + \indexwritesortasxxx} +\gdef\indexwritesortasxxx#1{% + \xdef\indexsortkey{#1}\endgroup} +} + + +% 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 + \useindexbackslash % \indexbackslash isn't defined now so it will be output + % as is; and it will print as backslash. + % The braces around \indexbrace are recognized by texindex. + % + % Get the string to sort by, by processing the index entry with all + % font commands turned off. + {\indexnofonts + \def\lbracechar{{\indexlbrace}}% + \def\rbracechar{{\indexrbrace}}% + \let\{=\lbracechar + \let\}=\rbracechar + \indexnonalnumdisappear + \xdef\indexsortkey{}% + \let\sortas=\indexwritesortas + \edef\temp{\the\toks0}% + \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas + \ifx\indexsortkey\empty + \xdef\indexsortkey{\temp}% + \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi + \fi + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} +\newbox\dummybox % used above + +% 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`\@ = 12 + % See comment in \requireopenindexfile. + \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi + \openin 1 \jobname.\indexname s + \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 + \typeout{No file \jobname.\indexname s.}% + \else + \catcode`\\ = 0 + % + % 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 \thisline + \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{\ttbackslash}% + \let\indexlbrace\{ % Likewise, set these sequences for braces + \let\indexrbrace\} % used in the sort key. + \begindoublecolumns + \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty + % + % Read input from the index file line by line. + \loopdo + \ifeof1 \else + \read 1 to \nextline + \fi + % + \indexinputprocessing + \thisline + % + \ifeof1\else + \let\thisline\nextline + \repeat + %% + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} +\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx} +\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next} + +\def\indexinputprocessing{% + \ifeof1 + \let\firsttoken\relax + \else + \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}% + \act + \fi +} +\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken} +\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1} + + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 +\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 +\catcode`\$=3 +\gdef\initialglyphs{% + % Some changes for non-alphabetic characters. Using the glyphs from the + % math fonts looks more consistent than the typewriter font used elsewhere + % for these characters. + \def\indexbackslash{\math{\backslash}}% + \let\\=\indexbackslash + % + % Can't get bold backslash so don't use bold forward slash + \catcode`\/=13 + \def/{{\secrmnotbold \normalslash}}% + \def-{{\normaldash\normaldash}}% en dash `--' + \def^{{\chapbf \normalcaret}}% + \def~{{\chapbf \normaltilde}}% + \def\_{% + \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% + \def|{$\vert$}% + \def<{$\less$}% + \def>{$\gtr$}% + \def+{$\normalplus$}% +}} + +\def\initial{% + \bgroup + \initialglyphs + \initialx +} + +\def\initialx#1{% + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + % The glue before the bonus allows a little bit of space at the + % bottom of a column to reduce an increase in inter-line spacing. + \nobreak + \vskip 0pt plus 5\baselineskip + \penalty -300 + \vskip 0pt plus -5\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 1\baselineskip + \leftline{\secfonts \kern-0.05em \secbf #1}% + % \secfonts is inside the argument of \leftline so that the change of + % \baselineskip will not affect any glue inserted before the vbox that + % \leftline creates. + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip + \egroup % \initialglyphs +} + +\newdimen\entryrightmargin +\entryrightmargin=0pt + +% \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. +% +\def\entry{% + \begingroup + % + % For pdfTeX and XeTeX. + % The redefinition of \domark stops marks being added in \pdflink to + % preserve coloured links across page boundaries. Otherwise the marks + % would get in the way of \lastbox in \insertentrybox. + \let\domark\relax + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % No extra space above this paragraph. + \parskip = 0in + % + % 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}% An undocumented command + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\entrybreak{\unskip\space\ignorespaces}% +\def\doentry{% + % Save the text of the entry + \global\setbox\boxA=\hbox\bgroup + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. + % Not absorbing as a macro argument reduces the chance of problems + % with catcodes occurring. +} +{\catcode`\@=11 +\gdef\finishentry#1{% + \egroup % end box A + \dimen@ = \wd\boxA % Length of text of entry + \global\setbox\boxA=\hbox\bgroup\unhbox\boxA + % #1 is the page number. + % + % Get the width of the page numbers, and only use + % leaders if they are present. + \global\setbox\boxB = \hbox{#1}% + \ifdim\wd\boxB = 0pt + \null\nobreak\hfill\ % + \else + % + \null\nobreak\indexdotfill % Have leaders before the page number. + % + \ifpdf + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA + \else + \ifx\XeTeXrevision\thisisundefined + \hskip\skip\thinshrinkable #1% + \else + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA + \fi + \fi + \fi + \egroup % end \boxA + \ifdim\wd\boxB = 0pt + \global\setbox\entrybox=\vbox{\unhbox\boxA}% + \else + \global\setbox\entrybox=\vbox\bgroup + % We want the text of the entries to be aligned to the left, and the + % page numbers to be aligned to the right. + % + \parindent = 0pt + \advance\leftskip by 0pt plus 1fil + \advance\leftskip by 0pt plus -1fill + \rightskip = 0pt plus -1fil + \advance\rightskip by 0pt plus 1fill + % Cause last line, which could consist of page numbers on their own + % if the list of page numbers is long, to be aligned to the right. + \parfillskip=0pt plus -1fill + % + \advance\rightskip by \entryrightmargin + % Determine how far we can stretch into the margin. + % This allows, e.g., "Appendix H GNU Free Documentation License" to + % fit on one line in @letterpaper format. + \ifdim\entryrightmargin>2.1em + \dimen@i=2.1em + \else + \dimen@i=0em + \fi + \advance \parfillskip by 0pt minus 1\dimen@i + % + \dimen@ii = \hsize + \advance\dimen@ii by -1\leftskip + \advance\dimen@ii by -1\entryrightmargin + \advance\dimen@ii by 1\dimen@i + \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line + \ifdim\dimen@ > 0.8\dimen@ii % due to long index text + \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly + \dimen@ii = \hsize + \ifnum\dimen@>\dimen@ii + % If the entry is too long, use the whole line + \dimen@ = \dimen@ii + \fi + \advance\leftskip by 0pt plus 1fill % ragged right + \advance \dimen@ by 1\rightskip + \parshape = 2 0pt \dimen@ 0em \dimen@ii + % Ideally we'd add a finite glue at the end of the first line only, + % instead of using \parshape with explicit line lengths, but TeX + % doesn't seem to provide a way to do such a thing. + % + \leftskip = 1em + \parindent = -1em + \fi\fi + \indent % start paragraph + \unhbox\boxA + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % Word spacing - no stretch + \spaceskip=\fontdimen2\font minus \fontdimen4\font + % + \linepenalty=1000 % Discourage line breaks. + \hyphenpenalty=5000 % Discourage hyphenation. + % + \par % format the paragraph + \egroup % The \vbox + \fi + \endgroup + \dotheinsertentrybox +}} + +\newskip\thinshrinkable +\skip\thinshrinkable=.15em minus .15em + +\newbox\entrybox +\def\insertentrybox{% + \ourunvbox\entrybox +} + +% default definition +\let\dotheinsertentrybox\insertentrybox + +% Use \lastbox to take apart vbox box by box, and add each sub-box +% to the current vertical list. +\def\ourunvbox#1{% +\bgroup % for local binding of \delayedbox + % Remove the last box from box #1 + \global\setbox#1=\vbox{% + \unvbox#1% + \unskip % remove any glue + \unpenalty + \global\setbox\interbox=\lastbox + }% + \setbox\delayedbox=\box\interbox + \ifdim\ht#1=0pt\else + \ourunvbox#1 % Repeat on what's left of the box + \nobreak + \fi + \box\delayedbox +\egroup +} +\newbox\delayedbox +\newbox\interbox + +% Used from \printindex. \firsttoken should be the first token +% after the \entry. If it's not another \entry, we are at the last +% line of a group of index entries, so insert a penalty to discourage +% widowed index entries. +\def\dotheinsertentryboxwithpenalty{% + \ifx\firsttoken\isentry + \else + \penalty 9000 + \fi + \insertentrybox +} +\def\isentry{\entry}% + +% Like plain.tex's \dotfill, except uses up at least 1 em. +% The filll stretch here overpowers both the fil and fill stretch to push +% the page number to the right. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} + + +\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 + \ifx\XeTeXrevision\thisisundefined + #2 + \else + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \fi + \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 % private names + +\newbox\partialpage +\newdimen\doublecolumnhsize + +% Use inside an output routine to save \topmark and \firstmark +\def\savemarks{% + \global\savedtopmark=\expandafter{\topmark }% + \global\savedfirstmark=\expandafter{\firstmark }% +} +\newtoks\savedtopmark +\newtoks\savedfirstmark + +% Set \topmark and \firstmark for next time \output runs. +% Can't be run from withinside \output (because any material +% added while an output routine is active, including +% penalties, is saved for after it finishes). The page so far +% should be empty, otherwise what's on it will be thrown away. +\def\restoremarks{% + \mark{\the\savedtopmark}% + \bgroup\output = {% + \setbox\dummybox=\box\PAGE + }abc\eject\egroup + % "abc" because output routine doesn't fire for a completely empty page. + \mark{\the\savedfirstmark}% +} + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % If not much space left on page, start a new page. + \ifdim\pagetotal>0.8\vsize\vfill\eject\fi + % + % 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 + }% + \savemarks + }% + \eject % run that output routine to set \partialpage + \restoremarks + % + % We recover the two marks that the last output routine saved in order + % to propagate the information in marks added around a chapter heading, + % which could be otherwise be lost by the time the final page is output. + % + % + % 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. + \advance\vsize by -\ht\partialpage + \vsize = 2\vsize + % + % For the benefit of balancing columns + \advance\baselineskip by 0pt plus 0.5pt +} + +% The double-column output routine for all double-column pages except +% the last, which is done by \balancecolumns. +% +\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 + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ + \global\advance\vsize by 2\ht\partialpage + \onepageout\pagesofar + \unvbox\PAGE + \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\txipagewidth{\box0\hfil\box2}% +} + + +% Finished with 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 \txipageheight (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. + \savemarks + \balancecolumns + % + % Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + \restoremarks + % Leave the double-column material on the current page, no automatic + % page break. + \box\balancedcolumns + % + % \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. + \global\vsize = \txipageheight % + \pagegoal = \txipageheight % +} +\newbox\balancedcolumns +\setbox\balancedcolumns=\vbox{shouldnt see this}% +% +% Only called for the last of the double column material. \doublecolumnout +% does the others. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \ifdim\dimen@<5\baselineskip + % Don't split a short final column in two. + \setbox2=\vbox{}% + \else + \divide\dimen@ by 2 % target to split to + \dimen@ii = \dimen@ + \splittopskip = \topskip + % Loop until left column is at least as high as the right column. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht1<\ht3 + \global\advance\dimen@ by 1pt + \repeat + }% + % Now the left column is in box 1, and the right column in box 3. + % Check whether the left column has come out higher than the page itself. + % (Note that we have doubled \vsize for the double columns, so + % the actual height of the page is 0.5\vsize). + \ifdim2\ht1>\vsize + % Just split the last of the double column material roughly in half. + \setbox2=\box0 + \setbox0 = \vsplit2 to \dimen@ii + \setbox0=\vbox to \dimen@ii {\unvbox0\vfill}% + \setbox2=\vbox to \dimen@ii {\unvbox2\vfill}% + \else + % Compare the heights of the two columns. + \ifdim4\ht1>5\ht3 + % Column heights are too different, so don't make their bottoms + % flush with each other. + \setbox2=\vbox to \ht1 {\unvbox3\vfill}% + \setbox0=\vbox to \ht1 {\unvbox1\vfill}% + \else + % Make column bottoms flush with each other. + \setbox2=\vbox to\ht1{\unvbox3\unskip}% + \setbox0=\vbox to\ht1{\unvbox1\unskip}% + \fi + \fi + \fi + % + \global\setbox\balancedcolumns=\vbox{\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\rm #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 + % This outputs a mark at the end of the page that clears \thischapter + % and \thissection, as is done in \startcontents. + \let\pchapsepmacro\relax + \chapmacro{}{Yomitfromtoc}{}% + \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{% + \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}} + +% Start a new page +\def\chappager{\par\vfill\supereject} + +% \chapoddpage - start on an odd page for a new chapter +% 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 +} + +\parseargdef\setchapternewpage{\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 + +% \chapmacro - 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{% + \expandafter\ifx\thisenv\titlepage\else + \checkenv{}% chapters, etc., should not start inside an environment. + \fi + % FIXME: \chapmacro is currently called from inside \titlepage when + % \setcontentsaftertitlepage to print the "Table of Contents" heading, but + % this should probably be done by \sectionheading with an option to print + % in chapter size. + % + % 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 \rm + \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 +} + + +% 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 \rm + % + % 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 + \else + \ifx\XeTeXrevision\thisisundefined + \else + \global\pdfmakepagedesttrue + \fi + \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. + \entryrightmargin=\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}\hskip.7em#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 + % Move the page numbers slightly to the right + \advance\entryrightmargin by -0.05em + \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 + % + % ' 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 + \ifnum\lastpenalty<10000 + % Penalize breaking before the environment, because preceding text + % often leads into it. + \penalty100 + \fi + \vskip\envskipamount + \fi + \fi +}} + +\def\afterenvbreak{{% + % =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 +}} + +% \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 + % + \setbox\groupbox=\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 + \addgroupbox + \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 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 { (defn. of \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 \rmfont + % + \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 + +% alias because \c means cedilla in @tex or @math +\let\texinfoc=\c + +\newcount\savedcatcodeone +\newcount\savedcatcodetwo + +% Used at the time of macro expansion. +% Argument is macro body with arguments substituted +\def\scanmacro#1{% + \newlinechar`\^^M + \def\xeatspaces{\eatspaces}% + % + % Temporarily undo catcode changes of \printindex. Set catcode of @ to + % 0 so that @-commands in macro expansions aren't printed literally when + % formatting an index file, where \ is used as the escape character. + \savedcatcodeone=\catcode`\@ + \savedcatcodetwo=\catcode`\\ + \catcode`\@=0 + \catcode`\\=\active + % + % Process the macro body under the current catcode regime. + \scantokens{#1@texinfoc}% + % + \catcode`\@=\savedcatcodeone + \catcode`\\=\savedcatcodetwo + % + % The \texinfoc is to remove the \newlinechar added by \scantokens, and + % can be noticed by \parsearg. + % We avoid surrounding the call to \scantokens with \bgroup and \egroup + % to allow macros to open or close groups themselves. +} + +% Used for copying and captions +\def\scanexp#1{% + \expandafter\scanmacro\expandafter{#1}% +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \commondummyword\macro1\commondummyword\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\commondummyword#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 + \passthroughcharstrue +} + +\def\scanargctxt{% used for copying and captions, not macros. + \scanctxt + \catcode`\@=\other + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% used for @macro definitions + \scanctxt + \catcode`\ =\other + \catcode`\@=\other + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +% Used when scanning braced macro arguments. Note, however, that catcode +% changes here are ineffectual if the macro invocation was nested inside +% an argument to another Texinfo command. +\def\macroargctxt{% + \scanctxt + \catcode`\ =\active + \catcode`\^^M=\other + \catcode`\\=\active +} + +\def\macrolineargctxt{% used for whole-line arguments without braces + \scanctxt + \catcode`\{=\other + \catcode`\}=\other +} + +% \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\commondummyword\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\commondummyword \noexpand#1% + \fi +} + +% \getargs -- Parse the arguments to a @macro line. Set \macname to +% the name of the macro, and \argl to the braced argument list. +\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}} +% This made use of the 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. + +% Parse the optional {params} list to @macro or @rmacro. +% Set \paramno to the number of arguments, +% and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a +% three-param macro.) 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). +% +% If there are 10 or more arguments, a different technique is used: see +% \parsemmanyargdef. +% +\def\parsemargdef#1;{% + \paramno=0\def\paramlist{}% + \let\hash\relax + % \hash is redefined to `#' later to get it into definitions + \let\xeatspaces\relax + \parsemargdefxxx#1,;,% + \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} + +% \parsemacbody, \parsermacbody +% +% Read recursive and nonrecursive macro bodies. (They're different since +% rec and nonrec macros end differently.) +% +% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro +% body to be transformed. +% Set \macrobody to the body of the macro, and call \defmacro. +% +{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% +\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% +{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% +\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% + +% Make @ a letter, so that we can make private-to-Texinfo macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% + +% 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 under which 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). +% +% 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. +\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} + + +\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}% + } + +% Define the named-macro outside of this group and then close this group. +% +\def\macargexpandinbody@{% + \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 +} + +% Trailing 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}% +} + + +%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%% + + +% This defines a Texinfo @macro or @rmacro, called by \parsemacbody. +% \macrobody has the body of the macro in it, with placeholders for +% its parameters, looking like "\xeatspaces{\hash 1}". +% \paramno is the number of parameters +% \paramlist is a TeX parameter text, e.g. "#1,#2,#3," +% There are four cases: macros of zero, one, up to nine, and many arguments. +% \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 + \ifnum\paramno=1 + \def\xeatspaces##1{##1}% + % This removes the pair of braces around the argument. We don't + % use \eatspaces, because this can cause ends of lines to be lost + % when the argument to \eatspaces is read, leading to line-based + % commands like "@itemize" not being read correctly. + \else + \let\xeatspaces\relax % suppress expansion + \fi + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\spaceisspace + \noexpand\endlineisspace + \noexpand\expandafter % skip any whitespace after the macro name. + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname{% + \egroup + \noexpand\scanmacro{\macrobody}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \egroup + \noexpand\scanmacro{\macrobody}% + }% + \else % at most 9 + \ifnum\paramno<10\relax + % @MACNAME sets the context for reading the macro argument + % @MACNAME@@ gets the argument, processes backslashes and appends a + % comma. + % @MACNAME@@@ removes braces surrounding the argument list. + % @MACNAME@@@@ scans the macro body with arguments substituted. + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\expandafter % This \expandafter skip any spaces after the + \noexpand\macroargctxt % macro before we change the catcode of space. + \noexpand\expandafter + \expandafter\noexpand\csname\the\macname @@\endcsname}% + \expandafter\xdef\csname\the\macname @@\endcsname##1{% + \noexpand\passargtomacro + \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname @@@@\endcsname\paramlist{% + \egroup\noexpand\scanmacro{\macrobody}}% + \else % 10 or more: + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \fi + \fi} + +\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape +@catcode`@_=11 % private names +@catcode`@!=11 % used as argument separator + +% \passargtomacro#1#2 - +% Call #1 with a list of tokens #2, with any doubled backslashes in #2 +% compressed to one. +% +% This implementation works by expansion, and not execution (so we cannot use +% \def or similar). This reduces the risk of this failing in contexts where +% complete expansion is done with no execution (for example, in writing out to +% an auxiliary file for an index entry). +% +% State is kept in the input stream: the argument passed to +% @look_ahead, @gobble_and_check_finish and @add_segment is +% +% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) +% +% where: +% THE_MACRO - name of the macro we want to call +% ARG_RESULT - argument list we build to pass to that macro +% PENDING_BS - either a backslash or nothing +% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next + +@gdef@passargtomacro#1#2{% + @add_segment #1!{}@relax#2\@_finish\% +} +@gdef@_finish{@_finishx} @global@let@_finishx@relax + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 used to look ahead +% +% If the next token is not a backslash, process the rest of the argument; +% otherwise, remove the next token. +@gdef@look_ahead#1!#2#3#4{% + @ifx#4\% + @expandafter@gobble_and_check_finish + @else + @expandafter@add_segment + @fi#1!{#2}#4#4% +} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 should be a backslash, which is gobbled. +% #5 looks ahead +% +% Double backslash found. Add a single backslash, and look ahead. +@gdef@gobble_and_check_finish#1!#2#3#4#5{% + @add_segment#1\!{}#5#5% +} + +@gdef@is_fi{@fi} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 is input stream until next backslash +% +% Input stream is either at the start of the argument, or just after a +% backslash sequence, either a lone backslash, or a doubled backslash. +% NEXT_TOKEN contains the first token in the input stream: if it is \finish, +% finish; otherwise, append to ARG_RESULT the segment of the argument up until +% the next backslash. PENDING_BACKSLASH contains a backslash to represent +% a backslash just before the start of the input stream that has not been +% added to ARG_RESULT. +@gdef@add_segment#1!#2#3#4\{% +@ifx#3@_finish + @call_the_macro#1!% +@else + % append the pending backslash to the result, followed by the next segment + @expandafter@is_fi@look_ahead#1#2#4!{\}@fi + % this @fi is discarded by @look_ahead. + % we can't get rid of it with \expandafter because we don't know how + % long #4 is. +} + +% #1 - THE_MACRO +% #2 - ARG_RESULT +% #3 discards the res of the conditional in @add_segment, and @is_fi ends the +% conditional. +@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} + +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% \braceorline MAC is used for a one-argument macro MAC. It checks +% whether the next non-whitespace character is a {. It sets the context +% for reading the argument (slightly different in the two cases). Then, +% to read the argument, in the whole-line case, it then calls the regular +% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. +% +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup + \macroargctxt + \expandafter\passargtomacro + \else + \macrolineargctxt\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 + {% + \requireauxfile + \atdummies % preserve commands, but don't expand them + % match definition in \xrdef, \refx, \xrefX. + \def\value##1{##1}% + \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{\putwordsee{} \xrefXX} +\def\xref{\putwordSee{} \xrefXX} +\def\ref{\xrefXX} + +\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} +\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} +% +\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 + % For pdfTeX and LuaTeX + {\indexnofonts + \makevalueexpandable + \turnoffactive + % 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. + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets + \fi + % + \leavevmode + \startlink attr{/Border [0 0 0]}% + \ifnum\filenamelength>0 + goto file{\the\filename.pdf} name{\pdfdestname}% + \else + goto name{\pdfmkpgn{\pdfdestname}}% + \fi + }% + \setcolor{\linkcolor}% + \else + \ifx\XeTeXrevision\thisisundefined + \else + % For XeTeX + {\indexnofonts + \makevalueexpandable + \turnoffactive + % 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. + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets + \fi + % + \leavevmode + \ifnum\filenamelength>0 + % With default settings, + % XeTeX (xdvipdfmx) replaces link destination names with integers. + % In this case, the replaced destination names of + % remote PDFs are no longer known. In order to avoid a replacement, + % you can use xdvipdfmx's command line option `-C 0x0010'. + % If you use XeTeX 0.99996+ (TeX Live 2016+), + % this command line option is no longer necessary + % because we can use the `dvipdfmx:config' special. + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% + \else + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoTo /D (\pdfdestname) >> >>}% + \fi + }% + \setcolor{\linkcolor}% + \fi + \fi + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \def\value##1{##1}% + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". \iffloat distinguishes them by + % \Xthisreftitle being set to a magic string. + \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}{}% + % Add a , if xref followed by a space + \if\space\noexpand\tokenafterxref ,% + \else\ifx\ \tokenafterxref ,% @TAB + \else\ifx\*\tokenafterxref ,% @* + \else\ifx\ \tokenafterxref ,% @SPACE + \else\ifx\ + \tokenafterxref ,% @NL + \else\ifx\tie\tokenafterxref ,% @tie + \fi\fi\fi\fi\fi\fi + \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 +} + +% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX +% is output afterwards if non-empty. +\def\refx#1#2{% + \requireauxfile + {% + \indexnofonts + \otherbackslash + \def\value##1{##1}% + \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. Define a control +% sequence for a cross-reference target (we prepend XR to the control sequence +% name to avoid collisions). The value is the page number. If this is a float +% type, we have more work to do. +% +\def\xrdef#1#2{% + {% Expand the node or anchor name to remove control sequences. + % \turnoffactive stops 8-bit characters being changed to commands + % like @'e. \refx does the same to retrieve the value in the definition. + \indexnofonts + \turnoffactive + \def\value##1{##1}% + \xdef\safexrefname{#1}% + }% + % + \bgroup + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% + \egroup + % We put the \gdef inside a group to avoid the definitions building up on + % TeX's save stack, which can cause it to run out of space for aux files with + % thousands of lines. \gdef doesn't use the save stack, but \csname does + % when it defines an unknown control sequence as \relax. + % + % 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 +} + +% 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 at the beginning of the file. +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% Used when writing to the aux file, or when using data from it. +\def\requireauxfile{% + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi + \global\let\requireauxfile=\relax % Only do this once. +} + +% 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 + % + % @ 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=\txipagewidth + \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 + \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro + % 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 + % For pdfTeX and LuaTeX <= 0.80 + \dopdfimage{#1}{#2}{#3}% + \else + \ifx\XeTeXrevision\thisisundefined + % For epsf.tex + % \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}% + \else + % For XeTeX + \doxeteximage{#1}{#2}{#3}% + \fi + \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. + {% + \requireauxfile + \atdummies + % + \ifx\thisshortcaption\empty + \def\gtemp{\thiscaption}% + \else + \def\gtemp{\thisshortcaption}% + \fi + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + \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 +} + +% XeTeX and LuaTeX can handle Unicode natively. +% Their default I/O uses UTF-8 sequences instead of a byte-wise operation. +% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise. +% +\newif\iftxinativeunicodecapable +\newif\iftxiusebytewiseio + +\ifx\XeTeXrevision\thisisundefined + \ifx\luatexversion\thisisundefined + \txinativeunicodecapablefalse + \txiusebytewiseiotrue + \else + \txinativeunicodecapabletrue + \txiusebytewiseiofalse + \fi +\else + \txinativeunicodecapabletrue + \txiusebytewiseiofalse +\fi + +% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex +% for non-UTF-8 (byte-wise) encodings. +% +\def\setbytewiseio{% + \ifx\XeTeXrevision\thisisundefined + \else + \XeTeXdefaultencoding "bytes" % For subsequent files to be read + \XeTeXinputencoding "bytes" % For document root file + % Unfortunately, there seems to be no corresponding XeTeX command for + % output encoding. This is a problem for auxiliary index and TOC files. + % The only solution would be perhaps to write out @U{...} sequences in + % place of non-ASCII characters. + \fi + + \ifx\luatexversion\thisisundefined + \else + \directlua{ + local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub + local function convert_char (char) + return utf8_char(byte(char)) + end + + local function convert_line (line) + return gsub(line, ".", convert_char) + end + + callback.register("process_input_buffer", convert_line) + + local function convert_line_out (line) + local line_out = "" + for c in string.utfvalues(line) do + line_out = line_out .. string.char(c) + end + return line_out + end + + callback.register("process_output_buffer", convert_line_out) + } + \fi + + \txiusebytewiseiotrue +} + + +% 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. +% +\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} +\def\documentencodingzzz#1{% + % + % 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 + \iftxinativeunicodecapable + \setbytewiseio + \fi + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \iftxinativeunicodecapable + \setbytewiseio + \fi + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \iftxinativeunicodecapable + \setbytewiseio + \fi + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \iftxinativeunicodecapable + % For native Unicode handling (XeTeX and LuaTeX) + \nativeunicodechardefs + \else + % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX) + \setnonasciicharscatcode\active + % since we already invoked \utfeightchardefs at the top level + % (below), do not re-invoke it, otherwise our check for duplicated + % definitions gets triggered. Making non-ascii chars active is + % sufficient. + \fi + % + \else + \message{Ignoring unknown document encoding: #1.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii + % + \ifx\XeTeXrevision\thisisundefined + \else + \ifx \declaredencoding \utfeight + \else + \ifx \declaredencoding \ascii + \else + \message{Warning: XeTeX with non-UTF-8 encodings cannot handle % + non-ASCII characters in auxiliary files.}% + \fi + \fi + \fi +} + +% emacs-page +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing, sorry: #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 +% + +\def\gdefchar#1#2{% +\gdef#1{% + \ifpassthroughchars + \string#1% + \else + #2% + \fi +}} + +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdefchar^^a0{\tie} + \gdefchar^^a1{\exclamdown} + \gdefchar^^a2{{\tcfont \char162}} % cent + \gdefchar^^a3{\pounds{}} + \gdefchar^^a4{{\tcfont \char164}} % currency + \gdefchar^^a5{{\tcfont \char165}} % yen + \gdefchar^^a6{{\tcfont \char166}} % broken bar + \gdefchar^^a7{\S} + \gdefchar^^a8{\"{}} + \gdefchar^^a9{\copyright{}} + \gdefchar^^aa{\ordf} + \gdefchar^^ab{\guillemetleft{}} + \gdefchar^^ac{\ensuremath\lnot} + \gdefchar^^ad{\-} + \gdefchar^^ae{\registeredsymbol{}} + \gdefchar^^af{\={}} + % + \gdefchar^^b0{\textdegree} + \gdefchar^^b1{$\pm$} + \gdefchar^^b2{$^2$} + \gdefchar^^b3{$^3$} + \gdefchar^^b4{\'{}} + \gdefchar^^b5{$\mu$} + \gdefchar^^b6{\P} + \gdefchar^^b7{\ensuremath\cdot} + \gdefchar^^b8{\cedilla\ } + \gdefchar^^b9{$^1$} + \gdefchar^^ba{\ordm} + \gdefchar^^bb{\guillemetright{}} + \gdefchar^^bc{$1\over4$} + \gdefchar^^bd{$1\over2$} + \gdefchar^^be{$3\over4$} + \gdefchar^^bf{\questiondown} + % + \gdefchar^^c0{\`A} + \gdefchar^^c1{\'A} + \gdefchar^^c2{\^A} + \gdefchar^^c3{\~A} + \gdefchar^^c4{\"A} + \gdefchar^^c5{\ringaccent A} + \gdefchar^^c6{\AE} + \gdefchar^^c7{\cedilla C} + \gdefchar^^c8{\`E} + \gdefchar^^c9{\'E} + \gdefchar^^ca{\^E} + \gdefchar^^cb{\"E} + \gdefchar^^cc{\`I} + \gdefchar^^cd{\'I} + \gdefchar^^ce{\^I} + \gdefchar^^cf{\"I} + % + \gdefchar^^d0{\DH} + \gdefchar^^d1{\~N} + \gdefchar^^d2{\`O} + \gdefchar^^d3{\'O} + \gdefchar^^d4{\^O} + \gdefchar^^d5{\~O} + \gdefchar^^d6{\"O} + \gdefchar^^d7{$\times$} + \gdefchar^^d8{\O} + \gdefchar^^d9{\`U} + \gdefchar^^da{\'U} + \gdefchar^^db{\^U} + \gdefchar^^dc{\"U} + \gdefchar^^dd{\'Y} + \gdefchar^^de{\TH} + \gdefchar^^df{\ss} + % + \gdefchar^^e0{\`a} + \gdefchar^^e1{\'a} + \gdefchar^^e2{\^a} + \gdefchar^^e3{\~a} + \gdefchar^^e4{\"a} + \gdefchar^^e5{\ringaccent a} + \gdefchar^^e6{\ae} + \gdefchar^^e7{\cedilla c} + \gdefchar^^e8{\`e} + \gdefchar^^e9{\'e} + \gdefchar^^ea{\^e} + \gdefchar^^eb{\"e} + \gdefchar^^ec{\`{\dotless i}} + \gdefchar^^ed{\'{\dotless i}} + \gdefchar^^ee{\^{\dotless i}} + \gdefchar^^ef{\"{\dotless i}} + % + \gdefchar^^f0{\dh} + \gdefchar^^f1{\~n} + \gdefchar^^f2{\`o} + \gdefchar^^f3{\'o} + \gdefchar^^f4{\^o} + \gdefchar^^f5{\~o} + \gdefchar^^f6{\"o} + \gdefchar^^f7{$\div$} + \gdefchar^^f8{\o} + \gdefchar^^f9{\`u} + \gdefchar^^fa{\'u} + \gdefchar^^fb{\^u} + \gdefchar^^fc{\"u} + \gdefchar^^fd{\'y} + \gdefchar^^fe{\th} + \gdefchar^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdefchar^^a4{\euro{}} + \gdefchar^^a6{\v S} + \gdefchar^^a8{\v s} + \gdefchar^^b4{\v Z} + \gdefchar^^b8{\v z} + \gdefchar^^bc{\OE} + \gdefchar^^bd{\oe} + \gdefchar^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdefchar^^a0{\tie} + \gdefchar^^a1{\ogonek{A}} + \gdefchar^^a2{\u{}} + \gdefchar^^a3{\L} + \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdefchar^^a5{\v L} + \gdefchar^^a6{\'S} + \gdefchar^^a7{\S} + \gdefchar^^a8{\"{}} + \gdefchar^^a9{\v S} + \gdefchar^^aa{\cedilla S} + \gdefchar^^ab{\v T} + \gdefchar^^ac{\'Z} + \gdefchar^^ad{\-} + \gdefchar^^ae{\v Z} + \gdefchar^^af{\dotaccent Z} + % + \gdefchar^^b0{\textdegree{}} + \gdefchar^^b1{\ogonek{a}} + \gdefchar^^b2{\ogonek{ }} + \gdefchar^^b3{\l} + \gdefchar^^b4{\'{}} + \gdefchar^^b5{\v l} + \gdefchar^^b6{\'s} + \gdefchar^^b7{\v{}} + \gdefchar^^b8{\cedilla\ } + \gdefchar^^b9{\v s} + \gdefchar^^ba{\cedilla s} + \gdefchar^^bb{\v t} + \gdefchar^^bc{\'z} + \gdefchar^^bd{\H{}} + \gdefchar^^be{\v z} + \gdefchar^^bf{\dotaccent z} + % + \gdefchar^^c0{\'R} + \gdefchar^^c1{\'A} + \gdefchar^^c2{\^A} + \gdefchar^^c3{\u A} + \gdefchar^^c4{\"A} + \gdefchar^^c5{\'L} + \gdefchar^^c6{\'C} + \gdefchar^^c7{\cedilla C} + \gdefchar^^c8{\v C} + \gdefchar^^c9{\'E} + \gdefchar^^ca{\ogonek{E}} + \gdefchar^^cb{\"E} + \gdefchar^^cc{\v E} + \gdefchar^^cd{\'I} + \gdefchar^^ce{\^I} + \gdefchar^^cf{\v D} + % + \gdefchar^^d0{\DH} + \gdefchar^^d1{\'N} + \gdefchar^^d2{\v N} + \gdefchar^^d3{\'O} + \gdefchar^^d4{\^O} + \gdefchar^^d5{\H O} + \gdefchar^^d6{\"O} + \gdefchar^^d7{$\times$} + \gdefchar^^d8{\v R} + \gdefchar^^d9{\ringaccent U} + \gdefchar^^da{\'U} + \gdefchar^^db{\H U} + \gdefchar^^dc{\"U} + \gdefchar^^dd{\'Y} + \gdefchar^^de{\cedilla T} + \gdefchar^^df{\ss} + % + \gdefchar^^e0{\'r} + \gdefchar^^e1{\'a} + \gdefchar^^e2{\^a} + \gdefchar^^e3{\u a} + \gdefchar^^e4{\"a} + \gdefchar^^e5{\'l} + \gdefchar^^e6{\'c} + \gdefchar^^e7{\cedilla c} + \gdefchar^^e8{\v c} + \gdefchar^^e9{\'e} + \gdefchar^^ea{\ogonek{e}} + \gdefchar^^eb{\"e} + \gdefchar^^ec{\v e} + \gdefchar^^ed{\'{\dotless{i}}} + \gdefchar^^ee{\^{\dotless{i}}} + \gdefchar^^ef{\v d} + % + \gdefchar^^f0{\dh} + \gdefchar^^f1{\'n} + \gdefchar^^f2{\v n} + \gdefchar^^f3{\'o} + \gdefchar^^f4{\^o} + \gdefchar^^f5{\H o} + \gdefchar^^f6{\"o} + \gdefchar^^f7{$\div$} + \gdefchar^^f8{\v r} + \gdefchar^^f9{\ringaccent u} + \gdefchar^^fa{\'u} + \gdefchar^^fb{\H u} + \gdefchar^^fc{\"u} + \gdefchar^^fd{\'y} + \gdefchar^^fe{\cedilla t} + \gdefchar^^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 +} + +% Give non-ASCII bytes the active definitions for processing UTF-8 sequences +\begingroup + \catcode`\~13 + \catcode`\$12 + \catcode`\"12 + + % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp + % substituting ~ and $ with a character token of that value. + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uccode`\$\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + % For bytes other than the first in a UTF-8 sequence. Not expected to + % be expanded except when writing to auxiliary files. + \countUTFx = "80 + \countUTFy = "C2 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $\fi}}% + \UTFviiiLoop + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}% + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}% + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiFourOctets\expandafter$\fi + }}% + \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 + \iftxinativeunicodecapable + % All Unicode characters can be used if native Unicode handling is + % active. However, if the font does not have the glyph, + % letters are missing. + \begingroup + \uccode`\.="#1\relax + \uppercase{.} + \endgroup + \else + \errhelp = \EMsimple + \errmessage{Unicode character U+#1 not supported, sorry}% + \fi + \else + \csname uni:#1\endcsname + \fi +} + +% These macros are used here to construct the name of a control +% sequence to be defined. +\def\UTFviiiTwoOctetsName#1#2{% + \csname u8:#1\string #2\endcsname}% +\def\UTFviiiThreeOctetsName#1#2#3{% + \csname u8:#1\string #2\string #3\endcsname}% +\def\UTFviiiFourOctetsName#1#2#3#4{% + \csname u8:#1\string #2\string #3\string #4\endcsname}% + +% For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), +% provide a definition macro to replace a Unicode character; +% this gets used by the @U command +% +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + \gdef\DeclareUnicodeCharacterUTFviii#1#2{% + \countUTFz = "#1\relax + \begingroup + \parseXMLCharref + + % Give \u8:... its definition. The sequence of seven \expandafter's + % expands after the \gdef three times, e.g. + % + % 1. \UTFviiTwoOctetsName B1 B2 + % 2. \csname u8:B1 \string B2 \endcsname + % 3. \u8: B1 B2 (a single control sequence token) + % + \expandafter\expandafter + \expandafter\expandafter + \expandafter\expandafter + \expandafter\gdef \UTFviiiTmp{#2}% + % + \expandafter\ifx\csname uni:#1\endcsname \relax \else + \message{Internal error, already defined: #1}% + \fi + % + % define an additional control sequence for this code point. + \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp + \endgroup} + % + % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp + % to the corresponding UTF-8 sequence. + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctetsName.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}% + \fi\fi\fi + } + + % Extract a byte from the end of the UTF-8 representation of \countUTFx. + % It must be a non-initial byte in the sequence. + % Change \uccode of #1 for it to be used in \parseUTFviiiB as one + % of the bytes. + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz % Save to be the future value of \countUTFz. + \multiply\countUTFz by 64 + + % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract + % in order to get the last five bits. + \advance\countUTFx by -\countUTFz + + % Convert this to the byte in the UTF-8 sequence. + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + % Used to put a UTF-8 byte sequence into \UTFviiiTmp + % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8 + % sequence. + % #2 is one of the \UTFviii*OctetsName macros. + % #3 is always a full stop (.) + % #4 is a template for the other bytes in the sequence. The values for these + % bytes is substituted in here with \uppercase using the \uccode's. + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +% For native Unicode handling (XeTeX and LuaTeX), +% provide a definition macro that sets a catcode to `other' non-globally +% +\def\DeclareUnicodeCharacterNativeOther#1#2{% + \catcode"#1=\other +} + +% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M +% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) +% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) +% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A +% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B +% +% Many of our renditions are less than wonderful, and all the missing +% characters are available somewhere. Loading the necessary fonts +% awaits user request. We can't truly support Unicode without +% reimplementing everything that's been done in LaTeX for many years, +% plus probably using luatex or xetex, and who knows what else. +% We won't be doing that here in this simple file. But we can try to at +% least make most of the characters not bomb out. +% +\def\unicodechardefs{% + \DeclareUnicodeCharacter{00A0}{\tie}% + \DeclareUnicodeCharacter{00A1}{\exclamdown}% + \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent + \DeclareUnicodeCharacter{00A3}{\pounds{}}% + \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency + \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen + \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar + \DeclareUnicodeCharacter{00A7}{\S}% + \DeclareUnicodeCharacter{00A8}{\"{ }}% + \DeclareUnicodeCharacter{00A9}{\copyright{}}% + \DeclareUnicodeCharacter{00AA}{\ordf}% + \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}% + \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}% + \DeclareUnicodeCharacter{00AD}{\-}% + \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% + \DeclareUnicodeCharacter{00AF}{\={ }}% + % + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% + \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% + \DeclareUnicodeCharacter{00B2}{$^2$}% + \DeclareUnicodeCharacter{00B3}{$^3$}% + \DeclareUnicodeCharacter{00B4}{\'{ }}% + \DeclareUnicodeCharacter{00B5}{$\mu$}% + \DeclareUnicodeCharacter{00B6}{\P}% + \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}% + \DeclareUnicodeCharacter{00B8}{\cedilla{ }}% + \DeclareUnicodeCharacter{00B9}{$^1$}% + \DeclareUnicodeCharacter{00BA}{\ordm}% + \DeclareUnicodeCharacter{00BB}{\guillemetright{}}% + \DeclareUnicodeCharacter{00BC}{$1\over4$}% + \DeclareUnicodeCharacter{00BD}{$1\over2$}% + \DeclareUnicodeCharacter{00BE}{$3\over4$}% + \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{00D7}{\ensuremath\times}% + \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{00F7}{\ensuremath\div}% + \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{010A}{\dotaccent{C}}% + \DeclareUnicodeCharacter{010B}{\dotaccent{c}}% + \DeclareUnicodeCharacter{010C}{\v{C}}% + \DeclareUnicodeCharacter{010D}{\v{c}}% + \DeclareUnicodeCharacter{010E}{\v{D}}% + \DeclareUnicodeCharacter{010F}{d'}% + % + \DeclareUnicodeCharacter{0110}{\DH}% + \DeclareUnicodeCharacter{0111}{\dh}% + \DeclareUnicodeCharacter{0112}{\=E}% + \DeclareUnicodeCharacter{0113}{\=e}% + \DeclareUnicodeCharacter{0114}{\u{E}}% + \DeclareUnicodeCharacter{0115}{\u{e}}% + \DeclareUnicodeCharacter{0116}{\dotaccent{E}}% + \DeclareUnicodeCharacter{0117}{\dotaccent{e}}% + \DeclareUnicodeCharacter{0118}{\ogonek{E}}% + \DeclareUnicodeCharacter{0119}{\ogonek{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{0122}{\cedilla{G}}% + \DeclareUnicodeCharacter{0123}{\cedilla{g}}% + \DeclareUnicodeCharacter{0124}{\^H}% + \DeclareUnicodeCharacter{0125}{\^h}% + \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}% + \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}% + \DeclareUnicodeCharacter{0128}{\~I}% + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}% + \DeclareUnicodeCharacter{012A}{\=I}% + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}% + \DeclareUnicodeCharacter{012C}{\u{I}}% + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}% + \DeclareUnicodeCharacter{012E}{\ogonek{I}}% + \DeclareUnicodeCharacter{012F}{\ogonek{i}}% + % + \DeclareUnicodeCharacter{0130}{\dotaccent{I}}% + \DeclareUnicodeCharacter{0131}{\dotless{i}}% + \DeclareUnicodeCharacter{0132}{IJ}% + \DeclareUnicodeCharacter{0133}{ij}% + \DeclareUnicodeCharacter{0134}{\^J}% + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}% + \DeclareUnicodeCharacter{0136}{\cedilla{K}}% + \DeclareUnicodeCharacter{0137}{\cedilla{k}}% + \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}% + \DeclareUnicodeCharacter{0139}{\'L}% + \DeclareUnicodeCharacter{013A}{\'l}% + \DeclareUnicodeCharacter{013B}{\cedilla{L}}% + \DeclareUnicodeCharacter{013C}{\cedilla{l}}% + \DeclareUnicodeCharacter{013D}{L'}% should kern + \DeclareUnicodeCharacter{013E}{l'}% should kern + \DeclareUnicodeCharacter{013F}{L\U{00B7}}% + % + \DeclareUnicodeCharacter{0140}{l\U{00B7}}% + \DeclareUnicodeCharacter{0141}{\L}% + \DeclareUnicodeCharacter{0142}{\l}% + \DeclareUnicodeCharacter{0143}{\'N}% + \DeclareUnicodeCharacter{0144}{\'n}% + \DeclareUnicodeCharacter{0145}{\cedilla{N}}% + \DeclareUnicodeCharacter{0146}{\cedilla{n}}% + \DeclareUnicodeCharacter{0147}{\v{N}}% + \DeclareUnicodeCharacter{0148}{\v{n}}% + \DeclareUnicodeCharacter{0149}{'n}% + \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}% + \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}% + \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{0156}{\cedilla{R}}% + \DeclareUnicodeCharacter{0157}{\cedilla{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{0165}{\v{t}}% + \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}% + \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}% + \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{0172}{\ogonek{U}}% + \DeclareUnicodeCharacter{0173}{\ogonek{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{017F}{\missingcharmsg{LONG S}}% + % + \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{ }}% + % + % Greek letters upper case + \DeclareUnicodeCharacter{0391}{{\it A}}% + \DeclareUnicodeCharacter{0392}{{\it B}}% + \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}% + \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}% + \DeclareUnicodeCharacter{0395}{{\it E}}% + \DeclareUnicodeCharacter{0396}{{\it Z}}% + \DeclareUnicodeCharacter{0397}{{\it H}}% + \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}% + \DeclareUnicodeCharacter{0399}{{\it I}}% + \DeclareUnicodeCharacter{039A}{{\it K}}% + \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}% + \DeclareUnicodeCharacter{039C}{{\it M}}% + \DeclareUnicodeCharacter{039D}{{\it N}}% + \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}% + \DeclareUnicodeCharacter{039F}{{\it O}}% + \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}% + \DeclareUnicodeCharacter{03A1}{{\it P}}% + %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma + \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}% + \DeclareUnicodeCharacter{03A4}{{\it T}}% + \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}% + \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}% + \DeclareUnicodeCharacter{03A7}{{\it X}}% + \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}% + \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}% + % + % Vowels with accents + \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}% + \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}% + \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}% + \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}% + \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}% + \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}% + % + % Standalone accent + \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}% + % + % Greek letters lower case + \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}% + \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}% + \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}% + \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}% + \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}% + \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}% + \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}% + \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}% + \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}% + \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}% + \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}% + \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}% + \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}% + \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}% + \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron + \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}% + \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}% + \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}% + \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}% + \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}% + \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}% + \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}% + \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}% + \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}% + \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}% + % + % More Greek vowels with accents + \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}% + \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}% + \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}% + \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}% + \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}% + % + % Variant Greek letters + \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}% + \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}% + \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}% + % + \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}% + % + % Punctuation + \DeclareUnicodeCharacter{2013}{--}% + \DeclareUnicodeCharacter{2014}{---}% + \DeclareUnicodeCharacter{2018}{\quoteleft{}}% + \DeclareUnicodeCharacter{2019}{\quoteright{}}% + \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% + \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% + \DeclareUnicodeCharacter{201D}{\quotedblright{}}% + \DeclareUnicodeCharacter{201E}{\quotedblbase{}}% + \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}% + \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}% + \DeclareUnicodeCharacter{2022}{\bullet{}}% + \DeclareUnicodeCharacter{202F}{\thinspace}% + \DeclareUnicodeCharacter{2026}{\dots{}}% + \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}% + \DeclareUnicodeCharacter{203A}{\guilsinglright{}}% + % + \DeclareUnicodeCharacter{20AC}{\euro{}}% + % + \DeclareUnicodeCharacter{2192}{\expansion{}}% + \DeclareUnicodeCharacter{21D2}{\result{}}% + % + % Mathematical symbols + \DeclareUnicodeCharacter{2200}{\ensuremath\forall}% + \DeclareUnicodeCharacter{2203}{\ensuremath\exists}% + \DeclareUnicodeCharacter{2208}{\ensuremath\in}% + \DeclareUnicodeCharacter{2212}{\minus{}}% + \DeclareUnicodeCharacter{2217}{\ast}% + \DeclareUnicodeCharacter{221E}{\ensuremath\infty}% + \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}% + \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}% + \DeclareUnicodeCharacter{2229}{\ensuremath\cap}% + \DeclareUnicodeCharacter{2261}{\equiv{}}% + \DeclareUnicodeCharacter{2264}{\ensuremath\leq}% + \DeclareUnicodeCharacter{2265}{\ensuremath\geq}% + \DeclareUnicodeCharacter{2282}{\ensuremath\subset}% + \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% + % + \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% + \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% + \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% + \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% + \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% + \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% + \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% + \DeclareUnicodeCharacter{2127}{\ensuremath\mho}% + \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% + \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% + \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% + \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}% + \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}% + \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}% + \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}% + \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}% + \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}% + \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}% + \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}% + \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}% + \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% + \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% + \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% + \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}% + \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% + \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% + \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% + \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}% + \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}% + \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% + \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% + \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% + \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}% + \DeclareUnicodeCharacter{2201}{\ensuremath\complement}% + \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% + \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% + \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% + \DeclareUnicodeCharacter{2209}{\ensuremath\notin}% + \DeclareUnicodeCharacter{220B}{\ensuremath\owns}% + \DeclareUnicodeCharacter{220F}{\ensuremath\prod}% + \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}% + \DeclareUnicodeCharacter{2211}{\ensuremath\sum}% + \DeclareUnicodeCharacter{2213}{\ensuremath\mp}% + \DeclareUnicodeCharacter{2218}{\ensuremath\circ}% + \DeclareUnicodeCharacter{221A}{\ensuremath\surd}% + \DeclareUnicodeCharacter{221D}{\ensuremath\propto}% + \DeclareUnicodeCharacter{2220}{\ensuremath\angle}% + \DeclareUnicodeCharacter{2223}{\ensuremath\mid}% + \DeclareUnicodeCharacter{2228}{\ensuremath\vee}% + \DeclareUnicodeCharacter{222A}{\ensuremath\cup}% + \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}% + \DeclareUnicodeCharacter{222E}{\ensuremath\oint}% + \DeclareUnicodeCharacter{223C}{\ensuremath\sim}% + \DeclareUnicodeCharacter{2240}{\ensuremath\wr}% + \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}% + \DeclareUnicodeCharacter{2245}{\ensuremath\cong}% + \DeclareUnicodeCharacter{2248}{\ensuremath\approx}% + \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}% + \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}% + \DeclareUnicodeCharacter{2260}{\ensuremath\neq}% + \DeclareUnicodeCharacter{226A}{\ensuremath\ll}% + \DeclareUnicodeCharacter{226B}{\ensuremath\gg}% + \DeclareUnicodeCharacter{227A}{\ensuremath\prec}% + \DeclareUnicodeCharacter{227B}{\ensuremath\succ}% + \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% + \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% + \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% + \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}% + \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}% + \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% + \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% + \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% + \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}% + \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}% + \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}% + \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}% + \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}% + \DeclareUnicodeCharacter{2299}{\ensuremath\odot}% + \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}% + \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}% + \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% + \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% + \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% + \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}% + \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}% + \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% + \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% + \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% + \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}% + \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}% + \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}% + \DeclareUnicodeCharacter{22C6}{\ensuremath\star}% + \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}% + \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}% + \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}% + \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}% + \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}% + \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% + \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% + % + \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}% + \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% + \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% + \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% + \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% + \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}% + \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% + \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% + \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% + \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}% + \DeclareUnicodeCharacter{266D}{\ensuremath\flat}% + \DeclareUnicodeCharacter{266E}{\ensuremath\natural}% + \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}% + \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}% + \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}% + \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}% + \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}% + \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}% + \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}% + \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}% + \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}% + \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}% + \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}% + \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}% + \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% + \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% + \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% + \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}% + \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% + \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% + \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% + % + \global\mathchardef\checkmark="1370% actually the square root sign + \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% +}% end of \unicodechardefs + +% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) +% It makes the setting that replace UTF-8 byte sequence. +\def\utfeightchardefs{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii + \unicodechardefs +} + +% Whether the active definitions of non-ASCII characters expand to +% non-active tokens with the same character code. This is used to +% write characters literally, instead of using active definitions for +% printing the correct glyphs. +\newif\ifpassthroughchars +\passthroughcharsfalse + +% For native Unicode handling (XeTeX and LuaTeX), +% provide a definition macro to replace/pass-through a Unicode character +% +\def\DeclareUnicodeCharacterNative#1#2{% + \catcode"#1=\active + \def\dodeclareunicodecharacternative##1##2##3{% + \begingroup + \uccode`\~="##2\relax + \uppercase{\gdef~}{% + \ifpassthroughchars + ##1% + \else + ##3% + \fi + } + \endgroup + } + \begingroup + \uccode`\.="#1\relax + \uppercase{\def\UTFNativeTmp{.}}% + \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}% + \endgroup +} + +% Native Unicode handling (XeTeX and LuaTeX) character replacing definition. +% It activates the setting that replaces Unicode characters. +\def\nativeunicodechardefs{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative + \unicodechardefs +} + +% For native Unicode handling (XeTeX and LuaTeX), +% make the character token expand +% to the sequences given in \unicodechardefs for printing. +\def\DeclareUnicodeCharacterNativeAtU#1#2{% + \def\UTFAtUTmp{#2} + \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp +} + +% @U command definitions for native Unicode handling (XeTeX and LuaTeX). +\def\nativeunicodechardefsatu{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU + \unicodechardefs +} + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% define all Unicode characters we know about, for the sake of @U. +\iftxinativeunicodecapable + \nativeunicodechardefsatu +\else + \utfeightchardefs +\fi + + +% 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 + \txipageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \txipagewidth = \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 + \else + \ifx\XeTeXrevision\thisisundefined + \special{papersize=#8,#7}% + \else + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % XeTeX does not have \pdfhorigin and \pdfvorigin. + \fi + \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 + \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 + \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 + \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 + \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 + +% Default value of \hfuzz, for suppressing warnings about overfull hboxes. +\hfuzz = 1pt + + +\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} + +% Set catcodes for Texinfo file + +% Active characters for printing the wanted glyph. +% 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\hatchar=`\^ +\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } +\let\realunder=_ + +\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 +\catcode`\-=\active \let-=\normaldash + + +% 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. +} + +% 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. + +% Print a typewriter backslash. For math mode, we can't simply use +% \backslashcurfont: 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). 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@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. + +% \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 `\'. +% +{@catcode`- = @active + @gdef@normalturnoffactive{% + @passthroughcharstrue + @let-=@normaldash + @let"=@normaldoublequote + @let$=@normaldollar %$ font-lock fix + @let+=@normalplus + @let<=@normalless + @let>=@normalgreater + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let~=@normaltilde + @let\=@ttbackslash + @markupsetuplqdefault + @markupsetuprqdefault + @unsepspaces + } +} + +% 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 @fixbackslash turn them back on. +@catcode`+=@other @catcode`@_=@other + +% \enablebackslashhack - allow file to begin `\input texinfo' +% +% 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. +% If the file did not have a `\input texinfo', then it is turned off after +% the first line; otherwise the first `\' in the file would cause an error. +% This is used on the very last line of this file, texinfo.tex. +% We also use @c to call @fixbackslash, in case ends of lines are hidden. +{ +@catcode`@^=7 +@catcode`@^^M=13@gdef@enablebackslashhack{% + @global@let\ = @eatinput% + @catcode`@^^M=13% + @def@c{@fixbackslash@c}% + % Definition for the newline at the end of this file. + @def ^^M{@let^^M@secondlinenl}% + % Definition for a newline in the main Texinfo file. + @gdef @secondlinenl{@fixbackslash}% + % In case the first line has a whole-line command on it + @let@originalparsearg@parsearg + @def@parsearg{@fixbackslash@originalparsearg} +}} + +{@catcode`@^=7 @catcode`@^^M=13% +@gdef@eatinput input texinfo#1^^M{@fixbackslash}} + +% Emergency active definition of newline, in case an active newline token +% appears by mistake. +{@catcode`@^=7 @catcode13=13% +@gdef@enableemergencynewline{% + @gdef^^M{% + @par% + %<warning: active newline>@par% +}}} + + +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @ttbackslash @fi + @catcode13=5 % regular end of line + @enableemergencynewline + @let@c=@texinfoc + @let@parsearg@originalparsearg + % Also turn back on active characters that might appear in the input + % file name, in case not using a pre-dumped format. + @catcode`+=@active + @catcode`@_=@active + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets + % called at the beginning of every Texinfo file. Not opening texinfo.cnf + % directly in this file, texinfo.tex, makes it possible to make a format + % file for Texinfo. + % + @openin 1 texinfo.cnf + @ifeof 1 @else @input texinfo.cnf @fi + @closein 1 +} + + +% 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\\|emacs-page" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@enablebackslashhack diff --git a/build-aux/update-copyright b/build-aux/update-copyright new file mode 100755 index 0000000..2d20d21 --- /dev/null +++ b/build-aux/update-copyright @@ -0,0 +1,274 @@ +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' + & eval 'exec perl -wS -0777 -pi "$0" $argv:q' + if 0; +# Update an FSF copyright year list to include the current year. + +my $VERSION = '2016-01-12.23:13'; # UTC + +# Copyright (C) 2009-2017 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: "UTC0" +# 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..4e3f3a2 --- /dev/null +++ b/build-aux/useless-if-before-free @@ -0,0 +1,210 @@ +eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"' + & 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 = '2016-08-01 17:47'; # 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-2017 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>)) + { + # Skip non-matching lines early to save time + $line =~ /\bif\b/ + or next; + 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: "UTC0" +## 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..2d17eaf --- /dev/null +++ b/build-aux/vc-list-files @@ -0,0 +1,113 @@ +#!/bin/sh +# List version-controlled file names. + +# Print a version string. +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 2006-2017 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: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/cfg.mk b/cfg.mk new file mode 100644 index 0000000..3403766 --- /dev/null +++ b/cfg.mk @@ -0,0 +1,159 @@ +# Customize maint.mk -*- makefile -*- +# Copyright (C) 2009-2017 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/>. + +# Cause the tool(s) built by this package to be used also when running +# commands via e.g., "make syntax-check". Doing this a little sooner +# would have avoided a grep infloop bug. +export PATH := $(builddir)/src$(PATH_SEPARATOR)$(PATH) + +# Used in maint.mk's web-manual rule +manual_title = GNU Grep: Print lines matching a pattern + +# Use the direct link. This is guaranteed to work immediately, while +# it can take a while for the faster mirror links to become usable. +url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE) + +# Tests not to run as part of "make distcheck". +local-checks-to-skip = \ + sc_texinfo_acronym + +# Tools used to bootstrap this package, used for "announcement". +bootstrap-tools = autoconf,automake,gnulib + +# Override the default Cc: used in generating an announcement. +announcement_Cc_ = $(translation_project_), $(PACKAGE)-devel@gnu.org + +# The tight_scope test gets confused about inline functions. +# like 'to_uchar'. +_gl_TS_unmarked_extern_functions = main usage mb_clen to_uchar dfaerror dfawarn + +# Now that we have better tests, make this the default. +export VERBOSE = yes + +# Comparing tarball sizes compressed using different xz presets, we see +# that -6e adds only 60 bytes to the size of the tarball, yet reduces +# (from -9) the decompression memory requirement from 64 MiB to 9 MiB. +# Don't be tempted by -5e, since -6 and -5 use the same dictionary size. +# $ for i in {4,5,6,7,8,9}{e,}; do \ +# (n=$(xz -$i < grep-2.11.tar|wc -c);echo $n $i) & done |sort -nr +# 1236632 4 +# 1162564 5 +# 1140988 4e +# 1139620 6 +# 1139480 7 +# 1139480 8 +# 1139480 9 +# 1129552 5e +# 1127616 6e +# 1127556 7e +# 1127556 8e +# 1127556 9e +export XZ_OPT = -6e + +old_NEWS_hash = a708c1088278e4d60e8e4ad2759228de + +# Many m4 macros names once began with 'jm_'. +# Make sure that none are inadvertently reintroduced. +sc_prohibit_jm_in_m4: + @grep -nE 'jm_[A-Z]' \ + $$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \ + { echo '$(ME): do not use jm_ in m4 macro names' \ + 1>&2; exit 1; } || : + +sc_prohibit_echo_minus_en: + @prohibit='\<echo -[en]' \ + halt='do not use echo ''-e or echo ''-n; use printf instead' \ + $(_sc_search_regexp) + +# Look for lines longer than 80 characters, except omit: +# - program-generated long lines in diff headers, +# - the help2man script copied from upstream, +# - tests involving long checksum lines, and +# - the 'pr' test cases. +LINE_LEN_MAX = 80 +FILTER_LONG_LINES = \ + /^[^:]*\.diff:[^:]*:@@ / d; \ + \|^[^:]*TODO:| d; \ + \|^[^:]*man/help2man:| d; \ + \|^[^:]*tests/misc/sha[0-9]*sum.*\.pl[-:]| d; \ + \|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; }; +sc_long_lines: + @files=$$($(VC_LIST_EXCEPT)) \ + halt='line(s) with more than $(LINE_LEN_MAX) characters; reindent'; \ + for file in $$files; do \ + expand $$file | grep -nE '^.{$(LINE_LEN_MAX)}.' | \ + sed -e "s|^|$$file:|" -e '$(FILTER_LONG_LINES)'; \ + done | grep . && { msg="$$halt" $(_sc_say_and_exit) } || : + +# Indent only with spaces. +sc_prohibit_tab_based_indentation: + @prohibit='^ * ' \ + halt='TAB in indentation; use only spaces' \ + $(_sc_search_regexp) + +# Don't use "indent-tabs-mode: nil" anymore. No longer needed. +sc_prohibit_emacs__indent_tabs_mode__setting: + @prohibit='^( *[*#] *)?indent-tabs-mode:' \ + halt='use of emacs indent-tabs-mode: setting' \ + $(_sc_search_regexp) + +# Ensure that the list of test file names in tests/Makefile.am is sorted. +sc_sorted_tests: + @perl -0777 -ne \ + '/^TESTS =(.*?)^$$/ms; ($$t = $$1) =~ s/[\\\s\n]+/\n/g;print $$t' \ + tests/Makefile.am | sort -c + +# THANKS.in is a list of name/email pairs for people who are mentioned in +# commit logs (and generated ChangeLog), but who are not also listed as an +# author of a commit. Name/email pairs of commit authors are automatically +# extracted from the repository. As a very minor factorization, when +# someone who was initially listed only in THANKS.in later authors a commit, +# this rule detects that their pair may now be removed from THANKS.in. +sc_THANKS_in_duplicates: + @{ git log --pretty=format:%aN | sort -u; \ + cut -b-36 THANKS.in | sed '/^$$/d;s/ *$$//'; } \ + | sort | uniq -d | grep . \ + && { echo '$(ME): remove the above names from THANKS.in' \ + 1>&2; exit 1; } || : + +# Ensure that tests don't use `cmd ... && fail=1` as that hides crashes. +# The "exclude" expression allows common idioms like `test ... && fail=1` +# and the 2>... portion allows commands that redirect stderr and so probably +# independently check its contents and thus detect any crash messages. +sc_prohibit_and_fail_1: + @prohibit='&& fail=1' \ + exclude='(stat|kill|test |EGREP|grep|compare|2> *[^/])' \ + halt='&& fail=1 detected. Please use: returns_ 1 ... || fail=1' \ + in_vc_files='^tests/' \ + $(_sc_search_regexp) + +update-copyright-env = \ + UPDATE_COPYRIGHT_USE_INTERVALS=1 \ + UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79 + +include $(abs_top_srcdir)/dist-check.mk + +exclude_file_name_regexp--sc_bindtextdomain = \ + ^tests/get-mb-cur-max\.c$$ + +exclude_file_name_regexp--sc_prohibit_strcmp = /colorize-.*\.c$$ +exclude_file_name_regexp--sc_prohibit_xalloc_without_use = ^src/kwset\.c$$ +exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \ + (Makefile|\.(am|mk)$$) + +exclude_file_name_regexp--sc_prohibit_doubled_word = ^tests/count-newline$$ + +exclude_file_name_regexp--sc_long_lines = ^tests/.*$$ diff --git a/config.hin b/config.hin new file mode 100644 index 0000000..346e054 --- /dev/null +++ b/config.hin @@ -0,0 +1,2121 @@ +/* config.hin. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Define to the function xargmatch calls on failures. */ +#undef ARGMATCH_DIE + +/* Define to the declaration of the xargmatch failure function. */ +#undef ARGMATCH_DIE_DECL + +/* Define to the number of bits in type 'ptrdiff_t'. */ +#undef BITSIZEOF_PTRDIFF_T + +/* Define to the number of bits in type 'sig_atomic_t'. */ +#undef BITSIZEOF_SIG_ATOMIC_T + +/* Define to the number of bits in type 'size_t'. */ +#undef BITSIZEOF_SIZE_T + +/* Define to the number of bits in type 'wchar_t'. */ +#undef BITSIZEOF_WCHAR_T + +/* Define to the number of bits in type 'wint_t'. */ +#undef BITSIZEOF_WINT_T + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if the C locale may have encoding errors. */ +#undef C_LOCALE_MAYBE_EILSEQ + +/* Define as the bit index in the word where to find bit 0 of the exponent of + 'double'. */ +#undef DBL_EXPBIT0_BIT + +/* Define as the word index where to find the exponent of 'double'. */ +#undef DBL_EXPBIT0_WORD + +/* the name of the file descriptor member of DIR */ +#undef DIR_FD_MEMBER_NAME + +#ifdef DIR_FD_MEMBER_NAME +# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME) +#else +# define DIR_TO_FD(Dir_p) -1 +#endif + + +/* Define to 1 if // is a file system root distinct from /. */ +#undef DOUBLE_SLASH_IS_DISTINCT_ROOT + +/* Define if struct dirent has a member d_ino that actually works. */ +#undef D_INO_IN_DIRENT + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Define this to 1 if F_DUPFD behavior does not match POSIX */ +#undef FCNTL_DUPFD_BUGGY + +/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like 'struct s { int n; double + d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 + compilers. When computing the size of such an object, don't use 'sizeof + (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)' + instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with + MSVC and with C++ compilers. */ +#undef FLEXIBLE_ARRAY_MEMBER + +/* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */ +#undef FUNC_NL_LANGINFO_YESEXPR_WORKS + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module close-stream shall be considered present. */ +#undef GNULIB_CLOSE_STREAM + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module dirent-safer shall be considered present. */ +#undef GNULIB_DIRENT_SAFER + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fcntl-safer shall be considered present. */ +#undef GNULIB_FCNTL_SAFER + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fdopendir shall be considered present. */ +#undef GNULIB_FDOPENDIR + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fd-safer-flag shall be considered present. */ +#undef GNULIB_FD_SAFER_FLAG + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fscanf shall be considered present. */ +#undef GNULIB_FSCANF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module lock shall be considered present. */ +#undef GNULIB_LOCK + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module malloc-gnu shall be considered present. */ +#undef GNULIB_MALLOC_GNU + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module msvc-nothrow shall be considered present. */ +#undef GNULIB_MSVC_NOTHROW + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module openat shall be considered present. */ +#undef GNULIB_OPENAT + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module openat-safer shall be considered present. */ +#undef GNULIB_OPENAT_SAFER + +/* enable some gnulib portability checks */ +#undef GNULIB_PORTCHECK + +/* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting glibc 2.15+. */ + #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \ + && defined __OPTIMIZE__ && __OPTIMIZE__) + # define _FORTIFY_SOURCE 2 + #endif + + +/* Define to 1 if printf and friends should be labeled with attribute + "__gnu_printf__" instead of "__printf__" */ +#undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module realloc-gnu shall be considered present. */ +#undef GNULIB_REALLOC_GNU + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module scanf shall be considered present. */ +#undef GNULIB_SCANF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module snprintf shall be considered present. */ +#undef GNULIB_SNPRINTF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror shall be considered present. */ +#undef GNULIB_STRERROR + +/* Define to 1 when the gnulib module btowc should be tested. */ +#undef GNULIB_TEST_BTOWC + +/* Define to 1 when the gnulib module chdir should be tested. */ +#undef GNULIB_TEST_CHDIR + +/* Define to 1 when the gnulib module cloexec should be tested. */ +#undef GNULIB_TEST_CLOEXEC + +/* Define to 1 when the gnulib module close should be tested. */ +#undef GNULIB_TEST_CLOSE + +/* Define to 1 when the gnulib module closedir should be tested. */ +#undef GNULIB_TEST_CLOSEDIR + +/* Define to 1 when the gnulib module dirfd should be tested. */ +#undef GNULIB_TEST_DIRFD + +/* Define to 1 when the gnulib module dup should be tested. */ +#undef GNULIB_TEST_DUP + +/* Define to 1 when the gnulib module dup2 should be tested. */ +#undef GNULIB_TEST_DUP2 + +/* Define to 1 when the gnulib module environ should be tested. */ +#undef GNULIB_TEST_ENVIRON + +/* Define to 1 when the gnulib module fchdir should be tested. */ +#undef GNULIB_TEST_FCHDIR + +/* Define to 1 when the gnulib module fcntl should be tested. */ +#undef GNULIB_TEST_FCNTL + +/* Define to 1 when the gnulib module fdopen should be tested. */ +#undef GNULIB_TEST_FDOPEN + +/* Define to 1 when the gnulib module fdopendir should be tested. */ +#undef GNULIB_TEST_FDOPENDIR + +/* Define to 1 when the gnulib module fstat should be tested. */ +#undef GNULIB_TEST_FSTAT + +/* Define to 1 when the gnulib module fstatat should be tested. */ +#undef GNULIB_TEST_FSTATAT + +/* Define to 1 when the gnulib module getcwd should be tested. */ +#undef GNULIB_TEST_GETCWD + +/* Define to 1 when the gnulib module getdtablesize should be tested. */ +#undef GNULIB_TEST_GETDTABLESIZE + +/* Define to 1 when the gnulib module getpagesize should be tested. */ +#undef GNULIB_TEST_GETPAGESIZE + +/* Define to 1 when the gnulib module isatty should be tested. */ +#undef GNULIB_TEST_ISATTY + +/* Define to 1 when the gnulib module iswblank should be tested. */ +#undef GNULIB_TEST_ISWBLANK + +/* Define to 1 when the gnulib module iswctype should be tested. */ +#undef GNULIB_TEST_ISWCTYPE + +/* Define to 1 when the gnulib module localeconv should be tested. */ +#undef GNULIB_TEST_LOCALECONV + +/* Define to 1 when the gnulib module lseek should be tested. */ +#undef GNULIB_TEST_LSEEK + +/* Define to 1 when the gnulib module lstat should be tested. */ +#undef GNULIB_TEST_LSTAT + +/* Define to 1 when the gnulib module malloc-posix should be tested. */ +#undef GNULIB_TEST_MALLOC_POSIX + +/* Define to 1 when the gnulib module mbrlen should be tested. */ +#undef GNULIB_TEST_MBRLEN + +/* Define to 1 when the gnulib module mbrtowc should be tested. */ +#undef GNULIB_TEST_MBRTOWC + +/* Define to 1 when the gnulib module mbscasecmp should be tested. */ +#undef GNULIB_TEST_MBSCASECMP + +/* Define to 1 when the gnulib module mbsinit should be tested. */ +#undef GNULIB_TEST_MBSINIT + +/* Define to 1 when the gnulib module mbslen should be tested. */ +#undef GNULIB_TEST_MBSLEN + +/* Define to 1 when the gnulib module mbsrtowcs should be tested. */ +#undef GNULIB_TEST_MBSRTOWCS + +/* Define to 1 when the gnulib module mbsstr should be tested. */ +#undef GNULIB_TEST_MBSSTR + +/* Define to 1 when the gnulib module mbtowc should be tested. */ +#undef GNULIB_TEST_MBTOWC + +/* Define to 1 when the gnulib module memchr should be tested. */ +#undef GNULIB_TEST_MEMCHR + +/* Define to 1 when the gnulib module mempcpy should be tested. */ +#undef GNULIB_TEST_MEMPCPY + +/* Define to 1 when the gnulib module memrchr should be tested. */ +#undef GNULIB_TEST_MEMRCHR + +/* Define to 1 when the gnulib module nl_langinfo should be tested. */ +#undef GNULIB_TEST_NL_LANGINFO + +/* Define to 1 when the gnulib module open should be tested. */ +#undef GNULIB_TEST_OPEN + +/* Define to 1 when the gnulib module openat should be tested. */ +#undef GNULIB_TEST_OPENAT + +/* Define to 1 when the gnulib module opendir should be tested. */ +#undef GNULIB_TEST_OPENDIR + +/* Define to 1 when the gnulib module pipe should be tested. */ +#undef GNULIB_TEST_PIPE + +/* Define to 1 when the gnulib module putenv should be tested. */ +#undef GNULIB_TEST_PUTENV + +/* Define to 1 when the gnulib module read should be tested. */ +#undef GNULIB_TEST_READ + +/* Define to 1 when the gnulib module readdir should be tested. */ +#undef GNULIB_TEST_READDIR + +/* Define to 1 when the gnulib module realloc-posix should be tested. */ +#undef GNULIB_TEST_REALLOC_POSIX + +/* Define to 1 when the gnulib module setenv should be tested. */ +#undef GNULIB_TEST_SETENV + +/* Define to 1 when the gnulib module setlocale should be tested. */ +#undef GNULIB_TEST_SETLOCALE + +/* Define to 1 when the gnulib module snprintf should be tested. */ +#undef GNULIB_TEST_SNPRINTF + +/* Define to 1 when the gnulib module stat should be tested. */ +#undef GNULIB_TEST_STAT + +/* Define to 1 when the gnulib module stpcpy should be tested. */ +#undef GNULIB_TEST_STPCPY + +/* Define to 1 when the gnulib module strdup should be tested. */ +#undef GNULIB_TEST_STRDUP + +/* Define to 1 when the gnulib module strerror should be tested. */ +#undef GNULIB_TEST_STRERROR + +/* Define to 1 when the gnulib module strnlen should be tested. */ +#undef GNULIB_TEST_STRNLEN + +/* Define to 1 when the gnulib module strstr should be tested. */ +#undef GNULIB_TEST_STRSTR + +/* Define to 1 when the gnulib module strtoll should be tested. */ +#undef GNULIB_TEST_STRTOLL + +/* Define to 1 when the gnulib module strtoull should be tested. */ +#undef GNULIB_TEST_STRTOULL + +/* Define to 1 when the gnulib module symlink should be tested. */ +#undef GNULIB_TEST_SYMLINK + +/* Define to 1 when the gnulib module unsetenv should be tested. */ +#undef GNULIB_TEST_UNSETENV + +/* Define to 1 when the gnulib module wcrtomb should be tested. */ +#undef GNULIB_TEST_WCRTOMB + +/* Define to 1 when the gnulib module wctob should be tested. */ +#undef GNULIB_TEST_WCTOB + +/* Define to 1 when the gnulib module wctomb should be tested. */ +#undef GNULIB_TEST_WCTOMB + +/* Define to 1 when the gnulib module wcwidth should be tested. */ +#undef GNULIB_TEST_WCWIDTH + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-mbtoucr shall be considered present. */ +#undef GNULIB_UNISTR_U8_MBTOUCR + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module unistr/u8-uctomb shall be considered present. */ +#undef GNULIB_UNISTR_U8_UCTOMB + +/* We are building grep */ +#undef GREP + +/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that + may be supplied by this distribution. */ +#undef HAVE_ALLOCA + +/* Define to 1 if <alloca.h> works. */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the <bp-sym.h> header file. */ +#undef HAVE_BP_SYM_H + +/* Define to 1 if you have the 'btowc' function. */ +#undef HAVE_BTOWC + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define to 1 if you have the `closedir' function. */ +#undef HAVE_CLOSEDIR + +/* Define to 1 if you have the <crtdefs.h> header file. */ +#undef HAVE_CRTDEFS_H + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't. + */ +#undef HAVE_DECL_ALARM + +/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_CLEARERR_UNLOCKED + +/* Define to 1 if you have the declaration of `dirfd', and to 0 if you don't. + */ +#undef HAVE_DECL_DIRFD + +/* Define to 1 if you have the declaration of `fchdir', and to 0 if you don't. + */ +#undef HAVE_DECL_FCHDIR + +/* Define to 1 if you have the declaration of `fdopendir', and to 0 if you + don't. */ +#undef HAVE_DECL_FDOPENDIR + +/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_FEOF_UNLOCKED + +/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FERROR_UNLOCKED + +/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FFLUSH_UNLOCKED + +/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FGETS_UNLOCKED + +/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTC_UNLOCKED + +/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTS_UNLOCKED + +/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FREAD_UNLOCKED + +/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FWRITE_UNLOCKED + +/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_GETCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_GETC_UNLOCKED + +/* Define to 1 if you have the declaration of `getdtablesize', and to 0 if you + don't. */ +#undef HAVE_DECL_GETDTABLESIZE + +/* Define to 1 if you have the declaration of `isblank', and to 0 if you + don't. */ +#undef HAVE_DECL_ISBLANK + +/* Define to 1 if you have the declaration of `iswblank', and to 0 if you + don't. */ +#undef HAVE_DECL_ISWBLANK + +/* Define to 1 if you have the declaration of `mbrlen', and to 0 if you don't. + */ +#undef HAVE_DECL_MBRLEN + +/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you + don't. */ +#undef HAVE_DECL_MBRTOWC + +/* Define to 1 if you have the declaration of `mbsinit', and to 0 if you + don't. */ +#undef HAVE_DECL_MBSINIT + +/* Define to 1 if you have the declaration of `mbsrtowcs', and to 0 if you + don't. */ +#undef HAVE_DECL_MBSRTOWCS + +/* Define to 1 if you have the declaration of `memrchr', and to 0 if you + don't. */ +#undef HAVE_DECL_MEMRCHR + +/* Define to 1 if you have the declaration of `program_invocation_name', and + to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_NAME + +/* Define to 1 if you have the declaration of `program_invocation_short_name', + and to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + +/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_PUTCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_PUTC_UNLOCKED + +/* Define to 1 if you have the declaration of `setenv', and to 0 if you don't. + */ +#undef HAVE_DECL_SETENV + +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_SNPRINTF + +/* Define to 1 if you have the declaration of `strdup', and to 0 if you don't. + */ +#undef HAVE_DECL_STRDUP + +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#undef HAVE_DECL_STRERROR_R + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNLEN + +/* Define to 1 if you have the declaration of `strtoimax', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOIMAX + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOLL + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOULL + +/* Define to 1 if you have the declaration of `strtoumax', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOUMAX + +/* Define to 1 if you have the declaration of `towlower', and to 0 if you + don't. */ +#undef HAVE_DECL_TOWLOWER + +/* Define to 1 if you have the declaration of `unsetenv', and to 0 if you + don't. */ +#undef HAVE_DECL_UNSETENV + +/* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you + don't. */ +#undef HAVE_DECL_WCRTOMB + +/* Define to 1 if you have the declaration of `wctob', and to 0 if you don't. + */ +#undef HAVE_DECL_WCTOB + +/* Define to 1 if you have the declaration of `wcwidth', and to 0 if you + don't. */ +#undef HAVE_DECL_WCWIDTH + +/* Define to 1 if you have the declaration of `_putenv', and to 0 if you + don't. */ +#undef HAVE_DECL__PUTENV + +/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL__SNPRINTF + +/* Define to 1 if you have the declaration of `__argv', and to 0 if you don't. + */ +#undef HAVE_DECL___ARGV + +/* Define to 1 if you have the declaration of `__fpending', and to 0 if you + don't. */ +#undef HAVE_DECL___FPENDING + +/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the `dirfd' function. */ +#undef HAVE_DIRFD + +/* Define to 1 if you have the 'dup2' function. */ +#undef HAVE_DUP2 + +/* Define if you have the declaration of environ. */ +#undef HAVE_ENVIRON_DECL + +/* Define to 1 if you have the 'fchdir' function. */ +#undef HAVE_FCHDIR + +/* Define to 1 if you have the 'fcntl' function. */ +#undef HAVE_FCNTL + +/* Define to 1 if you have the 'fdopendir' function. */ +#undef HAVE_FDOPENDIR + +/* Define to 1 if you have the <features.h> header file. */ +#undef HAVE_FEATURES_H + +/* Define to 1 if you have the 'fstatat' function. */ +#undef HAVE_FSTATAT + +/* Define to 1 if you have the 'fstatfs' function. */ +#undef HAVE_FSTATFS + +/* Define to 1 if you have the 'getdtablesize' function. */ +#undef HAVE_GETDTABLESIZE + +/* Define to 1 if you have the 'getexecname' function. */ +#undef HAVE_GETEXECNAME + +/* Define to 1 if you have the `getlocalename_l' function. */ +#undef HAVE_GETLOCALENAME_L + +/* Define to 1 if you have the <getopt.h> header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long_only' function. */ +#undef HAVE_GETOPT_LONG_ONLY + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the 'getprogname' function. */ +#undef HAVE_GETPROGNAME + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the <iconv.h> header file. */ +#undef HAVE_ICONV_H + +/* Define to 1 if the compiler supports one of the keywords 'inline', + '__inline__', '__inline' and effectively inlines functions marked as such. + */ +#undef HAVE_INLINE + +/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */ +#undef HAVE_INTMAX_T + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and + declares uintmax_t. */ +#undef HAVE_INTTYPES_H_WITH_UINTMAX + +/* Define to 1 if you have the 'isascii' function. */ +#undef HAVE_ISASCII + +/* Define to 1 if you have the 'isblank' function. */ +#undef HAVE_ISBLANK + +/* Define to 1 if you have the 'iswblank' function. */ +#undef HAVE_ISWBLANK + +/* Define to 1 if you have the 'iswcntrl' function. */ +#undef HAVE_ISWCNTRL + +/* Define to 1 if you have the 'iswctype' function. */ +#undef HAVE_ISWCTYPE + +/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET + +/* Define to 1 if you have the <langinfo.h> header file. */ +#undef HAVE_LANGINFO_H + +/* Define if your <locale.h> file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if you have the <libintl.h> header file. */ +#undef HAVE_LIBINTL_H + +/* Define to 1 if you have the Perl Compatible Regular Expressions library + (-lpcre). */ +#undef HAVE_LIBPCRE + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if the system has the type 'long long int'. */ +#undef HAVE_LONG_LONG_INT + +/* Define to 1 if you have the 'lstat' function. */ +#undef HAVE_LSTAT + +/* Define to 1 if your system has a GNU libc compatible 'malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC_GNU + +/* Define to 1 if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define if the 'malloc' function is POSIX compliant. */ +#undef HAVE_MALLOC_POSIX + +/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including + config.h and <sys/mman.h>. */ +#undef HAVE_MAP_ANONYMOUS + +/* Define to 1 if you have the 'mbrlen' function. */ +#undef HAVE_MBRLEN + +/* Define to 1 if you have the `mbrtowc' function. */ +#undef HAVE_MBRTOWC + +/* Define to 1 if you have the 'mbsinit' function. */ +#undef HAVE_MBSINIT + +/* Define to 1 if you have the 'mbslen' function. */ +#undef HAVE_MBSLEN + +/* Define to 1 if you have the 'mbsrtowcs' function. */ +#undef HAVE_MBSRTOWCS + +/* Define to 1 if <wchar.h> declares mbstate_t. */ +#undef HAVE_MBSTATE_T + +/* Define to 1 if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define to 1 if you have the `memrchr' function. */ +#undef HAVE_MEMRCHR + +/* Define to 1 if <limits.h> defines the MIN and MAX macros. */ +#undef HAVE_MINMAX_IN_LIMITS_H + +/* Define to 1 if <sys/param.h> defines the MIN and MAX macros. */ +#undef HAVE_MINMAX_IN_SYS_PARAM_H + +/* Define to 1 if you have the 'mprotect' function. */ +#undef HAVE_MPROTECT + +/* Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept. */ +#undef HAVE_MSVC_INVALID_PARAMETER_HANDLER + +/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the 'newlocale' function. */ +#undef HAVE_NEWLOCALE + +/* Define to 1 if you have the 'nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + +/* Define to 1 if the system has obstacks that work with any size object. */ +#undef HAVE_OBSTACK + +/* Define to 1 if you have the 'openat' function. */ +#undef HAVE_OPENAT + +/* Define to 1 if you have the `opendir' function. */ +#undef HAVE_OPENDIR + +/* Define to 1 if you have the <OS.h> header file. */ +#undef HAVE_OS_H + +/* Define to 1 if you have the 'pipe' function. */ +#undef HAVE_PIPE + +/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */ +#undef HAVE_PTHREAD_MUTEX_RECURSIVE + +/* Define if the POSIX multithreading library has read/write locks. */ +#undef HAVE_PTHREAD_RWLOCK + +/* Define if the 'pthread_rwlock_rdlock' function prefers a writer to a + reader. */ +#undef HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER + +/* Define to 1 if alphasort is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ALPHASORT + +/* Define to 1 if atoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ATOLL + +/* Define to 1 if btowc is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_BTOWC + +/* Define to 1 if canonicalize_file_name is declared even after undefining + macros. */ +#undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME + +/* Define to 1 if chdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CHDIR + +/* Define to 1 if chown is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CHOWN + +/* Define to 1 if closedir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CLOSEDIR + +/* Define to 1 if dirfd is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DIRFD + +/* Define to 1 if dprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DPRINTF + +/* Define to 1 if dup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP + +/* Define to 1 if dup2 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP2 + +/* Define to 1 if dup3 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP3 + +/* Define to 1 if duplocale is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUPLOCALE + +/* Define to 1 if endusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ENDUSERSHELL + +/* Define to 1 if environ is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ENVIRON + +/* Define to 1 if euidaccess is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_EUIDACCESS + +/* Define to 1 if faccessat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FACCESSAT + +/* Define to 1 if fchdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHDIR + +/* Define to 1 if fchmodat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHMODAT + +/* Define to 1 if fchownat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCHOWNAT + +/* Define to 1 if fcntl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FCNTL + +/* Define to 1 if fdatasync is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FDATASYNC + +/* Define to 1 if fdopendir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FDOPENDIR + +/* Define to 1 if ffsl is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFSL + +/* Define to 1 if ffsll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFSLL + +/* Define to 1 if fpurge is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FPURGE + +/* Define to 1 if fseeko is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSEEKO + +/* Define to 1 if fstat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSTAT + +/* Define to 1 if fstatat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSTATAT + +/* Define to 1 if fsync is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FSYNC + +/* Define to 1 if ftello is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FTELLO + +/* Define to 1 if ftruncate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FTRUNCATE + +/* Define to 1 if futimens is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FUTIMENS + +/* Define to 1 if getcwd is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETCWD + +/* Define to 1 if getdelim is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDELIM + +/* Define to 1 if getdomainname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDOMAINNAME + +/* Define to 1 if getdtablesize is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETDTABLESIZE + +/* Define to 1 if getgroups is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETGROUPS + +/* Define to 1 if gethostname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETHOSTNAME + +/* Define to 1 if getline is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLINE + +/* Define to 1 if getloadavg is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOADAVG + +/* Define to 1 if getlogin is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOGIN + +/* Define to 1 if getlogin_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETLOGIN_R + +/* Define to 1 if getpagesize is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETPAGESIZE + +/* Define to 1 if gets is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETS + +/* Define to 1 if getsubopt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETSUBOPT + +/* Define to 1 if getusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GETUSERSHELL + +/* Define to 1 if grantpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GRANTPT + +/* Define to 1 if group_member is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GROUP_MEMBER + +/* Define to 1 if imaxabs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_IMAXABS + +/* Define to 1 if imaxdiv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_IMAXDIV + +/* Define to 1 if initstate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INITSTATE + +/* Define to 1 if initstate_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INITSTATE_R + +/* Define to 1 if isatty is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISATTY + +/* Define to 1 if isblank is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISBLANK + +/* Define to 1 if iswctype is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISWCTYPE + +/* Define to 1 if lchmod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LCHMOD + +/* Define to 1 if lchown is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LCHOWN + +/* Define to 1 if link is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LINK + +/* Define to 1 if linkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LINKAT + +/* Define to 1 if lseek is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LSEEK + +/* Define to 1 if lstat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_LSTAT + +/* Define to 1 if mbrlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBRLEN + +/* Define to 1 if mbrtowc is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBRTOWC + +/* Define to 1 if mbsinit is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSINIT + +/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSNRTOWCS + +/* Define to 1 if mbsrtowcs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MBSRTOWCS + +/* Define to 1 if memmem is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMMEM + +/* Define to 1 if mempcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMPCPY + +/* Define to 1 if memrchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MEMRCHR + +/* Define to 1 if mkdirat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKDIRAT + +/* Define to 1 if mkdtemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKDTEMP + +/* Define to 1 if mkfifo is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKFIFO + +/* Define to 1 if mkfifoat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKFIFOAT + +/* Define to 1 if mknod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKNOD + +/* Define to 1 if mknodat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKNODAT + +/* Define to 1 if mkostemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKOSTEMP + +/* Define to 1 if mkostemps is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKOSTEMPS + +/* Define to 1 if mkstemp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKSTEMP + +/* Define to 1 if mkstemps is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_MKSTEMPS + +/* Define to 1 if nl_langinfo is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_NL_LANGINFO + +/* Define to 1 if openat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_OPENAT + +/* Define to 1 if opendir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_OPENDIR + +/* Define to 1 if pclose is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PCLOSE + +/* Define to 1 if pipe is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PIPE + +/* Define to 1 if pipe2 is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PIPE2 + +/* Define to 1 if popen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_POPEN + +/* Define to 1 if posix_openpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_POSIX_OPENPT + +/* Define to 1 if pread is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PREAD + +/* Define to 1 if ptsname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTSNAME + +/* Define to 1 if ptsname_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTSNAME_R + +/* Define to 1 if pwrite is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PWRITE + +/* Define to 1 if qsort_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_QSORT_R + +/* Define to 1 if random is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RANDOM + +/* Define to 1 if random_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RANDOM_R + +/* Define to 1 if rawmemchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RAWMEMCHR + +/* Define to 1 if readdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_READDIR + +/* Define to 1 if readlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_READLINK + +/* Define to 1 if readlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_READLINKAT + +/* Define to 1 if realpath is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_REALPATH + +/* Define to 1 if renameat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RENAMEAT + +/* Define to 1 if rewinddir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_REWINDDIR + +/* Define to 1 if rmdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RMDIR + +/* Define to 1 if rpmatch is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RPMATCH + +/* Define to 1 if scandir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SCANDIR + +/* Define to 1 if secure_getenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SECURE_GETENV + +/* Define to 1 if setenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETENV + +/* Define to 1 if sethostname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETHOSTNAME + +/* Define to 1 if setlocale is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETLOCALE + +/* Define to 1 if setstate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSTATE + +/* Define to 1 if setstate_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSTATE_R + +/* Define to 1 if setusershell is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETUSERSHELL + +/* Define to 1 if sleep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SLEEP + +/* Define to 1 if snprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SNPRINTF + +/* Define to 1 if srandom is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SRANDOM + +/* Define to 1 if srandom_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SRANDOM_R + +/* Define to 1 if stat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STAT + +/* Define to 1 if stpcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STPCPY + +/* Define to 1 if stpncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STPNCPY + +/* Define to 1 if strcasestr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCASESTR + +/* Define to 1 if strchrnul is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCHRNUL + +/* Define to 1 if strdup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRDUP + +/* Define to 1 if strerror_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRERROR_R + +/* Define to 1 if strncat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNCAT + +/* Define to 1 if strndup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNDUP + +/* Define to 1 if strnlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNLEN + +/* Define to 1 if strpbrk is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRPBRK + +/* Define to 1 if strsep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRSEP + +/* Define to 1 if strsignal is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRSIGNAL + +/* Define to 1 if strtod is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOD + +/* Define to 1 if strtoimax is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOIMAX + +/* Define to 1 if strtok_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOK_R + +/* Define to 1 if strtoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOLL + +/* Define to 1 if strtoull is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOULL + +/* Define to 1 if strtoumax is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRTOUMAX + +/* Define to 1 if strverscmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRVERSCMP + +/* Define to 1 if symlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SYMLINK + +/* Define to 1 if symlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SYMLINKAT + +/* Define to 1 if tmpfile is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TMPFILE + +/* Define to 1 if towctrans is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TOWCTRANS + +/* Define to 1 if truncate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TRUNCATE + +/* Define to 1 if ttyname_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TTYNAME_R + +/* Define to 1 if unlink is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLINK + +/* Define to 1 if unlinkat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLINKAT + +/* Define to 1 if unlockpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNLOCKPT + +/* Define to 1 if unsetenv is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UNSETENV + +/* Define to 1 if usleep is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_USLEEP + +/* Define to 1 if utimensat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_UTIMENSAT + +/* Define to 1 if vdprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_VDPRINTF + +/* Define to 1 if vsnprintf is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_VSNPRINTF + +/* Define to 1 if wcpcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCPCPY + +/* Define to 1 if wcpncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCPNCPY + +/* Define to 1 if wcrtomb is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCRTOMB + +/* Define to 1 if wcscasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCASECMP + +/* Define to 1 if wcscat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCAT + +/* Define to 1 if wcschr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCHR + +/* Define to 1 if wcscmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCMP + +/* Define to 1 if wcscoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCOLL + +/* Define to 1 if wcscpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCPY + +/* Define to 1 if wcscspn is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCSPN + +/* Define to 1 if wcsdup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSDUP + +/* Define to 1 if wcsftime is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSFTIME + +/* Define to 1 if wcslen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSLEN + +/* Define to 1 if wcsncasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCASECMP + +/* Define to 1 if wcsncat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCAT + +/* Define to 1 if wcsncmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCMP + +/* Define to 1 if wcsncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCPY + +/* Define to 1 if wcsnlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNLEN + +/* Define to 1 if wcsnrtombs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNRTOMBS + +/* Define to 1 if wcspbrk is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSPBRK + +/* Define to 1 if wcsrchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSRCHR + +/* Define to 1 if wcsrtombs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSRTOMBS + +/* Define to 1 if wcsspn is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSSPN + +/* Define to 1 if wcsstr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSSTR + +/* Define to 1 if wcstok is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSTOK + +/* Define to 1 if wcswidth is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSWIDTH + +/* Define to 1 if wcsxfrm is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSXFRM + +/* Define to 1 if wctob is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTOB + +/* Define to 1 if wctrans is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTRANS + +/* Define to 1 if wctype is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTYPE + +/* Define to 1 if wcwidth is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCWIDTH + +/* Define to 1 if wmemchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCHR + +/* Define to 1 if wmemcmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCMP + +/* Define to 1 if wmemcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCPY + +/* Define to 1 if wmemmove is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMMOVE + +/* Define to 1 if wmemset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMSET + +/* Define to 1 if _Exit is declared even after undefining macros. */ +#undef HAVE_RAW_DECL__EXIT + +/* Define to 1 if you have the `readdir' function. */ +#undef HAVE_READDIR + +/* Define to 1 if your system has a GNU libc compatible 'realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC_GNU + +/* Define if the 'realloc' function is POSIX compliant. */ +#undef HAVE_REALLOC_POSIX + +/* Define to 1 if you have the <search.h> header file. */ +#undef HAVE_SEARCH_H + +/* Define to 1 if you have the `setdtablesize' function. */ +#undef HAVE_SETDTABLESIZE + +/* Define to 1 if you have the 'setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the 'setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if 'sig_atomic_t' is a signed integer type. */ +#undef HAVE_SIGNED_SIG_ATOMIC_T + +/* Define to 1 if 'wchar_t' is a signed integer type. */ +#undef HAVE_SIGNED_WCHAR_T + +/* Define to 1 if 'wint_t' is a signed integer type. */ +#undef HAVE_SIGNED_WINT_T + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define if the return value of the snprintf function is the number of of + bytes (excluding the terminating NUL) that would have been produced if the + buffer had been large enough. */ +#undef HAVE_SNPRINTF_RETVAL_C99 + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares + uintmax_t. */ +#undef HAVE_STDINT_H_WITH_UINTMAX + +/* Define to 1 if you have the <stdio_ext.h> header file. */ +#undef HAVE_STDIO_EXT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `stpcpy' function. */ +#undef HAVE_STPCPY + +/* Define to 1 if you have the 'strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the 'strerror_r' function. */ +#undef HAVE_STRERROR_R + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Always define to 1, for backward compatibility. You can assume <string.h> + exists. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strnlen' function. */ +#undef HAVE_STRNLEN + +/* Define to 1 if you have the 'strtoimax' function. */ +#undef HAVE_STRTOIMAX + +/* Define to 1 if you have the `strtoll' function. */ +#undef HAVE_STRTOLL + +/* Define to 1 if you have the `strtoull' function. */ +#undef HAVE_STRTOULL + +/* Define to 1 if you have the 'strtoumax' function. */ +#undef HAVE_STRTOUMAX + +/* Define if there is a member named d_type in the struct describing directory + headers. */ +#undef HAVE_STRUCT_DIRENT_D_TYPE + +/* Define to 1 if `decimal_point' is a member of `struct lconv'. */ +#undef HAVE_STRUCT_LCONV_DECIMAL_POINT + +/* Define to 1 if `f_type' is a member of `struct statfs'. */ +#undef HAVE_STRUCT_STATFS_F_TYPE + +/* Define to 1 if you have the 'symlink' function. */ +#undef HAVE_SYMLINK + +/* Define to 1 if you have the <sys/bitypes.h> header file. */ +#undef HAVE_SYS_BITYPES_H + +/* Define to 1 if you have the <sys/cdefs.h> header file. */ +#undef HAVE_SYS_CDEFS_H + +/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the <sys/inttypes.h> header file. */ +#undef HAVE_SYS_INTTYPES_H + +/* Define to 1 if you have the <sys/mman.h> header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <sys/vfs.h> header file. */ +#undef HAVE_SYS_VFS_H + +/* Define to 1 if you have the `towlower' function. */ +#undef HAVE_TOWLOWER + +/* Define to 1 if you have the `tsearch' function. */ +#undef HAVE_TSEARCH + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `unsetenv' function. */ +#undef HAVE_UNSETENV + +/* Define to 1 if the system has the type 'unsigned long long int'. */ +#undef HAVE_UNSIGNED_LONG_LONG_INT + +/* Define to 1 if you have the `uselocale' function. */ +#undef HAVE_USELOCALE + +/* Define if you have a global __progname variable */ +#undef HAVE_VAR___PROGNAME + +/* Define to 1 if you have the 'vasnprintf' function. */ +#undef HAVE_VASNPRINTF + +/* Define to 1 if you have the <wchar.h> header file. */ +#undef HAVE_WCHAR_H + +/* Define if you have the 'wchar_t' type. */ +#undef HAVE_WCHAR_T + +/* Define to 1 if you have the `wcrtomb' function. */ +#undef HAVE_WCRTOMB + +/* Define to 1 if you have the `wcslen' function. */ +#undef HAVE_WCSLEN + +/* Define to 1 if you have the `wcsnlen' function. */ +#undef HAVE_WCSNLEN + +/* Define to 1 if you have the 'wctob' function. */ +#undef HAVE_WCTOB + +/* Define to 1 if you have the <wctype.h> header file. */ +#undef HAVE_WCTYPE_H + +/* Define to 1 if you have the 'wcwidth' function. */ +#undef HAVE_WCWIDTH + +/* Define to 1 if you have the <winsock2.h> header file. */ +#undef HAVE_WINSOCK2_H + +/* Define if you have the 'wint_t' type. */ +#undef HAVE_WINT_T + +/* Define to 1 if you have the 'wmemchr' function. */ +#undef HAVE_WMEMCHR + +/* Define to 1 if you have the 'wmemcpy' function. */ +#undef HAVE_WMEMCPY + +/* Define to 1 if you have the 'wmempcpy' function. */ +#undef HAVE_WMEMPCPY + +/* Define to 1 if fstatat (..., 0) works. For example, it does not work in AIX + 7.1. */ +#undef HAVE_WORKING_FSTATAT_ZERO_FLAG + +/* Define to 1 if O_NOATIME works. */ +#undef HAVE_WORKING_O_NOATIME + +/* Define to 1 if O_NOFOLLOW works. */ +#undef HAVE_WORKING_O_NOFOLLOW + +/* Define to 1 if you have the <xlocale.h> header file. */ +#undef HAVE_XLOCALE_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if you have the '_set_invalid_parameter_handler' function. */ +#undef HAVE__SET_INVALID_PARAMETER_HANDLER + +/* Define to 1 if the compiler supports __builtin_expect, + and to 2 if <builtins.h> does. */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(e, c) (e) +#elif HAVE___BUILTIN_EXPECT == 2 +# include <builtins.h> +#endif + + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Define to a symbolic name denoting the flavor of iconv_open() + implementation. */ +#undef ICONV_FLAVOR + +/* Define to 1 if lseek does not detect pipes. */ +#undef LSEEK_PIPE_BROKEN + +/* Define to 1 if 'lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + +/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ +#undef MALLOC_0_IS_NONNULL + +/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */ +#undef MAP_ANONYMOUS + +/* Define if the mbrtowc function does not return (size_t) -2 for empty input. + */ +#undef MBRTOWC_EMPTY_INPUT_BUG + +/* Define if the mbrtowc function has the NULL pwc argument bug. */ +#undef MBRTOWC_NULL_ARG1_BUG + +/* Define if the mbrtowc function has the NULL string argument bug. */ +#undef MBRTOWC_NULL_ARG2_BUG + +/* Define if the mbrtowc function does not return 0 for a NUL character. */ +#undef MBRTOWC_NUL_RETVAL_BUG + +/* Define if the mbrtowc function returns a wrong return value. */ +#undef MBRTOWC_RETVAL_BUG + +/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif + + +/* Define to 1 if assertions should be disabled. */ +#undef NDEBUG + +/* Define to 1 if open() fails to recognize a trailing slash. */ +#undef OPEN_TRAILING_SLASH_BUG + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* String identifying the packager of this software */ +#undef PACKAGE_PACKAGER + +/* Packager info for bug reports (URL/e-mail/...) */ +#undef PACKAGE_PACKAGER_BUG_REPORTS + +/* Packager-specific version information */ +#undef PACKAGE_PACKAGER_VERSION + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if <inttypes.h> exists and defines unusable PRI* macros. */ +#undef PRI_MACROS_BROKEN + +/* Define to the type that is the result of default argument promotions of + type mode_t. */ +#undef PROMOTED_MODE_T + +/* Define if the pthread_in_use() detection is hard. */ +#undef PTHREAD_IN_USE_DETECTION_HARD + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'ptrdiff_t'. */ +#undef PTRDIFF_T_SUFFIX + +/* Define to 1 if gnulib's dirfd() replacement is used. */ +#undef REPLACE_DIRFD + +/* Define to 1 if gnulib's fchdir() replacement is used. */ +#undef REPLACE_FCHDIR + +/* Define to 1 if stat needs help when passed a file name with a trailing + slash */ +#undef REPLACE_FUNC_STAT_FILE + +/* Define if nl_langinfo exists but is overridden by gnulib. */ +#undef REPLACE_NL_LANGINFO + +/* Define to 1 if open() should work around the inability to open a directory. + */ +#undef REPLACE_OPEN_DIRECTORY + +/* Define to 1 if strerror(0) does not return a message implying success. */ +#undef REPLACE_STRERROR_0 + +/* Define if vasnprintf exists but is overridden by gnulib. */ +#undef REPLACE_VASNPRINTF + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'sig_atomic_t'. */ +#undef SIG_ATOMIC_T_SUFFIX + +/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +#ifndef SIZE_MAX +# undef SIZE_MAX +#endif + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'size_t'. */ +#undef SIZE_T_SUFFIX + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Always define to 1, for backward compatibility. You can assume the C90 + standard headers exist. */ +#undef STDC_HEADERS + +/* Define to 1 if strerror_r returns char *. */ +#undef STRERROR_R_CHAR_P + +/* Define if the POSIX multithreading library can be used. */ +#undef USE_POSIX_THREADS + +/* Define if references to the POSIX multithreading library should be made + weak. */ +#undef USE_POSIX_THREADS_WEAK + +/* Define if the GNU Pth multithreading library can be used. */ +#undef USE_PTH_THREADS + +/* Define if references to the GNU Pth multithreading library should be made + weak. */ +#undef USE_PTH_THREADS_WEAK + +/* Define if the old Solaris multithreading library can be used. */ +#undef USE_SOLARIS_THREADS + +/* Define if references to the old Solaris multithreading library should be + made weak. */ +#undef USE_SOLARIS_THREADS_WEAK + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions if necessary. HP-UX 11.11 defines + mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of + whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, but it is not + safe for multithreaded apps. */ +#undef USE_UNLOCKED_IO + +/* Define if the native Windows multithreading API can be used. */ +#undef USE_WINDOWS_THREADS + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if unsetenv returns void instead of int. */ +#undef VOID_UNSETENV + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wchar_t'. */ +#undef WCHAR_T_SUFFIX + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wint_t'. */ +#undef WINT_T_SUFFIX + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#undef _DARWIN_USE_64_BIT_INODE + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to 1 on Solaris. */ +#undef _LCONV_C99 + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ +#undef _NETBSD_SOURCE + +/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif + + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for 'stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Define if you want <regex.h> to include <limits.h>, so that it consistently + overrides <limits.h>'s RE_DUP_MAX. */ +#undef _REGEX_INCLUDE_LIMITS_H + +/* Define if you want regoff_t to be at least as wide POSIX requires. */ +#undef _REGEX_LARGE_OFFSETS + +/* For standard stat data types on VMS. */ +#undef _USE_STD_STAT + +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + +/* Define to 1 if the system <stdint.h> predates C++11. */ +#undef __STDC_CONSTANT_MACROS + +/* Define to 1 if the system <stdint.h> predates C++11. */ +#undef __STDC_LIMIT_MACROS + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Please see the Gnulib manual for how to use these macros. + + Suppress extern inline with HP-UX cc, as it appears to be broken; see + <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>. + + Suppress extern inline with Sun C in standards-conformance mode, as it + mishandles inline functions that call each other. E.g., for 'inline void f + (void) { } inline void g (void) { f (); }', c99 incorrectly complains + 'reference to static identifier "f" in extern inline function'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use 'static inline' to implement + functions or macros in standard C headers like <ctype.h>. For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and + for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \ + || defined __DragonFly__ || defined __FreeBSD__) \ + && (defined __header_inline \ + ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ + && ! defined __clang__) \ + : ((! defined _DONT_USE_CTYPE_INLINE_ \ + && (defined __GNUC__ || defined __cplusplus)) \ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ + && defined __GNUC__ && ! defined __cplusplus)))) +# define _GL_EXTERN_INLINE_STDHEADER_BUG +#endif +#if ((__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ + && !defined __PGI \ + && !(defined __SUNPRO_C && __STDC__))) \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE +#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE +#else +# define _GL_INLINE static _GL_UNUSED +# define _GL_EXTERN_INLINE static _GL_UNUSED +#endif + +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for 'FOO'" + and "no previous declaration for 'FOO'" diagnostics, + when FOO is an inline function in the header; see + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif + +/* Define to a replacement function name for fnmatch(). */ +#undef fnmatch + +/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b)) + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to long or long long if <stdint.h> and <inttypes.h> don't define. */ +#undef intmax_t + +/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for Mac OS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif + +/* Define to 1 if the compiler is checking for lint. */ +#undef lint + +/* Define to a type if <wchar.h> does not define. */ +#undef mbstate_t + +/* Define to `int' if <sys/types.h> does not define. */ +#undef mode_t + +/* Define to the type of st_nlink in struct stat, or a supertype. */ +#undef nlink_t + +/* Define to `long int' if <sys/types.h> does not define. */ +#undef off_t + +/* Define to `int' if <sys/types.h> does not define. */ +#undef pid_t + +/* Define as the type of the result of subtracting two pointers, if the system + doesn't define it. */ +#undef ptrdiff_t + +/* Define to rpl_re_comp if the replacement should be used. */ +#undef re_comp + +/* Define to rpl_re_compile_fastmap if the replacement should be used. */ +#undef re_compile_fastmap + +/* Define to rpl_re_compile_pattern if the replacement should be used. */ +#undef re_compile_pattern + +/* Define to rpl_re_exec if the replacement should be used. */ +#undef re_exec + +/* Define to rpl_re_match if the replacement should be used. */ +#undef re_match + +/* Define to rpl_re_match_2 if the replacement should be used. */ +#undef re_match_2 + +/* Define to rpl_re_search if the replacement should be used. */ +#undef re_search + +/* Define to rpl_re_search_2 if the replacement should be used. */ +#undef re_search_2 + +/* Define to rpl_re_set_registers if the replacement should be used. */ +#undef re_set_registers + +/* Define to rpl_re_set_syntax if the replacement should be used. */ +#undef re_set_syntax + +/* Define to rpl_re_syntax_options if the replacement should be used. */ +#undef re_syntax_options + +/* Define to rpl_regcomp if the replacement should be used. */ +#undef regcomp + +/* Define to rpl_regerror if the replacement should be used. */ +#undef regerror + +/* Define to rpl_regexec if the replacement should be used. */ +#undef regexec + +/* Define to rpl_regfree if the replacement should be used. */ +#undef regfree + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +#undef size_t + +/* Define as a signed type of the same size as size_t. */ +#undef ssize_t + +/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_UNUSED +#endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED + +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif + + +/* Define as a macro for copying va_list variables. */ +#undef va_copy diff --git a/configure b/configure new file mode 100755 index 0000000..dfb3431 --- /dev/null +++ b/configure @@ -0,0 +1,39261 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69.185-b502e for GNU grep 3.1. +# +# Report bugs to <bug-grep@gnu.org>. +# +# +# Copyright (C) 1992-1996, 1998-2017 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 ${ZSH_VERSION+y} && (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 + + +# The user is always right. +if ${PATH_SEPARATOR+false} :; 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.) +as_nl=' +' +export as_nl +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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf "%s\n" "$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 \${$as_var+y} \ + && ( (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'. +printf "%s\n" "$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 \${ZSH_VERSION+y} && (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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 +IFS=$as_save_IFS +$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; } + + + 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'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and bug-grep@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=`printf "%s\n" "$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 || +printf "%s\n" 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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$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 || +printf "%s\n" 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" || + { printf "%s\n" "$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 grep' +PACKAGE_TARNAME='grep' +PACKAGE_VERSION='3.1' +PACKAGE_STRING='GNU grep 3.1' +PACKAGE_BUGREPORT='bug-grep@gnu.org' +PACKAGE_URL='http://www.gnu.org/software/grep/' + +ac_unique_file="src/grep.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_header_c_list= +gl_use_threads_default= +gl_func_list= +gl_header_list= +gl_fnmatch_required=POSIX +gl_getopt_required=POSIX +gt_needs= +ac_subst_vars='gltests_LTLIBOBJS +gltests_LIBOBJS +gl_LTLIBOBJS +gl_LIBOBJS +CONFIG_INCLUDE +am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +COLORIZE_SOURCE +PCRE_LIBS +PCRE_CFLAGS +USE_INCLUDED_REGEX_FALSE +USE_INCLUDED_REGEX_TRUE +POSUB +INTLLIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +GNULIB_WARN_CFLAGS +WARN_CFLAGS +WERROR_CFLAGS +HAVE_PERL_FALSE +HAVE_PERL_TRUE +LIBTESTS_LIBDEPS +LIBGREPUTILS_LTLIBDEPS +LIBGREPUTILS_LIBDEPS +abs_aux_dir +INTL_MACOSX_LIBS +REPLACE_ITOLD +GL_GENERATE_FLOAT_H_FALSE +GL_GENERATE_FLOAT_H_TRUE +FLOAT_H +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H +NEXT_FLOAT_H +LOCALE_TR_UTF8 +gltests_WITNESS +HAVE_FEATURES_H +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 +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE +LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE +LIBUNISTRING_UNISTR_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 +GNULIB_GETTIMEOFDAY +REPLACE_TZSET +REPLACE_TIMEGM +REPLACE_STRFTIME +REPLACE_NANOSLEEP +REPLACE_MKTIME +REPLACE_LOCALTIME_R +REPLACE_CTIME +HAVE_TIMEZONE_T +HAVE_TZSET +HAVE_TIMEGM +HAVE_STRPTIME +HAVE_NANOSLEEP +HAVE_DECL_LOCALTIME_R +GNULIB_TZSET +GNULIB_TIME_RZ +GNULIB_TIME_R +GNULIB_TIMEGM +GNULIB_STRPTIME +GNULIB_STRFTIME +GNULIB_NANOSLEEP +GNULIB_LOCALTIME +GNULIB_MKTIME +GNULIB_CTIME +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 +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 +HAVE__BOOL +GL_GENERATE_STDBOOL_H_FALSE +GL_GENERATE_STDBOOL_H_TRUE +STDBOOL_H +GL_GENERATE_STDARG_H_FALSE +GL_GENERATE_STDARG_H_TRUE +STDARG_H +NEXT_AS_FIRST_DIRECTIVE_STDARG_H +NEXT_STDARG_H +GL_GENERATE_STDALIGN_H_FALSE +GL_GENERATE_STDALIGN_H_TRUE +STDALIGN_H +PERL +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_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_QSORT_R +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 +SED +WINDOWS_STAT_INODES +WINDOWS_64_BIT_OFF_T +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H +NEXT_SYS_TYPES_H +LTLIBMULTITHREAD +LIBMULTITHREAD +LTLIBTHREAD +LIBTHREAD +LIBPTH_PREFIX +LTLIBPTH +LIBPTH +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H +NEXT_LOCALE_H +HAVE_XLOCALE_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 +REPLACE_STRUCT_LCONV +REPLACE_DUPLOCALE +REPLACE_SETLOCALE +REPLACE_LOCALECONV +HAVE_DUPLOCALE +GNULIB_DUPLOCALE +GNULIB_SETLOCALE +GNULIB_LOCALECONV +LOCALCHARSET_TESTS_ENVIRONMENT +GLIBC21 +HAVE_LANGINFO_YESEXPR +HAVE_LANGINFO_ERA +HAVE_LANGINFO_T_FMT_AMPM +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_H +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H +NEXT_LANGINFO_H +REPLACE_NL_LANGINFO +HAVE_NL_LANGINFO +GNULIB_NL_LANGINFO +REPLACE_TOWLOWER +REPLACE_ISWCNTRL +HAVE_WCTYPE_H +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_CRTDEFS_H +HAVE_WINT_T +HAVE_ISWCNTRL +REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T +HAVE_ISWBLANK +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK +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 +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_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 +APPLE_UNIVERSAL_BUILD +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 +GNULIB_OVERRIDES_WINT_T +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_ICONV_H +NEXT_ICONV_H +GL_GENERATE_ICONV_H_FALSE +GL_GENERATE_ICONV_H_TRUE +ICONV_H +REPLACE_ICONV_UTF +REPLACE_ICONV_OPEN +REPLACE_ICONV +ICONV_CONST +GNULIB_ICONV +LTLIBICONV +LIBICONV +LTLIBINTL +LIBINTL +GNULIB_GL_UNISTD_H_GETOPT +GETOPT_CDEFS_H +GETOPT_H +HAVE_SYS_CDEFS_H +HAVE_GETOPT_H +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H +NEXT_GETOPT_H +WINDOWS_64_BIT_ST_SIZE +WINDOWS_STAT_TIMESPEC +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_OVERRIDES_STRUCT_STAT +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 +GL_GENERATE_FNMATCH_H_FALSE +GL_GENERATE_FNMATCH_H_TRUE +FNMATCH_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 +HAVE_DIRENT_H +NEXT_AS_FIRST_DIRECTIVE_DIRENT_H +NEXT_DIRENT_H +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H +NEXT_CTYPE_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ISBLANK +GNULIB_ISBLANK +pkglibexecdir +lispdir +REPLACE_FDOPENDIR +REPLACE_DIRFD +REPLACE_CLOSEDIR +REPLACE_OPENDIR +HAVE_ALPHASORT +HAVE_SCANDIR +HAVE_FDOPENDIR +HAVE_DECL_FDOPENDIR +HAVE_DECL_DIRFD +HAVE_CLOSEDIR +HAVE_REWINDDIR +HAVE_READDIR +HAVE_OPENDIR +GNULIB_ALPHASORT +GNULIB_SCANDIR +GNULIB_FDOPENDIR +GNULIB_DIRFD +GNULIB_CLOSEDIR +GNULIB_REWINDDIR +GNULIB_READDIR +GNULIB_OPENDIR +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_TRUNCATE +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_GETLOGIN +HAVE_DECL_GETDOMAINNAME +HAVE_DECL_FDATASYNC +HAVE_DECL_FCHDIR +HAVE_DECL_ENVIRON +HAVE_USLEEP +HAVE_UNLINKAT +HAVE_TRUNCATE +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_TRUNCATE +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 +LOCALE_FR +REPLACE_WCSFTIME +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_WCSFTIME +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_WCSFTIME +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 +GL_GENERATE_ALLOCA_H_FALSE +GL_GENERATE_ALLOCA_H_TRUE +ALLOCA_H +ALLOCA +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +RANLIB +ARFLAGS +AR +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +SET_MAKE +AWK +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 +mkdir_p +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 +runstatedir +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 +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +enable_threads +enable_assert +with_gnu_ld +enable_rpath +with_libiconv_prefix +with_libpth_prefix +with_included_regex +with_packager +with_packager_version +with_packager_bug_reports +enable_gcc_warnings +enable_nls +with_libintl_prefix +enable_perl_regexp +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +PCRE_CFLAGS +PCRE_LIBS' + + +# 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' +runstatedir='${localstatedir}/run' +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=`printf "%s\n" "$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=`printf "%s\n" "$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 ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -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=`printf "%s\n" "$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=`printf "%s\n" "$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. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$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" ;; + *) printf "%s\n" "$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 runstatedir +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 || +printf "%s\n" 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 grep 3.1 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] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --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/grep] + --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 grep 3.1:";; + 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 + --disable-assert turn off assertions + --disable-rpath do not hardcode runtime library paths + --enable-gcc-warnings turn on lots of GCC warnings (for developers) + --disable-nls do not use Native Language Support + --disable-perl-regexp disable perl-regexp (pcre) 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-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-libpth-prefix[=DIR] search for libpth in DIR/include and DIR/lib + --without-libpth-prefix don't search for libpth in includedir and libdir + --without-included-regex + don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems). + --with-packager String identifying the packager of this software + --with-packager-version Packager-specific version information + --with-packager-bug-reports + Packager info for bug reports (URL/e-mail/...) + --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> + CPP C preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + PCRE_CFLAGS C compiler flags for PCRE, overriding pkg-config + PCRE_LIBS linker flags for PCRE, overriding pkg-config + +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-grep@gnu.org>. +GNU grep home page: <http://www.gnu.org/software/grep/>. +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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$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 + printf "%s\n" "$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 grep configure 3.1 +generated by GNU Autoconf 2.69.185-b502e + +Copyright (C) 2017 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\"" +printf "%s\n" "$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 + printf "%s\n" "$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 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_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\"" +printf "%s\n" "$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 + printf "%s\n" "$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 + printf "%s\n" "$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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +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 (void) +{ +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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# 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\"" +printf "%s\n" "$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 + printf "%s\n" "$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 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(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. */ + +#include <limits.h> +#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 (void) +{ +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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$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_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 + # Initialize each $ac_[]_AC_LANG_ABBREV[]_decl_warn_flag once. + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else + ac_save_werror_flag=$ac_c_werror_flag + ac_c_werror_flag="$ac_c_decl_warn_flag$ac_c_werror_flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + ac_c_werror_flag=$ac_save_werror_flag + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + +# 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 (void) +{ +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 (void) +{ +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 (void) +{ +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 (void) +{ +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 (void) +{ +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 (void) +{ + + 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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +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 (void) +{ +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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$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 grep $as_me 3.1, which was +generated by GNU Autoconf 2.69.185-b502e. 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "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=`printf "%s\n" "$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=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$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 + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$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 + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +gl_func_list="$gl_func_list btowc" +gl_header_list="$gl_header_list unistd.h" +gl_header_list="$gl_header_list sys/param.h" +gl_func_list="$gl_func_list _set_invalid_parameter_handler" +gl_header_list="$gl_header_list sys/socket.h" +gl_func_list="$gl_func_list fchdir" +gl_header_list="$gl_header_list dirent.h" +gl_func_list="$gl_func_list fdopendir" +gl_func_list="$gl_func_list strerror_r" +gl_func_list="$gl_func_list fcntl" +gl_func_list="$gl_func_list symlink" +gl_func_list="$gl_func_list mempcpy" +gl_func_list="$gl_func_list isblank" +gl_func_list="$gl_func_list iswctype" +gl_func_list="$gl_func_list mbsrtowcs" +gl_func_list="$gl_func_list wmemchr" +gl_func_list="$gl_func_list wmemcpy" +gl_func_list="$gl_func_list wmempcpy" +gl_header_list="$gl_header_list wctype.h" +gl_header_list="$gl_header_list stdio_ext.h" +gl_header_list="$gl_header_list sys/stat.h" +gl_func_list="$gl_func_list fstatat" +gl_func_list="$gl_func_list openat" +gl_func_list="$gl_func_list fstatfs" +gl_header_list="$gl_header_list sys/vfs.h" +gl_func_list="$gl_func_list getdtablesize" +gl_getopt_required=GNU +gl_header_list="$gl_header_list getopt.h" +gl_header_list="$gl_header_list sys/cdefs.h" +gl_func_list="$gl_func_list getprogname" +gl_func_list="$gl_func_list getexecname" +gl_header_list="$gl_header_list iconv.h" +gl_header_list="$gl_header_list limits.h" +gl_header_list="$gl_header_list wchar.h" +gl_header_list="$gl_header_list stdint.h" +gl_header_list="$gl_header_list inttypes.h" +gl_func_list="$gl_func_list iswcntrl" +gl_header_list="$gl_header_list crtdefs.h" +gl_func_list="$gl_func_list iswblank" +gl_header_list="$gl_header_list langinfo.h" +gl_header_list="$gl_header_list xlocale.h" +gl_func_list="$gl_func_list lstat" +gl_func_list="$gl_func_list mbsinit" +gl_func_list="$gl_func_list mbrtowc" +gl_func_list="$gl_func_list mbrlen" +gl_func_list="$gl_func_list mbslen" +gl_header_list="$gl_header_list sys/mman.h" +gl_func_list="$gl_func_list mprotect" +gl_func_list="$gl_func_list nl_langinfo" +gl_header_list="$gl_header_list malloc.h" +gl_func_list="$gl_func_list strdup" +gl_func_list="$gl_func_list strtoimax" +gl_func_list="$gl_func_list strtoumax" +gl_header_list="$gl_header_list sys/time.h" +gl_func_list="$gl_func_list pipe" +gl_header_list="$gl_header_list features.h" +gl_func_list="$gl_func_list wcrtomb" +gl_func_list="$gl_func_list wctob" +gl_func_list="$gl_func_list wcwidth" +gl_func_list="$gl_func_list newlocale" +gl_func_list="$gl_func_list setenv" +gl_func_list="$gl_func_list snprintf" +gl_func_list="$gl_func_list vasnprintf" +gl_func_list="$gl_func_list isascii" +gl_func_list="$gl_func_list setlocale" +gt_needs="$gt_needs " +# 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,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$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=`printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$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 + + + +# Set the GREP and EGREP variables to a dummy replacement for the 'grep' +# command, so that AC_PROG_GREP and AC_PROG_EGREP don't fail when no good +# 'grep' program is found. This makes it possible to build GNU grep on a +# Solaris machine that has only /usr/bin/grep and no /usr/xpg4/bin/grep. +# This function supports only restricted arguments: +# - No file names as arguments, process only standard input. +# - Only literal strings without backslashes, no regular expressions. +# - The only options are -e and -E (and -Ee). +# This function also does not support long lines beyond what the shell +# supports), and backslash-processes the input. +fn_grep () { + test "$1" = -E && shift + case $#:$1 in + 0:*) as_fn_error $? "fn_grep: expected pattern" "$LINENO" 5 ;; + 1:-*) as_fn_error $? "fn_grep: invalid command line" "$LINENO" 5 ;; + 1:*) pattern=$1 ;; + 2:--|2:-e|2:-Ee) pattern=$2 ;; + *) as_fn_error $? "fn_grep: invalid command line" "$LINENO" 5 ;; + esac + + case $pattern in + *['].^$\*[']*) as_fn_error $? "fn_grep: regular expressions not supported" "$LINENO" 5 ;; + esac + + rc=1 + while read line; do + case $line in + *$pattern*) + rc=0 + printf "%s\n" $line ;; + esac + done + return $rc +} + +test -n "$GREP" || GREP=fn_grep +test -n "$EGREP" || EGREP=fn_grep +ac_cv_path_EGREP=$EGREP + +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. + + + + +printf "%s\n" "#define GREP 1" >>confdefs.h + + + + +am__api_version='1.99a' + +# 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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +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+y}; 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$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' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "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=`printf "%s\n" "$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= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +printf %s "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 ('*'coreutils) '* | \ + 'BusyBox '* | \ + '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+y}; 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +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} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else + if printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$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='\' + +mkdir_p='$(MKDIR_P)' +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='grep' + VERSION='3.1' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# 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"} + +# 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+y} +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} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else + if printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$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='\' + # make --enable-silent-rules the default. + +ac_config_headers="$ac_config_headers config.h:config.hin" + + +# 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 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$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 + + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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}clang" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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="clang" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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. +printf "%s\n" "$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 -version; 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\"" +printf "%s\n" "$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 + printf "%s\n" "$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 (void) +{ + + ; + 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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$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+y} && 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 : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$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 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$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 (void) +{ +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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" = maybe && test "x$build" != "x$host"; then + cross_compiling=yes +elif 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$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 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$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 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(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 (void) +{ + + ; + 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 (void) +{ + + ; + 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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdbool.h> +#include <stddef.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 bool +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 = 0; + float fnumber = 0; + + 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); + + return *str && number && fnumber; +} +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; + +int +main (void) +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= 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); + + v1.i = 2; + v1.w.k = 5; + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +ac_prog_cc_stdc_options= +case "x$ac_cv_prog_cc_c11" in + x) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } ;; + xno) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } ;; + *) + ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11" + CC=$CC$ac_prog_cc_stdc_options + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c11" != xno +then : + ac_prog_cc_stdc=c11 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(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 <stddef.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 bool +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 = 0; + float fnumber = 0; + + 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); + + return *str && number && fnumber; +} +int +main (void) +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= 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=extc1x -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 +ac_prog_cc_stdc_options= +case "x$ac_cv_prog_cc_c99" in + x) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } ;; + xno) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } ;; + *) + ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99" + CC=$CC$ac_prog_cc_stdc_options + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno +then : + ac_prog_cc_stdc=c99 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(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 (void) +{ +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 +ac_prog_cc_stdc_options= +case "x$ac_cv_prog_cc_c89" in + x) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } ;; + xno) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } ;; + *) + ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89" + CC=$CC$ac_prog_cc_stdc_options + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno +then : + ac_prog_cc_stdc=c89 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_prog_cc_stdc=no + ac_cv_prog_cc_stdc=no +fi + +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 +DEPDIR=.deps + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +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 + + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$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 + + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + +printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + + + ac_fn_c_check_header_compile "$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 + +printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + +printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +printf "%s\n" "#define _MINIX 1" >>confdefs.h + + +printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(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 (void) +{ + + ; + 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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + + + + + + + + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "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 test ${ac_cv_prog_CPP+y} +then : + printf %s "(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. + # 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. */ +#include <limits.h> + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$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. + # 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. */ +#include <limits.h> + 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 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +printf %s "checking for Minix Amsterdam compiler... " >&6; } +if test ${gl_cv_c_amsterdam_compiler+y} +then : + printf %s "(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 -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +printf "%s\n" "$gl_cv_c_amsterdam_compiler" >&6; } + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + : + fi + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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='cr' + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + + + + + + + # 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+y} +then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(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 (void) +{ + + ; + 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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(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 (void) +{ + + ; + 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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi + + +printf "%s\n" "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h + +fi + + + + + + + + # Check whether --enable-threads was given. +if test ${enable_threads+y} +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 + + + + # Pre-early section. + + + + + # Code from module absolute-header: + # Code from module alignof: + # Code from module alignof-tests: + # Code from module alloca: + # Code from module alloca-opt: + # Code from module alloca-opt-tests: + # Code from module announce-gen: + # Code from module argmatch: + # Code from module argmatch-tests: + # Code from module assert: + # Code from module assure: + # Code from module at-internal: + # Code from module binary-io: + # Code from module binary-io-tests: + # Code from module bitrotate: + # Code from module bitrotate-tests: + # Code from module btowc: + # Code from module btowc-tests: + # Code from module builtin-expect: + # Code from module c-ctype: + # Code from module c-ctype-tests: + # Code from module c-strcase: + # Code from module c-strcase-tests: + # Code from module c-strcaseeq: + # Code from module c99: + # Code from module chdir: + # Code from module chdir-long: + # Code from module chdir-tests: + # Code from module cloexec: + # Code from module cloexec-tests: + # Code from module close: + # Code from module close-stream: + # Code from module close-tests: + # Code from module closedir: + # Code from module closeout: + # Code from module configmake: + # Code from module ctype: + # Code from module ctype-tests: + # Code from module cycle-check: + # Code from module d-ino: + # Code from module d-type: + # Code from module dev-ino: + # Code from module dfa: + # Code from module dfa-tests: + # Code from module dirent: + # Code from module dirent-safer: + # Code from module dirent-safer-tests: + # Code from module dirent-tests: + # Code from module dirfd: + # 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 dup: + # Code from module dup-tests: + # Code from module dup2: + # Code from module dup2-tests: + # Code from module environ: + # Code from module environ-tests: + # Code from module errno: + # Code from module errno-tests: + # Code from module error: + # Code from module exclude: + # Code from module exclude-tests: + # Code from module exitfail: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fchdir: + # Code from module fchdir-tests: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fcntl-h-tests: + # Code from module fcntl-safer: + # Code from module fcntl-safer-tests: + # Code from module fcntl-tests: + # Code from module fd-hook: + # Code from module fd-safer-flag: + # Code from module fdl: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fdopendir: + # Code from module fdopendir-tests: + # Code from module fgetc-tests: + # Code from module filename: + # Code from module filenamecat-lgpl: + # Code from module flexmember: + # Code from module float: + # Code from module float-tests: + # Code from module fnmatch: + # Code from module fnmatch-tests: + # Code from module fpending: + # Code from module fpending-tests: + # Code from module fpieee: + + # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module fstat: + # Code from module fstat-tests: + # Code from module fstatat: + # Code from module fstatat-tests: + # Code from module fts: + # Code from module fwrite-tests: + # Code from module gendocs: + # Code from module getcwd-lgpl: + # Code from module getcwd-lgpl-tests: + # Code from module getdtablesize: + # Code from module getdtablesize-tests: + # Code from module getopt-gnu: + # Code from module getopt-gnu-tests: + # Code from module getopt-posix: + # Code from module getopt-posix-tests: + # Code from module getpagesize: + # Code from module getprogname: + # Code from module getprogname-tests: + # Code from module gettext-h: + # 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 gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-tests: + # Code from module havelib: + # Code from module i-ring: + # Code from module i-ring-tests: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv-h-tests: + # Code from module iconv-tests: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module ignore-value-tests: + # Code from module include_next: + # Code from module inline: + # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttostr: + # Code from module inttostr-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: + # Code from module isatty: + # Code from module isatty-tests: + # Code from module isblank: + # Code from module isblank-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module iswctype: + # Code from module langinfo: + # Code from module langinfo-tests: + # Code from module largefile: + + # Code from module limits-h: + # Code from module limits-h-tests: + # Code from module localcharset: + # Code from module locale: + # Code from module locale-tests: + # Code from module localeconv: + # Code from module localeconv-tests: + # Code from module localename: + # Code from module localename-tests: + # Code from module lock: + # Code from module lseek: + # Code from module lseek-tests: + # Code from module lstat: + # Code from module lstat-tests: + # Code from module maintainer-makefile: + # Code from module malloc-gnu: + # Code from module malloc-gnu-tests: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module malloca-tests: + # Code from module manywarnings: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrlen: + # Code from module mbrtowc: + # Code from module mbscasecmp: + # Code from module mbscasecmp-tests: + # Code from module mbsinit: + # Code from module mbsinit-tests: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsrtowcs-tests: + # Code from module mbsstr: + # Code from module mbsstr-tests: + # Code from module mbtowc: + # Code from module mbuiter: + # Code from module memchr: + # Code from module memchr-tests: + # Code from module memchr2: + # Code from module memchr2-tests: + # Code from module mempcpy: + # Code from module memrchr: + # Code from module memrchr-tests: + # Code from module minmax: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nl_langinfo: + # Code from module nl_langinfo-tests: + # Code from module nocrash: + # Code from module obstack: + # Code from module open: + # Code from module open-tests: + # Code from module openat: + # Code from module openat-die: + # Code from module openat-h: + # Code from module openat-safer: + # Code from module openat-safer-tests: + # Code from module openat-tests: + # Code from module opendir: + # Code from module pathmax: + # Code from module pathmax-tests: + # Code from module perl: + # Code from module pipe-posix: + # Code from module pipe-posix-tests: + # Code from module propername: + # Code from module putenv: + # Code from module quote: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module quotearg-simple-tests: + # Code from module read: + # Code from module read-tests: + # Code from module readdir: + # Code from module readme-release: + # Code from module realloc-gnu: + # Code from module realloc-gnu-tests: + # Code from module realloc-posix: + # Code from module regex: + # Code from module regex-tests: + # Code from module safe-read: + # Code from module same-inode: + # Code from module save-cwd: + # Code from module setenv: + # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: + # 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/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module snprintf: + # Code from module snprintf-tests: + # Code from module ssize_t: + # Code from module stat: + # Code from module stat-tests: + # Code from module std-gnu11: + # Code from module stdalign: + # Code from module stdalign-tests: + # Code from module stdarg: + + + + # Code from module stdbool: + # Code from module stdbool-tests: + # Code from module stddef: + # Code from module stddef-tests: + # Code from module stdint: + # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: + # Code from module stdlib: + # Code from module stdlib-tests: + # Code from module stpcpy: + # Code from module strdup-posix: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module strerror-tests: + # Code from module striconv: + # Code from module striconv-tests: + # Code from module string: + # Code from module string-tests: + # Code from module strnlen: + # Code from module strnlen-tests: + # Code from module strnlen1: + # Code from module strstr: + # Code from module strstr-simple: + # Code from module strstr-tests: + # Code from module strtoimax: + # Code from module strtoimax-tests: + # Code from module strtoll: + # Code from module strtoll-tests: + # Code from module strtoull: + # Code from module strtoull-tests: + # Code from module strtoumax: + # Code from module strtoumax-tests: + # Code from module symlink: + # Code from module symlink-tests: + # Code from module sys_stat: + # Code from module sys_stat-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: + # Code from module threadlib: + + + + # Code from module time: + # Code from module time-tests: + # Code from module trim: + # Code from module unistd: + # Code from module unistd-safer: + # Code from module unistd-safer-tests: + # Code from module unistd-tests: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-mbtoucr-tests: + # Code from module unistr/u8-uctomb: + # Code from module unistr/u8-uctomb-tests: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module uniwidth/width-tests: + # Code from module unlocked-io: + # Code from module unsetenv: + # Code from module unsetenv-tests: + # Code from module update-copyright: + # Code from module useless-if-before-free: + # Code from module vasnprintf: + # Code from module vasnprintf-tests: + # Code from module vc-list-files: + # Code from module vc-list-files-tests: + # Code from module verify: + # Code from module verify-tests: + # Code from module version-etc: + # Code from module version-etc-fsf: + # Code from module version-etc-tests: + # Code from module warnings: + # Code from module wchar: + # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: + # Code from module wctob: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: + # Code from module wcwidth: + # Code from module wcwidth-tests: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: + # Code from module xbinary-io: + # Code from module xsize: + # Code from module xstriconv: + # Code from module xstrtoimax: + # Code from module xstrtoimax-tests: + # Code from module xstrtol: + # Code from module xstrtol-tests: + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$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 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$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 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + PKG_CONFIG="" + fi +fi + +# grep never invokes mbrtowc or mbrlen on empty input, +# so don't worry about this common bug, +# as working around it would merely slow grep down. +gl_cv_func_mbrtowc_empty_input='assume yes' + +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 + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +printf "%s\n" "#define const /**/" >>confdefs.h + +fi + + + + + + + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <alloca.h> +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stddef.h> +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi + +if test $ac_cv_func_alloca_works = yes; then + +printf "%s\n" "#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 + +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +printf %s "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if test ${ac_cv_os_cray+y} +then : + printf %s "(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 -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +printf "%s\n" "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`printf "%s\n" "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 : + +printf "%s\n" "#define CRAY_STACKSEG_END $ac_func" >>confdefs.h + + break +fi + + done +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h + + +fi + + + 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; + GNULIB_WCSFTIME=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_WCSFTIME=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; + REPLACE_WCSFTIME=0; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5 +printf %s "checking whether <wchar.h> uses 'inline' correctly... " >&6; } +if test ${gl_cv_header_wchar_h_correct_inline+y} +then : + printf %s "(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 + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + 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 + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + 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 + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 +printf "%s\n" "$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 + + + + + + for ac_func in $gl_func_list +do : + as_ac_var=`printf "%s\n" "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 `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +printf %s "checking for nl_langinfo and CODESET... " >&6; } +if test ${am_cv_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +printf "%s\n" "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +printf "%s\n" "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(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 () { + /* 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 the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#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=$? + printf "%s\n" "$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 native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=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=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + 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_TRUNCATE=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_TRUNCATE=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=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_TRUNCATE=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_header in $gl_header_list +do : + as_ac_Header=`printf "%s\n" "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 `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + : + + + + + + + + + + + + + + + + + : + + + + + + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +printf "%s\n" "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + + + + + + + + + + + + + + GNULIB_OPENDIR=0; + GNULIB_READDIR=0; + GNULIB_REWINDDIR=0; + GNULIB_CLOSEDIR=0; + GNULIB_DIRFD=0; + GNULIB_FDOPENDIR=0; + GNULIB_SCANDIR=0; + GNULIB_ALPHASORT=0; + HAVE_OPENDIR=1; + HAVE_READDIR=1; + HAVE_REWINDDIR=1; + HAVE_CLOSEDIR=1; + HAVE_DECL_DIRFD=1; + HAVE_DECL_FDOPENDIR=1; + HAVE_FDOPENDIR=1; + HAVE_SCANDIR=1; + HAVE_ALPHASORT=1; + REPLACE_OPENDIR=0; + REPLACE_CLOSEDIR=0; + REPLACE_DIRFD=0; + REPLACE_FDOPENDIR=0; + + + GNULIB_ISBLANK=0; + HAVE_ISBLANK=1; + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +printf %s "checking whether the preprocessor supports include_next... " >&6; } +if test ${gl_cv_have_include_next+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +printf "%s\n" "$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 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 +printf %s "checking whether system header files limit the line length... " >&6; } +if test ${gl_cv_pragma_columns+y} +then : + printf %s "(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 -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 +printf "%s\n" "$gl_cv_pragma_columns" >&6; } + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + + + + + + + + +# The Clang compiler raises a warning for an undeclared identifier that matches +# a compiler builtin function. All extant Clang versions are affected, as of +# Clang 3.6.0. Test a builtin known to every version. This problem affects the +# C and Objective C languages, but Clang does report an error under C++ and +# Objective C++. +# +# Passing -fno-builtin to the compiler would suppress this problem. That +# strategy would have the advantage of being insensitive to stray warnings, but +# it would make tests less realistic. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how $CC reports undeclared, standard C functions" >&5 +printf %s "checking how $CC reports undeclared, standard C functions... " >&6; } +if test ${ac_cv_c_decl_report+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test -s conftest.err +then : + # For AC_CHECK_DECL to react to warnings, the compiler must be silent on + # valid AC_CHECK_DECL input. No library function is consistently available + # on freestanding implementations, so test against a dummy declaration. + # Include always-available headers on the off chance that they somehow + # elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +#include <limits.h> +#include <stdarg.h> +#include <stddef.h> +extern void ac_decl (int, char *); +int +main (void) +{ +#ifdef __cplusplus + (void) ac_decl ((int) 0, (char *) 0); + (void) ac_decl; +#else + (void) ac_decl; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test -s conftest.err +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot detect from compiler exit status or warnings +See \`config.log' for more details" "$LINENO" 5; } +else + ac_cv_c_decl_report=warning +fi +else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compile a simple declaration test +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "compiler does not report undeclared identifiers +See \`config.log' for more details" "$LINENO" 5; } +fi +else + ac_cv_c_decl_report=error +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_decl_report" >&5 +printf "%s\n" "$ac_cv_c_decl_report" >&6; } + +case $ac_cv_c_decl_report in + warning) ac_c_decl_warn_flag=yes ;; + *) ac_c_decl_warn_flag= ;; +esac + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +printf %s "checking for complete errno.h... " >&6; } +if test ${gl_cv_header_errno_h_complete+y} +then : + printf %s "(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 -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5 +printf %s "checking absolute name of <errno.h>... " >&6; } +if test ${gl_cv_next_errno_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 +printf %s "checking for EMULTIHOP value... " >&6; } +if test ${gl_cv_header_errno_h_EMULTIHOP+y} +then : + printf %s "(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 -rf 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 -rf 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +printf %s "checking for ENOLINK value... " >&6; } +if test ${gl_cv_header_errno_h_ENOLINK+y} +then : + printf %s "(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 -rf 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 -rf 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +printf %s "checking for EOVERFLOW value... " >&6; } +if test ${gl_cv_header_errno_h_EOVERFLOW+y} +then : + printf %s "(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 -rf 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 -rf 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h + + + + + + + + + : + + + + + + + : + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +printf %s "checking whether strerror_r returns char *... " >&6; } +if test ${ac_cv_func_strerror_r_char_p+y} +then : + printf %s "(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 (void) +{ + + 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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +printf "%s\n" "#define STRERROR_R_CHAR_P 1" >>confdefs.h + +fi + + + XGETTEXT_EXTRA_OPTIONS= + + + + + + ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default" +if test "x$ac_cv_have_decl_fchdir" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FCHDIR $ac_have_decl" >>confdefs.h + + + + 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; + + + + + + + + + + + + + + + + : + + + + + + + : + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +printf %s "checking for working fcntl.h... " >&6; } +if test ${gl_cv_header_working_fcntl_h+y} +then : + printf %s "(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 (void) +{ + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_WORKING_O_NOATIME $ac_val" >>confdefs.h + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +printf "%s\n" "#define HAVE_WORKING_O_NOFOLLOW $ac_val" >>confdefs.h + + +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 + +printf "%s\n" "#define pid_t int" >>confdefs.h + +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 + +printf "%s\n" "#define mode_t int" >>confdefs.h + +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +printf %s "checking for promoted mode_t type... " >&6; } +if test ${gl_cv_promoted_mode_t+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +printf "%s\n" "$gl_cv_promoted_mode_t" >&6; } + +printf "%s\n" "#define PROMOTED_MODE_T $gl_cv_promoted_mode_t" >>confdefs.h + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +printf %s "checking for mbstate_t... " >&6; } +if test ${ac_cv_type_mbstate_t+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +printf "%s\n" "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +printf "%s\n" "#define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +printf "%s\n" "#define mbstate_t int" >>confdefs.h + + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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; + GNULIB_OVERRIDES_STRUCT_STAT=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; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +printf %s "checking whether stat file-mode macros are broken... " >&6; } +if test ${ac_cv_header_stat_broken+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +printf "%s\n" "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +printf "%s\n" "#define STAT_MACROS_BROKEN 1" >>confdefs.h + +fi + + + + + + + + + case "$host_os" in + mingw*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 +printf %s "checking for 64-bit off_t... " >&6; } +if test ${gl_cv_type_off_t_64+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 +printf %s "checking for 64-bit st_size... " >&6; } +if test ${gl_cv_member_st_size_64+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_member_st_size_64=yes +else + gl_cv_member_st_size_64=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 +printf "%s\n" "$gl_cv_member_st_size_64" >&6; } + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi + ;; + *) + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +printf %s "checking absolute name of <sys/stat.h>... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$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 + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + 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 + +printf "%s\n" "#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=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +printf %s "checking whether lstat correctly handles trailing slash... " >&6; } +if test ${gl_cv_func_lstat_dereferences_slashed_symlink+y} +then : + printf %s "(cached) " >&6 +else + rm -f conftest.sym conftest.file + echo >conftest.file + if test "$cross_compiling" = yes +then : + case "$host_os" in + *-gnu*) + # Guess yes on glibc systems. + 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 (void) +{ +struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* 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 + + rm -f conftest.sym conftest.file + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 +printf "%s\n" "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + +printf "%s\n" "#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 +printf %s "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } +if test ${gl_cv_func_getcwd_null+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; + esac + +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> +# endif +# ifndef getcwd + char *getcwd (); +# endif + +int +main (void) +{ + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ +#else + if (chdir ("/") != 0) + return 1; + else + { + char *f = getcwd (NULL, 0); + if (! f) + return 2; + if (f[0] != '/') + { free (f); return 3; } + if (f[1] != '\0') + { free (f); return 4; } + free (f); + return 0; + } +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_getcwd_null=yes +else + gl_cv_func_getcwd_null=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 +printf "%s\n" "$gl_cv_func_getcwd_null" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 +printf %s "checking for getcwd with POSIX signature... " >&6; } +if test ${gl_cv_func_getcwd_posix_signature+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +int +main (void) +{ +extern + #ifdef __cplusplus + "C" + #endif + char *getcwd (char *, size_t); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_getcwd_posix_signature=yes +else + gl_cv_func_getcwd_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 +printf "%s\n" "$gl_cv_func_getcwd_posix_signature" >&6; } + + + + + + + + ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" +if test "x$ac_cv_have_decl_getdtablesize" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_GETDTABLESIZE $ac_have_decl" >>confdefs.h + + + + + + + + + + + + + + + + + + : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_getopt_h='<'getopt.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5 +printf %s "checking absolute name of <getopt.h>... " >&6; } +if test ${gl_cv_next_getopt_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5 +printf "%s\n" "$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_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h + +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 : + printf "%s\n" "#define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h + +else + gl_replace_getopt=yes +fi + +done + fi + + if test -z "$gl_replace_getopt"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 +printf %s "checking whether getopt is POSIX compatible... " >&6; } +if test ${gl_cv_func_getopt_posix+y} +then : + printf %s "(cached) " >&6 +else + + if test $cross_compiling = no; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 +printf %s "checking for working GNU getopt function... " >&6; } +if test ${gl_cv_func_getopt_gnu+y} +then : + printf %s "(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> +#include <unistd.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 (void) +{ + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_gnu" >&6; } + if test "$gl_cv_func_getopt_gnu" != yes; then + gl_replace_getopt=yes + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 +printf %s "checking for working GNU getopt_long function... " >&6; } +if test ${gl_cv_func_getopt_long_gnu+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5 +printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; } + case "$gl_cv_func_getopt_long_gnu" in + *yes) ;; + *) gl_replace_getopt=yes ;; + esac + fi + fi + + + + + + + + + + + + + + + + + + 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+y} +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 + +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +printf %s "checking for ld... " >&6; } +elif test "$GCC" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else + + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + 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" + fi + case $host in + *-*-aix*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -rf conftest* + + ;; + esac + +fi + + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$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+y} +then : + enableval=$enable_rpath; : +else + enable_rpath=yes +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +printf %s "checking for the common suffixes of directories in the library search path... " >&6; } +if test ${acl_cv_libdirstems+y} +then : + printf %s "(cached) " >&6 +else + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +printf %s "checking for 64-bit host... " >&6; } +if test ${gl_cv_solaris_64bit+y} +then : + printf %s "(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 -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +printf "%s\n" "$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=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 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" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +printf "%s\n" "$acl_cv_libdirstems" >&6; } + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` + + + + + + + + + + + + + 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+y} +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 + + + + + + + + + GNULIB_ICONV=0; + ICONV_CONST=; + REPLACE_ICONV=0; + REPLACE_ICONV_OPEN=0; + REPLACE_ICONV_UTF=0; + ICONV_H=''; + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + + + + + + 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 + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(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 (void) +{ +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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(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 (void) +{ +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. */ + { + /* Try standardized names. */ + iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); + /* Try IRIX, OSF/1 names. */ + iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); + /* Try AIX names. */ + iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); + /* Try HP-UX names. */ + iconv_t cd4 = iconv_open ("utf8", "eucJP"); + if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) + && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) + result |= 16; + if (cd1 != (iconv_t)(-1)) + iconv_close (cd1); + if (cd2 != (iconv_t)(-1)) + iconv_close (cd2); + if (cd3 != (iconv_t)(-1)) + iconv_close (cd3); + if (cd4 != (iconv_t)(-1)) + iconv_close (cd4); + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +printf %s "checking for iconv declaration... " >&6; } + if test ${am_cv_proto_iconv+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + am_cv_proto_iconv_arg1="" +else + am_cv_proto_iconv_arg1="const" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: + $am_cv_proto_iconv" >&5 +printf "%s\n" " + $am_cv_proto_iconv" >&6; } + else + am_cv_proto_iconv_arg1="" + fi + +printf "%s\n" "#define ICONV_CONST $am_cv_proto_iconv_arg1" >>confdefs.h + + + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$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 + + + + + + + + + + + + + + : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_limits_h='<'limits.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5 +printf %s "checking absolute name of <limits.h>... " >&6; } +if test ${gl_cv_next_limits_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.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 'limits.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_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +printf "%s\n" "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_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='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +printf %s "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if test ${gl_cv_header_limits_width+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <limits.h> + int ullw = ULLONG_WIDTH; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_limits_width=yes +else + gl_cv_header_limits_width=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +printf "%s\n" "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +printf %s "checking for wint_t... " >&6; } +if test ${gt_cv_c_wint_t+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +printf "%s\n" "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +printf "%s\n" "#define HAVE_WINT_T 1" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +printf %s "checking whether wint_t is too small... " >&6; } +if test ${gl_cv_type_wint_t_too_small+y} +then : + printf %s "(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 verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_type_wint_t_too_small=no +else + gl_cv_type_wint_t_too_small=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +printf "%s\n" "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(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 (void) +{ +/* 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + + + + + + + + + + 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 + + + + + + + + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5 +printf %s "checking absolute name of <stdint.h>... " >&6; } +if test ${gl_cv_next_stdint_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +printf %s "checking whether stdint.h conforms to C99... " >&6; } +if test ${gl_cv_header_working_stdint_h+y} +then : + printf %s "(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 */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#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; + +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + +#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 (void) +{ + + ; + 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 */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 +#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 (void) +{ + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdint_h" >&6; } + fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + if test "$gl_cv_header_working_stdint_h" = yes; then + HAVE_C99_STDINT_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +printf %s "checking whether stdint.h predates C++11... " >&6; } +if test ${gl_cv_header_stdint_predates_cxx11_h+y} +then : + printf %s "(cached) " >&6 +else + gl_cv_header_stdint_predates_cxx11_h=yes + 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 + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +printf "%s\n" "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +printf "%s\n" "#define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +printf %s "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if test ${gl_cv_header_stdint_width+y} +then : + printf %s "(cached) " >&6 +else + gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #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 + + int iw = UINTMAX_WIDTH; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +printf "%s\n" "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + else + ac_fn_c_check_header_compile "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_INTTYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_bitypes_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_BITYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(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} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "#define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +printf %s "checking for bit size of $gltype... " >&6; } +if eval test \${gl_cv_bitsizeof_${gltype}+y} +then : + printf %s "(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} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + printf "%s\n" "#define BITSIZEOF_${GLTYPE} $result" >>confdefs.h + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +printf %s "checking whether $gltype is signed... " >&6; } +if eval test \${gl_cv_type_${gltype}_signed+y} +then : + printf %s "(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 (void) +{ + + ; + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + printf "%s\n" "#define HAVE_SIGNED_${GLTYPE} 1" >>confdefs.h + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(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 (void) +{ + + ; + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +printf %s "checking for $gltype integer literal suffix... " >&6; } +if eval test \${gl_cv_type_${gltype}_suffix+y} +then : + printf %s "(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 (void) +{ + + ; + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h + + done + + + + if test $GNULIB_OVERRIDES_WINT_T = 1; then + BITSIZEOF_WINT_T=32 + fi + + fi + + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5 +printf %s "checking absolute name of <inttypes.h>... " >&6; } +if test ${gl_cv_next_inttypes_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 +printf "%s\n" "$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=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <inttypes.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_inttypes_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +printf %s "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if test ${gt_cv_inttypes_pri_broken+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <inttypes.h> +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +printf "%s\n" "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +printf "%s\n" "#define PRI_MACROS_BROKEN 1" >>confdefs.h + + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + 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 test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + + + + + + + + : + + + + + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 +printf %s "checking absolute name of <wctype.h>... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$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 + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "#define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + 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 + +printf "%s\n" "#define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + 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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$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=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(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 (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + GNULIB_NL_LANGINFO=0; + HAVE_NL_LANGINFO=1; + REPLACE_NL_LANGINFO=0; + + + + + + + + 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 + +printf "%s\n" "#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl" >>confdefs.h + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +printf %s "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if test ${ac_cv_gnu_library_2_1+y} +then : + printf %s "(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 -rf conftest* + + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +printf "%s\n" "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + GNULIB_LOCALECONV=0; + GNULIB_SETLOCALE=0; + GNULIB_DUPLOCALE=0; + HAVE_DUPLOCALE=1; + REPLACE_LOCALECONV=0; + REPLACE_SETLOCALE=0; + REPLACE_DUPLOCALE=0; + REPLACE_STRUCT_LCONV=0; + + + REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; + HAVE_WCHAR_T=1; + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +printf %s "checking for wchar_t... " >&6; } +if test ${gt_cv_c_wchar_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + wchar_t foo = (wchar_t)'\0'; +int +main (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +printf "%s\n" "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +printf "%s\n" "#define HAVE_WCHAR_T 1" >>confdefs.h + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 +printf %s "checking absolute name of <stddef.h>... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$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 + + + + + + + + + gl_threads_api=none + LIBTHREAD= + LTLIBTHREAD= + LIBMULTITHREAD= + LTLIBMULTITHREAD= + if test "$gl_use_threads" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 +printf %s "checking whether imported symbols can be declared weak... " >&6; } +if test ${gl_cv_have_weak+y} +then : + printf %s "(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 (void) +{ +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 -rf 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 +printf "%s\n" "$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_compile "$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 (void) +{ +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. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +printf %s "checking for pthread_kill in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_kill+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +printf "%s\n" "$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. + # On Solaris 10 or newer, this test is no longer needed, because + # libc contains the fully functional pthread functions. + case "$host_os" in + solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) + +printf "%s\n" "#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. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +printf %s "checking for pthread_kill in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_kill+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +printf "%s\n" "$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. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 +printf %s "checking for pthread_kill in -lc_r... " >&6; } +if test ${ac_cv_lib_c_r_pthread_kill+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#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 + +printf "%s\n" "#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 (void) +{ +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" + +printf "%s\n" "#define USE_SOLARIS_THREADS 1" >>confdefs.h + + if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then + +printf "%s\n" "#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" + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libpth" >&5 +printf %s "checking how to link with libpth... " >&6; } +if test ${ac_cv_libpth_libs+y} +then : + printf %s "(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+y} +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libpth_libs" >&5 +printf "%s\n" "$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 (void) +{ +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" + +printf "%s\n" "#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 + +printf "%s\n" "#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 + +printf "%s\n" "#define USE_WINDOWS_THREADS 1" >>confdefs.h + + fi + ;; + esac + fi + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5 +printf %s "checking for multithread API to use... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5 +printf "%s\n" "$gl_threads_api" >&6; } + + + + + + + + + + + + + + + + + + + +printf "%s\n" "#define _USE_STD_STAT 1" >>confdefs.h + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5 +printf %s "checking absolute name of <sys/types.h>... " >&6; } +if test ${gl_cv_next_sys_types_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +printf "%s\n" "$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 + + + + + + + + + + + + + WINDOWS_STAT_INODES=0 + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + 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_QSORT_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; + +# Autoupdate added the following line to ensure that your configure +# script's behavior did not change. It is probably safe to remove. + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +printf %s "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if test ${gl_cv_func_malloc_posix+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +printf "%s\n" "$gl_cv_func_malloc_posix" >&6; } + + + + ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(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 (void) +{ +char *p = malloc (0); + int result = !p; + free (p); + return result; + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } + if test $ac_cv_func_malloc_0_nonnull = yes +then : + gl_cv_func_malloc_0_nonnull=1 +else + gl_cv_func_malloc_0_nonnull=0 +fi + + +printf "%s\n" "#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull" >>confdefs.h + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_DECL_MBRTOWC $ac_have_decl" >>confdefs.h + + 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 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg1+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg2+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +printf %s "checking whether mbrtowc has a correct return value... " >&6; } +if test ${gl_cv_func_mbrtowc_retval+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test ${gl_cv_func_mbrtowc_nul_retval+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +printf %s "checking whether mbrtowc works on empty input... " >&6; } +if test ${gl_cv_func_mbrtowc_empty_input+y} +then : + printf %s "(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=yes +else + gl_cv_func_mbrtowc_empty_input=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +printf %s "checking whether the C locale is free of encoding errors... " >&6; } +if test ${gl_cv_C_locale_sans_EILSEQ+y} +then : + printf %s "(cached) " >&6 +else + + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + #include <locale.h> + #include <wchar.h> + +int +main (void) +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_C_locale_sans_EILSEQ=yes +else + gl_cv_C_locale_sans_EILSEQ=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +printf "%s\n" "$gl_cv_C_locale_sans_EILSEQ" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +printf "%s\n" "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi + + + + + + + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "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 -rf 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 : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#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. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +printf %s "checking whether memchr works... " >&6; } +if test ${gl_cv_func_memchr_works+y} +then : + printf %s "(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 (void) +{ + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +printf "%s\n" "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +printf %s "checking for C/C++ restrict keyword... " >&6; } +if test ${ac_cv_c_restrict+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +printf "%s\n" "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) printf "%s\n" "#define restrict /**/" >>confdefs.h + ;; + *) printf "%s\n" "#define restrict $ac_cv_c_restrict" >>confdefs.h + ;; + esac + + + ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" +if test "x$ac_cv_have_decl_memrchr" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_MEMRCHR $ac_have_decl" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5 +printf %s "checking whether <limits.h> defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_limits_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_limits_h=yes +else + gl_cv_minmax_in_limits_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_limits_h" >&6; } + if test $gl_cv_minmax_in_limits_h = yes; then + +printf "%s\n" "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + + fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5 +printf %s "checking whether <sys/param.h> defines MIN and MAX... " >&6; } +if test ${gl_cv_minmax_in_sys_param_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/param.h> + int x = MIN (42, 17); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_minmax_in_sys_param_h=yes +else + gl_cv_minmax_in_sys_param_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 +printf "%s\n" "$gl_cv_minmax_in_sys_param_h" >&6; } + if test $gl_cv_minmax_in_sys_param_h = yes; then + +printf "%s\n" "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h + + fi + + + + + + + + + + + + + + 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 + +printf "%s\n" "#define HAVE_DECL_ALARM $ac_have_decl" >>confdefs.h + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +printf %s "checking for ssize_t... " >&6; } +if test ${gt_cv_ssize_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +printf "%s\n" "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +printf "%s\n" "#define ssize_t int" >>confdefs.h + + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdbool.h> + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #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 + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } 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; + bool *qq = &q; + +int +main (void) +{ + + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! 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 + !qq); + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$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 : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +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; + + + + + + + + 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 + +printf "%s\n" "#define HAVE_DECL_STRDUP $ac_have_decl" >>confdefs.h + + + + REPLACE_STRERROR_0=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +printf %s "checking whether strerror(0) succeeds... " >&6; } +if test ${gl_cv_func_strerror_0_works+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 +printf "%s\n" "$gl_cv_func_strerror_0_works" >&6; } + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + +printf "%s\n" "#define REPLACE_STRERROR_0 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 +printf %s "checking absolute name of <string.h>... " >&6; } +if test ${gl_cv_next_string_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +printf "%s\n" "$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=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "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" "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 + +printf "%s\n" "#define HAVE_DECL_STRNLEN $ac_have_decl" >>confdefs.h + + + + + + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_STRSTR=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5 +printf %s "checking whether strstr works... " >&6; } +if test ${gl_cv_func_strstr_works_always+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __GNU_LIBRARY__ + #include <features.h> + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ + || defined __UCLIBC__ + Lucky user + #endif +#elif defined __CYGWIN__ + #include <cygwin/version.h> + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) + 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_strstr_works_always="guessing yes" +else + gl_cv_func_strstr_works_always="guessing no" +fi +rm -rf conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> /* for strstr */ +#define P "_EF_BF_BD" +#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P +#define NEEDLE P P P P P + +int +main (void) +{ +return !!strstr (HAYSTACK, NEEDLE); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strstr_works_always=yes +else + gl_cv_func_strstr_works_always=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5 +printf "%s\n" "$gl_cv_func_strstr_works_always" >&6; } + case "$gl_cv_func_strstr_works_always" in + *yes) ;; + *) + REPLACE_STRSTR=1 + ;; + esac + fi + + + + + + + + ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoimax" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRTOIMAX $ac_have_decl" >>confdefs.h + + + + + + + + + ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoumax" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRTOUMAX $ac_have_decl" >>confdefs.h + + + + GNULIB_CTIME=0; + GNULIB_MKTIME=0; + GNULIB_LOCALTIME=0; + GNULIB_NANOSLEEP=0; + GNULIB_STRFTIME=0; + GNULIB_STRPTIME=0; + GNULIB_TIMEGM=0; + GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; + GNULIB_TZSET=0; + HAVE_DECL_LOCALTIME_R=1; + HAVE_NANOSLEEP=1; + HAVE_STRPTIME=1; + HAVE_TIMEGM=1; + HAVE_TZSET=1; + HAVE_TIMEZONE_T=0; + REPLACE_CTIME=GNULIB_PORTCHECK; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_MKTIME=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRFTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + REPLACE_TZSET=GNULIB_PORTCHECK; + + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; + + + + + + + + + : + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5 +printf %s "checking for struct timespec in <time.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_time_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> + +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5 +printf %s "checking for struct timespec in <sys/time.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_sys_time_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> + +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5 +printf %s "checking for struct timespec in <pthread.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_pthread_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> + +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5 +printf %s "checking for struct timespec in <unistd.h>... " >&6; } +if test ${gl_cv_sys_struct_timespec_in_unistd_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5 +printf %s "checking absolute name of <time.h>... " >&6; } +if test ${gl_cv_next_time_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl" >>confdefs.h + + + + + + + + + + : + + + + + + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +printf %s "checking if environ is properly declared... " >&6; } + if test ${gt_cv_var_environ_declaration+y} +then : + printf %s "(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 (void) +{ +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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +printf "%s\n" "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +printf "%s\n" "#define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes +then : + +else + +printf "%s\n" "#define off_t long int" >>confdefs.h + +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +printf %s "checking for LC_MESSAGES... " >&6; } +if test ${gt_cv_val_LC_MESSAGES+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> +int +main (void) +{ +return LC_MESSAGES + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_val_LC_MESSAGES=yes +else + gt_cv_val_LC_MESSAGES=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_val_LC_MESSAGES" >&5 +printf "%s\n" "$gt_cv_val_LC_MESSAGES" >&6; } + if test $gt_cv_val_LC_MESSAGES = yes; then + +printf "%s\n" "#define HAVE_LC_MESSAGES 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +printf %s "checking for CFLocaleCopyCurrent... " >&6; } +if test ${gt_cv_func_CFLocaleCopyCurrent+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +printf "%s\n" "#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 + + + + ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" +if test "x$ac_cv_have_decl_setenv" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_SETENV $ac_have_decl" >>confdefs.h + + + + + + + + + + + : + + + + + + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + + : + + + + + + + + + + : + + + + + + ac_fn_c_check_header_compile "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = xyes +then : + printf "%s\n" "#define HAVE_SEARCH_H 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" +if test "x$ac_cv_func_tsearch" = xyes +then : + printf "%s\n" "#define HAVE_TSEARCH 1" >>confdefs.h + +fi + + + + + + + + + + + : + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5 +printf %s "checking whether snprintf returns a byte count as in C99... " >&6; } +if test ${gl_cv_func_snprintf_retval_c99+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5 +printf "%s\n" "$gl_cv_func_snprintf_retval_c99" >&6; } + + + 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 + +printf "%s\n" "#define HAVE_DECL_SNPRINTF $ac_have_decl" >>confdefs.h + + + + 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 + +printf "%s\n" "#define HAVE_DECL_UNSETENV $ac_have_decl" >>confdefs.h + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +printf %s "checking for inttypes.h... " >&6; } +if test ${gl_cv_header_inttypes_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <inttypes.h> + +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 +printf "%s\n" "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +printf "%s\n" "#define HAVE_INTTYPES_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +printf %s "checking for stdint.h... " >&6; } +if test ${gl_cv_header_stdint_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <stdint.h> +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 +printf "%s\n" "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +printf "%s\n" "#define HAVE_STDINT_H_WITH_UINTMAX 1" >>confdefs.h + + fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +printf %s "checking for intmax_t... " >&6; } +if test ${gt_cv_c_intmax_t+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +printf "%s\n" "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h + + else + + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + +printf "%s\n" "#define intmax_t $ac_type" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +printf %s "checking where to find the exponent in a 'double'... " >&6; } +if test ${gl_cv_cc_double_expbit0+y} +then : + printf %s "(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 test ${ac_cv_c_bigendian+y} +then : + printf %s "(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 (void) +{ +#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 (void) +{ +#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 (void) +{ +#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 (void) +{ +#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 (void) +{ +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 (void) +{ + + /* 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) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + +fi +rm -rf 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +printf "%s\n" "$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 //'` + +printf "%s\n" "#define DBL_EXPBIT0_WORD $word" >>confdefs.h + + +printf "%s\n" "#define DBL_EXPBIT0_BIT $bit" >>confdefs.h + + ;; + esac + + + + + + + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen" +if test "x$ac_cv_func_wcslen" = xyes +then : + printf "%s\n" "#define HAVE_WCSLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsnlen" "ac_cv_func_wcsnlen" +if test "x$ac_cv_func_wcsnlen" = xyes +then : + printf "%s\n" "#define HAVE_WCSNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc" +if test "x$ac_cv_func_mbrtowc" = xyes +then : + printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcrtomb" "ac_cv_func_wcrtomb" +if test "x$ac_cv_func_wcrtomb" = xyes +then : + printf "%s\n" "#define HAVE_WCRTOMB 1" >>confdefs.h + +fi + + 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 + +printf "%s\n" "#define HAVE_DECL__SNPRINTF $ac_have_decl" >>confdefs.h + + + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + +printf "%s\n" "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h + + ;; + esac + + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +printf %s "checking for alloca as a compiler built-in... " >&6; } +if test ${gl_cv_rpl_alloca+y} +then : + printf %s "(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 -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +printf "%s\n" "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then + +printf "%s\n" "#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 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5 +printf %s "checking whether to enable assertions... " >&6; } + # Check whether --enable-assert was given. +if test ${enable_assert+y} +then : + enableval=$enable_assert; if test "x$enableval" = xno +then : + +printf "%s\n" "#define NDEBUG 1" >>confdefs.h + +elif test "x$enableval" != xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5 +printf "%s\n" "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;} + enable_assert=yes +fi +else + enable_assert=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5 +printf "%s\n" "$enable_assert" >&6; } + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext" + + + + + + + + : + + + + + + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 +printf %s "checking whether btowc(0) is correct... " >&6; } +if test ${gl_cv_func_btowc_nul+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.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 (btowc ('\0') != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_nul=yes +else + gl_cv_func_btowc_nul=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5 +printf "%s\n" "$gl_cv_func_btowc_nul" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 +printf %s "checking whether btowc(EOF) is correct... " >&6; } +if test ${gl_cv_func_btowc_eof+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac + if test $LOCALE_FR != 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") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_btowc_eof=yes +else + gl_cv_func_btowc_eof=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 +printf "%s\n" "$gl_cv_func_btowc_eof" >&6; } + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_BTOWC=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_BTOWC 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 +printf %s "checking for __builtin_expect... " >&6; } +if test ${gl_cv___builtin_expect+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <builtins.h> + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv___builtin_expect="in <builtins.h>" +else + gl_cv___builtin_expect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 +printf "%s\n" "$gl_cv___builtin_expect" >&6; } + if test "$gl_cv___builtin_expect" = yes; then + printf "%s\n" "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h + + elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then + printf "%s\n" "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h + + fi + + + + + + + + GNULIB_CHDIR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_CHDIR 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5 +printf %s "checking whether this system has an arbitrary file name length limit... " >&6; } +if test ${gl_cv_have_arbitrary_file_name_length_limit+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Arrange to define PATH_MAX, like "pathmax.h" does. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <limits.h> +#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include <sys/param.h> +#endif +#if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +#endif +#ifdef __hpux +# undef PATH_MAX +# define PATH_MAX 1024 +#endif +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef PATH_MAX +# define PATH_MAX 260 +#endif + +#ifdef PATH_MAX +have_arbitrary_file_name_length_limit +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1 +then : + gl_cv_have_arbitrary_file_name_length_limit=yes +else + gl_cv_have_arbitrary_file_name_length_limit=no +fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5 +printf "%s\n" "$gl_cv_have_arbitrary_file_name_length_limit" >&6; } + + if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext" + + : + fi + + +printf "%s\n" "#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 + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + 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 = 0; then + + + + : + + + + + + if test $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi + + if test $HAVE_FCHDIR = 0; then + REPLACE_CLOSE=1 + fi + fi + + + if test $REPLACE_CLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + + + + + + GNULIB_CLOSE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_CLOSE 1" >>confdefs.h + + + + + : + + + +printf "%s\n" "#define GNULIB_CLOSE_STREAM 1" >>confdefs.h + + + + + + ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir" +if test "x$ac_cv_func_closedir" = xyes +then : + printf "%s\n" "#define HAVE_CLOSEDIR 1" >>confdefs.h + +fi + + if test $ac_cv_func_closedir = no; then + HAVE_CLOSEDIR=0 + fi + + + + + : + + + + + + if test $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi + + if test $HAVE_FCHDIR = 0; then + if test $HAVE_CLOSEDIR = 1; then + REPLACE_CLOSEDIR=1 + fi + fi + + case $host_os,$HAVE_CLOSEDIR in + os2*,1) + REPLACE_CLOSEDIR=1;; + esac + + if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext" + + fi + + + + + + GNULIB_CLOSEDIR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h + + + + + : + + + 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}' + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_ctype_h='<'ctype.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5 +printf %s "checking absolute name of <ctype.h>... " >&6; } +if test ${gl_cv_next_ctype_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.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 'ctype.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_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_ctype_h + gl_cv_next_ctype_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5 +printf "%s\n" "$gl_cv_next_ctype_h" >&6; } + fi + NEXT_CTYPE_H=$gl_cv_next_ctype_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='<'ctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_ctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive + + + + + + + for gl_func in isblank; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5 +printf %s "checking for d_ino member in directory struct... " >&6; } +if test ${gl_cv_struct_dirent_d_ino+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems with Linux kernel. + linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_struct_dirent_d_ino="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/stat.h> + #include <dirent.h> + +int +main (void) +{ +DIR *dp = opendir ("."); + struct dirent *e; + struct stat st; + if (! dp) + return 1; + e = readdir (dp); + if (! e) + { closedir (dp); return 2; } + if (lstat (e->d_name, &st) != 0) + { closedir (dp); return 3; } + if (e->d_ino != st.st_ino) + { closedir (dp); return 4; } + closedir (dp); + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_struct_dirent_d_ino=yes +else + gl_cv_struct_dirent_d_ino=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5 +printf "%s\n" "$gl_cv_struct_dirent_d_ino" >&6; } + case "$gl_cv_struct_dirent_d_ino" in + *yes) + +printf "%s\n" "#define D_INO_IN_DIRENT 1" >>confdefs.h + + ;; + esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5 +printf %s "checking for d_type member in directory struct... " >&6; } +if test ${gl_cv_struct_dirent_d_type+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <dirent.h> + +int +main (void) +{ +struct dirent dp; dp.d_type = 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_struct_dirent_d_type=yes +else + gl_cv_struct_dirent_d_type=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5 +printf "%s\n" "$gl_cv_struct_dirent_d_type" >&6; } + if test $gl_cv_struct_dirent_d_type = yes; then + +printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h + + fi + + + + + + + + + + + + : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_dirent_h='<'dirent.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5 +printf %s "checking absolute name of <dirent.h>... " >&6; } +if test ${gl_cv_next_dirent_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_dirent_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <dirent.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 'dirent.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_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_dirent_h + gl_cv_next_dirent_h='"'$gl_header'"' + else + gl_cv_next_dirent_h='<'dirent.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5 +printf "%s\n" "$gl_cv_next_dirent_h" >&6; } + fi + NEXT_DIRENT_H=$gl_cv_next_dirent_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='<'dirent.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_dirent_h + fi + NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_dirent_h = yes; then + HAVE_DIRENT_H=1 + else + HAVE_DIRENT_H=0 + fi + + + + for gl_func in alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <dirent.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + : + + + + + + + + +printf "%s\n" "#define GNULIB_DIRENT_SAFER 1" >>confdefs.h + + + + + + + + ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" +if test "x$ac_cv_func_dirfd" = xyes +then : + printf "%s\n" "#define HAVE_DIRFD 1" >>confdefs.h + +fi + + ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h> + #include <dirent.h> +" +if test "x$ac_cv_have_decl_dirfd" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_DIRFD $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_dirfd = no; then + HAVE_DECL_DIRFD=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5 +printf %s "checking whether dirfd is a macro... " >&6; } +if test ${gl_cv_func_dirfd_macro+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <dirent.h> +#ifdef dirfd + dirent_header_defines_dirfd +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1 +then : + gl_cv_func_dirfd_macro=yes +else + gl_cv_func_dirfd_macro=no +fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5 +printf "%s\n" "$gl_cv_func_dirfd_macro" >&6; } + + # Use the replacement if we have no function or macro with that name, + # or if OS/2 kLIBC whose dirfd() does not work. + # Replace only if the system declares dirfd already. + case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in + no,no,*,yes | *,*,os2*,yes) + REPLACE_DIRFD=1 + +printf "%s\n" "#define REPLACE_DIRFD 1" >>confdefs.h +;; + esac + + if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \ + || test $REPLACE_DIRFD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5 +printf %s "checking how to get the file descriptor associated with an open DIR*... " >&6; } +if test ${gl_cv_sys_dir_fd_member_name+y} +then : + printf %s "(cached) " >&6 +else + + dirfd_save_CFLAGS=$CFLAGS + for ac_expr in d_fd dd_fd; do + + CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <sys/types.h> + #include <dirent.h> +int +main (void) +{ +DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + dir_fd_found=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$dirfd_save_CFLAGS + test "$dir_fd_found" = yes && break + done + test "$dir_fd_found" = yes || ac_expr=no_such_member + + gl_cv_sys_dir_fd_member_name=$ac_expr + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5 +printf "%s\n" "$gl_cv_sys_dir_fd_member_name" >&6; } + if test $gl_cv_sys_dir_fd_member_name != no_such_member; then + +printf "%s\n" "#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name" >>confdefs.h + + fi + + + fi + + + + + + GNULIB_DIRFD=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_DIRFD 1" >>confdefs.h + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +printf %s "checking whether // is distinct from /... " >&6; } +if test ${gl_cv_double_slash_root+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +printf "%s\n" "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_DUP=1 + fi + + + + + + : + + + + + + if test $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi + + if test $HAVE_FCHDIR = 0; then + REPLACE_DUP=1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5 +printf %s "checking whether dup works... " >&6; } +if test ${gl_cv_func_dup_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + gl_cv_func_dup_works='guessing yes' +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + #include <fcntl.h> + #include <errno.h> +int +main (void) +{ +/* On OS/2 kLIBC, dup does not work on a directory fd. */ + int fd = open (".", O_RDONLY); + return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_dup_works=yes +else + gl_cv_func_dup_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5 +printf "%s\n" "$gl_cv_func_dup_works" >&6; } + case "$gl_cv_func_dup_works" in + *yes) ;; + *) + REPLACE_DUP=1 + ;; + esac + + if test $REPLACE_DUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext" + + : + fi + + + + + + GNULIB_DUP=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_DUP 1" >>confdefs.h + + + + + + + + +printf "%s\n" "#define HAVE_DUP2 1" >>confdefs.h + + + if test $HAVE_DUP2 = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +printf %s "checking whether dup2 works... " >&6; } +if test ${gl_cv_func_dup2_works+y} +then : + printf %s "(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" ;; + 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" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + 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 <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + 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); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 +printf "%s\n" "$gl_cv_func_dup2_works" >&6; } + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes +then : + printf "%s\n" "#define HAVE_SETDTABLESIZE 1" >>confdefs.h + +fi + + ;; + esac + fi + + + + + : + + + + + + if test $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi + + if test $HAVE_FCHDIR = 0; then + if test $HAVE_DUP2 = 1; then + REPLACE_DUP2=1 + fi + fi + + + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + + + + + + GNULIB_DUP2=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_DUP2 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <error.h> +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$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_have_decl_fchdir = no; then + HAVE_DECL_FCHDIR=0 + fi + + + if test $HAVE_FCHDIR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext" + + : + +printf "%s\n" "#define REPLACE_FCHDIR 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5 +printf %s "checking whether open can visit directories... " >&6; } +if test ${gl_cv_func_open_directory_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_open_directory_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_open_directory_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fcntl.h> + +int +main (void) +{ +return open(".", O_RDONLY) < 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_open_directory_works=yes +else + gl_cv_func_open_directory_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5 +printf "%s\n" "$gl_cv_func_open_directory_works" >&6; } + case "$gl_cv_func_open_directory_works" in + *yes) ;; + *) + +printf "%s\n" "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h + + ;; + esac + fi + + + + + + + GNULIB_FCHDIR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h + + + + + + + + + : + + + + + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 +printf %s "checking whether fcntl handles F_DUPFD correctly... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> + #include <fcntl.h> + #include <limits.h> + #include <sys/resource.h> + #include <unistd.h> + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main (void) +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + 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; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 +printf "%s\n" "$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 + + +printf "%s\n" "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 +printf %s "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } +if test ${gl_cv_func_fcntl_f_dupfd_cloexec+y} +then : + printf %s "(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 (void) +{ + + ; + 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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 +printf "%s\n" "$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 $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi + + if test $HAVE_FCHDIR = 0; then + + + + : + + + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + fi + + + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" + + fi + + + + + + GNULIB_FCNTL=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FCNTL 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5 +printf %s "checking absolute name of <fcntl.h>... " >&6; } +if test ${gl_cv_next_fcntl_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +printf "%s\n" "$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=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fcntl.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + +printf "%s\n" "#define GNULIB_FCNTL_SAFER 1" >>confdefs.h + + + + + + + + ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" " +#include <dirent.h> + +" +if test "x$ac_cv_have_decl_fdopendir" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_FDOPENDIR $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + +else + HAVE_DECL_FDOPENDIR=0 +fi + + + : + + + + + + if test $ac_cv_func_fdopendir = no; then + HAVE_FDOPENDIR=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5 +printf %s "checking whether fdopendir works... " >&6; } +if test ${gl_cv_func_fdopendir_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_fdopendir_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <dirent.h> +#include <fcntl.h> +#include <unistd.h> +#if !HAVE_DECL_FDOPENDIR +extern +# ifdef __cplusplus +"C" +# endif +DIR *fdopendir (int); +#endif + +int +main (void) +{ +int result = 0; + int fd = open ("conftest.c", O_RDONLY); + if (fd < 0) result |= 1; + if (fdopendir (fd)) result |= 2; + if (close (fd)) result |= 4; + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fdopendir_works=yes +else + gl_cv_func_fdopendir_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5 +printf "%s\n" "$gl_cv_func_fdopendir_works" >&6; } + case "$gl_cv_func_fdopendir_works" in + *yes) ;; + *) + REPLACE_FDOPENDIR=1 + ;; + esac + fi + + if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext" + + fi + + + + + + GNULIB_FDOPENDIR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_FDOPENDIR 1" >>confdefs.h + + + + + : + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 +printf %s "checking for flexible array member... " >&6; } +if test ${ac_cv_c_flexmember+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + #include <stdio.h> + #include <stddef.h> + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; }; +int +main (void) +{ +int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_flexmember=yes +else + ac_cv_c_flexmember=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 +printf "%s\n" "$ac_cv_c_flexmember" >&6; } + if test $ac_cv_c_flexmember = yes; then + +printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h + + else + printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h + + fi + + + + + + + FNMATCH_H= + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' + ` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 +printf %s "checking for working $gl_fnmatch_required fnmatch... " >&6; } +if eval test \${$gl_fnmatch_cache_var+y} +then : + printf %s "(cached) " >&6 +else + if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + if test "$cross_compiling" = yes +then : + eval "$gl_fnmatch_cache_var=\"guessing no\"" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <fnmatch.h> + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + +int +main (void) +{ +char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + eval "$gl_fnmatch_cache_var=yes" +else + eval "$gl_fnmatch_cache_var=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 +eval ac_res=\$$gl_fnmatch_cache_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + fi + + if test -n "$FNMATCH_H"; then + GL_GENERATE_FNMATCH_H_TRUE= + GL_GENERATE_FNMATCH_H_FALSE='#' +else + GL_GENERATE_FNMATCH_H_TRUE='#' + GL_GENERATE_FNMATCH_H_FALSE= +fi + + + if test -n "$FNMATCH_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + + + +printf "%s\n" "#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch" >>confdefs.h + + + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + + fi + + + : + + + + + + fp_headers=' + #include <stdio.h> + #if HAVE_STDIO_EXT_H + # include <stdio_ext.h> + #endif + ' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __fpending" >&5 +printf %s "checking for __fpending... " >&6; } +if test ${gl_cv_func___fpending+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$fp_headers +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func___fpending" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_DECL___FPENDING $ac_have_decl" >>confdefs.h + + fi + + if test $gl_cv_func___fpending = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext" + + fi + + + + + case "$host_os" in + mingw*) + REPLACE_FSTAT=1 + ;; + esac + + + + + + : + + + + + + if test $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi + + if test $HAVE_FCHDIR = 0; then + case "$gl_cv_func_open_directory_works" in + *yes) ;; + *) + REPLACE_FSTAT=1 + ;; + esac + fi + + + if test $REPLACE_FSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_FSTAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FSTAT 1" >>confdefs.h + + + + + + + + + : + + + + + + + if test $ac_cv_func_fstatat = no; then + HAVE_FSTATAT=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5 +printf %s "checking whether fstatat (..., 0) works... " >&6; } +if test ${gl_cv_func_fstatat_zero_flag+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix*) gl_cv_func_fstatat_zero_flag="guessing no";; + *) gl_cv_func_fstatat_zero_flag="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <fcntl.h> + #include <sys/stat.h> + int + main (void) + { + struct stat a; + return fstatat (AT_FDCWD, ".", &a, 0) != 0; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fstatat_zero_flag=yes +else + gl_cv_func_fstatat_zero_flag=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5 +printf "%s\n" "$gl_cv_func_fstatat_zero_flag" >&6; } + + case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in + *yes+*yes) ;; + *) REPLACE_FSTATAT=1 + case $gl_cv_func_fstatat_zero_flag in + *yes) + +printf "%s\n" "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h + + ;; + esac + ;; + esac + fi + + if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext" + + fi + + + + + + GNULIB_FSTATAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h + + + + + + + + + + : + + + + + + + case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in + yes+*yes) + ;; + yes+*) + # Solaris 9 has *at functions, but uniformly mishandles trailing + # slash in all of them. + REPLACE_OPENAT=1 + ;; + *) + HAVE_OPENAT=0 + ;; + esac + + + + : + + + + + + + : + + + + + + + + ac_fn_c_check_member "$LINENO" "struct statfs" "f_type" "ac_cv_member_struct_statfs_f_type" "$ac_includes_default + #include <sys/vfs.h> +" +if test "x$ac_cv_member_struct_statfs_f_type" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STATFS_F_TYPE 1" >>confdefs.h + + +fi + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fts.$ac_objext" + + + + + + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in + *yes,yes) ;; + *) + REPLACE_GETCWD=1 + ;; + esac + + if test $REPLACE_GETCWD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext" + + fi + + + + + + GNULIB_GETCWD=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_GETCWD 1" >>confdefs.h + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_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. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +printf %s "checking whether getdtablesize works... " >&6; } +if test ${gl_cv_func_getdtablesize_works+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +printf "%s\n" "$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 + + + + + +printf "%s\n" "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h + + + + + + + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi + + if test $REPLACE_GETOPT = 1; then + + + : + + + + + + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + + + +printf "%s\n" "#define __GETOPT_PREFIX rpl_" >>confdefs.h + + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.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 + + + + + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes +then : + printf "%s\n" "#define HAVE_GETPAGESIZE 1" >>confdefs.h + +fi + + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + ac_fn_c_check_header_compile "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default" +if test "x$ac_cv_header_OS_h" = xyes +then : + printf "%s\n" "#define HAVE_OS_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + ac_fn_c_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default" +if test "x$ac_cv_have_decl_getpagesize" = xyes +then : + +else + HAVE_DECL_GETPAGESIZE=0 +fi + + + if test $REPLACE_GETPAGESIZE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getpagesize.$ac_objext" + + fi + + + + + + GNULIB_GETPAGESIZE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h + + + + + + : + + + + + + + + + + ac_found=0 + 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 + +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + 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 + +printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h> +" +if test "x$ac_cv_have_decl___argv" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL___ARGV $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + ac_found=1 +fi + + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 +printf %s "checking whether __progname is defined in default libraries... " >&6; } +if test ${gl_cv_var___progname+y} +then : + printf %s "(cached) " >&6 +else + + gl_cv_var___progname= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char *__progname; +int +main (void) +{ +return *__progname; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_var___progname=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 +printf "%s\n" "$gl_cv_var___progname" >&6; } + if test "$gl_cv_var___progname" = yes; then + +printf "%s\n" "#define HAVE_VAR___PROGNAME 1" >>confdefs.h + + fi + fi + + + + # 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" + + + : + + + : + + + + + + + + GNULIB_ICONV=1 + + + + + + + + + + + + + + : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_iconv_h='<'iconv.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <iconv.h>" >&5 +printf %s "checking absolute name of <iconv.h>... " >&6; } +if test ${gl_cv_next_iconv_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_iconv_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <iconv.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 'iconv.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_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_iconv_h + gl_cv_next_iconv_h='"'$gl_header'"' + else + gl_cv_next_iconv_h='<'iconv.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 +printf "%s\n" "$gl_cv_next_iconv_h" >&6; } + fi + NEXT_ICONV_H=$gl_cv_next_iconv_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='<'iconv.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_iconv_h + fi + NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive + + + + + + + + + + if test "$am_cv_func_iconv" = yes; then + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <iconv.h> + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "gnu_iconv" >/dev/null 2>&1 +then : + gl_func_iconv_gnu=yes +else + gl_func_iconv_gnu=no +fi +rm -rf conftest* + + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then + +printf "%s\n" "#define ICONV_FLAVOR $iconv_flavor" >>confdefs.h + + + + + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + + + REPLACE_ICONV_OPEN=1 + + fi + fi + + fi + + if test $REPLACE_ICONV_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + + fi + if test $REPLACE_ICONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext" + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 +printf %s "checking whether the compiler generally respects inline... " >&6; } +if test ${gl_cv_c_inline_effective+y} +then : + printf %s "(cached) " >&6 +else + if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_c_inline_effective=yes +else + gl_cv_c_inline_effective=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 +printf "%s\n" "$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then + +printf "%s\n" "#define HAVE_INLINE 1" >>confdefs.h + + fi + + + + + + + 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 (void) +{ + + ; + 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 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +printf %s "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if test ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +printf "%s\n" "$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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +printf %s "checking whether INT64_MAX == LONG_MAX... " >&6; } +if test ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +printf "%s\n" "$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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +printf %s "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if test ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +printf "%s\n" "$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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +printf %s "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if test ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +printf "%s\n" "$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 + + + + + + case $host_os in + mingw*) REPLACE_ISATTY=1 ;; + esac + + if test $REPLACE_ISATTY = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isatty.$ac_objext" + + : + fi + + + + + + GNULIB_ISATTY=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_ISATTY 1" >>confdefs.h + + + + + + + + + : + + + + + + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 + fi + + if test $HAVE_ISBLANK = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" + + fi + + + + + + GNULIB_ISBLANK=1 + + + + + + + + + + : + + + + + + ac_fn_c_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" " +/* 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> + +" +if test "x$ac_cv_have_decl_iswblank" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_ISWBLANK $ac_have_decl" >>confdefs.h + + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + : + fi + fi + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext" + + fi + fi + + + + + + GNULIB_ISWBLANK=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_ISWBLANK 1" >>confdefs.h + + + + + + + + if test $HAVE_WCTYPE_T = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iswctype.$ac_objext" + + fi + + + + + + GNULIB_ISWCTYPE=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_ISWCTYPE 1" >>confdefs.h + + + + + + + + + + + + + + + : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_langinfo_h='<'langinfo.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <langinfo.h>" >&5 +printf %s "checking absolute name of <langinfo.h>... " >&6; } +if test ${gl_cv_next_langinfo_h+y} +then : + printf %s "(cached) " >&6 +else + + if test $ac_cv_header_langinfo_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.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 'langinfo.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_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_langinfo_h + gl_cv_next_langinfo_h='"'$gl_header'"' + else + gl_cv_next_langinfo_h='<'langinfo.h'>' + fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5 +printf "%s\n" "$gl_cv_next_langinfo_h" >&6; } + fi + NEXT_LANGINFO_H=$gl_cv_next_langinfo_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='<'langinfo.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_langinfo_h + fi + NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive + + + + + + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + + : + + + + + + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 +printf %s "checking whether langinfo.h defines CODESET... " >&6; } +if test ${gl_cv_header_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = CODESET; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_codeset=yes +else + gl_cv_header_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5 +printf "%s\n" "$gl_cv_header_langinfo_codeset" >&6; } + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5 +printf %s "checking whether langinfo.h defines T_FMT_AMPM... " >&6; } +if test ${gl_cv_header_langinfo_t_fmt_ampm+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = T_FMT_AMPM; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_t_fmt_ampm=yes +else + gl_cv_header_langinfo_t_fmt_ampm=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5 +printf "%s\n" "$gl_cv_header_langinfo_t_fmt_ampm" >&6; } + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 +printf %s "checking whether langinfo.h defines ERA... " >&6; } +if test ${gl_cv_header_langinfo_era+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = ERA; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_era=yes +else + gl_cv_header_langinfo_era=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5 +printf "%s\n" "$gl_cv_header_langinfo_era" >&6; } + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5 +printf %s "checking whether langinfo.h defines YESEXPR... " >&6; } +if test ${gl_cv_header_langinfo_yesexpr+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> +int a = YESEXPR; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_langinfo_yesexpr=yes +else + gl_cv_header_langinfo_yesexpr=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5 +printf "%s\n" "$gl_cv_header_langinfo_yesexpr" >&6; } + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + + + + + + + + for gl_func in nl_langinfo; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + : + + + + + + + + + + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + + + + + + + + + + case "$host_os" in + solaris*) + +printf "%s\n" "#define _LCONV_C99 1" >>confdefs.h + + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 +printf %s "checking whether locale.h conforms to POSIX:2001... " >&6; } +if test ${gl_cv_header_locale_h_posix2001+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_h_posix2001=yes +else + gl_cv_header_locale_h_posix2001=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 +printf "%s\n" "$gl_cv_header_locale_h_posix2001" >&6; } + + + : + + + + + + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 +printf %s "checking whether locale.h defines locale_t... " >&6; } +if test ${gl_cv_header_locale_has_locale_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + locale_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_locale_has_locale_t=yes +else + gl_cv_header_locale_has_locale_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 +printf "%s\n" "$gl_cv_header_locale_has_locale_t" >&6; } + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 +printf %s "checking whether struct lconv is properly defined... " >&6; } +if test ${gl_cv_sys_struct_lconv_ok+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes); +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_sys_struct_lconv_ok=yes +else + gl_cv_sys_struct_lconv_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 +printf "%s\n" "$gl_cv_sys_struct_lconv_ok" >&6; } + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_locale_h='<'locale.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5 +printf %s "checking absolute name of <locale.h>... " >&6; } +if test ${gl_cv_next_locale_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.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 'locale.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_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_locale_h + gl_cv_next_locale_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 +printf "%s\n" "$gl_cv_next_locale_h" >&6; } + fi + NEXT_LOCALE_H=$gl_cv_next_locale_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='<'locale.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_locale_h + fi + NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + + + + + + + for gl_func in setlocale duplocale; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <locale.h> +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include <xlocale.h> +#endif + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi + + if test $REPLACE_LOCALECONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" + + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h> +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1" >>confdefs.h + + +fi + + + fi + + + + + + GNULIB_LOCALECONV=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h + + + + + + 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. + has_rwlock=false + 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 : + has_rwlock=true + +printf "%s\n" "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h + +fi + + if $has_rwlock; then + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5 +printf %s "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; } +if test ${gl_cv_pthread_rwlock_rdlock_prefer_writer+y} +then : + printf %s "(cached) " >&6 +else + save_LIBS="$LIBS" + LIBS="$LIBS $LIBMULTITHREAD" + if test "$cross_compiling" = yes +then : + gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#include <pthread.h> +#include <stdlib.h> +#include <unistd.h> + +#define SUCCEED() exit (0) +#define FAILURE() exit (1) +#define UNEXPECTED(n) (exit (10 + (n))) + +/* The main thread creates the waiting writer and the requesting reader threads + in the default way; this guarantees that they have the same priority. + We can reuse the main thread as first reader thread. */ + +static pthread_rwlock_t lock; +static pthread_t reader1; +static pthread_t writer; +static pthread_t reader2; +static pthread_t timer; +/* Used to pass control from writer to reader2 and from reader2 to timer, + as in a relay race. + Passing control from one running thread to another running thread + is most likely faster than to create the second thread. */ +static pthread_mutex_t baton; + +static void * +timer_func (void *ignored) +{ + /* Step 13 (can be before or after step 12): + The timer thread takes the baton, then waits a moment to make sure + it can tell whether the second reader thread is blocked at step 12. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (13); + usleep (100000); + /* By the time we get here, it's clear that the second reader thread is + blocked at step 12. This is the desired behaviour. */ + SUCCEED (); +} + +static void * +reader2_func (void *ignored) +{ + int err; + + /* Step 8 (can be before or after step 7): + The second reader thread takes the baton, then waits a moment to make sure + the writer thread has reached step 7. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (8); + usleep (100000); + /* Step 9: The second reader thread requests the lock. */ + err = pthread_rwlock_tryrdlock (&lock); + if (err == 0) + FAILURE (); + else if (err != EBUSY) + UNEXPECTED (9); + /* Step 10: Launch a timer, to test whether the next call blocks. */ + if (pthread_create (&timer, NULL, timer_func, NULL)) + UNEXPECTED (10); + /* Step 11: Release the baton. */ + if (pthread_mutex_unlock (&baton)) + UNEXPECTED (11); + /* Step 12: The second reader thread requests the lock. */ + err = pthread_rwlock_rdlock (&lock); + if (err == 0) + FAILURE (); + else + UNEXPECTED (12); +} + +static void * +writer_func (void *ignored) +{ + /* Step 4: Take the baton, so that the second reader thread does not go ahead + too early. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (4); + /* Step 5: Create the second reader thread. */ + if (pthread_create (&reader2, NULL, reader2_func, NULL)) + UNEXPECTED (5); + /* Step 6: Release the baton. */ + if (pthread_mutex_unlock (&baton)) + UNEXPECTED (6); + /* Step 7: The writer thread requests the lock. */ + if (pthread_rwlock_wrlock (&lock)) + UNEXPECTED (7); + return NULL; +} + +int +main () +{ + reader1 = pthread_self (); + + /* Step 1: The main thread initializes the lock and the baton. */ + if (pthread_rwlock_init (&lock, NULL)) + UNEXPECTED (1); + if (pthread_mutex_init (&baton, NULL)) + UNEXPECTED (1); + /* Step 2: The main thread acquires the lock as a reader. */ + if (pthread_rwlock_rdlock (&lock)) + UNEXPECTED (2); + /* Step 3: Create the writer thread. */ + if (pthread_create (&writer, NULL, writer_func, NULL)) + UNEXPECTED (3); + /* Job done. Go to sleep. */ + for (;;) + { + sleep (1); + } +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_pthread_rwlock_rdlock_prefer_writer=yes +else + gl_cv_pthread_rwlock_rdlock_prefer_writer=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + LIBS="$save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5 +printf "%s\n" "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; } + case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in + *yes) + +printf "%s\n" "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h + + ;; + esac + + 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 (void) +{ + +#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 : + +printf "%s\n" "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + : + + + +printf "%s\n" "#define GNULIB_LOCK 1" >>confdefs.h + + + + + + + + + : + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5 +printf %s "checking whether lseek detects pipes... " >&6; } +if test ${gl_cv_func_lseek_pipe+y} +then : + printf %s "(cached) " >&6 +else + case "$host_os" in + mingw*) + gl_cv_func_lseek_pipe=no + ;; + *) + if test $cross_compiling = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> /* for off_t */ +#include <stdio.h> /* for SEEK_CUR */ +#if HAVE_UNISTD_H +# include <unistd.h> +#else /* on Windows with MSVC */ +# include <io.h> +#endif + +int +main (void) +{ + + /* Exit with success only if stdin is seekable. */ + return lseek (0, (off_t)0, SEEK_CUR) < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if test -s conftest$ac_exeext \ + && ./conftest$ac_exeext < conftest.$ac_ext \ + && test 1 = "`echo hi \ + | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then + gl_cv_func_lseek_pipe=yes + else + gl_cv_func_lseek_pipe=no + fi + +else + gl_cv_func_lseek_pipe=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __BEOS__ +/* BeOS mistakenly return 0 when trying to seek on pipes. */ + Choke me. +#endif +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_lseek_pipe=yes +else + gl_cv_func_lseek_pipe=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + ;; + esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5 +printf "%s\n" "$gl_cv_func_lseek_pipe" >&6; } + if test $gl_cv_func_lseek_pipe = no; then + REPLACE_LSEEK=1 + +printf "%s\n" "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h + + fi + + + if test $WINDOWS_64_BIT_OFF_T = 1; then + REPLACE_LSEEK=1 + fi + + if test $REPLACE_LSEEK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lseek.$ac_objext" + + fi + + + + + + GNULIB_LSEEK=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_LSEEK 1" >>confdefs.h + + + + + + + : + + + + + + 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 + + + + + +printf "%s\n" "#define GNULIB_TEST_LSTAT 1" >>confdefs.h + + + + + + + + + ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(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 (void) +{ +char *p = malloc (0); + int result = !p; + free (p); + return result; + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } + if test $ac_cv_func_malloc_0_nonnull = yes +then : + +printf "%s\n" "#define HAVE_MALLOC_GNU 1" >>confdefs.h + +else + printf "%s\n" "#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 + + +printf "%s\n" "#define GNULIB_MALLOC_GNU 1" >>confdefs.h + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +printf "%s\n" "#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 + + + + + +printf "%s\n" "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h + + + + + + + + + + + + + : + + + + + + + + : + + + + + + if test $ac_cv_func_mbrlen = no; then + HAVE_MBRLEN=0 + ac_fn_c_check_decl "$LINENO" "mbrlen" "ac_cv_have_decl_mbrlen" " +/* 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_mbrlen" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_MBRLEN $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbrlen = yes; then + REPLACE_MBRLEN=1 + fi + else + if test $REPLACE_MBRTOWC = 1; then + REPLACE_MBRLEN=1 + fi + fi + + if test $HAVE_MBRLEN = 0 || test $REPLACE_MBRLEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrlen.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBRLEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBRLEN 1" >>confdefs.h + + + + + + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_DECL_MBRTOWC $ac_have_decl" >>confdefs.h + + 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 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg1+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test ${gl_cv_func_mbrtowc_null_arg2+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +printf %s "checking whether mbrtowc has a correct return value... " >&6; } +if test ${gl_cv_func_mbrtowc_retval+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test ${gl_cv_func_mbrtowc_nul_retval+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +printf %s "checking whether mbrtowc works on empty input... " >&6; } +if test ${gl_cv_func_mbrtowc_empty_input+y} +then : + printf %s "(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=yes +else + gl_cv_func_mbrtowc_empty_input=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +printf %s "checking whether the C locale is free of encoding errors... " >&6; } +if test ${gl_cv_C_locale_sans_EILSEQ+y} +then : + printf %s "(cached) " >&6 +else + + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + #include <locale.h> + #include <wchar.h> + +int +main (void) +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_C_locale_sans_EILSEQ=yes +else + gl_cv_C_locale_sans_EILSEQ=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +printf "%s\n" "$gl_cv_C_locale_sans_EILSEQ" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +printf "%s\n" "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +printf "%s\n" "#define C_LOCALE_MAYBE_EILSEQ 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 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h + + + + + + + + + GNULIB_MBSCASECMP=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSCASECMP 1" >>confdefs.h + + + + + + + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_DECL_MBSINIT $ac_have_decl" >>confdefs.h + + 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 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h + + + + + + + : + + + + + + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 + fi + + + + + + + GNULIB_MBSLEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSLEN 1" >>confdefs.h + + + + + + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$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_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " +/* 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_mbsrtowcs" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_MBSRTOWCS $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_mbsrtowcs = yes; then + REPLACE_MBSRTOWCS=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + else + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 +printf %s "checking whether mbsrtowcs works... " >&6; } +if test ${gl_cv_func_mbsrtowcs_works+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || 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 () +{ + int result = 0; + /* Test whether the function supports a NULL destination argument. + This fails on native Windows. */ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + const char input[] = "\337er"; + const char *src = input; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbsrtowcs (NULL, &src, 1, &state) != 3 + || src != input) + result |= 1; + } + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 2; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + result |= 4; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_mbsrtowcs_works=yes +else + gl_cv_func_mbsrtowcs_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 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 +printf "%s\n" "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi + + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSRTOWCS=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h + + + + + + + + + GNULIB_MBSSTR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBSSTR 1" >>confdefs.h + + + + + + + if false; then + REPLACE_MBTOWC=1 + fi + + if test $REPLACE_MBTOWC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBTOWC=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h + + + + + + : + + + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + ac_fn_c_check_header_compile "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes +then : + printf "%s\n" "#define HAVE_BP_SYM_H 1" >>confdefs.h + +fi + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + + + + + ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy" +if test "x$ac_cv_func_mempcpy" = xyes +then : + printf "%s\n" "#define HAVE_MEMPCPY 1" >>confdefs.h + +fi + + if test $ac_cv_func_mempcpy = no; then + HAVE_MEMPCPY=0 + fi + + if test $HAVE_MEMPCPY = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext" + + + : + + fi + + + + + + GNULIB_MEMPCPY=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h + + + + + + + + + : + + + + + + if test $ac_cv_have_decl_memrchr = no; then + HAVE_DECL_MEMRCHR=0 + fi + + ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" +if test "x$ac_cv_func_memrchr" = xyes +then : + printf "%s\n" "#define HAVE_MEMRCHR 1" >>confdefs.h + +fi + + + if test $ac_cv_func_memrchr = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext" + + : + fi + + + + + + GNULIB_MEMRCHR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h + + + + + + + + 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 + + +printf "%s\n" "#define GNULIB_MSVC_NOTHROW 1" >>confdefs.h + + + + + + + + : + + + + + + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5 +printf %s "checking whether YESEXPR works... " >&6; } +if test ${gl_cv_func_nl_langinfo_yesexpr_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> + +int +main (void) +{ +return !*nl_langinfo(YESEXPR); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_nl_langinfo_yesexpr_works=yes +else + gl_cv_func_nl_langinfo_yesexpr_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5 +printf "%s\n" "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; } + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac + +printf "%s\n" "#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS" >>confdefs.h + + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 + +printf "%s\n" "#define REPLACE_NL_LANGINFO 1" >>confdefs.h + + fi + else + HAVE_NL_LANGINFO=0 + fi + + if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" + + fi + + + + + + GNULIB_NL_LANGINFO=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for obstacks that work with any size object" >&5 +printf %s "checking for obstacks that work with any size object... " >&6; } +if test ${ac_cv_func_obstack+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_obstack" >&5 +printf "%s\n" "$ac_cv_func_obstack" >&6; } + if test "$ac_cv_func_obstack" = yes; then + +printf "%s\n" "#define HAVE_OBSTACK 1" >>confdefs.h + + else + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS obstack.$ac_objext" + + fi + + + + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + + : + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +printf %s "checking whether open recognizes a trailing slash... " >&6; } +if test ${gl_cv_func_open_slash+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +printf "%s\n" "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +printf "%s\n" "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_OPEN=1 + ;; + esac + ;; + esac + + if test $REPLACE_OPEN = 0; then + + + + : + + + + + + if test $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi + + if test $HAVE_FCHDIR = 0; then + REPLACE_OPEN=1 + fi + fi + + + + if test $REPLACE_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + + + + + + GNULIB_OPEN=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_OPEN 1" >>confdefs.h + + + + + + + + : + + + + + + + case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in + yes+*yes) + ;; + yes+*) + # Solaris 9 has *at functions, but uniformly mishandles trailing + # slash in all of them. + REPLACE_OPENAT=1 + ;; + *) + HAVE_OPENAT=0 + ;; + esac + + if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext" + + + + : + + fi + + +printf "%s\n" "#define GNULIB_OPENAT 1" >>confdefs.h + + + + + + + GNULIB_OPENAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_OPENAT 1" >>confdefs.h + + + + + + + + +printf "%s\n" "#define GNULIB_OPENAT_SAFER 1" >>confdefs.h + + + + + + ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" +if test "x$ac_cv_func_opendir" = xyes +then : + printf "%s\n" "#define HAVE_OPENDIR 1" >>confdefs.h + +fi + + if test $ac_cv_func_opendir = no; then + HAVE_OPENDIR=0 + fi + + + + + : + + + + + + if test $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi + + if test $HAVE_FCHDIR = 0; then + if test $HAVE_OPENDIR = 1; then + REPLACE_OPENDIR=1 + fi + fi + + case $host_os,$HAVE_OPENDIR in + os2*,1) + REPLACE_OPENDIR=1;; + esac + + if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext" + + fi + + + + + + GNULIB_OPENDIR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h + + + + + + : + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for perl5.005 or newer" >&5 +printf %s "checking for perl5.005 or newer... " >&6; } + if test "${PERL+set}" = set; then + # 'PERL' is set in the user's environment. + candidate_perl_names="$PERL" + perl_specified=yes + else + candidate_perl_names='perl perl5' + perl_specified=no + fi + + found=no + + PERL="$am_missing_run perl" + for perl in $candidate_perl_names; do + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + if ( $perl -e 'require 5.005; use File::Compare' ) > /dev/null 2>&1; then + PERL=$perl + found=yes + break + fi + done + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $found" >&5 +printf "%s\n" "$found" >&6; } + test $found = no && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: +WARNING: You don't seem to have perl5.005 or newer installed, or you lack + a usable version of the Perl File::Compare module. As a result, + you may be unable to run a few tests or to regenerate certain + files if you modify the sources from which they are derived. + " >&5 +printf "%s\n" "$as_me: WARNING: +WARNING: You don't seem to have perl5.005 or newer installed, or you lack + a usable version of the Perl File::Compare module. As a result, + you may be unable to run a few tests or to regenerate certain + files if you modify the sources from which they are derived. + " >&2;} + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + : + + + : + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_READ=1 + fi + + + + if test $REPLACE_READ = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS read.$ac_objext" + + : + fi + + + + + + GNULIB_READ=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_READ 1" >>confdefs.h + + + + + + + ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir" +if test "x$ac_cv_func_readdir" = xyes +then : + printf "%s\n" "#define HAVE_READDIR 1" >>confdefs.h + +fi + + if test $ac_cv_func_readdir = no; then + HAVE_READDIR=0 + fi + + if test $HAVE_READDIR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext" + + fi + + + + + + GNULIB_READDIR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_READDIR 1" >>confdefs.h + + + + + + + ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +printf %s "checking for GNU libc compatible realloc... " >&6; } +if test ${ac_cv_func_realloc_0_nonnull+y} +then : + printf %s "(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_realloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_realloc_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 *realloc (); + #endif + +int +main (void) +{ +char *p = realloc (0, 0); + int result = !p; + free (p); + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_realloc_0_nonnull=yes +else + ac_cv_func_realloc_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_realloc_0_nonnull" >&6; } + if test $ac_cv_func_realloc_0_nonnull = yes +then : + +printf "%s\n" "#define HAVE_REALLOC_GNU 1" >>confdefs.h + +else + printf "%s\n" "#define HAVE_REALLOC_GNU 0" >>confdefs.h + + REPLACE_REALLOC=1 + +fi + + + if test $REPLACE_REALLOC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" + + fi + + +printf "%s\n" "#define GNULIB_REALLOC_GNU 1" >>confdefs.h + + + + + + if test $gl_cv_func_malloc_posix = yes; then + +printf "%s\n" "#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 + + + + + +printf "%s\n" "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h + + + + + +# Check whether --with-included-regex was given. +if test ${with_included_regex+y} +then : + withval=$with_included_regex; +fi + + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + + : + + + + + + + : + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 +printf %s "checking for working re_compile_pattern... " >&6; } +if test ${gl_cv_func_re_compile_pattern_working+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + gl_cv_func_re_compile_pattern_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <regex.h> + + #include <locale.h> + #include <limits.h> + #include <string.h> + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include <signal.h> + # include <unistd.h> + #endif + + #if HAVE_MALLOC_H + # include <malloc.h> + #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif + +int +main (void) +{ +int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; + + /* Some builds of glibc go into an infinite loop on this + test. Use alarm to force death, and mallopt to avoid + malloc recursion in diagnosing the corrupted heap. */ +#if HAVE_DECL_ALARM + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif +#ifdef M_CHECK_ACTION + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); +#endif + + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + { + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + regfree (®ex); + } + + { + /* This test is from glibc bug 15078. + The test case is from Andreas Schwab in + <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>. + */ + static char const pat[] = "[^x]x"; + static char const data[] = + /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; + re_set_syntax (0); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } + regfree (®ex); + } + + if (! setlocale (LC_ALL, "C")) + return 1; + } + + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:]:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; + + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; + + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_re_compile_pattern_working=yes +else + gl_cv_func_re_compile_pattern_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 +printf "%s\n" "$gl_cv_func_re_compile_pattern_working" >&6; } + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 + ;; + esac + + if test $ac_use_included_regex = yes; then + +printf "%s\n" "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h + + +printf "%s\n" "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h + + +printf "%s\n" "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h + + +printf "%s\n" "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h + + +printf "%s\n" "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + + +printf "%s\n" "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + + +printf "%s\n" "#define re_search rpl_re_search" >>confdefs.h + + +printf "%s\n" "#define re_search_2 rpl_re_search_2" >>confdefs.h + + +printf "%s\n" "#define re_match rpl_re_match" >>confdefs.h + + +printf "%s\n" "#define re_match_2 rpl_re_match_2" >>confdefs.h + + +printf "%s\n" "#define re_set_registers rpl_re_set_registers" >>confdefs.h + + +printf "%s\n" "#define re_comp rpl_re_comp" >>confdefs.h + + +printf "%s\n" "#define re_exec rpl_re_exec" >>confdefs.h + + +printf "%s\n" "#define regcomp rpl_regcomp" >>confdefs.h + + +printf "%s\n" "#define regexec rpl_regexec" >>confdefs.h + + +printf "%s\n" "#define regerror rpl_regerror" >>confdefs.h + + +printf "%s\n" "#define regfree rpl_regfree" >>confdefs.h + + fi + + if test $ac_use_included_regex = yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + + + + + + + + + ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h + +fi + + + : + + + + + + + + + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" +if test "x$ac_cv_have_decl_isblank" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h + + + fi + + + + + + : + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +printf %s "checking for ssize_t... " >&6; } +if test ${gt_cv_ssize_t+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +printf "%s\n" "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +printf "%s\n" "#define ssize_t int" >>confdefs.h + + fi + + + + + + : + + + + + + case "$host_os" in + mingw*) + REPLACE_STAT=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +printf %s "checking whether stat handles trailing slashes on files... " >&6; } +if test ${gl_cv_func_stat_file_slash+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +printf "%s\n" "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + +printf "%s\n" "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + ;; + esac + + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + + + : + + fi + + + + + + GNULIB_STAT=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STAT 1" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 +printf %s "checking for working stdalign.h... " >&6; } +if test ${gl_cv_header_working_stdalign_h+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdalign.h> + #include <stddef.h> + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ + #ifdef __cplusplus + template <class t> struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper<type>, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_header_working_stdalign_h=yes +else + gl_cv_header_working_stdalign_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdalign_h" >&6; } + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + + if test -n "$STDALIGN_H"; then + GL_GENERATE_STDALIGN_H_TRUE= + GL_GENERATE_STDALIGN_H_FALSE='#' +else + GL_GENERATE_STDALIGN_H_TRUE='#' + GL_GENERATE_STDALIGN_H_FALSE= +fi + + + + STDARG_H='' + NEXT_STDARG_H='<stdarg.h>' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +printf %s "checking for va_copy... " >&6; } + if test ${gl_cv_func_va_copy+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +int +main (void) +{ + +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_va_copy=yes +else + gl_cv_func_va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +printf "%s\n" "$gl_cv_func_va_copy" >&6; } + if test $gl_cv_func_va_copy = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "vaccine" >/dev/null 2>&1 +then : + gl_aixcc=yes +else + gl_aixcc=no +fi +rm -rf conftest* + + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdarg_h='<'stdarg.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5 +printf %s "checking absolute name of <stdarg.h>... " >&6; } +if test ${gl_cv_next_stdarg_h+y} +then : + printf %s "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.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 'stdarg.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_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdarg_h + gl_cv_next_stdarg_h='"'$gl_header'"' + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +printf "%s\n" "$gl_cv_next_stdarg_h" >&6; } + fi + NEXT_STDARG_H=$gl_cv_next_stdarg_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='<'stdarg.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdarg_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive + + + + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if test ${gl_cv_func___va_copy+y} +then : + printf %s "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +int +main (void) +{ + +#ifndef __va_copy +error, bail out +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func___va_copy=yes +else + gl_cv_func___va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + as_echo_n="$saved_as_echo_n" + + if test $gl_cv_func___va_copy = yes; then + +printf "%s\n" "#define va_copy __va_copy" >>confdefs.h + + else + + +printf "%s\n" "#define va_copy gl_va_copy" >>confdefs.h + + fi + fi + fi + + if test -n "$STDARG_H"; then + GL_GENERATE_STDARG_H_TRUE= + GL_GENERATE_STDARG_H_FALSE='#' +else + GL_GENERATE_STDARG_H_TRUE='#' + GL_GENERATE_STDARG_H_FALSE= +fi + + + + + + + # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; } +if test ${gl_cv_decl_null_works+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 +printf %s "checking absolute name of <stddef.h>... " >&6; } +if test ${gl_cv_next_stddef_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +printf "%s\n" "$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 + + + + + printf "%s\n" "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5 +printf %s "checking absolute name of <stdio.h>... " >&6; } +if test ${gl_cv_next_stdio_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +printf "%s\n" "$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 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 +printf %s "checking which flavor of printf attribute matches inttypes macros... " >&6; } +if test ${gl_cv_func_printf_attribute_flavor+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define __STDC_FORMAT_MACROS 1 + #include <stdio.h> + #include <inttypes.h> + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_func_printf_attribute_flavor=system +else + gl_cv_func_printf_attribute_flavor=gnu +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +printf "%s\n" "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +printf "%s\n" "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + + GNULIB_FSCANF=1 + + +printf "%s\n" "#define GNULIB_FSCANF 1" >>confdefs.h + + + GNULIB_SCANF=1 + + +printf "%s\n" "#define GNULIB_SCANF 1" >>confdefs.h + + + 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=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5 +printf %s "checking absolute name of <stdlib.h>... " >&6; } +if test ${gl_cv_next_stdlib_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +printf "%s\n" "$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 qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(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 (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy" +if test "x$ac_cv_func_stpcpy" = xyes +then : + printf "%s\n" "#define HAVE_STPCPY 1" >>confdefs.h + +fi + + 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 + + + + + +printf "%s\n" "#define GNULIB_TEST_STPCPY 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 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRDUP 1" >>confdefs.h + + + + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +printf %s "checking for working strerror function... " >&6; } +if test ${gl_cv_func_working_strerror+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +printf "%s\n" "$gl_cv_func_working_strerror" >&6; } + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + REPLACE_STRERROR=1 + ;; + esac + + else + REPLACE_STRERROR=1 + fi + + if test $REPLACE_STRERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + fi + + +printf "%s\n" "#define GNULIB_STRERROR 1" >>confdefs.h + + + + + + + + GNULIB_STRERROR=1 + + + + + +printf "%s\n" "#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 + ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi + + 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 $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi + + + + + + + + + + : + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +printf %s "checking for working strnlen... " >&6; } +if test ${ac_cv_func_strnlen_working+y} +then : + printf %s "(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 (void) +{ + +#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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +printf "%s\n" "$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 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h + + + + + + if test $REPLACE_STRSTR = 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5 +printf %s "checking whether strstr works in linear time... " >&6; } +if test ${gl_cv_func_strstr_linear+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ + && !(defined __i386__ || defined __x86_64__) \ + && !defined __UCLIBC__ + Lucky user + #endif +#endif +#ifdef __CYGWIN__ + #include <cygwin/version.h> + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) + Lucky user + #endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky user" >/dev/null 2>&1 +then : + gl_cv_func_strstr_linear="guessing yes" +else + gl_cv_func_strstr_linear="guessing no" +fi +rm -rf conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MVS__ +/* z/OS does not deliver signals while strstr() is running (thanks to + restrictions on its LE runtime), which prevents us from limiting the + running time of this test. */ +# error "This test does not work properly on z/OS" +#endif +#include <signal.h> /* for signal */ +#include <string.h> /* for strstr */ +#include <stdlib.h> /* for malloc */ +#include <unistd.h> /* for alarm */ +static void quit (int sig) { _exit (sig + 128); } + +int +main (void) +{ + + int result = 0; + size_t m = 1000000; + char *haystack = (char *) malloc (2 * m + 2); + char *needle = (char *) malloc (m + 2); + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also have quadratic strstr. */ + signal (SIGALRM, quit); + alarm (5); + /* Check for quadratic performance. */ + if (haystack && needle) + { + memset (haystack, 'A', 2 * m); + haystack[2 * m] = 'B'; + haystack[2 * m + 1] = 0; + memset (needle, 'A', m); + needle[m] = 'B'; + needle[m + 1] = 0; + if (!strstr (haystack, needle)) + result |= 1; + } + /* Free allocated memory, in case some sanitizer is watching. */ + free (haystack); + free (needle); + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strstr_linear=yes +else + gl_cv_func_strstr_linear=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5 +printf "%s\n" "$gl_cv_func_strstr_linear" >&6; } + case "$gl_cv_func_strstr_linear" in + *yes) ;; + *) + REPLACE_STRSTR=1 + ;; + esac + fi + + if test $REPLACE_STRSTR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" + + fi + + + + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_STRSTR=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5 +printf %s "checking whether strstr works... " >&6; } +if test ${gl_cv_func_strstr_works_always+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __GNU_LIBRARY__ + #include <features.h> + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ + || defined __UCLIBC__ + Lucky user + #endif +#elif defined __CYGWIN__ + #include <cygwin/version.h> + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) + 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_strstr_works_always="guessing yes" +else + gl_cv_func_strstr_works_always="guessing no" +fi +rm -rf conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> /* for strstr */ +#define P "_EF_BF_BD" +#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P +#define NEEDLE P P P P P + +int +main (void) +{ +return !!strstr (HAYSTACK, NEEDLE); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strstr_works_always=yes +else + gl_cv_func_strstr_works_always=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5 +printf "%s\n" "$gl_cv_func_strstr_works_always" >&6; } + case "$gl_cv_func_strstr_works_always" in + *yes) ;; + *) + REPLACE_STRSTR=1 + ;; + esac + fi + + if test $REPLACE_STRSTR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" + + fi + + + + + + GNULIB_STRSTR=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRSTR 1" >>confdefs.h + + + + + + + + : + + + + + + + : + + + + + + if test "$ac_cv_have_decl_strtoimax" != yes; then + HAVE_DECL_STRTOIMAX=0 + fi + + if test "$ac_cv_func_strtoimax" = yes; then + HAVE_STRTOIMAX=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strtoimax works" >&5 +printf %s "checking whether strtoimax works... " >&6; } +if test ${gl_cv_func_strtoimax+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess no on AIX 5. + aix5*) gl_cv_func_strtoimax="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_strtoimax="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <errno.h> +#include <string.h> +#include <inttypes.h> +int main () +{ + if (sizeof (intmax_t) > sizeof (int)) + { + const char *s = "4294967295"; + char *p; + intmax_t res; + errno = 0; + res = strtoimax (s, &p, 10); + if (p != s + strlen (s)) + return 1; + if (errno != 0) + return 2; + if (res != (intmax_t) 65535 * (intmax_t) 65537) + return 3; + } + else + { + const char *s = "2147483647"; + char *p; + intmax_t res; + errno = 0; + res = strtoimax (s, &p, 10); + if (p != s + strlen (s)) + return 1; + if (errno != 0) + return 2; + if (res != 2147483647) + return 3; + } + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_strtoimax=yes +else + gl_cv_func_strtoimax=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtoimax" >&5 +printf "%s\n" "$gl_cv_func_strtoimax" >&6; } + case "$gl_cv_func_strtoimax" in + *no) REPLACE_STRTOIMAX=1 ;; + esac + else + if test "$ac_cv_have_decl_strtoimax" = yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOIMAX=1 + fi + HAVE_STRTOIMAX=0 + fi + + if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoimax.$ac_objext" + + + ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoll" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRTOLL $ac_have_decl" >>confdefs.h + + + + fi + + + + + + GNULIB_STRTOIMAX=1 + + + + + + + + if test "$ac_cv_type_long_long_int" = yes; then + ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" +if test "x$ac_cv_func_strtoll" = xyes +then : + printf "%s\n" "#define HAVE_STRTOLL 1" >>confdefs.h + +fi + + if test $ac_cv_func_strtoll = no; then + HAVE_STRTOLL=0 + fi + fi + + if test $HAVE_STRTOLL = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoll.$ac_objext" + + + : + + fi + + + + + + GNULIB_STRTOLL=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRTOLL 1" >>confdefs.h + + + + + + + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = xyes +then : + printf "%s\n" "#define HAVE_STRTOULL 1" >>confdefs.h + +fi + + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + fi + fi + + if test $HAVE_STRTOULL = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoull.$ac_objext" + + + : + + fi + + + + + + GNULIB_STRTOULL=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_STRTOULL 1" >>confdefs.h + + + + + + + + : + + + + + + + : + + + + + + if test "$ac_cv_have_decl_strtoumax" = yes; then + if test "$ac_cv_func_strtoumax" != yes; then + # HP-UX 11.11 has "#define strtoimax(...) ..." but no function. + REPLACE_STRTOUMAX=1 + fi + else + HAVE_DECL_STRTOUMAX=0 + fi + + if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext" + + + ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoull" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_STRTOULL $ac_have_decl" >>confdefs.h + + + + fi + + + + + + GNULIB_STRTOUMAX=1 + + + + + + + + + + + + + + + + : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +printf %s "checking absolute name of <sys/stat.h>... " >&6; } +if test ${gl_cv_next_sys_stat_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +printf "%s\n" "$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 + + + + + + + + + WINDOWS_STAT_TIMESPEC=0 + + + + + + + + + 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 + +printf "%s\n" "#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=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> + +int +main (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5 +printf %s "checking absolute name of <unistd.h>... " >&6; } +if test ${gl_cv_next_unistd_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +printf "%s\n" "$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 truncate ttyname_r unlink unlinkat usleep; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(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 (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "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_UNISTR_H='unistr.h' + else + LIBUNISTRING_UNISTR_H= + fi + + + + +printf "%s\n" "#define GNULIB_UNISTR_U8_MBTOUCR 1" >>confdefs.h + + + + + 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 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE= +fi + + + + +printf "%s\n" "#define GNULIB_UNISTR_U8_UCTOMB 1" >>confdefs.h + + + + + 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 0 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE= + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#' +else + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#' + LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE= +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_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 6 + } + } + } + + + + + } + }; then + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE= + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#' +else + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#' + LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE= +fi + + + + +printf "%s\n" "#define USE_UNLOCKED_IO 1" >>confdefs.h + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + +# Check whether --with-packager was given. +if test ${with_packager+y} +then : + withval=$with_packager; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +# Check whether --with-packager-version was given. +if test ${with_packager_version+y} +then : + withval=$with_packager_version; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER_VERSION \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + +# Check whether --with-packager-bug-reports was given. +if test ${with_packager_bug_reports+y} +then : + withval=$with_packager_bug_reports; case $withval in + yes|no) ;; + *) +printf "%s\n" "#define PACKAGE_PACKAGER_BUG_REPORTS \"$withval\"" >>confdefs.h + ;; + esac + +fi + + + if test "X$with_packager" = "X" && \ + test "X$with_packager_version$with_packager_bug_reports" != "X" + then + as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5 + fi + + + + + + + + + + + : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5 +printf %s "checking absolute name of <wchar.h>... " >&6; } +if test ${gl_cv_next_wchar_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 +printf "%s\n" "$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 wcsftime ; do + as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(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 (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "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 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +printf %s "checking whether mbrtowc handles incomplete characters... " >&6; } +if test ${gl_cv_func_mbrtowc_incomplete_state+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test ${gl_cv_func_mbrtowc_sanitycheck+y} +then : + printf %s "(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 2; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +printf "%s\n" "$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_wcrtomb = no; then + HAVE_WCRTOMB=0 + ac_fn_c_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" " +/* 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_wcrtomb" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_WCRTOMB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wcrtomb = yes; then + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 +printf %s "checking whether wcrtomb return value is correct... " >&6; } +if test ${gl_cv_func_wcrtomb_retval+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || 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 () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wcrtomb_retval=yes +else + gl_cv_func_wcrtomb_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5 +printf "%s\n" "$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi + + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + + + GNULIB_WCRTOMB=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h + + + + + + + + : + + + + + + if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 + else + HAVE_WCTOB=1 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5 +printf %s "checking whether wctob works... " >&6; } +if test ${gl_cv_func_wctob_works+y} +then : + printf %s "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris <= 9 and Cygwin. + solaris2.[1-9] | solaris2.[1-9].* | cygwin*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac + case "$host_os" in + cygwin*) + if test "$cross_compiling" = yes +then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.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> + +register long global __asm__ ("%ebx"); + +int main () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + global = 0x12345678; + if (wctob (0x00FC) != -1) + return 1; + if (global != 0x12345678) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + : +else + gl_cv_func_wctob_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 + + ;; + esac + if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != 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") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_wctob_works=yes +else + gl_cv_func_wctob_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 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5 +printf "%s\n" "$gl_cv_func_wctob_works" >&6; } + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 0; then + + ac_fn_c_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" " +/* 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_wctob" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL_WCTOB $ac_have_decl" >>confdefs.h + + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + fi + fi + fi + + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wctob.$ac_objext" + + + : + + fi + + + + + + GNULIB_WCTOB=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_WCTOB 1" >>confdefs.h + + + + + + + if false; then + REPLACE_WCTOMB=1 + fi + + if test $REPLACE_WCTOMB = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wctomb.$ac_objext" + + + : + + fi + + + + + + GNULIB_WCTOMB=1 + + + + + +printf "%s\n" "#define GNULIB_TEST_WCTOMB 1" >>confdefs.h + + + + + + + + + : + + + + + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 +printf %s "checking absolute name of <wctype.h>... " >&6; } +if test ${gl_cv_next_wctype_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +printf %s "checking whether iswcntrl works... " >&6; } +if test ${gl_cv_func_iswcntrl_works+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +printf "%s\n" "$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 + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "#define HAVE_TOWLOWER 1" >>confdefs.h + +fi + + 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 + +printf "%s\n" "#define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h + + 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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +printf %s "checking for wctype_t... " >&6; } +if test ${gl_cv_type_wctype_t+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +printf "%s\n" "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +printf %s "checking for wctrans_t... " >&6; } +if test ${gl_cv_type_wctrans_t+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +printf "%s\n" "$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=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +printf %s "checking whether $gl_func is declared without a macro... " >&6; } +if eval test \${$as_gl_Symbol+y} +then : + printf %s "(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 (void) +{ +#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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "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 + +printf "%s\n" "#define HAVE_DECL_WCWIDTH $ac_have_decl" >>confdefs.h + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 +printf %s "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } +if test ${gl_cv_func_wcwidth_works+y} +then : + printf %s "(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; + if (wcwidth (0xFF1A) == 0) + result |= 8; + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5 +printf "%s\n" "$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 + + + + + +printf "%s\n" "#define GNULIB_TEST_WCWIDTH 1" >>confdefs.h + + + + : + + : + + # End of code from modules + + + + + + + + + + gltests_libdeps= + gltests_ltlibdeps= + + + + + + + + + + gl_source_base='gnulib-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 + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(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 () { + /* 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 the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#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=$? + printf "%s\n" "$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 native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=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=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(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 () { + /* 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 the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#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=$? + printf "%s\n" "$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 native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=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=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(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, 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. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* 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 tr_TR 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 eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$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=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_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=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + + + + + + if test "$GNULIB_ENVIRON" != 1; then + if test "$GNULIB_ENVIRON" = 0; then + GNULIB_ENVIRON=$gl_module_indicator_condition + else + GNULIB_ENVIRON="($GNULIB_ENVIRON || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_FD_SAFER_FLAG $gl_module_indicator_condition" >>confdefs.h + + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + fi + + if test $REPLACE_FDOPEN = 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5 +printf %s "checking whether fdopen sets errno... " >&6; } +if test ${gl_cv_func_fdopen_works+y} +then : + printf %s "(cached) " >&6 +else + + if test "$cross_compiling" = yes +then : + case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdio.h> +#include <errno.h> +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_fdopen_works=yes +else + gl_cv_func_fdopen_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5 +printf "%s\n" "$gl_cv_func_fdopen_works" >&6; } + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi + + if test $REPLACE_FDOPEN = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS fdopen.$ac_objext" + + + fi + + + + + + if test "$GNULIB_FDOPEN" != 1; then + if test "$GNULIB_FDOPEN" = 0; then + GNULIB_FDOPEN=$gl_module_indicator_condition + else + GNULIB_FDOPEN="($GNULIB_FDOPEN || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_FDOPEN 1" >>confdefs.h + + + + + + + FLOAT_H= + REPLACE_FLOAT_LDBL=0 + case "$host_os" in + aix* | beos* | openbsd* | mirbsd* | irix*) + FLOAT_H=float.h + ;; + freebsd* | dragonfly*) + 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 -rf conftest* + + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | dragonfly* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi + ;; + esac + + REPLACE_ITOLD=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 +printf %s "checking whether conversion from 'int' to 'long double' works... " >&6; } +if test ${gl_cv_func_itold_works+y} +then : + printf %s "(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 -rf 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5 +printf %s "checking absolute name of <float.h>... " >&6; } +if test ${gl_cv_next_float_h+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +printf "%s\n" "$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 + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS float.$ac_objext" + + fi + if test $REPLACE_ITOLD = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS itold.$ac_objext" + + fi + + + + : + + : + : + : + : + + + : + + + + + + + + + ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" +if test "x$ac_cv_func_setlocale" = xyes +then : + printf "%s\n" "#define HAVE_SETLOCALE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "uselocale" "ac_cv_func_uselocale" +if test "x$ac_cv_func_uselocale" = xyes +then : + printf "%s\n" "#define HAVE_USELOCALE 1" >>confdefs.h + +fi + + if test $ac_cv_func_uselocale = yes; then + ac_fn_c_check_func "$LINENO" "getlocalename_l" "ac_cv_func_getlocalename_l" +if test "x$ac_cv_func_getlocalename_l" = xyes +then : + printf "%s\n" "#define HAVE_GETLOCALENAME_L 1" >>confdefs.h + +fi + + fi + + + : + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +printf %s "checking for a turkish Unicode locale... " >&6; } +if test ${gt_cv_locale_tr_utf8+y} +then : + printf %s "(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, 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. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* 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 tr_TR 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 eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$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=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 + else + # None found. + gt_cv_locale_tr_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=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(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 () { + /* 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 the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#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=$? + printf "%s\n" "$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 native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=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=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "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 -rf 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 : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + : + + + + + + + : + + + + + + + + + # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "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 -rf 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 : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + : + + + + + + + : + + + + + + + + + # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "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 -rf 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 : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + : + + + + + + + : + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(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 () { + /* 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 the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#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=$? + printf "%s\n" "$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 native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=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=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + : + + + + + + if test $ac_cv_func_pipe != yes; then + HAVE_PIPE=0 + fi + + if test $HAVE_PIPE = 0; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS pipe.$ac_objext" + + fi + + + + + + if test "$GNULIB_PIPE" != 1; then + if test "$GNULIB_PIPE" = 0; then + GNULIB_PIPE=$gl_module_indicator_condition + else + GNULIB_PIPE="($GNULIB_PIPE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_PIPE 1" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5 +printf %s "checking for putenv compatible with GNU and SVID... " >&6; } +if test ${gl_cv_func_svid_putenv+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; + + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 2; + + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 3; + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_svid_putenv=yes +else + gl_cv_func_svid_putenv=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5 +printf "%s\n" "$gl_cv_func_svid_putenv" >&6; } + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac + + if test $REPLACE_PUTENV = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS putenv.$ac_objext" + + + ac_fn_c_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default" +if test "x$ac_cv_have_decl__putenv" = xyes +then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +printf "%s\n" "#define HAVE_DECL__PUTENV $ac_have_decl" >>confdefs.h + + + fi + + + + + + if test "$GNULIB_PUTENV" != 1; then + if test "$GNULIB_PUTENV" = 0; then + GNULIB_PUTENV=$gl_module_indicator_condition + else + GNULIB_PUTENV="($GNULIB_PUTENV || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_PUTENV 1" >>confdefs.h + + + + + + + # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "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 -rf 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 : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + : + + + + + + + : + + + + + + + + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 +printf %s "checking whether setenv validates arguments... " >&6; } +if test ${gl_cv_func_setenv_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <stdlib.h> + #include <errno.h> + #include <string.h> + +int +main (void) +{ + + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_setenv_works=yes +else + gl_cv_func_setenv_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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 +printf "%s\n" "$gl_cv_func_setenv_works" >&6; } + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac + fi + + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setenv.$ac_objext" + + fi + + + + + + if test "$GNULIB_SETENV" != 1; then + if test "$GNULIB_SETENV" = 0; then + GNULIB_SETENV=$gl_module_indicator_condition + else + GNULIB_SETENV="($GNULIB_SETENV || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SETENV 1" >>confdefs.h + + + + + + + case "$host_os" in + mingw*) REPLACE_SETLOCALE=1 ;; + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac + + if test $REPLACE_SETLOCALE = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setlocale.$ac_objext" + + + : + + fi + + + + + + if test "$GNULIB_SETLOCALE" != 1; then + if test "$GNULIB_SETLOCALE" = 0; then + GNULIB_SETLOCALE=$gl_module_indicator_condition + else + GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SETLOCALE 1" >>confdefs.h + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(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 () { + /* 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 the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#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=$? + printf "%s\n" "$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 native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=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=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +printf %s "checking for SIZE_MAX... " >&6; } +if test ${gl_cv_size_max+y} +then : + printf %s "(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 -rf 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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +printf "%s\n" "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +printf "%s\n" "#define SIZE_MAX $gl_cv_size_max" >>confdefs.h + + fi + + + + + gl_cv_func_snprintf_usable=no + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi + + if test $ac_cv_func_snprintf = yes; then + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +printf %s "checking whether snprintf respects a size of 1... " >&6; } +if test ${gl_cv_func_snprintf_size1+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +printf "%s\n" "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +printf %s "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if test ${gl_cv_func_printf_positions+y} +then : + printf %s "(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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +printf "%s\n" "$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 + + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + + : + + + + + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + fi + : + + fi + + : + + + + + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + + + + + if test "$GNULIB_SNPRINTF" != 1; then + if test "$GNULIB_SNPRINTF" = 0; then + GNULIB_SNPRINTF=$gl_module_indicator_condition + else + GNULIB_SNPRINTF="($GNULIB_SNPRINTF || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h + + + + + +printf "%s\n" "#define GNULIB_SNPRINTF $gl_module_indicator_condition" >>confdefs.h + + + + + + + + # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "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 -rf 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 : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + : + + + + + + + : + + + + + + + : + + + + + + + + + # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +printf %s "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 -rf 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 : + +printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -rf conftest* + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +printf "%s\n" "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + : + + + + + + + : + + + + + + + + + : + + + + + + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5 +printf %s "checking whether symlink handles trailing slash correctly... " >&6; } +if test ${gl_cv_func_symlink_works+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main (void) +{ +int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gl_cv_func_symlink_works=yes +else + gl_cv_func_symlink_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 + + rm -f conftest.f conftest.link conftest.lnk2 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5 +printf "%s\n" "$gl_cv_func_symlink_works" >&6; } + case "$gl_cv_func_symlink_works" in + *yes) ;; + *) + REPLACE_SYMLINK=1 + ;; + esac + fi + + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext" + + fi + + + + + + if test "$GNULIB_SYMLINK" != 1; then + if test "$GNULIB_SYMLINK" = 0; then + GNULIB_SYMLINK=$gl_module_indicator_condition + else + GNULIB_SYMLINK="($GNULIB_SYMLINK || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_SYMLINK 1" >>confdefs.h + + + + + + + : + + + + + + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes +then : + printf "%s\n" "#define HAVE_UNSETENV 1" >>confdefs.h + +fi + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + else + HAVE_UNSETENV=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +printf %s "checking for unsetenv() return type... " >&6; } +if test ${gt_cv_func_unsetenv_ret+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +printf "%s\n" "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + +printf "%s\n" "#define VOID_UNSETENV 1" >>confdefs.h + + REPLACE_UNSETENV=1 + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 +printf %s "checking whether unsetenv obeys POSIX... " >&6; } +if test ${gl_cv_func_unsetenv_works+y} +then : + printf %s "(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 (void) +{ + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 +printf "%s\n" "$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 + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS unsetenv.$ac_objext" + + + + + : + + + + + + + fi + + + + + + if test "$GNULIB_UNSETENV" != 1; then + if test "$GNULIB_UNSETENV" = 0; then + GNULIB_UNSETENV=$gl_module_indicator_condition + else + GNULIB_UNSETENV="($GNULIB_UNSETENV || $gl_module_indicator_condition)" + fi + fi + + + + + +printf "%s\n" "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h + + + + + + : + + + + + + if test $ac_cv_func_vasnprintf = no; then + + + : + + + + + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +printf "%s\n" "#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 + +printf "%s\n" "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + fi + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +printf %s "checking for a traditional french locale... " >&6; } +if test ${gt_cv_locale_fr+y} +then : + printf %s "(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 () { + /* 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 the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#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=$? + printf "%s\n" "$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 native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=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=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +printf "%s\n" "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +printf %s "checking for a french Unicode locale... " >&6; } +if test ${gt_cv_locale_fr_utf8+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +printf %s "checking for a traditional japanese locale... " >&6; } +if test ${gt_cv_locale_ja+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +printf "%s\n" "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +printf %s "checking for a transitional chinese locale... " >&6; } +if test ${gt_cv_locale_zh_CN+y} +then : + printf %s "(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=$? + printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +printf "%s\n" "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi + + + + + + + + + + + + + LIBGREPUTILS_LIBDEPS="$gl_libdeps" + + LIBGREPUTILS_LTLIBDEPS="$gl_ltlibdeps" + + LIBTESTS_LIBDEPS="$gltests_libdeps" + + + +# The test suite needs to know if we have a working perl. +# FIXME: this is suboptimal. Ideally, we would be able to call gl_PERL +# with an ACTION-IF-NOT-FOUND argument ... +cu_have_perl=yes +case $PERL in *"/missing "*) cu_have_perl=no;; esac + if test $cu_have_perl = yes; then + HAVE_PERL_TRUE= + HAVE_PERL_FALSE='#' +else + HAVE_PERL_TRUE='#' + HAVE_PERL_FALSE= +fi + + +# Check whether --enable-gcc-warnings was given. +if test ${enable_gcc_warnings+y} +then : + enableval=$enable_gcc_warnings; case $enableval in + yes|no) ;; + *) as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;; + esac + gl_gcc_warnings=$enableval +else + gl_gcc_warnings=no + if test "$GCC" = yes && test -d "$srcdir"/.git; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if ! (6 < __GNUC__ + (2 <= __GNUC_MINOR__)) + #error "--enable-gcc-warnings defaults to 'no' on older GCC" + #endif + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_gcc_warnings=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +fi + + +if test "$gl_gcc_warnings" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +printf %s "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if test ${gl_cv_warn_c__Werror__Wunknown_warning_option+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +printf "%s\n" "$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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 +printf %s "checking whether C compiler handles -Werror... " >&6; } +if test ${gl_cv_warn_c__Werror+y} +then : + printf %s "(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 (void) +{ + + ; + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5 +printf "%s\n" "$gl_cv_warn_c__Werror" >&6; } +if test "x$gl_cv_warn_c__Werror" = xyes +then : + as_fn_append WERROR_CFLAGS " -Werror" +fi + + + + + nw= + # This, $nw, is the list of warnings we disable. + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wstack-protector" # generates false alarms for useful code + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations + nw="$nw -Winline" # streq.h's streq4, streq6 and strcaseeq6 + nw="$nw -Wstrict-overflow" # regexec.c + + + + if test -n "$GCC"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5 +printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; } + if test ${gl_cv_cc_nomfi_supported+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_supported=yes +else + gl_cv_cc_nomfi_supported=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; } + + if test "$gl_cv_cc_nomfi_supported" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5 +printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; } + if test ${gl_cv_cc_nomfi_needed+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_nomfi_needed=no +else + gl_cv_cc_nomfi_needed=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 +printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5 +printf %s "checking whether -Wuninitialized is supported... " >&6; } + if test ${gl_cv_cc_uninitialized_supported+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_uninitialized_supported=yes +else + gl_cv_cc_uninitialized_supported=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 +printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; } + + fi + + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -F -f <( + # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec)) + + gl_manywarn_set= + for gl_manywarn_item in -fno-common \ + -W \ + -Wabi \ + -Waddress \ + -Waggressive-loop-optimizations \ + -Wall \ + -Wattributes \ + -Wbad-function-cast \ + -Wbool-compare \ + -Wbool-operation \ + -Wbuiltin-declaration-mismatch \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wchkp \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ + -Wcpp \ + -Wdangling-else \ + -Wdate-time \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdesignated-init \ + -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wduplicated-branches \ + -Wduplicated-cond \ + -Wduplicate-decl-specifier \ + -Wempty-body \ + -Wendif-labels \ + -Wenum-compare \ + -Wexpansion-to-defined \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-signedness \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wframe-address \ + -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wincompatible-pointer-types \ + -Winit-self \ + -Winline \ + -Wint-conversion \ + -Wint-in-bool-context \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-not-parentheses \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmemset-elt-size \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-include-dirs \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wopenmp-simd \ + -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-compare \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wpsabi \ + -Wrestrict \ + -Wreturn-local-addr \ + -Wreturn-type \ + -Wscalar-storage-order \ + -Wsequence-point \ + -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ + -Wswitch \ + -Wswitch-bool \ + -Wswitch-default \ + -Wswitch-unreachable \ + -Wsync-nand \ + -Wsystem-headers \ + -Wtautological-compare \ + -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: + ptrdiff_max_max=9223372036854775807 + gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" + gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[0-3].* | \ + 'gcc (GCC) '4.[0-7].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + + # Disable specific options as needed. + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + + ws=$gl_manywarn_set + + + gl_warn_set= + set x $ws; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + ws=$gl_warn_set + + for w in $ws; do + +as_gl_Warn=`printf "%s\n" "gl_cv_warn_c_$w" | $as_tr_sh` +gl_positive="$w" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5 +printf %s "checking whether C compiler handles $w... " >&6; } +if eval test \${$as_gl_Warn+y} +then : + printf %s "(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 (void) +{ + + ; + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_gl_Warn"\" = x"yes" +then : + as_fn_append WARN_CFLAGS " $w" +fi + + + done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-missing-field-initializers" >&5 +printf %s "checking whether C compiler handles -Wno-missing-field-initializers... " >&6; } +if test ${gl_cv_warn_c__Wno_missing_field_initializers+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_missing_field_initializers=yes +else + gl_cv_warn_c__Wno_missing_field_initializers=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_missing_field_initializers" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_missing_field_initializers" >&6; } +if test "x$gl_cv_warn_c__Wno_missing_field_initializers" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers" +fi + + # We need this one + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-sign-compare" >&5 +printf %s "checking whether C compiler handles -Wno-sign-compare... " >&6; } +if test ${gl_cv_warn_c__Wno_sign_compare+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_sign_compare=yes +else + gl_cv_warn_c__Wno_sign_compare=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-sign-compare" +fi + + # Too many warnings for now + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-parameter" >&5 +printf %s "checking whether C compiler handles -Wno-unused-parameter... " >&6; } +if test ${gl_cv_warn_c__Wno_unused_parameter+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_unused_parameter=yes +else + gl_cv_warn_c__Wno_unused_parameter=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_unused_parameter" >&6; } +if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-unused-parameter" +fi + + # Too many warnings for now + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-logical-op" >&5 +printf %s "checking whether C compiler handles -Wno-logical-op... " >&6; } +if test ${gl_cv_warn_c__Wno_logical_op+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_logical_op=yes +else + gl_cv_warn_c__Wno_logical_op=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_logical_op" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_logical_op" >&6; } +if test "x$gl_cv_warn_c__Wno_logical_op" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-logical-op" +fi + + + + + + +printf "%s\n" "#define lint 1" >>confdefs.h + + +printf "%s\n" "#define GNULIB_PORTCHECK 1" >>confdefs.h + + + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5 +printf %s "checking whether C compiler handles -Wno-format-nonliteral... " >&6; } +if test ${gl_cv_warn_c__Wno_format_nonliteral+y} +then : + printf %s "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gl_cv_warn_c__Wno_format_nonliteral=yes +else + gl_cv_warn_c__Wno_format_nonliteral=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5 +printf "%s\n" "$gl_cv_warn_c__Wno_format_nonliteral" >&6; } +if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes +then : + as_fn_append WARN_CFLAGS " -Wno-format-nonliteral" +fi + + + + gl_warn_set= + set x $WARN_CFLAGS; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + GNULIB_WARN_CFLAGS=$gl_warn_set + + +fi + +# By default, argmatch should fail calling usage (EXIT_FAILURE). + +printf "%s\n" "#define ARGMATCH_DIE usage (EXIT_FAILURE)" >>confdefs.h + + +printf "%s\n" "#define ARGMATCH_DIE_DECL void usage (int _e)" >>confdefs.h + + +# Autoupdate added the following line to ensure that your configure +# script's behavior did not change. It is probably safe to remove. + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <$ac_hdr> + +int +main (void) +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(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 opendir (); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir +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_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(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 opendir (); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x +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_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +printf %s "checking whether closedir returns void... " >&6; } +if test ${ac_cv_func_closedir_void+y} +then : + printf %s "(cached) " >&6 +else + if test "$cross_compiling" = yes +then : + ac_cv_func_closedir_void=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main (void) +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_func_closedir_void=no +else + ac_cv_func_closedir_void=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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +printf "%s\n" "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +printf "%s\n" "#define CLOSEDIR_VOID 1" >>confdefs.h + +fi + + + + + + + + + + + + + + : + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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" + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +printf %s "checking for CFLocaleCopyCurrent... " >&6; } +if test ${gt_cv_func_CFLocaleCopyCurrent+y} +then : + printf %s "(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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +printf "%s\n" "#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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if eval test \${$gt_func_gnugettext_libc+y} +then : + printf %s "(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 (void) +{ + +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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$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 + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(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 (void) +{ +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 (void) +{ +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(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 (void) +{ +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. */ + { + /* Try standardized names. */ + iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); + /* Try IRIX, OSF/1 names. */ + iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); + /* Try AIX names. */ + iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); + /* Try HP-UX names. */ + iconv_t cd4 = iconv_open ("utf8", "eucJP"); + if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) + && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) + result |= 16; + if (cd1 != (iconv_t)(-1)) + iconv_close (cd1); + if (cd2 != (iconv_t)(-1)) + iconv_close (cd2); + if (cd3 != (iconv_t)(-1)) + iconv_close (cd3); + if (cd4 != (iconv_t)(-1)) + iconv_close (cd4); + } + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$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+y} +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 + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if eval test \${$gt_func_gnugettext_libintl+y} +then : + printf %s "(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 (void) +{ + +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 (void) +{ + +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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$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 + +printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$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 + + +printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + + if test "$ac_use_included_regex" = yes; then + USE_INCLUDED_REGEX_TRUE= + USE_INCLUDED_REGEX_FALSE='#' +else + USE_INCLUDED_REGEX_TRUE='#' + USE_INCLUDED_REGEX_FALSE= +fi + +if test "$ac_use_included_regex" = no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Included lib/regex.c not used" >&5 +printf "%s\n" "$as_me: WARNING: Included lib/regex.c not used" >&2;} +fi + + + # Check whether --enable-perl-regexp was given. +if test ${enable_perl_regexp+y} +then : + enableval=$enable_perl_regexp; case $enableval in + yes|no) test_pcre=$enableval;; + *) as_fn_error $? "invalid value $enableval for --disable-perl-regexp" "$LINENO" 5;; + esac +else + test_pcre=maybe +fi + + + + + use_pcre=no + + if test $test_pcre != no; then + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PCRE" >&5 +printf %s "checking for PCRE... " >&6; } + +if test -n "$PCRE_CFLAGS"; then + pkg_cv_PCRE_CFLAGS="$PCRE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpcre") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCRE_CFLAGS=`$PKG_CONFIG --cflags "libpcre" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PCRE_LIBS"; then + pkg_cv_PCRE_LIBS="$PCRE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpcre") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCRE_LIBS=`$PKG_CONFIG --libs "libpcre" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PCRE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcre" 2>&1` + else + PCRE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcre" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PCRE_PKG_ERRORS" >&5 + + : ${PCRE_LIBS=-lpcre} +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + : ${PCRE_LIBS=-lpcre} +else + PCRE_CFLAGS=$pkg_cv_PCRE_CFLAGS + PCRE_LIBS=$pkg_cv_PCRE_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcre_compile" >&5 +printf %s "checking for pcre_compile... " >&6; } +if test ${pcre_cv_have_pcre_compile+y} +then : + printf %s "(cached) " >&6 +else + pcre_saved_CFLAGS=$CFLAGS + pcre_saved_LIBS=$LIBS + CFLAGS="$CFLAGS $PCRE_CFLAGS" + LIBS="$PCRE_LIBS $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pcre.h> + +int +main (void) +{ +pcre *p = pcre_compile (0, 0, 0, 0, 0); + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + pcre_cv_have_pcre_compile=yes +else + pcre_cv_have_pcre_compile=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$pcre_saved_CFLAGS + LIBS=$pcre_saved_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $pcre_cv_have_pcre_compile" >&5 +printf "%s\n" "$pcre_cv_have_pcre_compile" >&6; } + + if test "$pcre_cv_have_pcre_compile" = yes; then + use_pcre=yes + elif test $test_pcre = maybe; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: GNU grep will be built without pcre support." >&5 +printf "%s\n" "$as_me: WARNING: GNU grep will be built without pcre support." >&2;} + else + as_fn_error $? "pcre support not available" "$LINENO" 5 + fi + fi + + if test $use_pcre = yes; then + +printf "%s\n" "#define HAVE_LIBPCRE 1" >>confdefs.h + + else + PCRE_CFLAGS= + PCRE_LIBS= + fi + + +case $host_os in + mingw*) suffix=w32 ;; + *) suffix=posix ;; +esac +COLORIZE_SOURCE=colorize-$suffix.c + + +ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile tests/Makefile po/Makefile.in doc/Makefile gnulib-tests/Makefile" + +GREP="$ac_abs_top_builddir/src/grep" +EGREP="$ac_abs_top_builddir/src/grep -E" +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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$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+y} || &/ + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$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=`printf "%s\n" "$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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "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 "${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 +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_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_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 +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 +CONFIG_INCLUDE=config.h + +if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDARG_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_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then + as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" 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 + + +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 + + + 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 "${HAVE_PERL_TRUE}" && test -z "${HAVE_PERL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_PERL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_INCLUDED_REGEX_TRUE}" && test -z "${USE_INCLUDED_REGEX_FALSE}"; then + as_fn_error $? "conditional \"USE_INCLUDED_REGEX\" 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" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$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 ${ZSH_VERSION+y} && (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 + + +# The user is always right. +if ${PATH_SEPARATOR+false} :; 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.) +as_nl=' +' +export as_nl +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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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 + printf "%s\n" "$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 \${$as_var+y} \ + && ( (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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$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 || +printf "%s\n" 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=`printf "%s\n" "$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 || +printf "%s\n" 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 grep $as_me 3.1, which was +generated by GNU Autoconf 2.69.185-b502e. 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-grep@gnu.org>. +GNU grep home page: <http://www.gnu.org/software/grep/>. +General help using GNU software: <http://www.gnu.org/gethelp/>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`printf "%s\n" "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +GNU grep config.status 3.1 +configured by $0, generated by GNU Autoconf 2.69.185-b502e, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2017 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 ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$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=`printf "%s\n" "$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 ) + printf "%s\n" "$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 + \printf "%s\n" "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 + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" +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 + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links + test ${CONFIG_COMMANDS+y} || 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=`printf "%s\n" "$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 '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$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 || +printf "%s\n" 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$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@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$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"; } && + { printf "%s\n" "$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 +printf "%s\n" "$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 + { + printf "%s\n" "/* $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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$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 + printf "%s\n" "/* $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 || +printf "%s\n" 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 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +printf "%s\n" "$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) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$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. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "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 ;; + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..032c91b --- /dev/null +++ b/configure.ac @@ -0,0 +1,227 @@ +dnl +dnl autoconf input file for GNU grep +dnl +dnl Copyright (C) 1997-2006, 2009-2017 Free Software Foundation, Inc. +dnl +dnl This file is part of GNU grep. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see <http://www.gnu.org/licenses/>. + +AC_INIT([GNU grep], + m4_esyscmd([build-aux/git-version-gen .tarball-version]), + [bug-grep@gnu.org]) + +# Set the GREP and EGREP variables to a dummy replacement for the 'grep' +# command, so that AC_PROG_GREP and AC_PROG_EGREP don't fail when no good +# 'grep' program is found. This makes it possible to build GNU grep on a +# Solaris machine that has only /usr/bin/grep and no /usr/xpg4/bin/grep. +# This function supports only restricted arguments: +# - No file names as arguments, process only standard input. +# - Only literal strings without backslashes, no regular expressions. +# - The only options are -e and -E (and -Ee). +# This function also does not support long lines beyond what the shell +# supports), and backslash-processes the input. +fn_grep () { + test "$1" = -E && shift + case $@%:@:$1 in + 0:*) AC_MSG_ERROR([fn_grep: expected pattern]) ;; + 1:-*) AC_MSG_ERROR([fn_grep: invalid command line]) ;; + 1:*) pattern=$1 ;; + 2:--|2:-e|2:-Ee) pattern=$2 ;; + *) AC_MSG_ERROR([fn_grep: invalid command line]) ;; + esac + + case $pattern in + [*['].^$\*[']*]) dnl The outer brackets are for M4. + AC_MSG_ERROR([fn_grep: regular expressions not supported]) ;; + esac + + rc=1 + while read line; do + case $line in + *$pattern*) + rc=0 + AS_ECHO([$line]) ;; + esac + done + return $rc +} + +test -n "$GREP" || GREP=fn_grep +test -n "$EGREP" || EGREP=fn_grep +ac_cv_path_EGREP=$EGREP + +AC_CONFIG_AUX_DIR(build-aux) +AC_CONFIG_SRCDIR(src/grep.c) +AC_DEFINE([GREP], 1, [We are building grep]) +AC_PREREQ(2.59) +AC_CONFIG_MACRO_DIRS([m4]) + +dnl Automake stuff. +AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz color-tests parallel-tests + subdir-objects]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. + +AC_CONFIG_HEADERS([config.h:config.hin]) + +dnl Checks for programs. +AC_CANONICAL_HOST +AC_PROG_AWK +AC_PROG_INSTALL +AC_PROG_CC +gl_EARLY +AC_PROG_RANLIB +PKG_PROG_PKG_CONFIG([0.9.0]) + +# grep never invokes mbrtowc or mbrlen on empty input, +# so don't worry about this common bug, +# as working around it would merely slow grep down. +gl_cv_func_mbrtowc_empty_input='assume yes' + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_SIZE_T +AC_C_CONST +gl_INIT + +# The test suite needs to know if we have a working perl. +# FIXME: this is suboptimal. Ideally, we would be able to call gl_PERL +# with an ACTION-IF-NOT-FOUND argument ... +cu_have_perl=yes +case $PERL in *"/missing "*) cu_have_perl=no;; esac +AM_CONDITIONAL([HAVE_PERL], [test $cu_have_perl = yes]) + +AC_ARG_ENABLE([gcc-warnings], + [AS_HELP_STRING([--enable-gcc-warnings], + [turn on lots of GCC warnings (for developers)])], + [case $enableval in + yes|no) ;; + *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;; + esac + gl_gcc_warnings=$enableval], + [gl_gcc_warnings=no + if test "$GCC" = yes && test -d "$srcdir"/.git; then + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #if ! (6 < __GNUC__ + (2 <= __GNUC_MINOR__)) + #error "--enable-gcc-warnings defaults to 'no' on older GCC" + #endif + ]])], + [gl_gcc_warnings=yes]) + fi] +) + +if test "$gl_gcc_warnings" = yes; then + gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) + AC_SUBST([WERROR_CFLAGS]) + + nw= + # This, $nw, is the list of warnings we disable. + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wstack-protector" # generates false alarms for useful code + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations + nw="$nw -Winline" # streq.h's streq4, streq6 and strcaseeq6 + nw="$nw -Wstrict-overflow" # regexec.c + + gl_MANYWARN_ALL_GCC([ws]) + gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) + for w in $ws; do + gl_WARN_ADD([$w]) + done + gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one + gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now + gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c + gl_WARN_ADD([-Wno-logical-op]) + + AC_SUBST([WARN_CFLAGS]) + + AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) + AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) + AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE], + [/* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting glibc 2.15+. */ + #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \ + && defined __OPTIMIZE__ && __OPTIMIZE__) + # define _FORTIFY_SOURCE 2 + #endif + ]) + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + gl_WARN_ADD([-Wno-format-nonliteral]) + gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw]) + AC_SUBST([GNULIB_WARN_CFLAGS]) +fi + +# By default, argmatch should fail calling usage (EXIT_FAILURE). +AC_DEFINE([ARGMATCH_DIE], [usage (EXIT_FAILURE)], + [Define to the function xargmatch calls on failures.]) +AC_DEFINE([ARGMATCH_DIE_DECL], [void usage (int _e)], + [Define to the declaration of the xargmatch failure function.]) + +dnl Checks for header files. +AC_HEADER_STDC +AC_HEADER_DIRENT + +dnl Checks for functions. +AC_FUNC_CLOSEDIR_VOID + +AC_CHECK_FUNCS_ONCE(isascii setlocale) + +dnl I18N feature +AM_GNU_GETTEXT_VERSION([0.18.2]) +AM_GNU_GETTEXT([external]) + +dnl Some installers want to be informed if we do not use our regex. +dnl For example, if the host platform uses dynamic linking and the installer +dnl knows that the grep may be invoked on other hosts with buggy libraries, +dnl then the installer should configure --with-included-regex. +AM_CONDITIONAL([USE_INCLUDED_REGEX], [test "$ac_use_included_regex" = yes]) +if test "$ac_use_included_regex" = no; then + AC_MSG_WARN([Included lib/regex.c not used]) +fi + +gl_FUNC_PCRE + +case $host_os in + mingw*) suffix=w32 ;; + *) suffix=posix ;; +esac +COLORIZE_SOURCE=colorize-$suffix.c +AC_SUBST([COLORIZE_SOURCE]) + +AC_CONFIG_FILES([ + Makefile + lib/Makefile + src/Makefile + tests/Makefile + po/Makefile.in + doc/Makefile + gnulib-tests/Makefile +]) +GREP="$ac_abs_top_builddir/src/grep" +EGREP="$ac_abs_top_builddir/src/grep -E" +AC_OUTPUT diff --git a/dist-check.mk b/dist-check.mk new file mode 100644 index 0000000..f23339e --- /dev/null +++ b/dist-check.mk @@ -0,0 +1,198 @@ +# Most of this is probably too coreutils-centric to be useful to other packages. + +bin=bin-$$$$ + +write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)' + +tmpdir = $(abs_top_builddir)/tests/torture + +t=$(tmpdir)/$(PACKAGE)/test +pfx=$(t)/i + +built_programs = \ + $$(echo 'spy:;@echo $$(bin_PROGRAMS)' \ + | MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy \ + | fmt -1 | sed 's,$(EXEEXT)$$,,' | sort -u) + +# More than once, tainted build and source directory names would +# have caused at least one "make check" test to apply "chmod 700" +# to all directories under $HOME. Make sure it doesn't happen again. +tp = $(tmpdir)/taint +t_prefix = $(tp)/a +t_taint = '$(t_prefix) b' +fake_home = $(tp)/home + +# When extracting from a distribution tarball, extract using the fastest +# method possible. With dist-xz, that means using the *.xz file. +ifneq ('', $(filter *.xz, $(DIST_ARCHIVES))) + tar_decompress_opt_ = J + suffix_ = xz +else + ifneq ('', $(filter *.gz, $(DIST_ARCHIVES))) + tar_decompress_opt_ = z + suffix_ = gz + else + tar_decompress_opt_ = j + suffix_ = bz2 + endif +endif +amtar_extract_ = $(AMTAR) -$(tar_decompress_opt_)xf +preferred_tarball_ = $(distdir).tar.$(suffix_) + +# Ensure that tests run from tainted build and src dir names work, +# and don't affect anything in $HOME. Create witness files in $HOME, +# record their attributes, and build/test. Then ensure that the +# witnesses were not affected. +# Skip this test when using libtool, since libtool-generated scripts +# cannot deal with a space-tainted srcdir. +ALL_RECURSIVE_TARGETS += taint-distcheck +taint-distcheck: $(DIST_ARCHIVES) + grep '^[ ]*LT_INIT' configure.ac >/dev/null && exit 0 || : + test -d $(t_taint) && chmod -R 700 $(t_taint) || : + -rm -rf $(t_taint) $(fake_home) + mkdir -p $(t_prefix) $(t_taint) $(fake_home) + $(amtar_extract_) $(preferred_tarball_) -C $(t_taint) + mkfifo $(fake_home)/fifo + touch $(fake_home)/f + mkdir -p $(fake_home)/d/e + ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before + HOME=$(fake_home); export HOME; \ + cd $(t_taint)/$(distdir) \ + && ./configure \ + && $(MAKE) \ + && $(MAKE) check \ + && ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \ + && diff $(tp)/.ls-before $(tp)/.ls-after \ + && test -d $(t_prefix) + rm -rf $(tp) + +# Verify that a twisted use of --program-transform-name=PROGRAM works. +define install-transform-check + echo running install-transform-check \ + && rm -rf $(pfx) \ + && $(MAKE) program_transform_name='s/.*/zyx/' \ + prefix=$(pfx) install \ + && test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \ + && test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx" +endef + +# Install, then verify that all binaries and man pages are in place. +# Note that neither the binary, ginstall, nor the [.1 man page is installed. +define my-instcheck + echo running my-instcheck; \ + $(MAKE) prefix=$(pfx) install \ + && test ! -f $(pfx)/bin/ginstall \ + && { fail=0; \ + for i in $(built_programs); do \ + test "$$i" = ginstall && i=install; \ + for j in "$(pfx)/bin/$$i" \ + "$(pfx)/share/man/man1/$$i.1"; do \ + case $$j in *'[.1') continue;; esac; \ + test -f "$$j" && : \ + || { echo "$$j not installed"; fail=1; }; \ + done; \ + done; \ + test $$fail = 1 && exit 1 || :; \ + } +endef + +# The hard-linking for-loop below ensures that there is a bin/ directory +# full of all of the programs under test (except the ones that are required +# for basic Makefile rules), all symlinked to the just-built "false" program. +# This is to ensure that if ever a test neglects to make PATH include +# the build srcdir, these always-failing programs will run. +# Otherwise, it is too easy to test the wrong programs. +# Note that "false" itself is a symlink to true, so it too will malfunction. +define coreutils-path-check + { \ + echo running coreutils-path-check; \ + if test -f $(srcdir)/src/true.c; then \ + fail=1; \ + mkdir $(bin) \ + && ($(write_loser)) > $(bin)/loser \ + && chmod a+x $(bin)/loser \ + && for i in $(built_programs); do \ + case $$i in \ + rm|expr|basename|echo|sort|ls|tr);; \ + cat|dirname|mv|wc);; \ + *) ln $(bin)/loser $(bin)/$$i;; \ + esac; \ + done \ + && ln -sf ../src/true $(bin)/false \ + && PATH=`pwd`/$(bin)$(PATH_SEPARATOR)$$PATH \ + $(MAKE) -C tests check \ + && { test -d gnulib-tests \ + && $(MAKE) -C gnulib-tests check \ + || :; } \ + && rm -rf $(bin) \ + && fail=0; \ + else \ + fail=0; \ + fi; \ + test $$fail = 1 && exit 1 || :; \ + } +endef + +# More generic version of the rule above. +define generic-path-check + { \ + echo running generic-path-check; \ + if test -f /bin/false; then \ + fail=1; \ + mkdir $(bin) \ + && ($(write_loser)) > $(bin)/loser \ + && chmod a+x $(bin)/loser \ + && for i in $(built_programs); do \ + ln $(bin)/loser $(bin)/$$i; \ + done \ + && PATH=`pwd`/$(bin)$(PATH_SEPARATOR)$$PATH \ + $(MAKE) check \ + && { test -d gnulib-tests \ + && $(MAKE) -C gnulib-tests check \ + || :; } \ + && rm -rf $(bin) \ + && fail=0; \ + else \ + fail=0; \ + fi; \ + test $$fail = 1 && exit 1 || :; \ + } +endef + +# Use this to make sure we don't run these programs when building +# from a virgin compressed tarball file, below. +null_AM_MAKEFLAGS ?= \ + ACLOCAL=false \ + AUTOCONF=false \ + AUTOMAKE=false \ + AUTOHEADER=false \ + GPERF=false \ + MAKEINFO=false + +ALL_RECURSIVE_TARGETS += my-distcheck +my-distcheck: $(DIST_ARCHIVES) $(local-check) + $(MAKE) syntax-check + $(MAKE) check + -rm -rf $(t) + mkdir -p $(t) + $(amtar_extract_) $(preferred_tarball_) -C $(t) + (set -e; cd $(t)/$(distdir); \ + ./configure --quiet --enable-gcc-warnings --disable-nls; \ + $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)'; \ + $(MAKE) dvi; \ + $(install-transform-check); \ + $(my-instcheck); \ + $(coreutils-path-check); \ + $(generic-path-check); \ + $(MAKE) distclean \ + ) + (cd $(t) && mv $(distdir) $(distdir).old \ + && $(amtar_extract_) - ) < $(preferred_tarball_) + find $(t)/$(distdir).old $(t)/$(distdir) -name .deps | xargs rmdir + diff -ur $(t)/$(distdir).old $(t)/$(distdir) + -rm -rf $(t) + rmdir $(tmpdir)/$(PACKAGE) $(tmpdir) + @echo "========================"; \ + echo "ready for distribution:"; \ + for i in $(DIST_ARCHIVES); do echo " $$i"; done; \ + echo "========================" diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..a4aae4a --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,38 @@ +# Process this file with automake to create Makefile.in +# Makefile.am for grep/doc. +# +# Copyright 2008-2017 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/>. + +info_TEXINFOS = grep.texi +grep_TEXINFOS = fdl.texi + +man_MANS = grep.1 fgrep.1 egrep.1 + +EXTRA_DIST = grep.in.1 +CLEANFILES = grep.1 egrep.1 fgrep.1 + +grep.1: grep.in.1 + $(AM_V_GEN)rm -f $@-t $@ + $(AM_V_at)sed 's/@''VERSION@/$(VERSION)/' $(srcdir)/grep.in.1 > $@-t + $(AM_V_at)chmod a=r $@-t + $(AM_V_at)mv -f $@-t $@ + +egrep.1 fgrep.1: Makefile.am + $(AM_V_GEN)rm -f $@-t $@ + $(AM_V_at)inst=`echo grep | sed '$(transform)'`.1 \ + && echo ".so man1/$$inst" > $@-t + $(AM_V_at)chmod a=r $@-t + $(AM_V_at)mv -f $@-t $@ diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..cba88c4 --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,1694 @@ +# Makefile.in generated by automake 1.99a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2015 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@ + +# Process this file with automake to create Makefile.in +# Makefile.am for grep/doc. +# +# Copyright 2008-2017 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/>. +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@ +subdir = doc +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/assert.m4 $(top_srcdir)/m4/btowc.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 \ + $(top_srcdir)/m4/chdir-long.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \ + $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/configmake.m4 \ + $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/cycle-check.m4 \ + $(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \ + $(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \ + $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \ + $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.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/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \ + $(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/i-ring.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconv_h.m4 \ + $(top_srcdir)/m4/iconv_open.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/isatty.m4 $(top_srcdir)/m4/isblank.m4 \ + $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswctype.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lcmessage.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/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ + $(top_srcdir)/m4/localename.m4 $(top_srcdir)/m4/lock.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \ + $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \ + $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ + $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ + $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ + $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \ + $(top_srcdir)/m4/minmax.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/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \ + $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/onceonly.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \ + $(top_srcdir)/m4/opendir.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/pcre.m4 $(top_srcdir)/m4/perl.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \ + $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/read.m4 \ + $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \ + $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/safe-read.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/setenv.m4 \ + $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stat.m4 $(top_srcdir)/m4/std-gnu11.m4 \ + $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.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/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strstr.m4 \ + $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtoll.m4 \ + $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ + $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_types_h.m4 \ + $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/time_h.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/version-etc.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/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctomb.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/xstrtol.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \ + $(srcdir)/stamp-vti $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = +SOURCES = +DIST_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)/grep.info +TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux +DVIS = grep.dvi +PDFS = grep.pdf +PSS = grep.ps +HTMLS = grep.html +TEXINFOS = grep.texi +TEXI2DVI = texi2dvi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" +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; }; \ + } +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(grep_TEXINFOS) $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/mdate-sh \ + $(top_srcdir)/build-aux/texinfo.tex +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +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@ +COLORIZE_SOURCE = @COLORIZE_SOURCE@ +CONFIG_INCLUDE = @CONFIG_INCLUDE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +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@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@ +GNULIB_CTIME = @GNULIB_CTIME@ +GNULIB_DIRFD = @GNULIB_DIRFD@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ +GNULIB_DUP = @GNULIB_DUP@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +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_FDOPENDIR = @GNULIB_FDOPENDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFSL = @GNULIB_FFSL@ +GNULIB_FFSLL = @GNULIB_FFSLL@ +GNULIB_FGETC = @GNULIB_FGETC@ +GNULIB_FGETS = @GNULIB_FGETS@ +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_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_ICONV = @GNULIB_ICONV@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISBLANK = @GNULIB_ISBLANK@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ +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_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +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_OPENDIR = @GNULIB_OPENDIR@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ +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_PREAD = @GNULIB_PREAD@ +GNULIB_PRINTF = @GNULIB_PRINTF@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +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_RANDOM = @GNULIB_RANDOM@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ +GNULIB_READ = @GNULIB_READ@ +GNULIB_READDIR = @GNULIB_READDIR@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_REALPATH = @GNULIB_REALPATH@ +GNULIB_REMOVE = @GNULIB_REMOVE@ +GNULIB_RENAME = @GNULIB_RENAME@ +GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ +GNULIB_REWINDDIR = @GNULIB_REWINDDIR@ +GNULIB_RMDIR = @GNULIB_RMDIR@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANDIR = @GNULIB_SCANDIR@ +GNULIB_SCANF = @GNULIB_SCANF@ +GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +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_STRFTIME = @GNULIB_STRFTIME@ +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_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ +GNULIB_TMPFILE = @GNULIB_TMPFILE@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ +GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ +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_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ +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_WCSFTIME = @GNULIB_WCSFTIME@ +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_ALPHASORT = @HAVE_ALPHASORT@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_CLOSEDIR = @HAVE_CLOSEDIR@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +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 = @HAVE_DECL_GETLOGIN@ +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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +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_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_DIRENT_H = @HAVE_DIRENT_H@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +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_FDOPENDIR = @HAVE_FDOPENDIR@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +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_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_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISBLANK = @HAVE_ISBLANK@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +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_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OPENDIR = @HAVE_OPENDIR@ +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_PREAD = @HAVE_PREAD@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READDIR = @HAVE_READDIR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_REWINDDIR = @HAVE_REWINDDIR@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCANDIR = @HAVE_SCANDIR@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +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_SLEEP = @HAVE_SLEEP@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_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_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ +HAVE_TZSET = @HAVE_TZSET@ +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_WCSFTIME = @HAVE_WCSFTIME@ +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_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ +ICONV_CONST = @ICONV_CONST@ +ICONV_H = @ICONV_H@ +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@ +LDFLAGS = @LDFLAGS@ +LIBGREPUTILS_LIBDEPS = @LIBGREPUTILS_LIBDEPS@ +LIBGREPUTILS_LTLIBDEPS = @LIBGREPUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMULTITHREAD = @LIBMULTITHREAD@ +LIBOBJS = @LIBOBJS@ +LIBPTH = @LIBPTH@ +LIBPTH_PREFIX = @LIBPTH_PREFIX@ +LIBS = @LIBS@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ +LIBTHREAD = @LIBTHREAD@ +LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ +LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ +LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIMITS_H = @LIMITS_H@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBPTH = @LTLIBPTH@ +LTLIBTHREAD = @LTLIBTHREAD@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ +NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@ +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_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_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_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_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_CTYPE_H = @NEXT_CTYPE_H@ +NEXT_DIRENT_H = @NEXT_DIRENT_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_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_STDARG_H = @NEXT_STDARG_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_TYPES_H = @NEXT_SYS_TYPES_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_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CFLAGS = @PCRE_CFLAGS@ +PCRE_LIBS = @PCRE_LIBS@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +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_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DIRFD = @REPLACE_DIRFD@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +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_GMTIME = @REPLACE_GMTIME@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +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_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_OPENDIR = @REPLACE_OPENDIR@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +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_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_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +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_STRFTIME = @REPLACE_STRFTIME@ +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_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +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_WCSFTIME = @REPLACE_WCSFTIME@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDALIGN_H = @STDALIGN_H@ +STDARG_H = @STDARG_H@ +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@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_aux_dir = @abs_aux_dir@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__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@ +info_TEXINFOS = grep.texi +grep_TEXINFOS = fdl.texi +man_MANS = grep.1 fgrep.1 egrep.1 +EXTRA_DIST = grep.in.1 +CLEANFILES = grep.1 egrep.1 fgrep.1 +all: all-am + +.SUFFIXES: +.SUFFIXES: .dvi .html .info .pdf .ps .texi +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +.texi.info: + $(AM_V_MAKEINFO)$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ + -I $(srcdir) --no-split -o $@-t \ + $< + $(AM_V_at)mv -f $@-t $@ + +.texi.dvi: + $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ + $< + +.texi.pdf: + $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ + $< + +.texi.html: + $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) + $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ + else \ + rm -rf $(@:.html=.htp); exit 1; \ + fi +$(srcdir)/grep.info: grep.texi $(srcdir)/version.texi $(grep_TEXINFOS) +grep.dvi: grep.texi $(srcdir)/version.texi $(grep_TEXINFOS) +grep.pdf: grep.texi $(srcdir)/version.texi $(grep_TEXINFOS) +grep.html: grep.texi $(srcdir)/version.texi $(grep_TEXINFOS) +$(srcdir)/version.texi: $(srcdir)/stamp-vti +$(srcdir)/stamp-vti: grep.texi $(top_srcdir)/configure + @(dir=.; test -f ./grep.texi || dir=$(srcdir); \ + set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/grep.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)/version.texi \ + || (echo "Updating $(srcdir)/version.texi" && \ + cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \ + mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \ + rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$ + @cp $(srcdir)/version.texi $@ + +mostlyclean-vti: + -rm -f vti.tmp* $(srcdir)/version.texi.tmp* + +maintainer-clean-vti: + -rm -f $(srcdir)/stamp-vti $(srcdir)/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|^.*/||'`; \ + (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile"; \ + rm -f $$relfile; \ + 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 \ + file=./$$base; \ + else \ + file=$(srcdir)/$$base; \ + fi; \ + if test -f $$file && test ! -f "$(distdir)/$$base"; then \ + cp -p $$file "$(distdir)/$$base"; \ + fi; \ + done + +mostlyclean-aminfo: + -rm -rf grep.t2d grep.t2p + +clean-aminfo: + -test -z "grep.dvi grep.pdf grep.ps grep.html" \ + || rm -rf grep.dvi grep.pdf grep.ps grep.html + +maintainer-clean-aminfo: + -test -z "$(INFO_DEPS)" || rm -f $(INFO_DEPS) +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-info +check-am: all-am +check: check-am +all-am: Makefile $(INFO_DEPS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -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) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-aminfo clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: $(DVIS) + +html: html-am + +html-am: $(HTMLS) + +info: info-am + +info-am: $(INFO_DEPS) + +install-data-am: install-info-am install-man + +install-dvi: install-dvi-am + +install-dvi-am: $(DVIS) + @$(NORMAL_INSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ + done +install-exec-am: + +install-html: install-html-am + +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-am + +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 \ + echo ./$$file; \ + else \ + echo $(srcdir)/$$file; \ + fi; \ + 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-am + +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-am + +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: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti + +pdf: pdf-am + +pdf-am: $(PDFS) + +ps: ps-am + +ps-am: $(PSS) + +uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-man uninstall-pdf-am uninstall-ps-am + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-aminfo clean-generic \ + cscopelist-am ctags-am dist-info distclean distclean-generic \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti mostlyclean \ + mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-man uninstall-man1 uninstall-pdf-am uninstall-ps-am + +.PRECIOUS: Makefile + + +grep.1: grep.in.1 + $(AM_V_GEN)rm -f $@-t $@ + $(AM_V_at)sed 's/@''VERSION@/$(VERSION)/' $(srcdir)/grep.in.1 > $@-t + $(AM_V_at)chmod a=r $@-t + $(AM_V_at)mv -f $@-t $@ + +egrep.1 fgrep.1: Makefile.am + $(AM_V_GEN)rm -f $@-t $@ + $(AM_V_at)inst=`echo grep | sed '$(transform)'`.1 \ + && echo ".so man1/$$inst" > $@-t + $(AM_V_at)chmod a=r $@-t + $(AM_V_at)mv -f $@-t $@ + +# 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/doc/fdl.texi b/doc/fdl.texi new file mode 100644 index 0000000..9c3bbe5 --- /dev/null +++ b/doc/fdl.texi @@ -0,0 +1,505 @@ +@c The GNU Free Documentation License. +@center Version 1.3, 3 November 2008 + +@c This file is intended to be included within another document, +@c hence no sectioning command or @node. + +@display +Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. +@uref{http://fsf.org/} + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, La@TeX{} input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG@. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The ``publisher'' means any person or entity that distributes copies +of the Document to the public. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +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, receipt of a copy of some or all of the same material does +not give you any rights to use it. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation 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. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +@item +RELICENSING + +``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the +site means any set of copyrightable works thus published on the MMC +site. + +``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +``Incorporate'' means to publish or republish a Document, in whole or +in part, as part of another Document. + +An MMC is ``eligible for relicensing'' if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + +@end enumerate + +@page +@heading ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with@dots{}Texts.''@: line with this: + +@smallexample +@group + with the Invariant Sections being @var{list their titles}, with + the Front-Cover Texts being @var{list}, and with the Back-Cover Texts + being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@c Local Variables: +@c ispell-local-pdict: "ispell-dict" +@c End: diff --git a/doc/grep.in.1 b/doc/grep.in.1 new file mode 100644 index 0000000..40c9586 --- /dev/null +++ b/doc/grep.in.1 @@ -0,0 +1,1215 @@ +.\" GNU grep man page +.if !\n(.g \{\ +. if !\w|\*(lq| \{\ +. ds lq `` +. if \w'\(lq' .ds lq "\(lq +. \} +. if !\w|\*(rq| \{\ +. ds rq '' +. if \w'\(rq' .ds rq "\(rq +. \} +.\} +. +.ie \n[.g] .mso www.tmac +.el \{\ +. de MTO +\\$2 \(laemail: \\$1 \(ra\\$3 +.. +. de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.\} +. +.TH GREP 1 \*(Dt "GNU grep @VERSION@" "User Commands" +.hy 0 +. +.SH NAME +grep, egrep, fgrep \- print lines matching a pattern +. +.SH SYNOPSIS +.B grep +.RI [ OPTIONS ] +.I PATTERN +.RI [ FILE .\|.\|.] +.br +.B grep +.RI [ OPTIONS ] +.B \-e +.I PATTERN +\&.\|.\|.\& +.RI [ FILE .\|.\|.] +.br +.B grep +.RI [ OPTIONS ] +.B \-f +.I FILE +\&.\|.\|.\& +.RI [ FILE .\|.\|.] +. +.SH DESCRIPTION +.B grep +searches for +.I PATTERN +in each +.IR FILE . +A +.I FILE +of +.RB "\*(lq" \- "\*(rq" +stands for standard input. +If no +.I FILE +is given, recursive searches examine the working directory, +and nonrecursive searches read standard input. +By default, +.B grep +prints the matching lines. +.PP +In addition, the variant programs +.B egrep +and +.B fgrep +are the same as +.B "grep\ \-E" +and +.BR "grep\ \-F" , +respectively. +These variants are deprecated, but are provided for backward compatibility. +. +.SH OPTIONS +.SS "Generic Program Information" +.TP +.B \-\^\-help +Output a usage message and exit. +.TP +.BR \-V ", " \-\^\-version +Output the version number of +.B grep +and exit. +.SS "Matcher Selection" +.TP +.BR \-E ", " \-\^\-extended\-regexp +Interpret +.I PATTERN +as an extended regular expression (ERE, see below). +.TP +.BR \-F ", " \-\^\-fixed\-strings +Interpret +.I PATTERN +as a list of fixed strings (instead of regular expressions), +separated by newlines, +any of which is to be matched. +.TP +.BR \-G ", " \-\^\-basic\-regexp +Interpret +.I PATTERN +as a basic regular expression (BRE, see below). +This is the default. +.TP +.BR \-P ", " \-\^\-perl\-regexp +Interpret the pattern as a Perl-compatible regular expression (PCRE). +This is experimental and +.B "grep \-P" +may warn of unimplemented features. +.SS "Matching Control" +.TP +.BI \-e " PATTERN" "\fR,\fP \-\^\-regexp=" PATTERN +Use +.I PATTERN +as the pattern. +If this option is used multiple times or is combined with the +.B \-f +.RB ( \-\-file ) +option, search for all patterns given. +This option can be used to protect a pattern beginning with \*(lq\-\*(rq. +.TP +.BI \-f " FILE" "\fR,\fP \-\^\-file=" FILE +Obtain patterns from +.IR FILE , +one per line. +If this option is used multiple times or is combined with the +.B \-e +.RB ( \-\-regexp ) +option, search for all patterns given. +The empty file contains zero patterns, and therefore matches nothing. +.TP +.BR \-i ", " \-\^\-ignore\-case +Ignore case distinctions, so that characters that differ only in case +match each other. +.TP +.BR \-v ", " \-\^\-invert\-match +Invert the sense of matching, to select non-matching lines. +.TP +.BR \-w ", " \-\^\-word\-regexp +Select only those lines containing matches that form whole words. +The test is that the matching substring must either be at the +beginning of the line, or preceded by a non-word constituent +character. +Similarly, it must be either at the end of the line +or followed by a non-word constituent character. +Word-constituent characters are letters, digits, and the underscore. +This option has no effect if +.B \-x +is also specified. +.TP +.BR \-x ", " \-\^\-line\-regexp +Select only those matches that exactly match the whole line. +For a regular expression pattern, this is like parenthesizing the +pattern and then surrounding it with +.B ^ +and +.BR $ . +.TP +.B \-y +Obsolete synonym for +.BR \-i . +.SS "General Output Control" +.TP +.BR \-c ", " \-\^\-count +Suppress normal output; instead print a count of +matching lines for each input file. +With the +.BR \-v ", " \-\^\-invert\-match +option (see below), count non-matching lines. +.TP +.BR \-\^\-color [ =\fIWHEN\fP "], " \-\^\-colour [ =\fIWHEN\fP ] +Surround the matched (non-empty) strings, matching lines, context lines, +file names, line numbers, byte offsets, and separators (for fields and +groups of context lines) with escape sequences to display them in color +on the terminal. +The colors are defined by the environment variable +.BR GREP_COLORS . +The deprecated environment variable +.B GREP_COLOR +is still supported, but its setting does not have priority. +.I WHEN +is +.BR never ", " always ", or " auto . +.TP +.BR \-L ", " \-\^\-files\-without\-match +Suppress normal output; instead print the name +of each input file from which no output would +normally have been printed. +The scanning will stop on the first match. +.TP +.BR \-l ", " \-\^\-files\-with\-matches +Suppress normal output; instead print +the name of each input file from which output +would normally have been printed. +The scanning will stop on the first match. +.TP +.BI \-m " NUM" "\fR,\fP \-\^\-max\-count=" NUM +Stop reading a file after +.I NUM +matching lines. +If the input is standard input from a regular file, +and +.I NUM +matching lines are output, +.B grep +ensures that the standard input is positioned to just after the last +matching line before exiting, regardless of the presence of trailing +context lines. +This enables a calling process to resume a search. +When +.B grep +stops after +.I NUM +matching lines, it outputs any trailing context lines. +When the +.B \-c +or +.B \-\^\-count +option is also used, +.B grep +does not output a count greater than +.IR NUM . +When the +.B \-v +or +.B \-\^\-invert\-match +option is also used, +.B grep +stops after outputting +.I NUM +non-matching lines. +.TP +.BR \-o ", " \-\^\-only\-matching +Print only the matched (non-empty) parts of a matching line, +with each such part on a separate output line. +.TP +.BR \-q ", " \-\^\-quiet ", " \-\^\-silent +Quiet; do not write anything to standard output. +Exit immediately with zero status if any match is found, +even if an error was detected. +Also see the +.B \-s +or +.B \-\^\-no\-messages +option. +.TP +.BR \-s ", " \-\^\-no\-messages +Suppress error messages about nonexistent or unreadable files. +.SS "Output Line Prefix Control" +.TP +.BR \-b ", " \-\^\-byte\-offset +Print the 0-based byte offset within the input file +before each line of output. +If +.B \-o +.RB ( \-\^\-only\-matching ) +is specified, +print the offset of the matching part itself. +.TP +.BR \-H ", " \-\^\-with\-filename +Print the file name for each match. +This is the default when there is more than one file to search. +.TP +.BR \-h ", " \-\^\-no\-filename +Suppress the prefixing of file names on output. +This is the default when there is only one file +(or only standard input) to search. +.TP +.BI \-\^\-label= LABEL +Display input actually coming from standard input as input coming from file +.IR LABEL . +This is especially useful when implementing tools like +.BR zgrep , +e.g., +.BR "gzip -cd foo.gz | grep --label=foo -H something" . +See also the +.B \-H +option. +.TP +.BR \-n ", " \-\^\-line\-number +Prefix each line of output with the 1-based line number +within its input file. +.TP +.BR \-T ", " \-\^\-initial\-tab +Make sure that the first character of actual line content lies on a +tab stop, so that the alignment of tabs looks normal. +This is useful with options that prefix their output to the actual content: +.BR \-H , \-n , +and +.BR \-b . +In order to improve the probability that lines +from a single file will all start at the same column, +this also causes the line number and byte offset (if present) +to be printed in a minimum size field width. +.TP +.BR \-u ", " \-\^\-unix\-byte\-offsets +Report Unix-style byte offsets. +This switch causes +.B grep +to report byte offsets as if the file were a Unix-style text file, +i.e., with CR characters stripped off. +This will produce results identical to running +.B grep +on a Unix machine. +This option has no effect unless +.B \-b +option is also used; +it has no effect on platforms other than MS-DOS and MS-Windows. +.TP +.BR \-Z ", " \-\^\-null +Output a zero byte (the ASCII +.B NUL +character) instead of the character that normally follows a file name. +For example, +.B "grep \-lZ" +outputs a zero byte after each file name instead of the usual newline. +This option makes the output unambiguous, even in the presence of file +names containing unusual characters like newlines. +This option can be used with commands like +.BR "find \-print0" , +.BR "perl \-0" , +.BR "sort \-z" , +and +.B "xargs \-0" +to process arbitrary file names, +even those that contain newline characters. +.SS "Context Line Control" +.TP +.BI \-A " NUM" "\fR,\fP \-\^\-after\-context=" NUM +Print +.I NUM +lines of trailing context after matching lines. +Places a line containing a group separator +.RB ( \-\^\- ) +between contiguous groups of matches. +With the +.B \-o +or +.B \-\^\-only\-matching +option, this has no effect and a warning is given. +.TP +.BI \-B " NUM" "\fR,\fP \-\^\-before\-context=" NUM +Print +.I NUM +lines of leading context before matching lines. +Places a line containing a group separator +.RB ( \-\^\- ) +between contiguous groups of matches. +With the +.B \-o +or +.B \-\^\-only\-matching +option, this has no effect and a warning is given. +.TP +.BI \-C " NUM" "\fR,\fP \-" NUM "\fR,\fP \-\^\-context=" NUM +Print +.I NUM +lines of output context. +Places a line containing a group separator +.RB ( \-\^\- ) +between contiguous groups of matches. +With the +.B \-o +or +.B \-\^\-only\-matching +option, this has no effect and a warning is given. +.SS "File and Directory Selection" +.TP +.BR \-a ", " \-\^\-text +Process a binary file as if it were text; this is equivalent to the +.B \-\^\-binary\-files=text +option. +.TP +.BI \-\^\-binary\-files= TYPE +If a file's data or metadata +indicate that the file contains binary data, +assume that the file is of type +.IR TYPE . +Non-text bytes indicate binary data; these are either output bytes that are +improperly encoded for the current locale, or null input bytes when the +.B \-z +option is not given. +.IP +By default, +.I TYPE +is +.BR binary , +and when +.B grep +discovers that a file is binary it suppresses any further output, and +instead outputs either a one-line message saying that a binary file +matches, or no message if there is no match. +.IP +If +.I TYPE +is +.BR without-match , +when +.B grep +discovers that a file is binary it assumes that the rest of the file +does not match; this is equivalent to the +.B \-I +option. +.IP +If +.I TYPE +is +.BR text , +.B grep +processes a binary file as if it were text; this is equivalent to the +.B \-a +option. +.IP +When +.I type +is +.BR binary , +.B grep +may treat non-text bytes as line terminators even without the +.B \-z +option. This means choosing +.B binary +versus +.B text +can affect whether a pattern matches a file. For +example, when +.I type +is +.B binary +the pattern +.B q$ might +match +.B q +immediately followed by a null byte, even though this +is not matched when +.I type +is +.BR text . +Conversely, when +.I type +is +.B binary +the pattern +.B .\& +(period) might not match a null byte. +.IP +.I Warning: +The +.B \-a +option might output binary garbage, +which can have nasty side effects if the output is a terminal and if the +terminal driver interprets some of it as commands. +On the other hand, when reading files whose text encodings are +unknown, it can be helpful to use +.B \-a +or to set +.B LC_ALL='C' +in the environment, in order to find more matches even if the matches +are unsafe for direct display. +.TP +.BI \-D " ACTION" "\fR,\fP \-\^\-devices=" ACTION +If an input file is a device, FIFO or socket, use +.I ACTION +to process it. +By default, +.I ACTION +is +.BR read , +which means that devices are read just as if they were ordinary files. +If +.I ACTION +is +.BR skip , +devices are silently skipped. +.TP +.BI \-d " ACTION" "\fR,\fP \-\^\-directories=" ACTION +If an input file is a directory, use +.I ACTION +to process it. +By default, +.I ACTION +is +.BR read , +i.e., read directories just as if they were ordinary files. +If +.I ACTION +is +.BR skip , +silently skip directories. +If +.I ACTION +is +.BR recurse , +read all files under each directory, recursively, +following symbolic links only if they are on the command line. +This is equivalent to the +.B \-r +option. +.TP +.BI \-\^\-exclude= GLOB +Skip any command-line file with a name suffix that matches the pattern +.IR GLOB , +using wildcard matching; a name suffix is either the whole +name, or any suffix starting after a +.B / +and before a +non-\fB/\fP. +When searching recursively, skip any subfile whose base name matches +.IR GLOB ; +the base name is the part after the last +.BR / . +A pattern can use +.BR * , +.BR ? , +and +.BR [ ... ] +as wildcards, and +.B \e +to quote a wildcard or backslash character literally. +.TP +.BI \-\^\-exclude-from= FILE +Skip files whose base name matches any of the file-name globs read from +.I FILE +(using wildcard matching as described under +.BR \-\^\-exclude ). +.TP +.BI \-\^\-exclude-dir= GLOB +Skip any command-line directory with a name suffix that matches the +pattern +.IR GLOB . +When searching recursively, skip any subdirectory +whose base name matches +.IR GLOB . +Ignore any redundant trailing slashes in +.IR GLOB . +.TP +.BR \-I +Process a binary file as if it did not contain matching data; this is +equivalent to the +.B \-\^\-binary\-files=without-match +option. +.TP +.BI \-\^\-include= GLOB +Search only files whose base name matches +.I GLOB +(using wildcard matching as described under +.BR \-\^\-exclude ). +.TP +.BR \-r ", " \-\^\-recursive +Read all files under each directory, recursively, +following symbolic links only if they are on the command line. +Note that if no file operand is given, grep searches the working directory. +This is equivalent to the +.B "\-d recurse" +option. +.TP +.BR \-R ", " \-\^\-dereference\-recursive +Read all files under each directory, recursively. +Follow all symbolic links, unlike +.BR \-r . +.SS "Other Options" +.TP +.BR \-\^\-line\-buffered +Use line buffering on output. +This can cause a performance penalty. +.TP +.BR \-U ", " \-\^\-binary +Treat the file(s) as binary. +By default, under MS-DOS and MS-Windows, +.BR grep +guesses whether a file is text or binary as described for the +.B \-\^\-binary\-files +option. +If +.BR grep +decides the file is a text file, it strips the CR characters from the +original file contents (to make regular expressions with +.B ^ +and +.B $ +work correctly). +Specifying +.B \-U +overrules this guesswork, causing all files to be read and passed to the +matching mechanism verbatim; if the file is a text file with CR/LF +pairs at the end of each line, this will cause some regular +expressions to fail. +This option has no effect on platforms +other than MS-DOS and MS-Windows. +.TP +.BR \-z ", " \-\^\-null\-data +Treat input and output data as sequences of lines, each terminated by +a zero byte (the ASCII NUL character) instead of a newline. +Like the +.B \-Z +or +.B \-\^\-null +option, this option can be used with commands like +.B sort -z +to process arbitrary file names. +. +.SH "REGULAR EXPRESSIONS" +A regular expression is a pattern that describes a set of strings. +Regular expressions are constructed analogously to arithmetic +expressions, by using various operators to combine smaller expressions. +.PP +.B grep +understands three different versions of regular expression syntax: +\*(lqbasic\*(rq (BRE), \*(lqextended\*(rq (ERE) and \*(lqperl\*(rq (PCRE). +In GNU +.B grep +there is no difference in available functionality between basic and +extended syntaxes. +In other implementations, basic regular expressions are less powerful. +The following description applies to extended regular expressions; +differences for basic regular expressions are summarized afterwards. +Perl-compatible regular expressions give additional functionality, and are +documented in pcresyntax(3) and pcrepattern(3), but work only if +PCRE is available in the system. +.PP +The fundamental building blocks are the regular expressions +that match a single character. +Most characters, including all letters and digits, +are regular expressions that match themselves. +Any meta-character with special meaning +may be quoted by preceding it with a backslash. +.PP +The period +.B .\& +matches any single character. +.SS "Character Classes and Bracket Expressions" +A +.I "bracket expression" +is a list of characters enclosed by +.B [ +and +.BR ] . +It matches any single +character in that list; if the first character of the list +is the caret +.B ^ +then it matches any character +.I not +in the list. +For example, the regular expression +.B [0123456789] +matches any single digit. +.PP +Within a bracket expression, a +.I "range expression" +consists of two characters separated by a hyphen. +It matches any single character that sorts between the two characters, +inclusive, using the locale's collating sequence and character set. +For example, in the default C locale, +.B [a\-d] +is equivalent to +.BR [abcd] . +Many locales sort characters in dictionary order, and in these locales +.B [a\-d] +is typically not equivalent to +.BR [abcd] ; +it might be equivalent to +.BR [aBbCcDd] , +for example. +To obtain the traditional interpretation of bracket expressions, +you can use the C locale by setting the +.B LC_ALL +environment variable to the value +.BR C . +.PP +Finally, certain named classes of characters are predefined within +bracket expressions, as follows. +Their names are self explanatory, and they are +.BR [:alnum:] , +.BR [:alpha:] , +.BR [:cntrl:] , +.BR [:digit:] , +.BR [:graph:] , +.BR [:lower:] , +.BR [:print:] , +.BR [:punct:] , +.BR [:space:] , +.BR [:upper:] , +and +.BR [:xdigit:]. +For example, +.B [[:alnum:]] +means the character class of numbers and +letters in the current locale. +In the C locale and ASCII +character set encoding, this is the same as +.BR [0\-9A\-Za\-z] . +(Note that the brackets in these class names are part of the symbolic +names, and must be included in addition to the brackets delimiting +the bracket expression.) +Most meta-characters lose their special meaning inside bracket expressions. +To include a literal +.B ] +place it first in the list. +Similarly, to include a literal +.B ^ +place it anywhere but first. +Finally, to include a literal +.B \- +place it last. +.SS Anchoring +The caret +.B ^ +and the dollar sign +.B $ +are meta-characters that respectively match the empty string at the +beginning and end of a line. +.SS "The Backslash Character and Special Expressions" +The symbols +.B \e< +and +.B \e> +respectively match the empty string at the beginning and end of a word. +The symbol +.B \eb +matches the empty string at the edge of a word, +and +.B \eB +matches the empty string provided it's +.I not +at the edge of a word. +The symbol +.B \ew +is a synonym for +.B [_[:alnum:]] +and +.B \eW +is a synonym for +.BR [^_[:alnum:]] . +.SS Repetition +A regular expression may be followed by one of several repetition operators: +.PD 0 +.TP +.B ? +The preceding item is optional and matched at most once. +.TP +.B * +The preceding item will be matched zero or more times. +.TP +.B + +The preceding item will be matched one or more times. +.TP +.BI { n } +The preceding item is matched exactly +.I n +times. +.TP +.BI { n ,} +The preceding item is matched +.I n +or more times. +.TP +.BI {, m } +The preceding item is matched at most +.I m +times. +This is a GNU extension. +.TP +.BI { n , m } +The preceding item is matched at least +.I n +times, but not more than +.I m +times. +.PD +.SS Concatenation +Two regular expressions may be concatenated; the resulting +regular expression matches any string formed by concatenating +two substrings that respectively match the concatenated +expressions. +.SS Alternation +Two regular expressions may be joined by the infix operator +.BR | ; +the resulting regular expression matches any string matching +either alternate expression. +.SS Precedence +Repetition takes precedence over concatenation, which in turn +takes precedence over alternation. +A whole expression may be enclosed in parentheses +to override these precedence rules and form a subexpression. +.SS "Back References and Subexpressions" +The back-reference +.BI \e n\c +\&, where +.I n +is a single digit, matches the substring +previously matched by the +.IR n th +parenthesized subexpression of the regular expression. +.SS "Basic vs Extended Regular Expressions" +In basic regular expressions the meta-characters +.BR ? , +.BR + , +.BR { , +.BR | , +.BR ( , +and +.BR ) +lose their special meaning; instead use the backslashed +versions +.BR \e? , +.BR \e+ , +.BR \e{ , +.BR \e| , +.BR \e( , +and +.BR \e) . +. +.SH "ENVIRONMENT VARIABLES" +The behavior of +.B grep +is affected by the following environment variables. +.PP +The locale for category +.BI LC_ foo +is specified by examining the three environment variables +.BR LC_ALL , +.BR LC_\fIfoo\fP , +.BR LANG , +in that order. +The first of these variables that is set specifies the locale. +For example, if +.B LC_ALL +is not set, but +.B LC_MESSAGES +is set to +.BR pt_BR , +then the Brazilian Portuguese locale is used for the +.B LC_MESSAGES +category. +The C locale is used if none of these environment variables are set, +if the locale catalog is not installed, or if +.B grep +was not compiled with national language support (NLS). +The shell command +.B "locale \-a" +lists locales that are currently available. +.TP +.B GREP_OPTIONS +This variable specifies default options +to be placed in front of any explicit options. +As this causes problems when writing portable scripts, +this feature will be removed in a future release of +.BR grep , +and +.B grep +warns if it is used. +Please use an alias or script instead. +.TP +.B GREP_COLOR +This variable specifies the color used to highlight matched (non-empty) text. +It is deprecated in favor of +.BR GREP_COLORS , +but still supported. +The +.BR mt , +.BR ms , +and +.B mc +capabilities of +.B GREP_COLORS +have priority over it. +It can only specify the color used to highlight +the matching non-empty text in any matching line +(a selected line when the +.B -v +command-line option is omitted, +or a context line when +.B -v +is specified). +The default is +.BR 01;31 , +which means a bold red foreground text on the terminal's default background. +.TP +.B GREP_COLORS +Specifies the colors and other attributes +used to highlight various parts of the output. +Its value is a colon-separated list of capabilities +that defaults to +.B ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36 +with the +.B rv +and +.B ne +boolean capabilities omitted (i.e., false). +Supported capabilities are as follows. +.RS +.TP +.B sl= +SGR substring for whole selected lines +(i.e., +matching lines when the +.B \-v +command-line option is omitted, +or non-matching lines when +.B \-v +is specified). +If however the boolean +.B rv +capability +and the +.B \-v +command-line option are both specified, +it applies to context matching lines instead. +The default is empty (i.e., the terminal's default color pair). +.TP +.B cx= +SGR substring for whole context lines +(i.e., +non-matching lines when the +.B \-v +command-line option is omitted, +or matching lines when +.B \-v +is specified). +If however the boolean +.B rv +capability +and the +.B \-v +command-line option are both specified, +it applies to selected non-matching lines instead. +The default is empty (i.e., the terminal's default color pair). +.TP +.B rv +Boolean value that reverses (swaps) the meanings of +the +.B sl= +and +.B cx= +capabilities +when the +.B \-v +command-line option is specified. +The default is false (i.e., the capability is omitted). +.TP +.B mt=01;31 +SGR substring for matching non-empty text in any matching line +(i.e., +a selected line when the +.B \-v +command-line option is omitted, +or a context line when +.B \-v +is specified). +Setting this is equivalent to setting both +.B ms= +and +.B mc= +at once to the same value. +The default is a bold red text foreground over the current line background. +.TP +.B ms=01;31 +SGR substring for matching non-empty text in a selected line. +(This is only used when the +.B \-v +command-line option is omitted.) +The effect of the +.B sl= +(or +.B cx= +if +.BR rv ) +capability remains active when this kicks in. +The default is a bold red text foreground over the current line background. +.TP +.B mc=01;31 +SGR substring for matching non-empty text in a context line. +(This is only used when the +.B \-v +command-line option is specified.) +The effect of the +.B cx= +(or +.B sl= +if +.BR rv ) +capability remains active when this kicks in. +The default is a bold red text foreground over the current line background. +.TP +.B fn=35 +SGR substring for file names prefixing any content line. +The default is a magenta text foreground over the terminal's default background. +.TP +.B ln=32 +SGR substring for line numbers prefixing any content line. +The default is a green text foreground over the terminal's default background. +.TP +.B bn=32 +SGR substring for byte offsets prefixing any content line. +The default is a green text foreground over the terminal's default background. +.TP +.B se=36 +SGR substring for separators that are inserted +between selected line fields +.RB ( : ), +between context line fields, +.RB ( \- ), +and between groups of adjacent lines when nonzero context is specified +.RB ( \-\^\- ). +The default is a cyan text foreground over the terminal's default background. +.TP +.B ne +Boolean value that prevents clearing to the end of line +using Erase in Line (EL) to Right +.RB ( \\\\\\33[K ) +each time a colorized item ends. +This is needed on terminals on which EL is not supported. +It is otherwise useful on terminals +for which the +.B back_color_erase +.RB ( bce ) +boolean terminfo capability does not apply, +when the chosen highlight colors do not affect the background, +or when EL is too slow or causes too much flicker. +The default is false (i.e., the capability is omitted). +.PP +Note that boolean capabilities have no +.BR = ... +part. +They are omitted (i.e., false) by default and become true when specified. +.PP +See the Select Graphic Rendition (SGR) section +in the documentation of the text terminal that is used +for permitted values and their meaning as character attributes. +These substring values are integers in decimal representation +and can be concatenated with semicolons. +.B grep +takes care of assembling the result +into a complete SGR sequence +.RB ( \\\\\\33[ ... m ). +Common values to concatenate include +.B 1 +for bold, +.B 4 +for underline, +.B 5 +for blink, +.B 7 +for inverse, +.B 39 +for default foreground color, +.B 30 +to +.B 37 +for foreground colors, +.B 90 +to +.B 97 +for 16-color mode foreground colors, +.B 38;5;0 +to +.B 38;5;255 +for 88-color and 256-color modes foreground colors, +.B 49 +for default background color, +.B 40 +to +.B 47 +for background colors, +.B 100 +to +.B 107 +for 16-color mode background colors, and +.B 48;5;0 +to +.B 48;5;255 +for 88-color and 256-color modes background colors. +.RE +.TP +\fBLC_ALL\fP, \fBLC_COLLATE\fP, \fBLANG\fP +These variables specify the locale for the +.B LC_COLLATE +category, +which determines the collating sequence +used to interpret range expressions like +.BR [a\-z] . +.TP +\fBLC_ALL\fP, \fBLC_CTYPE\fP, \fBLANG\fP +These variables specify the locale for the +.B LC_CTYPE +category, +which determines the type of characters, +e.g., which characters are whitespace. +This category also determines the character encoding, that is, whether +text is encoded in UTF-8, ASCII, or some other encoding. In the C or +POSIX locale, all characters are encoded as a single byte and every +byte is a valid character. +.TP +\fBLC_ALL\fP, \fBLC_MESSAGES\fP, \fBLANG\fP +These variables specify the locale for the +.B LC_MESSAGES +category, +which determines the language that +.B grep +uses for messages. +The default C locale uses American English messages. +.TP +.B POSIXLY_CORRECT +If set, +.B grep +behaves as POSIX requires; otherwise, +.B grep +behaves more like other GNU programs. +POSIX requires that options that follow file names must be +treated as file names; by default, such options are permuted to the +front of the operand list and are treated as options. +Also, POSIX requires that unrecognized options be diagnosed as +\*(lqillegal\*(rq, but since they are not really against the law the default +is to diagnose them as \*(lqinvalid\*(rq. +.B POSIXLY_CORRECT +also disables \fB_\fP\fIN\fP\fB_GNU_nonoption_argv_flags_\fP, +described below. +.TP +\fB_\fP\fIN\fP\fB_GNU_nonoption_argv_flags_\fP +(Here +.I N +is +.BR grep 's +numeric process ID.) If the +.IR i th +character of this environment variable's value is +.BR 1 , +do not consider the +.IR i th +operand of +.B grep +to be an option, even if it appears to be one. +A shell can put this variable in the environment for each command it runs, +specifying which operands are the results of file name wildcard +expansion and therefore should not be treated as options. +This behavior is available only with the GNU C library, and only +when +.B POSIXLY_CORRECT +is not set. +. +.SH "EXIT STATUS" +Normally the exit status is 0 if a line is selected, 1 if no lines +were selected, and 2 if an error occurred. However, if the +.B \-q +or +.B \-\^\-quiet +or +.B \-\^\-silent +is used and a line is selected, the exit status is 0 even if an error +occurred. +. +.SH COPYRIGHT +Copyright 1998\(en2000, 2002, 2005\(en2017 Free Software Foundation, Inc. +.PP +This is free software; +see the source for copying conditions. +There is NO warranty; +not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +. +.SH BUGS +.SS "Reporting Bugs" +Email bug reports to +.MTO bug-grep@gnu.org "the bug-reporting address" . +An +.URL http://lists.gnu.org/mailman/listinfo/bug-grep "email archive" +and a +.URL http://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep "bug tracker" +are available. +.SS "Known Bugs" +Large repetition counts in the +.BI { n , m } +construct may cause +.B grep +to use lots of memory. +In addition, +certain other obscure regular expressions require exponential time +and space, and may cause +.B grep +to run out of memory. +.PP +Back-references are very slow, and may require exponential time. +. +.SH "SEE ALSO" +.SS "Regular Manual Pages" +awk(1), cmp(1), diff(1), find(1), gzip(1), +perl(1), sed(1), sort(1), xargs(1), zgrep(1), +read(2), +pcre(3), pcresyntax(3), pcrepattern(3), +terminfo(5), +glob(7), regex(7). +.SS "POSIX Programmer's Manual Page" +grep(1p). +.SS "Full Documentation" +A +.URL http://www.gnu.org/software/grep/manual/ "complete manual" +is available. +If the +.B info +and +.B grep +programs are properly installed at your site, the command +.IP +.B info grep +.PP +should give you access to the complete manual. +. +.SH NOTES +This man page is maintained only fitfully; +the full documentation is often more up-to-date. +.\" Work around problems with some troff -man implementations. +.br diff --git a/doc/grep.info b/doc/grep.info new file mode 100644 index 0000000..c29bd60 --- /dev/null +++ b/doc/grep.info @@ -0,0 +1,2419 @@ +This is grep.info-t, produced by makeinfo version 6.3 from grep.texi. + +This manual is for ‘grep’, a pattern matching engine. + + Copyright © 1999-2002, 2005, 2008-2017 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, with no Front-Cover Texts, + and with no Back-Cover Texts. A copy of the license is included in + the section entitled “GNU Free Documentation License”. +INFO-DIR-SECTION Text creation and manipulation +START-INFO-DIR-ENTRY +* grep: (grep). Print lines matching a pattern. +END-INFO-DIR-ENTRY + + +File: grep.info-t, Node: Top, Next: Introduction, Up: (dir) + +grep +**** + +‘grep’ prints lines that contain a match for a pattern. + + This manual is for version 3.1 of GNU Grep. + + This manual is for ‘grep’, a pattern matching engine. + + Copyright © 1999-2002, 2005, 2008-2017 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, with no Front-Cover Texts, + and with no Back-Cover Texts. A copy of the license is included in + the section entitled “GNU Free Documentation License”. + +* Menu: + +* Introduction:: Introduction. +* Invoking:: Command-line options, environment, exit status. +* Regular Expressions:: Regular Expressions. +* Usage:: Examples. +* Performance:: Performance tuning. +* Reporting Bugs:: Reporting Bugs. +* Copying:: License terms for this manual. +* Index:: Combined index. + + +File: grep.info-t, Node: Introduction, Next: Invoking, Prev: Top, Up: Top + +1 Introduction +************** + +‘grep’ searches input files for lines containing a match to a given +pattern list. When it finds a match in a line, it copies the line to +standard output (by default), or produces whatever other sort of output +you have requested with options. + + Though ‘grep’ expects to do the matching on text, it has no limits on +input line length other than available memory, and it can match +arbitrary characters within a line. If the final byte of an input file +is not a newline, ‘grep’ silently supplies one. Since newline is also a +separator for the list of patterns, there is no way to match newline +characters in a text. + + +File: grep.info-t, Node: Invoking, Next: Regular Expressions, Prev: Introduction, Up: Top + +2 Invoking ‘grep’ +***************** + +The general synopsis of the ‘grep’ command line is + + grep OPTIONS PATTERN INPUT_FILE_NAMES + +There can be zero or more OPTIONS. PATTERN will only be seen as such +(and not as an INPUT_FILE_NAME) if it wasn’t already specified within +OPTIONS (by using the ‘-e PATTERN’ or ‘-f FILE’ options). There can be +zero or more INPUT_FILE_NAMES. + +* Menu: + +* Command-line Options:: Short and long names, grouped by category. +* Environment Variables:: POSIX, GNU generic, and GNU grep specific. +* Exit Status:: Exit status returned by ‘grep’. +* grep Programs:: ‘grep’ programs. + + +File: grep.info-t, Node: Command-line Options, Next: Environment Variables, Up: Invoking + +2.1 Command-line Options +======================== + +‘grep’ comes with a rich set of options: some from POSIX and some being +GNU extensions. Long option names are always a GNU extension, even for +options that are from POSIX specifications. Options that are specified +by POSIX, under their short names, are explicitly marked as such to +facilitate POSIX-portable programming. A few option names are provided +for compatibility with older or more exotic implementations. + +* Menu: + +* Generic Program Information:: +* Matching Control:: +* General Output Control:: +* Output Line Prefix Control:: +* Context Line Control:: +* File and Directory Selection:: +* Other Options:: + + Several additional options control which variant of the ‘grep’ +matching engine is used. *Note grep Programs::. + + +File: grep.info-t, Node: Generic Program Information, Next: Matching Control, Up: Command-line Options + +2.1.1 Generic Program Information +--------------------------------- + +‘--help’ + Print a usage message briefly summarizing the command-line options + and the bug-reporting address, then exit. + +‘-V’ +‘--version’ + Print the version number of ‘grep’ to the standard output stream. + This version number should be included in all bug reports. + + +File: grep.info-t, Node: Matching Control, Next: General Output Control, Prev: Generic Program Information, Up: Command-line Options + +2.1.2 Matching Control +---------------------- + +‘-e PATTERN’ +‘--regexp=PATTERN’ + Use PATTERN as the pattern. If this option is used multiple times + or is combined with the ‘-f’ (‘--file’) option, search for all + patterns given. (‘-e’ is specified by POSIX.) + +‘-f FILE’ +‘--file=FILE’ + Obtain patterns from FILE, one per line. If this option is used + multiple times or is combined with the ‘-e’ (‘--regexp’) option, + search for all patterns given. The empty file contains zero + patterns, and therefore matches nothing. (‘-f’ is specified by + POSIX.) + +‘-i’ +‘-y’ +‘--ignore-case’ + Ignore case distinctions, so that characters that differ only in + case match each other. Although this is straightforward when + letters differ in case only via lowercase-uppercase pairs, the + behavior is unspecified in other situations. For example, + uppercase “S” has an unusual lowercase counterpart “ſ” (Unicode + character U+017F, LATIN SMALL LETTER LONG S) in many locales, and + it is unspecified whether this unusual character matches “S” or “s” + even though uppercasing it yields “S”. Another example: the + lowercase German letter “ß” (U+00DF, LATIN SMALL LETTER SHARP S) is + normally capitalized as the two-character string “SS” but it does + not match “SS”, and it might not match the uppercase letter “ẞ” + (U+1E9E, LATIN CAPITAL LETTER SHARP S) even though lowercasing the + latter yields the former. + + ‘-y’ is an obsolete synonym that is provided for compatibility. + (‘-i’ is specified by POSIX.) + +‘-v’ +‘--invert-match’ + Invert the sense of matching, to select non-matching lines. (‘-v’ + is specified by POSIX.) + +‘-w’ +‘--word-regexp’ + Select only those lines containing matches that form whole words. + The test is that the matching substring must either be at the + beginning of the line, or preceded by a non-word constituent + character. Similarly, it must be either at the end of the line or + followed by a non-word constituent character. Word-constituent + characters are letters, digits, and the underscore. This option + has no effect if ‘-x’ is also specified. + +‘-x’ +‘--line-regexp’ + Select only those matches that exactly match the whole line. For a + regular expression pattern, this is like parenthesizing the pattern + and then surrounding it with ‘^’ and ‘$’. (‘-x’ is specified by + POSIX.) + + +File: grep.info-t, Node: General Output Control, Next: Output Line Prefix Control, Prev: Matching Control, Up: Command-line Options + +2.1.3 General Output Control +---------------------------- + +‘-c’ +‘--count’ + Suppress normal output; instead print a count of matching lines for + each input file. With the ‘-v’ (‘--invert-match’) option, count + non-matching lines. (‘-c’ is specified by POSIX.) + +‘--color[=WHEN]’ +‘--colour[=WHEN]’ + Surround the matched (non-empty) strings, matching lines, context + lines, file names, line numbers, byte offsets, and separators (for + fields and groups of context lines) with escape sequences to + display them in color on the terminal. The colors are defined by + the environment variable ‘GREP_COLORS’ and default to + ‘ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36’ for bold red + matched text, magenta file names, green line numbers, green byte + offsets, cyan separators, and default terminal colors otherwise. + The deprecated environment variable ‘GREP_COLOR’ is still + supported, but its setting does not have priority; it defaults to + ‘01;31’ (bold red) which only covers the color for matched text. + WHEN is ‘never’, ‘always’, or ‘auto’. + +‘-L’ +‘--files-without-match’ + Suppress normal output; instead print the name of each input file + from which no output would normally have been printed. The + scanning of each file stops on the first match. + +‘-l’ +‘--files-with-matches’ + Suppress normal output; instead print the name of each input file + from which output would normally have been printed. The scanning + of each file stops on the first match. (‘-l’ is specified by + POSIX.) + +‘-m NUM’ +‘--max-count=NUM’ + Stop after the first NUM selected lines. If the input is standard + input from a regular file, and NUM selected lines are output, + ‘grep’ ensures that the standard input is positioned just after the + last selected line before exiting, regardless of the presence of + trailing context lines. This enables a calling process to resume a + search. For example, the following shell script makes use of it: + + while grep -m 1 PATTERN + do + echo xxxx + done < FILE + + But the following probably will not work because a pipe is not a + regular file: + + # This probably will not work. + cat FILE | + while grep -m 1 PATTERN + do + echo xxxx + done + + When ‘grep’ stops after NUM selected lines, it outputs any trailing + context lines. When the ‘-c’ or ‘--count’ option is also used, + ‘grep’ does not output a count greater than NUM. When the ‘-v’ or + ‘--invert-match’ option is also used, ‘grep’ stops after outputting + NUM non-matching lines. + +‘-o’ +‘--only-matching’ + Print only the matched (non-empty) parts of matching lines, with + each such part on a separate output line. Output lines use the + same delimiters as input, and delimiters are null bytes if ‘-z’ + (‘--null-data’) is also used (*note Other Options::). + +‘-q’ +‘--quiet’ +‘--silent’ + Quiet; do not write anything to standard output. Exit immediately + with zero status if any match is found, even if an error was + detected. Also see the ‘-s’ or ‘--no-messages’ option. (‘-q’ is + specified by POSIX.) + +‘-s’ +‘--no-messages’ + Suppress error messages about nonexistent or unreadable files. + Portability note: unlike GNU ‘grep’, 7th Edition Unix ‘grep’ did + not conform to POSIX, because it lacked ‘-q’ and its ‘-s’ option + behaved like GNU ‘grep’’s ‘-q’ option.(1) USG-style ‘grep’ also + lacked ‘-q’ but its ‘-s’ option behaved like GNU ‘grep’’s. + Portable shell scripts should avoid both ‘-q’ and ‘-s’ and should + redirect standard and error output to ‘/dev/null’ instead. (‘-s’ + is specified by POSIX.) + + ---------- Footnotes ---------- + + (1) Of course, 7th Edition Unix predated POSIX by several years! + + +File: grep.info-t, Node: Output Line Prefix Control, Next: Context Line Control, Prev: General Output Control, Up: Command-line Options + +2.1.4 Output Line Prefix Control +-------------------------------- + +When several prefix fields are to be output, the order is always file +name, line number, and byte offset, regardless of the order in which +these options were specified. + +‘-b’ +‘--byte-offset’ + Print the 0-based byte offset within the input file before each + line of output. If ‘-o’ (‘--only-matching’) is specified, print + the offset of the matching part itself. + +‘-H’ +‘--with-filename’ + Print the file name for each match. This is the default when there + is more than one file to search. + +‘-h’ +‘--no-filename’ + Suppress the prefixing of file names on output. This is the + default when there is only one file (or only standard input) to + search. + +‘--label=LABEL’ + Display input actually coming from standard input as input coming + from file LABEL. This is especially useful when implementing tools + like ‘zgrep’; e.g.: + + gzip -cd foo.gz | grep --label=foo -H something + +‘-n’ +‘--line-number’ + Prefix each line of output with the 1-based line number within its + input file. (‘-n’ is specified by POSIX.) + +‘-T’ +‘--initial-tab’ + Make sure that the first character of actual line content lies on a + tab stop, so that the alignment of tabs looks normal. This is + useful with options that prefix their output to the actual content: + ‘-H’, ‘-n’, and ‘-b’. This may also prepend spaces to output line + numbers and byte offsets so that lines from a single file all start + at the same column. + +‘-Z’ +‘--null’ + Output a zero byte (the ASCII NUL character) instead of the + character that normally follows a file name. For example, ‘grep + -lZ’ outputs a zero byte after each file name instead of the usual + newline. This option makes the output unambiguous, even in the + presence of file names containing unusual characters like newlines. + This option can be used with commands like ‘find -print0’, ‘perl + -0’, ‘sort -z’, and ‘xargs -0’ to process arbitrary file names, + even those that contain newline characters. + + +File: grep.info-t, Node: Context Line Control, Next: File and Directory Selection, Prev: Output Line Prefix Control, Up: Command-line Options + +2.1.5 Context Line Control +-------------------------- + +“Context lines” are non-matching lines that are near a matching line. +They are output only if one of the following options are used. +Regardless of how these options are set, ‘grep’ never outputs any given +line more than once. If the ‘-o’ (‘--only-matching’) option is +specified, these options have no effect and a warning is given upon +their use. + +‘-A NUM’ +‘--after-context=NUM’ + Print NUM lines of trailing context after matching lines. + +‘-B NUM’ +‘--before-context=NUM’ + Print NUM lines of leading context before matching lines. + +‘-C NUM’ +‘-NUM’ +‘--context=NUM’ + Print NUM lines of leading and trailing output context. + +‘--group-separator=STRING’ + When ‘-A’, ‘-B’ or ‘-C’ are in use, print STRING instead of ‘--’ + between groups of lines. + +‘--no-group-separator’ + When ‘-A’, ‘-B’ or ‘-C’ are in use, do not print a separator + between groups of lines. + + Here are some points about how ‘grep’ chooses the separator to print +between prefix fields and line content: + + • Matching lines normally use ‘:’ as a separator between prefix + fields and actual line content. + + • Context (i.e., non-matching) lines use ‘-’ instead. + + • When context is not specified, matching lines are simply output one + right after another. + + • When context is specified, lines that are adjacent in the input + form a group and are output one right after another, while by + default a separator appears between non-adjacent groups. + + • The default separator is a ‘--’ line; its presence and appearance + can be changed with the options above. + + • Each group may contain several matching lines when they are close + enough to each other that two adjacent groups connect and can merge + into a single contiguous one. + + +File: grep.info-t, Node: File and Directory Selection, Next: Other Options, Prev: Context Line Control, Up: Command-line Options + +2.1.6 File and Directory Selection +---------------------------------- + +‘-a’ +‘--text’ + Process a binary file as if it were text; this is equivalent to the + ‘--binary-files=text’ option. + +‘--binary-files=TYPE’ + If a file’s data or metadata indicate that the file contains binary + data, assume that the file is of type TYPE. Non-text bytes + indicate binary data; these are either output bytes that are + improperly encoded for the current locale (*note Environment + Variables::), or null input bytes when the ‘-z’ (‘--null-data’) + option is not given (*note Other Options::). + + By default, TYPE is ‘binary’, and ‘grep’ suppresses output after + null input binary data is discovered, and suppresses output lines + that contain improperly encoded data. When some output is + suppressed, ‘grep’ follows any output with a one-line message + saying that a binary file matches. + + If TYPE is ‘without-match’, when ‘grep’ discovers null input binary + data it assumes that the rest of the file does not match; this is + equivalent to the ‘-I’ option. + + If TYPE is ‘text’, ‘grep’ processes binary data as if it were text; + this is equivalent to the ‘-a’ option. + + When TYPE is ‘binary’, ‘grep’ may treat non-text bytes as line + terminators even without the ‘-z’ (‘--null-data’) option. This + means choosing ‘binary’ versus ‘text’ can affect whether a pattern + matches a file. For example, when TYPE is ‘binary’ the pattern + ‘q$’ might match ‘q’ immediately followed by a null byte, even + though this is not matched when TYPE is ‘text’. Conversely, when + TYPE is ‘binary’ the pattern ‘.’ (period) might not match a null + byte. + + _Warning:_ The ‘-a’ (‘--binary-files=text’) option might output + binary garbage, which can have nasty side effects if the output is + a terminal and if the terminal driver interprets some of it as + commands. On the other hand, when reading files whose text + encodings are unknown, it can be helpful to use ‘-a’ or to set + ‘LC_ALL='C'’ in the environment, in order to find more matches even + if the matches are unsafe for direct display. + +‘-D ACTION’ +‘--devices=ACTION’ + If an input file is a device, FIFO, or socket, use ACTION to + process it. If ACTION is ‘read’, all devices are read just as if + they were ordinary files. If ACTION is ‘skip’, devices, FIFOs, and + sockets are silently skipped. By default, devices are read if they + are on the command line or if the ‘-R’ (‘--dereference-recursive’) + option is used, and are skipped if they are encountered recursively + and the ‘-r’ (‘--recursive’) option is used. This option has no + effect on a file that is read via standard input. + +‘-d ACTION’ +‘--directories=ACTION’ + If an input file is a directory, use ACTION to process it. By + default, ACTION is ‘read’, which means that directories are read + just as if they were ordinary files (some operating systems and + file systems disallow this, and will cause ‘grep’ to print error + messages for every directory or silently skip them). If ACTION is + ‘skip’, directories are silently skipped. If ACTION is ‘recurse’, + ‘grep’ reads all files under each directory, recursively, following + command-line symbolic links and skipping other symlinks; this is + equivalent to the ‘-r’ option. + +‘--exclude=GLOB’ + Skip any command-line file with a name suffix that matches the + pattern GLOB, using wildcard matching; a name suffix is either the + whole name, or any suffix starting after a ‘/’ and before a + non-‘/’. When searching recursively, skip any subfile whose base + name matches GLOB; the base name is the part after the last ‘/’. A + pattern can use ‘*’, ‘?’, and ‘[’...‘]’ as wildcards, and ‘\’ to + quote a wildcard or backslash character literally. + +‘--exclude-from=FILE’ + Skip files whose name matches any of the patterns read from FILE + (using wildcard matching as described under ‘--exclude’). + +‘--exclude-dir=GLOB’ + Skip any command-line directory with a name suffix that matches the + pattern GLOB. When searching recursively, skip any subdirectory + whose base name matches GLOB. Ignore any redundant trailing + slashes in GLOB. + +‘-I’ + Process a binary file as if it did not contain matching data; this + is equivalent to the ‘--binary-files=without-match’ option. + +‘--include=GLOB’ + Search only files whose name matches GLOB, using wildcard matching + as described under ‘--exclude’. + +‘-r’ +‘--recursive’ + For each directory operand, read and process all files in that + directory, recursively. Follow symbolic links on the command line, + but skip symlinks that are encountered recursively. Note that if + no file operand is given, grep searches the working directory. + This is the same as the ‘--directories=recurse’ option. + +‘-R’ +‘--dereference-recursive’ + For each directory operand, read and process all files in that + directory, recursively, following all symbolic links. + + +File: grep.info-t, Node: Other Options, Prev: File and Directory Selection, Up: Command-line Options + +2.1.7 Other Options +------------------- + +‘--line-buffered’ + Use line buffering on output. This can cause a performance + penalty. + +‘-U’ +‘--binary’ + On platforms that distinguish between text and binary I/O, use the + latter when reading and writing files other than the user’s + terminal, so that all input bytes are read and written as-is. This + overrides the default behavior where ‘grep’ follows the operating + system’s advice whether to use text or binary I/O. On MS-Windows + when ‘grep’ uses text I/O it reads a carriage return–newline pair + as a newline and a Control-Z as end-of-file, and it writes a + newline as a carriage return–newline pair. + + When using text I/O ‘--byte-offset’ (‘-b’) counts and + ‘--binary-files’ heuristics apply to input data after text-I/O + processing. Also, the ‘--binary-files’ heuristics need not agree + with the ‘--binary’ option; that is, they may treat the data as + text even if ‘--binary’ is given, or vice versa. *Note File and + Directory Selection::. + + This option has no effect on GNU and other POSIX-compatible + platforms, which do not distinguish text from binary I/O. + +‘-z’ +‘--null-data’ + Treat input and output data as sequences of lines, each terminated + by a zero byte (the ASCII NUL character) instead of a newline. + Like the ‘-Z’ or ‘--null’ option, this option can be used with + commands like ‘sort -z’ to process arbitrary file names. + + +File: grep.info-t, Node: Environment Variables, Next: Exit Status, Prev: Command-line Options, Up: Invoking + +2.2 Environment Variables +========================= + +The behavior of ‘grep’ is affected by the following environment +variables. + + The locale for category ‘LC_FOO’ is specified by examining the three +environment variables ‘LC_ALL’, ‘LC_FOO’, and ‘LANG’, in that order. +The first of these variables that is set specifies the locale. For +example, if ‘LC_ALL’ is not set, but ‘LC_COLLATE’ is set to ‘pt_BR’, +then the Brazilian Portuguese locale is used for the ‘LC_COLLATE’ +category. As a special case for ‘LC_MESSAGES’ only, the environment +variable ‘LANGUAGE’ can contain a colon-separated list of languages that +overrides the three environment variables that ordinarily specify the +‘LC_MESSAGES’ category. The ‘C’ locale is used if none of these +environment variables are set, if the locale catalog is not installed, +or if ‘grep’ was not compiled with national language support (NLS). The +shell command ‘locale -a’ lists locales that are currently available. + + Many of the environment variables in the following list let you +control highlighting using Select Graphic Rendition (SGR) commands +interpreted by the terminal or terminal emulator. (See the section in +the documentation of your text terminal for permitted values and their +meanings as character attributes.) These substring values are integers +in decimal representation and can be concatenated with semicolons. +‘grep’ takes care of assembling the result into a complete SGR sequence +(‘\33[’...‘m’). Common values to concatenate include ‘1’ for bold, ‘4’ +for underline, ‘5’ for blink, ‘7’ for inverse, ‘39’ for default +foreground color, ‘30’ to ‘37’ for foreground colors, ‘90’ to ‘97’ for +16-color mode foreground colors, ‘38;5;0’ to ‘38;5;255’ for 88-color and +256-color modes foreground colors, ‘49’ for default background color, +‘40’ to ‘47’ for background colors, ‘100’ to ‘107’ for 16-color mode +background colors, and ‘48;5;0’ to ‘48;5;255’ for 88-color and 256-color +modes background colors. + + The two-letter names used in the ‘GREP_COLORS’ environment variable +(and some of the others) refer to terminal “capabilities,” the ability +of a terminal to highlight text, or change its color, and so on. These +capabilities are stored in an online database and accessed by the +‘terminfo’ library. + +‘GREP_OPTIONS’ + This variable specifies default options to be placed in front of + any explicit options. As this causes problems when writing + portable scripts, this feature will be removed in a future release + of ‘grep’, and ‘grep’ warns if it is used. Please use an alias or + script instead. For example, if ‘grep’ is in the directory + ‘/usr/bin’ you can prepend ‘$HOME/bin’ to your ‘PATH’ and create an + executable script ‘$HOME/bin/grep’ containing the following: + + #! /bin/sh + export PATH=/usr/bin + exec grep --color=auto --devices=skip "$@" + +‘GREP_COLOR’ + This variable specifies the color used to highlight matched + (non-empty) text. It is deprecated in favor of ‘GREP_COLORS’, but + still supported. The ‘mt’, ‘ms’, and ‘mc’ capabilities of + ‘GREP_COLORS’ have priority over it. It can only specify the color + used to highlight the matching non-empty text in any matching line + (a selected line when the ‘-v’ command-line option is omitted, or a + context line when ‘-v’ is specified). The default is ‘01;31’, + which means a bold red foreground text on the terminal’s default + background. + +‘GREP_COLORS’ + This variable specifies the colors and other attributes used to + highlight various parts of the output. Its value is a + colon-separated list of ‘terminfo’ capabilities that defaults to + ‘ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36’ with the ‘rv’ + and ‘ne’ boolean capabilities omitted (i.e., false). Supported + capabilities are as follows. + + ‘sl=’ + SGR substring for whole selected lines (i.e., matching lines + when the ‘-v’ command-line option is omitted, or non-matching + lines when ‘-v’ is specified). If however the boolean ‘rv’ + capability and the ‘-v’ command-line option are both + specified, it applies to context matching lines instead. The + default is empty (i.e., the terminal’s default color pair). + + ‘cx=’ + SGR substring for whole context lines (i.e., non-matching + lines when the ‘-v’ command-line option is omitted, or + matching lines when ‘-v’ is specified). If however the + boolean ‘rv’ capability and the ‘-v’ command-line option are + both specified, it applies to selected non-matching lines + instead. The default is empty (i.e., the terminal’s default + color pair). + + ‘rv’ + Boolean value that reverses (swaps) the meanings of the ‘sl=’ + and ‘cx=’ capabilities when the ‘-v’ command-line option is + specified. The default is false (i.e., the capability is + omitted). + + ‘mt=01;31’ + SGR substring for matching non-empty text in any matching line + (i.e., a selected line when the ‘-v’ command-line option is + omitted, or a context line when ‘-v’ is specified). Setting + this is equivalent to setting both ‘ms=’ and ‘mc=’ at once to + the same value. The default is a bold red text foreground + over the current line background. + + ‘ms=01;31’ + SGR substring for matching non-empty text in a selected line. + (This is used only when the ‘-v’ command-line option is + omitted.) The effect of the ‘sl=’ (or ‘cx=’ if ‘rv’) + capability remains active when this takes effect. The default + is a bold red text foreground over the current line + background. + + ‘mc=01;31’ + SGR substring for matching non-empty text in a context line. + (This is used only when the ‘-v’ command-line option is + specified.) The effect of the ‘cx=’ (or ‘sl=’ if ‘rv’) + capability remains active when this takes effect. The default + is a bold red text foreground over the current line + background. + + ‘fn=35’ + SGR substring for file names prefixing any content line. The + default is a magenta text foreground over the terminal’s + default background. + + ‘ln=32’ + SGR substring for line numbers prefixing any content line. + The default is a green text foreground over the terminal’s + default background. + + ‘bn=32’ + SGR substring for byte offsets prefixing any content line. + The default is a green text foreground over the terminal’s + default background. + + ‘se=36’ + SGR substring for separators that are inserted between + selected line fields (‘:’), between context line fields (‘-’), + and between groups of adjacent lines when nonzero context is + specified (‘--’). The default is a cyan text foreground over + the terminal’s default background. + + ‘ne’ + Boolean value that prevents clearing to the end of line using + Erase in Line (EL) to Right (‘\33[K’) each time a colorized + item ends. This is needed on terminals on which EL is not + supported. It is otherwise useful on terminals for which the + ‘back_color_erase’ (‘bce’) boolean ‘terminfo’ capability does + not apply, when the chosen highlight colors do not affect the + background, or when EL is too slow or causes too much flicker. + The default is false (i.e., the capability is omitted). + + Note that boolean capabilities have no ‘=’... part. They are + omitted (i.e., false) by default and become true when specified. + +‘LC_ALL’ +‘LC_COLLATE’ +‘LANG’ + These variables specify the locale for the ‘LC_COLLATE’ category, + which might affect how range expressions like ‘[a-z]’ are + interpreted. + +‘LC_ALL’ +‘LC_CTYPE’ +‘LANG’ + These variables specify the locale for the ‘LC_CTYPE’ category, + which determines the type of characters, e.g., which characters are + whitespace. This category also determines the character encoding, + that is, whether text is encoded in UTF-8, ASCII, or some other + encoding. In the ‘C’ or ‘POSIX’ locale, all characters are encoded + as a single byte and every byte is a valid character. + +‘LANGUAGE’ +‘LC_ALL’ +‘LC_MESSAGES’ +‘LANG’ + These variables specify the locale for the ‘LC_MESSAGES’ category, + which determines the language that ‘grep’ uses for messages. The + default ‘C’ locale uses American English messages. + +‘POSIXLY_CORRECT’ + If set, ‘grep’ behaves as POSIX requires; otherwise, ‘grep’ behaves + more like other GNU programs. POSIX requires that options that + follow file names must be treated as file names; by default, such + options are permuted to the front of the operand list and are + treated as options. Also, ‘POSIXLY_CORRECT’ disables special + handling of an invalid bracket expression. *Note + invalid-bracket-expr::. + +‘_N_GNU_nonoption_argv_flags_’ + (Here ‘N’ is ‘grep’’s numeric process ID.) If the Ith character of + this environment variable’s value is ‘1’, do not consider the Ith + operand of ‘grep’ to be an option, even if it appears to be one. A + shell can put this variable in the environment for each command it + runs, specifying which operands are the results of file name + wildcard expansion and therefore should not be treated as options. + This behavior is available only with the GNU C library, and only + when ‘POSIXLY_CORRECT’ is not set. + + +File: grep.info-t, Node: Exit Status, Next: grep Programs, Prev: Environment Variables, Up: Invoking + +2.3 Exit Status +=============== + +Normally the exit status is 0 if a line is selected, 1 if no lines were +selected, and 2 if an error occurred. However, if the ‘-q’ or ‘--quiet’ +or ‘--silent’ option is used and a line is selected, the exit status is +0 even if an error occurred. Other ‘grep’ implementations may exit with +status greater than 2 on error. + + +File: grep.info-t, Node: grep Programs, Prev: Exit Status, Up: Invoking + +2.4 ‘grep’ Programs +=================== + +‘grep’ searches the named input files for lines containing a match to +the given pattern. By default, ‘grep’ prints the matching lines. A +file named ‘-’ stands for standard input. If no input is specified, +‘grep’ searches the working directory ‘.’ if given a command-line option +specifying recursion; otherwise, ‘grep’ searches standard input. There +are four major variants of ‘grep’, controlled by the following options. + +‘-G’ +‘--basic-regexp’ + Interpret the pattern as a basic regular expression (BRE). This is + the default. + +‘-E’ +‘--extended-regexp’ + Interpret the pattern as an extended regular expression (ERE). + (‘-E’ is specified by POSIX.) + +‘-F’ +‘--fixed-strings’ + Interpret the pattern as a list of fixed strings (instead of + regular expressions), separated by newlines, any of which is to be + matched. (‘-F’ is specified by POSIX.) + +‘-P’ +‘--perl-regexp’ + Interpret the pattern as a Perl-compatible regular expression + (PCRE). This is experimental, particularly when combined with the + ‘-z’ (‘--null-data’) option, and ‘grep -P’ may warn of + unimplemented features. *Note Other Options::. + + In addition, two variant programs ‘egrep’ and ‘fgrep’ are available. +‘egrep’ is the same as ‘grep -E’. ‘fgrep’ is the same as ‘grep -F’. +Direct invocation as either ‘egrep’ or ‘fgrep’ is deprecated, but is +provided to allow historical applications that rely on them to run +unmodified. + + +File: grep.info-t, Node: Regular Expressions, Next: Usage, Prev: Invoking, Up: Top + +3 Regular Expressions +********************* + +A “regular expression” is a pattern that describes a set of strings. +Regular expressions are constructed analogously to arithmetic +expressions, by using various operators to combine smaller expressions. +‘grep’ understands three different versions of regular expression +syntax: basic (BRE), extended (ERE), and Perl-compatible (PCRE). In GNU +‘grep’, there is no difference in available functionality between the +basic and extended syntaxes. In other implementations, basic regular +expressions are less powerful. The following description applies to +extended regular expressions; differences for basic regular expressions +are summarized afterwards. Perl-compatible regular expressions give +additional functionality, and are documented in the pcresyntax(3) and +pcrepattern(3) manual pages, but work only if PCRE is available in the +system. + +* Menu: + +* Fundamental Structure:: +* Character Classes and Bracket Expressions:: +* The Backslash Character and Special Expressions:: +* Anchoring:: +* Back-references and Subexpressions:: +* Basic vs Extended:: + + +File: grep.info-t, Node: Fundamental Structure, Next: Character Classes and Bracket Expressions, Up: Regular Expressions + +3.1 Fundamental Structure +========================= + +The fundamental building blocks are the regular expressions that match a +single character. Most characters, including all letters and digits, +are regular expressions that match themselves. Any meta-character with +special meaning may be quoted by preceding it with a backslash. + + A regular expression may be followed by one of several repetition +operators: + +‘.’ + The period ‘.’ matches any single character. + +‘?’ + The preceding item is optional and will be matched at most once. + +‘*’ + The preceding item will be matched zero or more times. + +‘+’ + The preceding item will be matched one or more times. + +‘{N}’ + The preceding item is matched exactly N times. + +‘{N,}’ + The preceding item is matched N or more times. + +‘{,M}’ + The preceding item is matched at most M times. This is a GNU + extension. + +‘{N,M}’ + The preceding item is matched at least N times, but not more than M + times. + + The empty regular expression matches the empty string. Two regular +expressions may be concatenated; the resulting regular expression +matches any string formed by concatenating two substrings that +respectively match the concatenated expressions. + + Two regular expressions may be joined by the infix operator ‘|’; the +resulting regular expression matches any string matching either +alternate expression. + + Repetition takes precedence over concatenation, which in turn takes +precedence over alternation. A whole expression may be enclosed in +parentheses to override these precedence rules and form a subexpression. +An unmatched ‘)’ matches just itself. + + +File: grep.info-t, Node: Character Classes and Bracket Expressions, Next: The Backslash Character and Special Expressions, Prev: Fundamental Structure, Up: Regular Expressions + +3.2 Character Classes and Bracket Expressions +============================================= + +A “bracket expression” is a list of characters enclosed by ‘[’ and ‘]’. +It matches any single character in that list; if the first character of +the list is the caret ‘^’, then it matches any character *not* in the +list. For example, the regular expression ‘[0123456789]’ matches any +single digit. + + Within a bracket expression, a “range expression” consists of two +characters separated by a hyphen. It matches any single character that +sorts between the two characters, inclusive. In the default C locale, +the sorting sequence is the native character order; for example, ‘[a-d]’ +is equivalent to ‘[abcd]’. In other locales, the sorting sequence is +not specified, and ‘[a-d]’ might be equivalent to ‘[abcd]’ or to +‘[aBbCcDd]’, or it might fail to match any character, or the set of +characters that it matches might even be erratic. To obtain the +traditional interpretation of bracket expressions, you can use the ‘C’ +locale by setting the ‘LC_ALL’ environment variable to the value ‘C’. + + Finally, certain named classes of characters are predefined within +bracket expressions, as follows. Their interpretation depends on the +‘LC_CTYPE’ locale; for example, ‘[[:alnum:]]’ means the character class +of numbers and letters in the current locale. + +‘[:alnum:]’ + Alphanumeric characters: ‘[:alpha:]’ and ‘[:digit:]’; in the ‘C’ + locale and ASCII character encoding, this is the same as + ‘[0-9A-Za-z]’. + +‘[:alpha:]’ + Alphabetic characters: ‘[:lower:]’ and ‘[:upper:]’; in the ‘C’ + locale and ASCII character encoding, this is the same as + ‘[A-Za-z]’. + +‘[:blank:]’ + Blank characters: space and tab. + +‘[:cntrl:]’ + Control characters. In ASCII, these characters have octal codes + 000 through 037, and 177 (DEL). In other character sets, these are + the equivalent characters, if any. + +‘[:digit:]’ + Digits: ‘0 1 2 3 4 5 6 7 8 9’. + +‘[:graph:]’ + Graphical characters: ‘[:alnum:]’ and ‘[:punct:]’. + +‘[:lower:]’ + Lower-case letters; in the ‘C’ locale and ASCII character encoding, + this is ‘a b c d e f g h i j k l m n o p q r s t u v w x y z’. + +‘[:print:]’ + Printable characters: ‘[:alnum:]’, ‘[:punct:]’, and space. + +‘[:punct:]’ + Punctuation characters; in the ‘C’ locale and ASCII character + encoding, this is ‘! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ + ] ^ _ ` { | } ~’. + +‘[:space:]’ + Space characters: in the ‘C’ locale, this is tab, newline, vertical + tab, form feed, carriage return, and space. *Note Usage::, for + more discussion of matching newlines. + +‘[:upper:]’ + Upper-case letters: in the ‘C’ locale and ASCII character encoding, + this is ‘A B C D E F G H I J K L M N O P Q R S T U V W X Y Z’. + +‘[:xdigit:]’ + Hexadecimal digits: ‘0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f’. + + Note that the brackets in these class names are part of the symbolic +names, and must be included in addition to the brackets delimiting the +bracket expression. + + If you mistakenly omit the outer brackets, and search for say, +‘[:upper:]’, GNU ‘grep’ prints a diagnostic and exits with status 2, on +the assumption that you did not intend to search for the nominally +equivalent regular expression: ‘[:epru]’. Set the ‘POSIXLY_CORRECT’ +environment variable to disable this feature. + + Most meta-characters lose their special meaning inside bracket +expressions. + +‘]’ + ends the bracket expression if it’s not the first list item. So, + if you want to make the ‘]’ character a list item, you must put it + first. + +‘[.’ + represents the open collating symbol. + +‘.]’ + represents the close collating symbol. + +‘[=’ + represents the open equivalence class. + +‘=]’ + represents the close equivalence class. + +‘[:’ + represents the open character class symbol, and should be followed + by a valid character class name. + +‘:]’ + represents the close character class symbol. + +‘-’ + represents the range if it’s not first or last in a list or the + ending point of a range. + +‘^’ + represents the characters not in the list. If you want to make the + ‘^’ character a list item, place it anywhere but first. + + +File: grep.info-t, Node: The Backslash Character and Special Expressions, Next: Anchoring, Prev: Character Classes and Bracket Expressions, Up: Regular Expressions + +3.3 The Backslash Character and Special Expressions +=================================================== + +The ‘\’ character, when followed by certain ordinary characters, takes a +special meaning: + +‘\b’ + Match the empty string at the edge of a word. + +‘\B’ + Match the empty string provided it’s not at the edge of a word. + +‘\<’ + Match the empty string at the beginning of word. + +‘\>’ + Match the empty string at the end of word. + +‘\w’ + Match word constituent, it is a synonym for ‘[_[:alnum:]]’. + +‘\W’ + Match non-word constituent, it is a synonym for ‘[^_[:alnum:]]’. + +‘\s’ + Match whitespace, it is a synonym for ‘[[:space:]]’. + +‘\S’ + Match non-whitespace, it is a synonym for ‘[^[:space:]]’. + + For example, ‘\brat\b’ matches the separate word ‘rat’, ‘\Brat\B’ +matches ‘crate’ but not ‘furry rat’. + + +File: grep.info-t, Node: Anchoring, Next: Back-references and Subexpressions, Prev: The Backslash Character and Special Expressions, Up: Regular Expressions + +3.4 Anchoring +============= + +The caret ‘^’ and the dollar sign ‘$’ are meta-characters that +respectively match the empty string at the beginning and end of a line. +They are termed “anchors”, since they force the match to be “anchored” +to beginning or end of a line, respectively. + + +File: grep.info-t, Node: Back-references and Subexpressions, Next: Basic vs Extended, Prev: Anchoring, Up: Regular Expressions + +3.5 Back-references and Subexpressions +====================================== + +The back-reference ‘\N’, where N is a single digit, matches the +substring previously matched by the Nth parenthesized subexpression of +the regular expression. For example, ‘(a)\1’ matches ‘aa’. When used +with alternation, if the group does not participate in the match then +the back-reference makes the whole match fail. For example, ‘a(.)|b\1’ +will not match ‘ba’. When multiple regular expressions are given with +‘-e’ or from a file (‘-f FILE’), back-references are local to each +expression. + + +File: grep.info-t, Node: Basic vs Extended, Prev: Back-references and Subexpressions, Up: Regular Expressions + +3.6 Basic vs Extended Regular Expressions +========================================= + +In basic regular expressions the meta-characters ‘?’, ‘+’, ‘{’, ‘|’, +‘(’, and ‘)’ lose their special meaning; instead use the backslashed +versions ‘\?’, ‘\+’, ‘\{’, ‘\|’, ‘\(’, and ‘\)’. + + Traditional ‘egrep’ did not support the ‘{’ meta-character, and some +‘egrep’ implementations support ‘\{’ instead, so portable scripts should +avoid ‘{’ in ‘grep -E’ patterns and should use ‘[{]’ to match a literal +‘{’. + + GNU ‘grep -E’ attempts to support traditional usage by assuming that +‘{’ is not special if it would be the start of an invalid interval +specification. For example, the command ‘grep -E '{1'’ searches for the +two-character string ‘{1’ instead of reporting a syntax error in the +regular expression. POSIX allows this behavior as an extension, but +portable scripts should avoid it. + + +File: grep.info-t, Node: Usage, Next: Performance, Prev: Regular Expressions, Up: Top + +4 Usage +******* + +Here is an example command that invokes GNU ‘grep’: + + grep -i 'hello.*world' menu.h main.c + +This lists all lines in the files ‘menu.h’ and ‘main.c’ that contain the +string ‘hello’ followed by the string ‘world’; this is because ‘.*’ +matches zero or more characters within a line. *Note Regular +Expressions::. The ‘-i’ option causes ‘grep’ to ignore case, causing it +to match the line ‘Hello, world!’, which it would not otherwise match. +*Note Invoking::, for more details about how to invoke ‘grep’. + + Here are some common questions and answers about ‘grep’ usage. + + 1. How can I list just the names of matching files? + + grep -l 'main' *.c + + lists the names of all C files in the current directory whose + contents mention ‘main’. + + 2. How do I search directories recursively? + + grep -r 'hello' /home/gigi + + searches for ‘hello’ in all files under the ‘/home/gigi’ directory. + For more control over which files are searched, use ‘find’, ‘grep’, + and ‘xargs’. For example, the following command searches only C + files: + + find /home/gigi -name '*.c' -print0 | xargs -0r grep -H 'hello' + + This differs from the command: + + grep -H 'hello' *.c + + which merely looks for ‘hello’ in all files in the current + directory whose names end in ‘.c’. The ‘find ...’ command line + above is more similar to the command: + + grep -rH --include='*.c' 'hello' /home/gigi + + 3. What if a pattern has a leading ‘-’? + + grep -e '--cut here--' * + + searches for all lines matching ‘--cut here--’. Without ‘-e’, + ‘grep’ would attempt to parse ‘--cut here--’ as a list of options. + + 4. Suppose I want to search for a whole word, not a part of a word? + + grep -w 'hello' * + + searches only for instances of ‘hello’ that are entire words; it + does not match ‘Othello’. For more control, use ‘\<’ and ‘\>’ to + match the start and end of words. For example: + + grep 'hello\>' * + + searches only for words ending in ‘hello’, so it matches the word + ‘Othello’. + + 5. How do I output context around the matching lines? + + grep -C 2 'hello' * + + prints two lines of context around each matching line. + + 6. How do I force ‘grep’ to print the name of the file? + + Append ‘/dev/null’: + + grep 'eli' /etc/passwd /dev/null + + gets you: + + /etc/passwd:eli:x:2098:1000:Eli Smith:/home/eli:/bin/bash + + Alternatively, use ‘-H’, which is a GNU extension: + + grep -H 'eli' /etc/passwd + + 7. Why do people use strange regular expressions on ‘ps’ output? + + ps -ef | grep '[c]ron' + + If the pattern had been written without the square brackets, it + would have matched not only the ‘ps’ output line for ‘cron’, but + also the ‘ps’ output line for ‘grep’. Note that on some platforms, + ‘ps’ limits the output to the width of the screen; ‘grep’ does not + have any limit on the length of a line except the available memory. + + 8. Why does ‘grep’ report “Binary file matches”? + + If ‘grep’ listed all matching “lines” from a binary file, it would + probably generate output that is not useful, and it might even muck + up your display. So GNU ‘grep’ suppresses output from files that + appear to be binary files. To force GNU ‘grep’ to output lines + even from files that appear to be binary, use the ‘-a’ or + ‘--binary-files=text’ option. To eliminate the “Binary file + matches” messages, use the ‘-I’ or ‘--binary-files=without-match’ + option. + + 9. Why doesn’t ‘grep -lv’ print non-matching file names? + + ‘grep -lv’ lists the names of all files containing one or more + lines that do not match. To list the names of all files that + contain no matching lines, use the ‘-L’ or ‘--files-without-match’ + option. + + 10. I can do “OR” with ‘|’, but what about “AND”? + + grep 'paul' /etc/motd | grep 'franc,ois' + + finds all lines that contain both ‘paul’ and ‘franc,ois’. + + 11. Why does the empty pattern match every input line? + + The ‘grep’ command searches for lines that contain strings that + match a pattern. Every line contains the empty string, so an empty + pattern causes ‘grep’ to find a match on each line. It is not the + only such pattern: ‘^’, ‘$’, ‘.*’, and many other patterns cause + ‘grep’ to match every line. + + To match empty lines, use the pattern ‘^$’. To match blank lines, + use the pattern ‘^[[:blank:]]*$’. To match no lines at all, use + the command ‘grep -f /dev/null’. + + 12. How can I search in both standard input and in files? + + Use the special file name ‘-’: + + cat /etc/passwd | grep 'alain' - /etc/motd + + 13. How to express palindromes in a regular expression? + + It can be done by using back-references; for example, a palindrome + of 4 characters can be written with a BRE: + + grep -w -e '\(.\)\(.\).\2\1' file + + It matches the word “radar” or “civic.” + + Guglielmo Bondioni proposed a single RE that finds all palindromes + up to 19 characters long using 9 subexpressions and + 9 back-references: + + grep -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\9\8\7\6\5\4\3\2\1$' file + + Note this is done by using GNU ERE extensions; it might not be + portable to other implementations of ‘grep’. + + 14. Why is this back-reference failing? + + echo 'ba' | grep -E '(a)\1|b\1' + + This gives no output, because the first alternate ‘(a)\1’ does not + match, as there is no ‘aa’ in the input, so the ‘\1’ in the second + alternate has nothing to refer back to, meaning it will never match + anything. (The second alternate in this example can only match if + the first alternate has matched—making the second one superfluous.) + + 15. How can I match across lines? + + Standard grep cannot do this, as it is fundamentally line-based. + Therefore, merely using the ‘[:space:]’ character class does not + match newlines in the way you might expect. + + With the GNU ‘grep’ option ‘-z’ (‘--null-data’), each input and + output “line” is null-terminated; *note Other Options::. Thus, you + can match newlines in the input, but typically if there is a match + the entire input is output, so this usage is often combined with + output-suppressing options like ‘-q’, e.g.: + + printf 'foo\nbar\n' | grep -z -q 'foo[[:space:]]\+bar' + + If this does not suffice, you can transform the input before giving + it to ‘grep’, or turn to ‘awk’, ‘sed’, ‘perl’, or many other + utilities that are designed to operate across lines. + + 16. What do ‘grep’, ‘fgrep’, and ‘egrep’ stand for? + + The name ‘grep’ comes from the way line editing was done on Unix. + For example, ‘ed’ uses the following syntax to print a list of + matching lines on the screen: + + global/regular expression/print + g/re/p + + ‘fgrep’ stands for Fixed ‘grep’; ‘egrep’ stands for Extended + ‘grep’. + + +File: grep.info-t, Node: Performance, Next: Reporting Bugs, Prev: Usage, Up: Top + +5 Performance +************* + +Typically ‘grep’ is an efficient way to search text. However, it can be +quite slow in some cases, and it can search large files where even minor +performance tweaking can help significantly. Although the algorithm +used by ‘grep’ is an implementation detail that can change from release +to release, understanding its basic strengths and weaknesses can help +you improve its performance. + + The ‘grep’ command operates partly via a set of automata that are +designed for efficiency, and partly via a slower matcher that takes over +when the fast matchers run into unusual features like back-references. +When feasible, the Boyer–Moore fast string searching algorithm is used +to match a single fixed pattern, and the Aho–Corasick algorithm is used +to match multiple fixed patterns. + + Generally speaking ‘grep’ operates more efficiently in single-byte +locales, since it can avoid the special processing needed for multi-byte +characters. If your pattern will work just as well that way, setting +‘LC_ALL’ to a single-byte locale can help performance considerably. +Setting ‘LC_ALL='C'’ can be particularly efficient, as ‘grep’ is tuned +for that locale. + + Outside the ‘C’ locale, case-insensitive search, and search for +bracket expressions like ‘[a-z]’ and ‘[[=a=]b]’, can be surprisingly +inefficient due to difficulties in fast portable access to concepts like +multi-character collating elements. + + A back-reference such as ‘\1’ can hurt performance significantly in +some cases, since back-references cannot in general be implemented via a +finite state automaton, and instead trigger a backtracking algorithm +that can be quite inefficient. For example, although the pattern +‘^(.*)\1{14}(.*)\2{13}$’ matches only lines whose lengths can be written +as a sum 15x + 14y for nonnegative integers x and y, the pattern matcher +does not perform linear Diophantine analysis and instead backtracks +through all possible matching strings, using an algorithm that is +exponential in the worst case. + + On some operating systems that support files with holes—large regions +of zeros that are not physically present on secondary storage—‘grep’ can +skip over the holes efficiently without needing to read the zeros. This +optimization is not available if the ‘-a’ (‘--text’) option is used +(*note File and Directory Selection::), unless the ‘-z’ (‘--null-data’) +option is also used (*note Other Options::). + + For more about the algorithms used by ‘grep’ and about related string +matching algorithms, see: + + • Aho AV. Algorithms for finding patterns in strings. In: van Leeuwen + J. _Handbook of Theoretical Computer Science_, vol. A. New York: + Elsevier; 1990. p. 255–300. This surveys classic string matching + algorithms, some of which are used by ‘grep’. + + • Aho AV, Corasick MJ. Efficient string matching: an aid to + bibliographic search. _CACM_. 1975;18(6):333–40. + <http://dx.doi.org/10.1145/360825.360855>. This introduces the + Aho–Corasick algorithm. + + • Boyer RS, Moore JS. A fast string searching algorithm. _CACM_. + 1977;20(10):762–72. <http://dx.doi.org/10.1145/359842.359859>. This + introduces the Boyer–Moore algorithm. + + • Faro S, Lecroq T. The exact online string matching problem: a + review of the most recent results. _ACM Comput Surv_. + 2013;45(2):13. <http://dx.doi.org/10.1145/2431211.2431212>. This + surveys string matching algorithms that might help improve the + performance of ‘grep’ in the future. + + +File: grep.info-t, Node: Reporting Bugs, Next: Copying, Prev: Performance, Up: Top + +6 Reporting bugs +**************** + +Bug reports can be found at the GNU bug report logs for ‘grep’ +(http://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep). If you find a +bug not listed there, please email it to <bug-grep@gnu.org> to create a +new bug report. + +6.1 Known Bugs +============== + +Large repetition counts in the ‘{n,m}’ construct may cause ‘grep’ to use +lots of memory. In addition, certain other obscure regular expressions +require exponential time and space, and may cause ‘grep’ to run out of +memory. + + Back-references are very slow, and may require exponential time. + + +File: grep.info-t, Node: Copying, Next: Index, Prev: Reporting Bugs, Up: Top + +7 Copying +********* + +GNU ‘grep’ is licensed under the GNU GPL, which makes it “free +software”. + + The “free” in “free software” refers to liberty, not price. As some +GNU project advocates like to point out, think of “free speech” rather +than “free beer”. In short, you have the right (freedom) to run and +change ‘grep’ and distribute it to other people, and—if you want—charge +money for doing either. The important restriction is that you have to +grant your recipients the same rights and impose the same restrictions. + + This general method of licensing software is sometimes called “open +source”. The GNU project prefers the term “free software” for reasons +outlined at +<http://www.gnu.org/philosophy/open-source-misses-the-point.html>. + + This manual is free documentation in the same sense. The +documentation license is included below. The license for the program is +available with the source code, or at +<http://www.gnu.org/licenses/gpl.html>. + +* Menu: + +* GNU Free Documentation License:: + + +File: grep.info-t, Node: GNU Free Documentation License, Up: Copying + +7.1 GNU Free Documentation License +================================== + + Version 1.3, 3 November 2008 + + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + <http://fsf.org/> + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document “free” in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of “copyleft”, which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + “Document”, below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as “you”. You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A “Modified Version” of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A “Secondary Section” is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document’s overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The “Invariant Sections” are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The “Cover Texts” are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A “Transparent” copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + “Transparent” is called “Opaque”. + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The “Title Page” means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, “Title + Page” means the text near the most prominent appearance of the + work’s title, preceding the beginning of the body of the text. + + The “publisher” means any person or entity that distributes copies + of the Document to the public. + + A section “Entitled XYZ” means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) + To “Preserve the Title” of such a section when you modify the + Document means that it remains a section “Entitled XYZ” according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document’s license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document’s + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled “History”, Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled “History” in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + “History” section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled “Acknowledgements” or “Dedications”, + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled “Endorsements”. Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + “Endorsements” or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version’s + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled “Endorsements”, provided it contains + nothing but endorsements of your Modified Version by various + parties—for example, statements of peer review or that the text has + been approved by an organization as the authoritative definition of + a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + “History” in the various original documents, forming one section + Entitled “History”; likewise combine any sections Entitled + “Acknowledgements”, and any sections Entitled “Dedications”. You + must delete all sections Entitled “Endorsements.” + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an “aggregate” if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation’s users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document’s Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled “Acknowledgements”, + “Dedications”, or “History”, the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + 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, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation 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. See + <http://www.gnu.org/copyleft/>. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License “or any later version” applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy’s public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A “Massive Multiauthor Collaboration” (or “MMC”) contained in the + site means any set of copyrightable works thus published on the MMC + site. + + “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + “Incorporate” means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is “eligible for relicensing” if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the “with...Texts.” line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: grep.info-t, Node: Index, Prev: Copying, Up: Top + +Index +***** + +