mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-10 19:25:15 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63cf44e7ac | ||
|
|
9507085cf3 | ||
|
|
8d3c8c3643 | ||
|
|
16c9da79ef | ||
|
|
d0132d6bec | ||
|
|
1306676ce3 | ||
|
|
e18cda8b5e | ||
|
|
ddf896eb8e | ||
|
|
9aadbdf371 | ||
|
|
f1b769ff28 | ||
|
|
94ff2b9475 | ||
|
|
470d206b2e | ||
|
|
08f0a4e409 | ||
|
|
00fda01856 | ||
|
|
bf31619762 | ||
|
|
31a743b2bb | ||
|
|
48b43d9d83 | ||
|
|
4b9e71f993 | ||
|
|
16cd214585 | ||
|
|
f2c7ab2c1f | ||
|
|
2c377512c2 | ||
|
|
74c3b26d85 | ||
|
|
72ab1d45d2 | ||
|
|
d9302e4b73 | ||
|
|
f1394282f0 | ||
|
|
d8b1af2801 | ||
|
|
445cb4e989 | ||
|
|
f40703a29a | ||
|
|
e348b12ae0 | ||
|
|
ba6f6bf90f | ||
|
|
d9af6cc62f | ||
|
|
ab30845981 | ||
|
|
0b3870c112 | ||
|
|
e92a5d5bae | ||
|
|
02cbcfc577 | ||
|
|
8c67836b58 | ||
|
|
cae30a7df4 | ||
|
|
9fb2ad6738 | ||
|
|
8bce355d7c | ||
|
|
ae7c7ada67 | ||
|
|
9e42f7b625 | ||
|
|
f87fc33f87 | ||
|
|
7ba81a101f | ||
|
|
9190f3e726 | ||
|
|
330de47708 | ||
|
|
bb84601097 | ||
|
|
9a96ccfa20 | ||
|
|
6051d37287 | ||
|
|
2aec1bc1de | ||
|
|
c6e1f6235a | ||
|
|
ab6fbb02ad | ||
|
|
f2632e420f | ||
|
|
19f01e885f | ||
|
|
6792619fa8 | ||
|
|
645ff8cdee | ||
|
|
a726df0b44 | ||
|
|
ce209526ed | ||
|
|
b94bf14aac | ||
|
|
2a4426474d | ||
|
|
9022c575cc | ||
|
|
dae9263b7b | ||
|
|
cdd11a9322 | ||
|
|
da7ab9b7b0 | ||
|
|
0899b02570 | ||
|
|
0f23d6d25b | ||
|
|
47cef7a2ff | ||
|
|
7972022dac | ||
|
|
ea4f4c4c1b | ||
|
|
d97207ad77 | ||
|
|
3068221b53 | ||
|
|
6f0d1fd89d | ||
|
|
6526f6dbf7 | ||
|
|
817e461c23 | ||
|
|
c4e3dae3ac | ||
|
|
8cedc168fa | ||
|
|
3b14996787 | ||
|
|
041cad1677 | ||
|
|
31478b7ab7 | ||
|
|
e957bbb7d4 | ||
|
|
b5f513ef2c | ||
|
|
3afa674b1d | ||
|
|
ac481f3b08 | ||
|
|
010c94a243 | ||
|
|
d37a7c45b3 | ||
|
|
d63e24071f | ||
|
|
afd36419df | ||
|
|
6918b5fcc9 | ||
|
|
38e616f0f5 | ||
|
|
db433e9db8 | ||
|
|
870f12c270 | ||
|
|
e0a53a7f4a | ||
|
|
27c1ceb8da | ||
|
|
8f5d3a2dd5 | ||
|
|
adfd774c80 | ||
|
|
057194c61e | ||
|
|
a6f622cd50 | ||
|
|
2b8ce46775 | ||
|
|
19553c4e06 | ||
|
|
b1722803ec | ||
|
|
6f5e0eea04 | ||
|
|
e4ad4676be | ||
|
|
7b50efe542 | ||
|
|
cf90ca5d46 | ||
|
|
e373aad966 | ||
|
|
3e4c37cf7b | ||
|
|
dfaa776005 | ||
|
|
aecd294cb0 | ||
|
|
52eddd8c33 | ||
|
|
60403d1bc1 | ||
|
|
dd9f12de60 | ||
|
|
6085f203e1 | ||
|
|
7a360eeaed | ||
|
|
af550e2927 | ||
|
|
78632bbcdc | ||
|
|
483c899a17 |
+6
-24
@@ -1,30 +1,12 @@
|
|||||||
*.flc
|
|
||||||
*.patch *.log log patches applied
|
|
||||||
*.prj
|
|
||||||
ABOUT-NLS
|
|
||||||
COPYING
|
|
||||||
INSTALL
|
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
|
||||||
_*
|
|
||||||
a.exe
|
|
||||||
a.out
|
|
||||||
aclocal.m4
|
|
||||||
autom4te.cache
|
|
||||||
b.out
|
|
||||||
bison-*
|
|
||||||
build-aux
|
|
||||||
conf[0-9]*
|
|
||||||
confdefs*
|
|
||||||
config.cache
|
config.cache
|
||||||
config.h
|
config.h
|
||||||
config.hin
|
|
||||||
config.log
|
config.log
|
||||||
config.status
|
config.status
|
||||||
configure
|
|
||||||
configure.lineno
|
|
||||||
conftest*
|
|
||||||
intl
|
|
||||||
patches
|
|
||||||
releases
|
|
||||||
stamp-h*
|
stamp-h*
|
||||||
|
bison-*
|
||||||
|
patches
|
||||||
|
*.patch *.log log patches applied
|
||||||
|
*.prj
|
||||||
|
releases
|
||||||
|
autom4te.cache
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
patch_list='Bison Patches <[email protected]>'
|
|
||||||
@@ -0,0 +1,324 @@
|
|||||||
|
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 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 at translations should contact the appropriate team.
|
||||||
|
|
||||||
|
When reporting bugs in the `intl/' directory or bugs which may be
|
||||||
|
related to internationalization, you should tell about the version of
|
||||||
|
`gettext' which is used. The information can be found in the
|
||||||
|
`intl/VERSION' file, in internationalized packages.
|
||||||
|
|
||||||
|
Quick configuration advice
|
||||||
|
==========================
|
||||||
|
|
||||||
|
If you want to exploit the full power of internationalization, you
|
||||||
|
should configure it using
|
||||||
|
|
||||||
|
./configure --with-included-gettext
|
||||||
|
|
||||||
|
to force usage of internationalizing routines provided within this
|
||||||
|
package, despite the existence of internationalizing capabilities in the
|
||||||
|
operating system where this package is being installed. So far, only
|
||||||
|
the `gettext' implementation in the GNU C library version 2 provides as
|
||||||
|
many features (such as locale alias, message inheritance, automatic
|
||||||
|
charset conversion or plural form handling) as the implementation here.
|
||||||
|
It is also not possible to offer this additional functionality on top
|
||||||
|
of a `catgets' implementation. Future versions of GNU `gettext' will
|
||||||
|
very likely convey even more functionality. So it might be a good idea
|
||||||
|
to change to GNU `gettext' as soon as possible.
|
||||||
|
|
||||||
|
So you need _not_ provide this option if you are using GNU libc 2 or
|
||||||
|
you have installed a recent copy of the GNU gettext package with the
|
||||||
|
included `libintl'.
|
||||||
|
|
||||||
|
INSTALL Matters
|
||||||
|
===============
|
||||||
|
|
||||||
|
Some packages are "localizable" when properly installed; the
|
||||||
|
programs they contain can be made to speak your own native language.
|
||||||
|
Most such packages use GNU `gettext'. Other packages have their own
|
||||||
|
ways to internationalization, predating GNU `gettext'.
|
||||||
|
|
||||||
|
By default, this package will be installed to allow translation of
|
||||||
|
messages. It will automatically detect whether the system already
|
||||||
|
provides the GNU `gettext' functions. If not, the GNU `gettext' own
|
||||||
|
library will be used. This library is wholly contained within this
|
||||||
|
package, usually in the `intl/' subdirectory, so prior installation of
|
||||||
|
the GNU `gettext' package is _not_ required. Installers may use
|
||||||
|
special options at configuration time for changing the default
|
||||||
|
behaviour. The commands:
|
||||||
|
|
||||||
|
./configure --with-included-gettext
|
||||||
|
./configure --disable-nls
|
||||||
|
|
||||||
|
will respectively bypass any pre-existing `gettext' to use the
|
||||||
|
internationalizing routines provided within this package, or else,
|
||||||
|
_totally_ disable translation of messages.
|
||||||
|
|
||||||
|
When you already have GNU `gettext' installed on your system and run
|
||||||
|
configure without an option for your new package, `configure' will
|
||||||
|
probably detect the previously built and installed `libintl.a' file and
|
||||||
|
will decide to use this. This might be not what is desirable. You
|
||||||
|
should use the more recent version of the GNU `gettext' library. I.e.
|
||||||
|
if the file `intl/VERSION' shows that the library which comes with this
|
||||||
|
package is more recent, you should use
|
||||||
|
|
||||||
|
./configure --with-included-gettext
|
||||||
|
|
||||||
|
to prevent auto-detection.
|
||||||
|
|
||||||
|
The configuration process will not test for the `catgets' function
|
||||||
|
and therefore it will not be used. The reason is that even an
|
||||||
|
emulation of `gettext' on top of `catgets' could not provide all the
|
||||||
|
extensions of the GNU `gettext' library.
|
||||||
|
|
||||||
|
Internationalized packages have usually 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.
|
||||||
|
|
||||||
|
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. 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.
|
||||||
|
|
||||||
|
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'.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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://www.iro.umontreal.ca/contrib/po/HTML/', in the "National 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 `[email protected]', 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 `[email protected]' 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 skill are praised more than
|
||||||
|
programming skill, here.
|
||||||
|
|
||||||
|
Available Packages
|
||||||
|
==================
|
||||||
|
|
||||||
|
Languages are not equally supported in all packages. The following
|
||||||
|
matrix shows the current state of internationalization, as of September
|
||||||
|
2001. 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 bg cs da de el en eo es et fi fr gl he hr id it ja
|
||||||
|
+----------------------------------------------------+
|
||||||
|
a2ps | [] [] [] |
|
||||||
|
bash | [] [] [] [] |
|
||||||
|
bfd | |
|
||||||
|
binutils | [] |
|
||||||
|
bison | [] [] [] [] [] |
|
||||||
|
clisp | [] [] [] [] |
|
||||||
|
cpio | [] [] [] [] [] |
|
||||||
|
diffutils | [] [] [] [] [] [] [] |
|
||||||
|
enscript | [] [] |
|
||||||
|
error | [] [] |
|
||||||
|
fetchmail | |
|
||||||
|
fileutils | [] [] [] [] [] [] [] [] |
|
||||||
|
findutils | [] [] [] [] [] [] [] [] |
|
||||||
|
flex | [] [] [] |
|
||||||
|
freetype | |
|
||||||
|
gas | |
|
||||||
|
gawk | [] [] |
|
||||||
|
gcal | |
|
||||||
|
gcc | |
|
||||||
|
gettext | [] [] [] [] [] [] [] [] [] [] |
|
||||||
|
gnupg | [] [] [] [] [] [] [] |
|
||||||
|
gprof | |
|
||||||
|
grep | [] [] [] [] [] [] [] [] |
|
||||||
|
hello | [] [] [] [] [] [] [] [] [] [] [] |
|
||||||
|
id-utils | [] [] [] |
|
||||||
|
indent | [] [] [] [] [] |
|
||||||
|
jpilot | [] |
|
||||||
|
kbd | |
|
||||||
|
ld | [] |
|
||||||
|
libc | [] [] [] [] [] [] [] [] |
|
||||||
|
lilypond | [] |
|
||||||
|
lynx | [] [] [] [] |
|
||||||
|
m4 | [] [] [] [] [] [] [] [] |
|
||||||
|
make | [] [] [] [] [] [] |
|
||||||
|
mysecretdiary | [] |
|
||||||
|
nano | [] [] [] |
|
||||||
|
opcodes | |
|
||||||
|
parted | [] [] [] |
|
||||||
|
ptx | [] [] [] [] [] [] [] |
|
||||||
|
python | |
|
||||||
|
recode | [] [] [] [] [] [] [] [] [] |
|
||||||
|
sed | [] [] [] [] [] [] [] [] [] [] [] [] |
|
||||||
|
sh-utils | [] [] [] [] [] [] [] [] [] [] |
|
||||||
|
sharutils | [] [] [] [] [] [] [] [] |
|
||||||
|
sketch | |
|
||||||
|
soundtracker | [] [] [] |
|
||||||
|
sp | |
|
||||||
|
tar | [] [] [] [] [] [] [] [] |
|
||||||
|
texinfo | [] [] [] [] [] [] |
|
||||||
|
textutils | [] [] [] [] [] [] [] [] |
|
||||||
|
util-linux | [] [] |
|
||||||
|
wdiff | [] [] [] |
|
||||||
|
wget | [] [] [] [] [] [] [] [] [] [] |
|
||||||
|
+----------------------------------------------------+
|
||||||
|
bg cs da de el en eo es et fi fr gl he hr id it ja
|
||||||
|
0 14 24 32 11 1 8 23 13 1 33 22 4 0 7 9 18
|
||||||
|
|
||||||
|
ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh
|
||||||
|
+----------------------------------------------------+
|
||||||
|
a2ps | [] [] [] | 6
|
||||||
|
bash | | 4
|
||||||
|
bfd | | 0
|
||||||
|
binutils | | 1
|
||||||
|
bison | [] | 6
|
||||||
|
clisp | [] | 5
|
||||||
|
cpio | [] [] [] [] [] | 10
|
||||||
|
diffutils | [] [] [] [] | 11
|
||||||
|
enscript | [] [] [] | 5
|
||||||
|
error | [] [] | 4
|
||||||
|
fetchmail | | 0
|
||||||
|
fileutils | [] [] [] [] [] [] [] [] [] | 17
|
||||||
|
findutils | [] [] [] [] [] [] [] [] | 16
|
||||||
|
flex | [] [] [] | 6
|
||||||
|
freetype | | 0
|
||||||
|
gas | | 0
|
||||||
|
gawk | [] | 3
|
||||||
|
gcal | | 0
|
||||||
|
gcc | | 0
|
||||||
|
gettext | [] [] [] [] [] [] [] [] | 18
|
||||||
|
gnupg | [] [] [] | 10
|
||||||
|
gprof | | 0
|
||||||
|
grep | [] [] [] [] | 12
|
||||||
|
hello | [] [] [] [] [] [] [] [] [] [] [] | 22
|
||||||
|
id-utils | [] [] [] | 6
|
||||||
|
indent | [] [] [] [] [] [] [] | 12
|
||||||
|
jpilot | | 1
|
||||||
|
kbd | [] | 1
|
||||||
|
ld | | 1
|
||||||
|
libc | [] [] [] [] [] [] [] [] | 16
|
||||||
|
lilypond | [] [] | 3
|
||||||
|
lynx | [] [] [] [] | 8
|
||||||
|
m4 | [] [] [] [] | 12
|
||||||
|
make | [] [] [] [] [] [] | 12
|
||||||
|
mysecretdiary | | 1
|
||||||
|
nano | [] | 4
|
||||||
|
opcodes | [] | 1
|
||||||
|
parted | [] [] | 5
|
||||||
|
ptx | [] [] [] [] [] [] [] [] | 15
|
||||||
|
python | | 0
|
||||||
|
recode | [] [] [] [] | 13
|
||||||
|
sed | [] [] [] [] [] [] [] | 19
|
||||||
|
sh-utils | [] [] [] [] [] [] [] [] [] [] [] | 21
|
||||||
|
sharutils | [] [] [] | 11
|
||||||
|
sketch | | 0
|
||||||
|
soundtracker | | 3
|
||||||
|
sp | | 0
|
||||||
|
tar | [] [] [] [] [] [] [] | 15
|
||||||
|
texinfo | [] | 7
|
||||||
|
textutils | [] [] [] [] [] [] [] [] | 16
|
||||||
|
util-linux | [] [] | 4
|
||||||
|
wdiff | [] [] [] [] | 7
|
||||||
|
wget | [] [] [] [] [] [] [] | 17
|
||||||
|
+----------------------------------------------------+
|
||||||
|
33 teams ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh
|
||||||
|
53 domains 9 1 6 20 0 6 17 1 13 25 10 11 23 21 2 2 387
|
||||||
|
|
||||||
|
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 September 2001 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://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
|
||||||
|
|
||||||
|
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
|
||||||
|
to 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
|
||||||
|
`[email protected]' to make the `.pot' files available to
|
||||||
|
the translation teams.
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
|
|||||||
If the program is interactive, make it output a short notice like this
|
If the program is interactive, make it output a short notice like this
|
||||||
when it starts in an interactive mode:
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) year name of author
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
|
|||||||
-26
@@ -4,31 +4,9 @@
|
|||||||
# It is necessary if you want to build targets usually of interest
|
# It is necessary if you want to build targets usually of interest
|
||||||
# only to the maintainer.
|
# only to the maintainer.
|
||||||
|
|
||||||
# Copyright (C) 2001, 2003 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 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along
|
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
|
|
||||||
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
||||||
# command below won't work with e.g. stock DOS/Windows shells.
|
# command below won't work with e.g. stock DOS/Windows shells.
|
||||||
ifeq ($(wildcard /bin/s[h]),/bin/sh)
|
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
else
|
|
||||||
# will be used only with the next shell-test line, then overwritten
|
|
||||||
# by a configured-in value
|
|
||||||
SHELL = sh
|
|
||||||
endif
|
|
||||||
|
|
||||||
have-Makefile := $(shell test -f Makefile && echo yes)
|
have-Makefile := $(shell test -f Makefile && echo yes)
|
||||||
|
|
||||||
@@ -36,11 +14,7 @@ have-Makefile := $(shell test -f Makefile && echo yes)
|
|||||||
# give them a diagnostic.
|
# give them a diagnostic.
|
||||||
ifeq ($(have-Makefile),yes)
|
ifeq ($(have-Makefile),yes)
|
||||||
|
|
||||||
# Make tar archive easier to reproduce.
|
|
||||||
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
|
||||||
|
|
||||||
include Makefile
|
include Makefile
|
||||||
include $(srcdir)/Makefile.cfg
|
|
||||||
include $(srcdir)/Makefile.maint
|
include $(srcdir)/Makefile.maint
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,135 +0,0 @@
|
|||||||
-*- outline -*-
|
|
||||||
|
|
||||||
This file attempts to describe the rules to use when hacking Bison.
|
|
||||||
Don't put this file into the distribution. Don't mention it in the
|
|
||||||
ChangeLog.
|
|
||||||
|
|
||||||
Everything related to the development of Bison is on Savannah:
|
|
||||||
|
|
||||||
http://savannah.gnu.org/projects/bison/
|
|
||||||
|
|
||||||
|
|
||||||
* Administrivia
|
|
||||||
|
|
||||||
** If you incorporate a change from somebody on the net:
|
|
||||||
First, if it is a large change, you must make sure they have signed
|
|
||||||
the appropriate paperwork. Second, be sure to add their name and
|
|
||||||
email address to THANKS.
|
|
||||||
|
|
||||||
** If a change fixes a test, mention the test in the ChangeLog entry.
|
|
||||||
|
|
||||||
** Bug reports
|
|
||||||
If somebody reports a new bug, mention his name in the ChangeLog entry
|
|
||||||
and in the test case you write. Put him into THANKS.
|
|
||||||
|
|
||||||
The correct response to most actual bugs is to write a new test case
|
|
||||||
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
|
||||||
and check everything in.
|
|
||||||
|
|
||||||
|
|
||||||
* Hacking
|
|
||||||
|
|
||||||
** Visible changes
|
|
||||||
Which include serious bug fixes, must be mentioned in NEWS.
|
|
||||||
|
|
||||||
** Translations
|
|
||||||
Only user visible strings are to be translated: error messages, bits
|
|
||||||
of the .output file etc. This excludes impossible error messages
|
|
||||||
(comparable to assert/abort), and all the --trace output which is
|
|
||||||
meant for the maintainers only.
|
|
||||||
|
|
||||||
|
|
||||||
* Test suite
|
|
||||||
|
|
||||||
** make check
|
|
||||||
Use liberally.
|
|
||||||
|
|
||||||
** Release checks
|
|
||||||
Try to run the test suite with more severe conditions before a
|
|
||||||
release:
|
|
||||||
|
|
||||||
- Configure the package with --enable-gcc-warnings, so that one checks
|
|
||||||
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
|
||||||
cleanly too.
|
|
||||||
|
|
||||||
- run `make maintainer-check' which:
|
|
||||||
- runs `valgrind -q bison' to run Bison under Valgrind.
|
|
||||||
- runs the parsers under Valgrind.
|
|
||||||
- runs the test suite with G++ as C compiler...
|
|
||||||
|
|
||||||
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
|
||||||
instance, `-traditional' to check that the parsers are K&R. Note
|
|
||||||
that it does not make sense for glr.c, which should be ANSI,
|
|
||||||
but currently is actually GNU C, nor for lalr1.cc, which anyway is
|
|
||||||
not exercised yet in the test suite.
|
|
||||||
|
|
||||||
|
|
||||||
* Release Procedure
|
|
||||||
|
|
||||||
** Tests
|
|
||||||
See above.
|
|
||||||
|
|
||||||
** Update the foreign files
|
|
||||||
Running `./bootstrap' in the top level should update them all for you.
|
|
||||||
This covers PO files too. Sometimes a PO file contains problems that
|
|
||||||
causes it to be rejected by recent Gettext releases; please report
|
|
||||||
these to the Translation Project.
|
|
||||||
|
|
||||||
** Update NEWS
|
|
||||||
The version number, *and* the date of the release (including for
|
|
||||||
betas).
|
|
||||||
|
|
||||||
** Update ChangeLog
|
|
||||||
Should have an entry similar to `Version 1.49b.'.
|
|
||||||
Check all this in once `make distcheck' passes.
|
|
||||||
|
|
||||||
** make alpha
|
|
||||||
Running `make alpha' is absolutely perfect for beta releases: it makes
|
|
||||||
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
|
||||||
announcement. It is so neat, that that's what I use anyway for
|
|
||||||
genuine releases, but adjusting things by hand (e.g., the urls in the
|
|
||||||
announcement file, the ChangeLog which is not needed etc.).
|
|
||||||
|
|
||||||
If it fails, you're on your own...
|
|
||||||
|
|
||||||
It requires GNU Make.
|
|
||||||
|
|
||||||
** Upload
|
|
||||||
Put the tarballs/xdeltas where they should be. Or put it somewhere,
|
|
||||||
and send the URL to [email protected].
|
|
||||||
|
|
||||||
** Bump the version number
|
|
||||||
In configure.ac. Run `make', check this in.
|
|
||||||
|
|
||||||
** Announce
|
|
||||||
Complete/fix the announcement file, and send it at least to
|
|
||||||
[email protected] (if a real release, or a ``serious beta''),
|
|
||||||
[email protected], [email protected], [email protected],
|
|
||||||
and [email protected].
|
|
||||||
|
|
||||||
Send the same announcement on the comp.compilers newsgroup by sending
|
|
||||||
email to [email protected]. Do not make any Cc as the moderator will
|
|
||||||
throw away anything cross-posted or Cc'ed. It really needs to be a
|
|
||||||
separate message.
|
|
||||||
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
|
||||||
|
|
||||||
GNU Bison 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.
|
|
||||||
|
|
||||||
GNU Bison 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 GNU Bison; see the file COPYING. If not, write to the Free
|
|
||||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
02110-1301, USA.
|
|
||||||
@@ -0,0 +1,231 @@
|
|||||||
|
Copyright 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
|
This file is free documentation; the Free Software Foundation gives
|
||||||
|
unlimited permission to copy, distribute and modify it.
|
||||||
|
|
||||||
|
Basic Installation
|
||||||
|
==================
|
||||||
|
|
||||||
|
These are generic installation instructions.
|
||||||
|
|
||||||
|
The `configure' shell script attempts to guess correct values for
|
||||||
|
various system-dependent variables used during compilation. It uses
|
||||||
|
those values to create a `Makefile' in each directory of the package.
|
||||||
|
It may also create one or more `.h' files containing system-dependent
|
||||||
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
|
you can run in the future to recreate the current configuration, 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 only 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. If you're
|
||||||
|
using `csh' on an old version of System V, you might need to type
|
||||||
|
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||||
|
`configure' itself.
|
||||||
|
|
||||||
|
Running `configure' takes awhile. While running, it prints some
|
||||||
|
messages telling which features it is checking for.
|
||||||
|
|
||||||
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
|
3. Optionally, type `make check' to run any self-tests that come with
|
||||||
|
the package.
|
||||||
|
|
||||||
|
4. Type `make install' to install the programs and any data files and
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
5. You can remove the program binaries and object files from the
|
||||||
|
source code directory by typing `make clean'. To also remove the
|
||||||
|
files that `configure' created (so you can compile the package for
|
||||||
|
a different kind of computer), type `make distclean'. There is
|
||||||
|
also a `make maintainer-clean' target, but that is intended mainly
|
||||||
|
for the package's developers. If you use it, you may have to get
|
||||||
|
all sorts of other programs in order to regenerate files that came
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
Compilers and Options
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Some systems require unusual options for compilation or linking that
|
||||||
|
the `configure' script does not know about. Run `./configure --help'
|
||||||
|
for details on some of the pertinent environment variables.
|
||||||
|
|
||||||
|
You can give `configure' initial values for variables by setting
|
||||||
|
them in the environment. You can do that on the command line like this:
|
||||||
|
|
||||||
|
./configure CC=c89 CFLAGS=-O2 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 must use a version of `make' that
|
||||||
|
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||||
|
directory where you want the object files and executables to go and run
|
||||||
|
the `configure' script. `configure' automatically checks for the
|
||||||
|
source code in the directory that `configure' is in and in `..'.
|
||||||
|
|
||||||
|
If you have to use a `make' that does not support the `VPATH'
|
||||||
|
variable, you have to compile the package for one architecture at a
|
||||||
|
time in the source code directory. After you have installed the
|
||||||
|
package for one architecture, use `make distclean' before reconfiguring
|
||||||
|
for another architecture.
|
||||||
|
|
||||||
|
Installation Names
|
||||||
|
==================
|
||||||
|
|
||||||
|
By default, `make install' will install the package's files in
|
||||||
|
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||||
|
installation prefix other than `/usr/local' by giving `configure' the
|
||||||
|
option `--prefix=PATH'.
|
||||||
|
|
||||||
|
You can specify separate installation prefixes for
|
||||||
|
architecture-specific files and architecture-independent files. If you
|
||||||
|
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||||
|
PATH as the prefix for installing programs and libraries.
|
||||||
|
Documentation and other data files will still use the regular prefix.
|
||||||
|
|
||||||
|
In addition, if you use an unusual directory layout you can give
|
||||||
|
options like `--bindir=PATH' to specify different values for particular
|
||||||
|
kinds of files. Run `configure --help' for a list of the directories
|
||||||
|
you can set and what kinds of files go in them.
|
||||||
|
|
||||||
|
If the package supports it, you can cause programs to be installed
|
||||||
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
|
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||||
|
|
||||||
|
Optional Features
|
||||||
|
=================
|
||||||
|
|
||||||
|
Some packages pay attention to `--enable-FEATURE' options to
|
||||||
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
|
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||||
|
is something like `gnu-as' or `x' (for the X Window System). The
|
||||||
|
`README' should mention any `--enable-' and `--with-' options that the
|
||||||
|
package recognizes.
|
||||||
|
|
||||||
|
For packages that use the X Window System, `configure' can usually
|
||||||
|
find the X include and library files automatically, but if it doesn't,
|
||||||
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
|
`--x-libraries=DIR' to specify their locations.
|
||||||
|
|
||||||
|
Specifying the System Type
|
||||||
|
==========================
|
||||||
|
|
||||||
|
There may be some features `configure' cannot figure out
|
||||||
|
automatically, but needs to determine by the type of host the package
|
||||||
|
will run on. Usually `configure' can figure that out, but if it prints
|
||||||
|
a message saying it cannot guess the host 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 host type.
|
||||||
|
|
||||||
|
If you are _building_ compiler tools for cross-compiling, you should
|
||||||
|
use the `--target=TYPE' option 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'. In this case, you should also specify the
|
||||||
|
build platform with `--build=TYPE', because, in this case, it may not
|
||||||
|
be possible to guess the build platform (it sometimes involves
|
||||||
|
compiling and running simple test programs, and this can't be done if
|
||||||
|
the compiler is a cross compiler).
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
will cause the specified gcc to be used as the C compiler (unless it is
|
||||||
|
overridden in the site shell script).
|
||||||
|
|
||||||
|
`configure' Invocation
|
||||||
|
======================
|
||||||
|
|
||||||
|
`configure' recognizes the following options to control how it
|
||||||
|
operates.
|
||||||
|
|
||||||
|
`--help'
|
||||||
|
`-h'
|
||||||
|
Print a summary of the options to `configure', and exit.
|
||||||
|
|
||||||
|
`--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.
|
||||||
|
|
||||||
|
`configure' also accepts some other, not widely useful, options. Run
|
||||||
|
`configure --help' for more details.
|
||||||
|
|
||||||
+23
-25
@@ -1,32 +1,30 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
AUTOMAKE_OPTIONS = 1.5 check-news readme-alpha dist-bzip2
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
|
||||||
## it under the terms of the GNU General Public License as published by
|
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
SUBDIRS = config po runtime-po lib data src doc examples tests
|
SUBDIRS = config intl po lib src doc m4 tests
|
||||||
|
|
||||||
# Files installed for use by Automake.
|
EXTRA_DIST = REFERENCES configure.bat OChangeLog Makefile.maint GNUmakefile
|
||||||
aclocaldir = @aclocaldir@
|
|
||||||
aclocal_DATA = m4/bison-i18n.m4
|
|
||||||
|
|
||||||
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
DISTCLEANFILES = intl/libintl.h
|
||||||
OChangeLog PACKAGING
|
|
||||||
|
|
||||||
.PHONY: maintainer-check
|
|
||||||
maintainer-check:
|
## ---------------------------- ##
|
||||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
## Customizing Makefile.maint. ##
|
||||||
|
## ---------------------------- ##
|
||||||
|
|
||||||
|
move_if_change = $(srcdir)/config/move-if-change
|
||||||
|
prev_version_file = $(srcdir)/config/prev-version.txt
|
||||||
|
release_archive_dir = releases
|
||||||
|
|
||||||
|
# Uploading betas.
|
||||||
|
hosts = alpha
|
||||||
|
alpha_host = alpha.gnu.org
|
||||||
|
alpha_url_dir = gnu/bison
|
||||||
|
|
||||||
|
# Files to update automatically.
|
||||||
|
wget_files = $(srcdir)/config/config.guess $(srcdir)/config/config.sub \
|
||||||
|
$(srcdir)/config/texinfo.tex
|
||||||
|
|
||||||
|
cvs_files = $(srcdir)/config/missing
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
# Customize Makefile.maint for Bison. -*- makefile -*-
|
|
||||||
# Copyright (C) 2003 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301, USA.
|
|
||||||
|
|
||||||
prev_version_file = $(srcdir)/config/prev-version.txt
|
|
||||||
announce_gen = $(srcdir)/config/announce-gen
|
|
||||||
release_archive_dir = releases
|
|
||||||
|
|
||||||
# Use alpha.gnu.org for alpha and beta releases.
|
|
||||||
# Use ftp.gnu.org for major releases.
|
|
||||||
gnu_ftp_host-alpha = alpha
|
|
||||||
gnu_ftp_host-beta = alpha
|
|
||||||
gnu_ftp_host-major = ftp
|
|
||||||
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
|
||||||
|
|
||||||
url_dir_list = \
|
|
||||||
ftp://$(gnu_rel_host).gnu.org/gnu/bison
|
|
||||||
|
|
||||||
# Files to update automatically.
|
|
||||||
wget_files = \
|
|
||||||
$(srcdir)/config/config.guess \
|
|
||||||
$(srcdir)/config/config.sub \
|
|
||||||
$(srcdir)/config/texinfo.tex \
|
|
||||||
|
|
||||||
cvs_files = \
|
|
||||||
$(srcdir)/config/install-sh \
|
|
||||||
$(srcdir)/config/mdate-sh \
|
|
||||||
$(srcdir)/config/missing \
|
|
||||||
$(srcdir)/config/mkinstalldirs
|
|
||||||
|
|
||||||
# Tests not to run.
|
|
||||||
# local-checks-to-skip ?= \
|
|
||||||
# author_mark_check \
|
|
||||||
# strftime-check syntax-check makefile_path_separator_check \
|
|
||||||
# makefile-check
|
|
||||||
+457
@@ -0,0 +1,457 @@
|
|||||||
|
# Makefile.in generated by automake 1.5a from Makefile.am.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
SHELL = @SHELL@
|
||||||
|
|
||||||
|
srcdir = @srcdir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
|
||||||
|
bindir = @bindir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
datadir = @datadir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
libdir = @libdir@
|
||||||
|
infodir = @infodir@
|
||||||
|
mandir = @mandir@
|
||||||
|
includedir = @includedir@
|
||||||
|
oldincludedir = /usr/include
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
top_builddir = .
|
||||||
|
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = @program_transform_name@
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_triplet = @host@
|
||||||
|
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AUTOM4TE = @AUTOM4TE@
|
||||||
|
AWK = @AWK@
|
||||||
|
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
||||||
|
CATALOGS = @CATALOGS@
|
||||||
|
CATOBJEXT = @CATOBJEXT@
|
||||||
|
CC = @CC@
|
||||||
|
CPP = @CPP@
|
||||||
|
DATADIRNAME = @DATADIRNAME@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
GCC = @GCC@
|
||||||
|
GENCAT = @GENCAT@
|
||||||
|
GLIBC21 = @GLIBC21@
|
||||||
|
GMOFILES = @GMOFILES@
|
||||||
|
GMSGFMT = @GMSGFMT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
INSTOBJEXT = @INSTOBJEXT@
|
||||||
|
INTLBISON = @INTLBISON@
|
||||||
|
INTLLIBS = @INTLLIBS@
|
||||||
|
INTLOBJS = @INTLOBJS@
|
||||||
|
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
||||||
|
LIBICONV = @LIBICONV@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||||
|
MSGFMT = @MSGFMT@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
POFILES = @POFILES@
|
||||||
|
POSUB = @POSUB@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
U = @U@
|
||||||
|
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||||
|
USE_NLS = @USE_NLS@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.5 check-news readme-alpha dist-bzip2
|
||||||
|
|
||||||
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
|
SUBDIRS = config intl po lib src doc m4 tests
|
||||||
|
|
||||||
|
EXTRA_DIST = REFERENCES configure.bat OChangeLog Makefile.maint GNUmakefile
|
||||||
|
|
||||||
|
DISTCLEANFILES = intl/libintl.h
|
||||||
|
|
||||||
|
move_if_change = $(srcdir)/config/move-if-change
|
||||||
|
prev_version_file = $(srcdir)/config/prev-version.txt
|
||||||
|
release_archive_dir = releases
|
||||||
|
|
||||||
|
# Uploading betas.
|
||||||
|
hosts = alpha
|
||||||
|
alpha_host = alpha.gnu.org
|
||||||
|
alpha_url_dir = gnu/bison
|
||||||
|
|
||||||
|
# Files to update automatically.
|
||||||
|
wget_files = $(srcdir)/config/config.guess $(srcdir)/config/config.sub \
|
||||||
|
$(srcdir)/config/texinfo.tex
|
||||||
|
|
||||||
|
|
||||||
|
cvs_files = $(srcdir)/config/missing
|
||||||
|
subdir = .
|
||||||
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
|
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
||||||
|
CONFIG_HEADER = config.h
|
||||||
|
CONFIG_CLEAN_FILES = intl/Makefile
|
||||||
|
DIST_SOURCES =
|
||||||
|
|
||||||
|
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
|
||||||
|
uninstall-info-recursive all-recursive install-data-recursive \
|
||||||
|
install-exec-recursive installdirs-recursive install-recursive \
|
||||||
|
uninstall-recursive check-recursive installcheck-recursive
|
||||||
|
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \
|
||||||
|
Makefile.am Makefile.in NEWS THANKS aclocal.m4 config.hin \
|
||||||
|
configure configure.in
|
||||||
|
DIST_SUBDIRS = $(SUBDIRS)
|
||||||
|
all: config.h
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||||
|
cd $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||||
|
|
||||||
|
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
$(SHELL) ./config.status --recheck
|
||||||
|
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||||
|
cd $(srcdir) && $(AUTOCONF)
|
||||||
|
|
||||||
|
$(ACLOCAL_M4): configure.in m4/c-bs-a.m4 m4/codeset.m4 m4/dmalloc.m4 m4/error.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/malloc.m4 m4/mbrtowc.m4 m4/mbstate_t.m4 m4/prereq.m4 m4/progtest.m4 m4/realloc.m4 m4/strerror_r.m4 m4/warning.m4
|
||||||
|
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||||
|
|
||||||
|
config.h: stamp-h1
|
||||||
|
@if test ! -f $@; then \
|
||||||
|
rm -f stamp-h1; \
|
||||||
|
$(MAKE) stamp-h1; \
|
||||||
|
else :; fi
|
||||||
|
|
||||||
|
stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
|
||||||
|
@rm -f stamp-h1
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||||
|
|
||||||
|
$(srcdir)/config.hin: $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||||
|
cd $(top_srcdir) && $(AUTOHEADER)
|
||||||
|
touch $(srcdir)/config.hin
|
||||||
|
|
||||||
|
distclean-hdr:
|
||||||
|
-rm -f config.h
|
||||||
|
intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||||
|
uninstall-info-am:
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
$(RECURSIVE_TARGETS):
|
||||||
|
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||||
|
dot_seen=no; \
|
||||||
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
echo "Making $$target in $$subdir"; \
|
||||||
|
if test "$$subdir" = "."; then \
|
||||||
|
dot_seen=yes; \
|
||||||
|
local_target="$$target-am"; \
|
||||||
|
else \
|
||||||
|
local_target="$$target"; \
|
||||||
|
fi; \
|
||||||
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||||
|
done; \
|
||||||
|
if test "$$dot_seen" = "no"; then \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
|
fi; test -z "$$fail"
|
||||||
|
|
||||||
|
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||||
|
maintainer-clean-recursive:
|
||||||
|
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||||
|
dot_seen=no; \
|
||||||
|
case "$@" in \
|
||||||
|
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||||
|
*) list='$(SUBDIRS)' ;; \
|
||||||
|
esac; \
|
||||||
|
rev=''; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = "."; then :; else \
|
||||||
|
rev="$$subdir $$rev"; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
rev="$$rev ."; \
|
||||||
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
|
for subdir in $$rev; do \
|
||||||
|
echo "Making $$target in $$subdir"; \
|
||||||
|
if test "$$subdir" = "."; then \
|
||||||
|
local_target="$$target-am"; \
|
||||||
|
else \
|
||||||
|
local_target="$$target"; \
|
||||||
|
fi; \
|
||||||
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||||
|
done && test -z "$$fail"
|
||||||
|
tags-recursive:
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||||
|
done
|
||||||
|
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) ' { files[$$0] = 1; } \
|
||||||
|
END { for (i in files) print i; }'`; \
|
||||||
|
mkid -fID $$unique $(LISP)
|
||||||
|
|
||||||
|
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
tags=; \
|
||||||
|
here=`pwd`; \
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = .; then :; else \
|
||||||
|
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) ' { files[$$0] = 1; } \
|
||||||
|
END { for (i in files) print i; }'`; \
|
||||||
|
test -z "$(ETAGS_ARGS)config.hin$$unique$(LISP)$$tags" \
|
||||||
|
|| etags $(ETAGS_ARGS) $$tags config.hin $$unique $(LISP)
|
||||||
|
|
||||||
|
GTAGS:
|
||||||
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
|
&& cd $(top_srcdir) \
|
||||||
|
&& gtags -i $(GTAGS_ARGS) $$here
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
|
||||||
|
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
|
top_distdir = .
|
||||||
|
# Avoid unsightly `./'.
|
||||||
|
distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
|
||||||
|
GZIP_ENV = --best
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; \
|
||||||
|
then :; else \
|
||||||
|
echo "NEWS not updated; not releasing" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||||
|
mkdir $(distdir)
|
||||||
|
$(mkinstalldirs) $(distdir)/intl $(distdir)/po $(distdir)/tests
|
||||||
|
@for file in $(DISTFILES); do \
|
||||||
|
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||||
|
$(mkinstalldirs) "$(distdir)/$$dir"; \
|
||||||
|
fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
cp -pR $$d/$$file $(distdir) \
|
||||||
|
|| exit 1; \
|
||||||
|
else \
|
||||||
|
test -f $(distdir)/$$file \
|
||||||
|
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
for subdir in $(SUBDIRS); do \
|
||||||
|
if test "$$subdir" = .; then :; else \
|
||||||
|
test -d $(distdir)/$$subdir \
|
||||||
|
|| mkdir $(distdir)/$$subdir \
|
||||||
|
|| exit 1; \
|
||||||
|
(cd $$subdir && \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
top_distdir="$(top_distdir)" \
|
||||||
|
distdir=../$(distdir)/$$subdir \
|
||||||
|
distdir) \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||||
|
|| chmod -R a+r $(distdir)
|
||||||
|
dist-gzip: distdir
|
||||||
|
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||||
|
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||||
|
|
||||||
|
dist-bzip2: distdir
|
||||||
|
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||||
|
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||||
|
|
||||||
|
dist dist-all: distdir
|
||||||
|
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||||
|
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||||
|
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(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
|
||||||
|
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
|
||||||
|
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||||
|
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||||
|
mkdir $(distdir)/=build
|
||||||
|
mkdir $(distdir)/=inst
|
||||||
|
chmod a-w $(distdir)
|
||||||
|
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
|
||||||
|
&& cd $(distdir)/=build \
|
||||||
|
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||||
|
--with-included-gettext \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||||
|
&& (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
|
||||||
|
|| { echo "ERROR: files left after uninstall:" ; \
|
||||||
|
find $$dc_install_base -type f -print ; \
|
||||||
|
exit 1; } >&2 ) \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) distclean \
|
||||||
|
&& rm -f $(distdir).tar.gz \
|
||||||
|
&& (test `find . -type f -print | wc -l` -eq 0 \
|
||||||
|
|| { echo "ERROR: files left after distclean:" ; \
|
||||||
|
find . -type f -print ; \
|
||||||
|
exit 1; } >&2 )
|
||||||
|
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
|
||||||
|
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||||
|
sed 'h;s/./=/g;p;x;p;x'
|
||||||
|
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:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
`test -z '$(STRIP)' || \
|
||||||
|
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||||
|
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
@echo "This command is intended for maintainers to use"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
clean: clean-recursive
|
||||||
|
|
||||||
|
clean-am: clean-generic mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-recursive
|
||||||
|
-rm -f config.status config.cache config.log
|
||||||
|
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||||
|
|
||||||
|
dvi: dvi-recursive
|
||||||
|
|
||||||
|
dvi-am:
|
||||||
|
|
||||||
|
info: info-recursive
|
||||||
|
|
||||||
|
info-am:
|
||||||
|
|
||||||
|
install-data-am:
|
||||||
|
|
||||||
|
install-exec-am:
|
||||||
|
|
||||||
|
install-info: install-info-recursive
|
||||||
|
|
||||||
|
install-man:
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-recursive
|
||||||
|
|
||||||
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-recursive
|
||||||
|
|
||||||
|
mostlyclean-am: mostlyclean-generic
|
||||||
|
|
||||||
|
uninstall-am: uninstall-info-am
|
||||||
|
|
||||||
|
uninstall-info: uninstall-info-recursive
|
||||||
|
|
||||||
|
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
|
||||||
|
clean-generic clean-recursive dist dist-all dist-bzip2 \
|
||||||
|
dist-gzip distcheck distclean distclean-generic distclean-hdr \
|
||||||
|
distclean-recursive distclean-tags distdir dvi dvi-am \
|
||||||
|
dvi-recursive info info-am info-recursive install install-am \
|
||||||
|
install-data install-data-am install-data-recursive \
|
||||||
|
install-exec install-exec-am install-exec-recursive \
|
||||||
|
install-info install-info-am install-info-recursive install-man \
|
||||||
|
install-recursive install-strip installcheck installcheck-am \
|
||||||
|
installdirs installdirs-am installdirs-recursive \
|
||||||
|
maintainer-clean maintainer-clean-generic \
|
||||||
|
maintainer-clean-recursive mostlyclean mostlyclean-generic \
|
||||||
|
mostlyclean-recursive tags tags-recursive uninstall \
|
||||||
|
uninstall-am uninstall-info-am uninstall-info-recursive \
|
||||||
|
uninstall-recursive
|
||||||
|
|
||||||
|
# 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:
|
||||||
+250
-503
@@ -1,8 +1,8 @@
|
|||||||
# -*-Makefile-*-
|
# -*-Makefile-*-
|
||||||
# This Makefile fragment is shared between the coreutils,
|
# This Makefile fragment is shared between fileutils, sh-utils, textutils,
|
||||||
# CPPI, Bison, and Autoconf.
|
# CPPI, Bison, and Autoconf.
|
||||||
|
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
## Copyright 2001 Free Software Foundation, Inc.
|
||||||
##
|
##
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## 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
|
## it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,485 +16,43 @@
|
|||||||
##
|
##
|
||||||
## You should have received a copy of the GNU General Public License
|
## You should have received a copy of the GNU General Public License
|
||||||
## along with this program; if not, write to the Free Software
|
## along with this program; if not, write to the Free Software
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
## 02110-1301, USA.
|
## 02111-1307, USA.
|
||||||
|
|
||||||
# This is reported not to work with make-3.79.1
|
|
||||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
|
||||||
ME := Makefile.maint
|
|
||||||
|
|
||||||
# Do not save the original name or timestamp in the .tar.gz file.
|
# Do not save the original name or timestamp in the .tar.gz file.
|
||||||
# Use --rsyncable if available.
|
GZIP_ENV = '--no-name --best'
|
||||||
GZIP_ENV = \
|
|
||||||
"--no-name --best$$( \
|
|
||||||
case $$(gzip --help) in \
|
|
||||||
(*--rsyncable*) echo ' --rsyncable';; \
|
|
||||||
esac \
|
|
||||||
)"
|
|
||||||
|
|
||||||
CVS = cvs
|
CVS = cvs
|
||||||
|
|
||||||
CVS_LIST = sh -c ' \
|
prev_version_file ?= .prev-version
|
||||||
(cvsu --find --types=AFGM $$*) 2>/dev/null || \
|
|
||||||
awk -F/ '\''{ \
|
|
||||||
if (!$$1 && $$3 !~ /^-/) { \
|
|
||||||
f=FILENAME; \
|
|
||||||
sub(/CVS\/Entries/, "", f); \
|
|
||||||
print f $$2; \
|
|
||||||
}}'\'' \
|
|
||||||
$$(find $${*-*} -name Entries -print) /dev/null \
|
|
||||||
' dummy
|
|
||||||
|
|
||||||
CVS_LIST_EXCEPT = \
|
|
||||||
$(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
|
||||||
|
|
||||||
ifeq ($(origin prev_version_file), undefined)
|
|
||||||
prev_version_file = .prev-version
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||||
PREV_VERSION := $(shell cat $(prev_version_file))
|
PREV_VERSION := $(shell cat $(prev_version_file))
|
||||||
|
PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
|
||||||
|
|
||||||
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
||||||
tag-this-version = $(subst .,_,$(VERSION))
|
tag-this-version = $(subst .,_,$(VERSION))
|
||||||
|
tag-prev-version = $(subst .,_,$(PREV_VERSION))
|
||||||
this-cvs-tag = $(tag-package)-$(tag-this-version)
|
this-cvs-tag = $(tag-package)-$(tag-this-version)
|
||||||
|
prev-cvs-tag = $(tag-package)-$(tag-prev-version)
|
||||||
my_distdir = $(PACKAGE)-$(VERSION)
|
my_distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
|
||||||
# Old releases are stored here.
|
# Old releases are stored here.
|
||||||
# Used for diffs and xdeltas.
|
# Used for diffs and xdeltas.
|
||||||
release_archive_dir ?= ../release
|
release_archive_dir ?= ../release
|
||||||
|
|
||||||
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
|
||||||
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
|
||||||
export LC_ALL = C
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------------- ##
|
|
||||||
## Sanity checks. ##
|
|
||||||
## --------------- ##
|
|
||||||
|
|
||||||
# Checks that don't require cvs.
|
|
||||||
# Run `changelog-check' last, as previous test may reveal problems requiring
|
|
||||||
# new ChangeLog entries.
|
|
||||||
local-checks-available = \
|
|
||||||
po-check copyright-check writable-files m4-check author_mark_check \
|
|
||||||
changelog-check strftime-check syntax-check makefile_path_separator_check \
|
|
||||||
makefile-check
|
|
||||||
.PHONY: $(local-checks-available)
|
|
||||||
|
|
||||||
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
|
||||||
|
|
||||||
.PHONY: $(syntax-check-rules)
|
|
||||||
syntax-check-rules = \
|
|
||||||
sc_cast_of_argument_to_free \
|
|
||||||
sc_cast_of_x_alloc_return_value \
|
|
||||||
sc_cast_of_alloca_return_value \
|
|
||||||
sc_changelog \
|
|
||||||
sc_dd_max_sym_length \
|
|
||||||
sc_error_exit_success \
|
|
||||||
sc_file_system \
|
|
||||||
sc_obsolete_symbols \
|
|
||||||
sc_prohibit_atoi_atof \
|
|
||||||
sc_prohibit_jm_in_m4 \
|
|
||||||
sc_root_tests \
|
|
||||||
sc_space_tab \
|
|
||||||
sc_sun_os_names \
|
|
||||||
sc_system_h_headers \
|
|
||||||
sc_tight_scope \
|
|
||||||
sc_trailing_space \
|
|
||||||
sc_unmarked_diagnostics
|
|
||||||
|
|
||||||
syntax-check: $(syntax-check-rules)
|
|
||||||
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
|
||||||
# $$(find -type f -name '*.[chly]') && \
|
|
||||||
# { echo '$(ME): found conditional include' 1>&2; \
|
|
||||||
# exit 1; } || :
|
|
||||||
|
|
||||||
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
|
||||||
# $(srcdir)/{lib,src}/*.[chy] && \
|
|
||||||
# { echo '$(ME): FIXME' 1>&2; \
|
|
||||||
# exit 1; } || :
|
|
||||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
|
||||||
|
|
||||||
sc_cast_of_argument_to_free:
|
|
||||||
@grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
|
|
||||||
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_cast_of_x_alloc_return_value:
|
|
||||||
@grep -nE --exclude=$(srcdir)/lib/regex.c \
|
|
||||||
'\*\) *x(m|c|re)alloc\>' \
|
|
||||||
$(srcdir)/{lib,src}/*.[chy] && \
|
|
||||||
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_cast_of_alloca_return_value:
|
|
||||||
@grep -nE '\*\) *alloca\>' \
|
|
||||||
$(srcdir)/src/*.[chy] && \
|
|
||||||
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_space_tab:
|
|
||||||
@grep -n '[ ] ' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Don't use the old ato* functions in `real' code.
|
|
||||||
# They provide no error checking mechanism.
|
|
||||||
# Instead, use strto* functions.
|
|
||||||
sc_prohibit_atoi_atof:
|
|
||||||
@grep -nE '\<(ato[filq]|ato''ll)\>' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
|
||||||
# since when that parameter is 0, error does not exit. Use `0' instead.
|
|
||||||
sc_error_exit_success:
|
|
||||||
@grep -nF 'error (EXIT_SUCCESS,' \
|
|
||||||
$$(find -type f -name '*.[chly]') && \
|
|
||||||
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_file_system:
|
|
||||||
@grep -ni 'file''system' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found use of "file''system";' \
|
|
||||||
'rewrite to use "file system"' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_obsolete_symbols:
|
|
||||||
@grep -nE '\<(HAVE_''FCNTL_H)\>' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): do not use HAVE_''FCNTL_H' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
|
||||||
|
|
||||||
# Each nonempty line must start with a year number, or a TAB.
|
|
||||||
sc_changelog:
|
|
||||||
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
|
|
||||||
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
|
||||||
# with the strings from the two affected variables.
|
|
||||||
dd_c = $(srcdir)/src/dd.c
|
|
||||||
sc_dd_max_sym_length:
|
|
||||||
ifneq ($(wildcard $(dd_c)),)
|
|
||||||
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
|
||||||
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
|
||||||
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
|
||||||
| wc --max-line-length); \
|
|
||||||
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
|
||||||
|tr -d '"' | wc --max-line-length); \
|
|
||||||
if test "$$len" = "$$max"; then :; else \
|
|
||||||
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Many m4 macros names once began with `jm_'.
|
|
||||||
# On 2004-04-13, they were all changed to start with gl_ instead.
|
|
||||||
# Make sure that none are inadvertently reintroduced.
|
|
||||||
sc_prohibit_jm_in_m4:
|
|
||||||
@grep -nE 'jm_[A-Z]' \
|
|
||||||
$$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
|
|
||||||
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
sc_root_tests:
|
|
||||||
@t1=sc-root.expected; t2=sc-root.actual; \
|
|
||||||
grep -nl '^PRIV_CHECK_ARG=require-root' \
|
|
||||||
$$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
|
|
||||||
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
|
|
||||||
$(srcdir)/tests/Makefile.am |sort > $$t2; \
|
|
||||||
diff -u $$t1 $$t2 || diff=1; \
|
|
||||||
rm -f $$t1 $$t2; \
|
|
||||||
test "$$diff" \
|
|
||||||
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Create a list of regular expressions matching the names
|
|
||||||
# of files included from system.h. Exclude a couple.
|
|
||||||
.re-list:
|
|
||||||
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
|
||||||
| grep -Ev 'sys/(param|file)\.h' \
|
|
||||||
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
|
||||||
> $@-t
|
|
||||||
@mv $@-t $@
|
|
||||||
|
|
||||||
# Files in src/ should not include directly any of
|
|
||||||
# the headers already included via system.h.
|
|
||||||
sc_system_h_headers: .re-list
|
|
||||||
if test -f $(srcdir)/src/system.h; then \
|
|
||||||
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
|
||||||
grep -nE -f .re-list \
|
|
||||||
$$($(CVS_LIST) src | \
|
|
||||||
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
|
||||||
&& { echo '$(ME): the above are already included via system.h'\
|
|
||||||
1>&2; exit 1; } || :; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
sc_sun_os_names:
|
|
||||||
@grep -nEi \
|
|
||||||
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_tight_scope:
|
|
||||||
$(MAKE) -C src $@
|
|
||||||
|
|
||||||
sc_trailing_space:
|
|
||||||
@grep -n '[ ]$$' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found trailing space(s)' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Look for diagnostics that aren't marked for translation.
|
|
||||||
# This won't find any for which error's format string is on a separate line.
|
|
||||||
sc_unmarked_diagnostics:
|
|
||||||
@grep -nE \
|
|
||||||
'\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c \
|
|
||||||
| grep -v '_(' && \
|
|
||||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Ensure that date's --help output stays in sync with the info
|
|
||||||
# documentation for GNU strftime. The only exception is %N,
|
|
||||||
# which date accepts but GNU strftime does not.
|
|
||||||
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
|
||||||
strftime-check:
|
|
||||||
if test -f $(srcdir)/src/date.c; then \
|
|
||||||
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
|
||||||
| $(extract_char) > $@-src; \
|
|
||||||
{ echo N; \
|
|
||||||
info libc date calendar format | grep '^ `%.'\' \
|
|
||||||
| $(extract_char); } | sort > $@-info; \
|
|
||||||
diff -u $@-src $@-info || exit 1; \
|
|
||||||
rm -f $@-src $@-info; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure that we use only the standard $(VAR) notation,
|
|
||||||
# not @...@ in Makefile.am, now that we can rely on automake
|
|
||||||
# to emit a definition for each substituted variable.
|
|
||||||
makefile-check:
|
|
||||||
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
|
||||||
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
news-date-check: NEWS
|
|
||||||
today=`date +%Y-%m-%d`; \
|
|
||||||
if head NEWS | grep '^\*.*'$$today >/dev/null; then \
|
|
||||||
:; \
|
|
||||||
else \
|
|
||||||
echo "today's date is not in NEWS" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
changelog-check:
|
|
||||||
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
|
||||||
:; \
|
|
||||||
else \
|
|
||||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
m4-check:
|
|
||||||
@grep 'AC_DEFUN([^[]' m4/*.m4 \
|
|
||||||
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
|
||||||
# FIXME: don't hard-code src/false.c below; use a more general mechanism.
|
|
||||||
po-check:
|
|
||||||
if test -f po/POTFILES.in; then \
|
|
||||||
grep -E -v '^(#|$$)' po/POTFILES.in \
|
|
||||||
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
|
||||||
files=; \
|
|
||||||
for file in lib/*.[chly] src/*.[chly]; do \
|
|
||||||
case $$file in \
|
|
||||||
*.[ch]) \
|
|
||||||
base=`expr " $$file" : ' \(.*\)\..'`; \
|
|
||||||
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
|
||||||
esac; \
|
|
||||||
files="$$files $$file"; \
|
|
||||||
done; \
|
|
||||||
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > $@-2; \
|
|
||||||
diff -u $@-1 $@-2 || exit 1; \
|
|
||||||
rm -f $@-1 $@-2; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
|
||||||
# the English word `and', the string must be marked with `N_ (...)' so that
|
|
||||||
# gettext recognizes it as a string requiring translation.
|
|
||||||
author_mark_check:
|
|
||||||
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
|
||||||
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Sometimes it is useful to change the PATH environment variable
|
|
||||||
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
|
||||||
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
|
||||||
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
|
||||||
# and there probably aren't many projects with so many Makefile.am files
|
|
||||||
# that we'd have to worry about limits on command line length.
|
|
||||||
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
|
||||||
makefile_path_separator_check:
|
|
||||||
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
|
||||||
&& { echo $(msg) 1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Check that `make alpha' will not fail at the end of the process.
|
|
||||||
writable-files:
|
|
||||||
if test -d $(release_archive_dir); then :; else \
|
|
||||||
mkdir $(release_archive_dir); \
|
|
||||||
fi
|
|
||||||
for file in $(distdir).tar.gz $(xd-delta) \
|
|
||||||
$(release_archive_dir)/$(distdir).tar.gz \
|
|
||||||
$(release_archive_dir)/$(xd-delta); do \
|
|
||||||
test -e $$file || continue; \
|
|
||||||
test -w $$file \
|
|
||||||
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
|
||||||
done; \
|
|
||||||
test "$$fail" && exit 1 || :
|
|
||||||
|
|
||||||
v_etc_file = lib/version-etc.c
|
|
||||||
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
|
||||||
copyright-check:
|
|
||||||
@if test -f $(v_etc_file); then \
|
|
||||||
grep 'enum { COPYRIGHT_YEAR = 2005 };' $(v_etc_file) \
|
|
||||||
>/dev/null \
|
|
||||||
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
|
||||||
exit 1; }; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Sanity checks with the CVS repository.
|
|
||||||
cvs-tag-check:
|
|
||||||
echo $(this-cvs-tag); \
|
|
||||||
if $(CVS) -n log -h README | grep -e $(this-cvs-tag): >/dev/null; then \
|
|
||||||
echo "$(this-cvs-tag) as already been used; not tagging" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
else :; fi
|
|
||||||
|
|
||||||
cvs-diff-check:
|
|
||||||
if $(CVS) diff >cvs-diffs; then \
|
|
||||||
rm cvs-diffs; \
|
|
||||||
else \
|
|
||||||
echo "Some files are locally modified:" 1>&2; \
|
|
||||||
cat cvs-diffs; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
cvs-check: cvs-diff-check cvs-tag-check
|
|
||||||
|
|
||||||
maintainer-distcheck: changelog-check
|
|
||||||
$(MAKE) distcheck
|
|
||||||
$(MAKE) my-distcheck
|
|
||||||
|
|
||||||
|
|
||||||
# Tag before making distribution. Also, don't make a distribution if
|
|
||||||
# checks fail. Also, make sure the NEWS file is up-to-date.
|
|
||||||
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
|
|
||||||
cvs-dist: $(local-check) cvs-check maintainer-distcheck
|
|
||||||
$(CVS) update po
|
|
||||||
$(CVS) tag -c $(this-cvs-tag)
|
|
||||||
$(MAKE) dist
|
|
||||||
|
|
||||||
# Use this to make sure we don't run these programs when building
|
|
||||||
# from a virgin tgz file, below.
|
|
||||||
null_AM_MAKEFLAGS = \
|
|
||||||
ACLOCAL=false \
|
|
||||||
AUTOCONF=false \
|
|
||||||
AUTOMAKE=false \
|
|
||||||
AUTOHEADER=false \
|
|
||||||
MAKEINFO=false
|
|
||||||
|
|
||||||
# Detect format-string/arg-list mismatches that would normally be obscured
|
|
||||||
# by the use of _(). The --disable-nls effectively defines away that macro,
|
|
||||||
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
|
|
||||||
# treated as a failure. Also, check for shadowing problems with -Wshadow.
|
|
||||||
# These CFLAGS are pretty strict. If you build this target, you probably
|
|
||||||
# have to have a recent version of gcc and glibc headers.
|
|
||||||
TMPDIR ?= /tmp
|
|
||||||
t=$(TMPDIR)/$(PACKAGE)/test
|
|
||||||
my-distcheck: $(local-check)
|
|
||||||
-rm -rf $(t)
|
|
||||||
mkdir -p $(t)
|
|
||||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
|
||||||
cd $(t)/$(distdir) \
|
|
||||||
&& ./configure --disable-nls \
|
|
||||||
&& $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
|
|
||||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
|
||||||
&& $(MAKE) dvi \
|
|
||||||
&& $(MAKE) check \
|
|
||||||
&& $(MAKE) distclean
|
|
||||||
(cd $(t) && mv $(distdir) $(distdir).old \
|
|
||||||
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
|
||||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
|
||||||
-rm -rf $(t)
|
|
||||||
@echo "========================"; \
|
|
||||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
|
||||||
echo "========================"
|
|
||||||
|
|
||||||
WGET = wget
|
|
||||||
WGETFLAGS = -C off
|
|
||||||
|
|
||||||
tgz-md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
|
|
||||||
tgz-sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
|
|
||||||
bz2-md5 = $(shell md5sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
|
||||||
bz2-sha1 = $(shell sha1sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
|
||||||
xdelta-md5 = $(shell md5sum < $(xd-delta)|sed 's/ -//')
|
|
||||||
xdelta-sha1 = $(shell sha1sum < $(xd-delta)|sed 's/ -//')
|
|
||||||
tgz-size = $(shell du --human $(my_distdir).tar.gz|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
bz2-size = $(shell du --human $(my_distdir).tar.bz2|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
xd-size = $(shell du --human $(xd-delta)|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
|
|
||||||
rel-check:
|
|
||||||
tarz=/tmp/rel-check-tarz-$$$$; \
|
|
||||||
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
|
||||||
set -e; \
|
|
||||||
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
|
||||||
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
|
|
||||||
echo "$(md5) -" > $$md5_tmp; \
|
|
||||||
md5sum -c $$md5_tmp < $$tarz
|
|
||||||
|
|
||||||
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
|
||||||
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
|
||||||
|
|
||||||
rel-files = $(xd-delta) $(DIST_ARCHIVES)
|
|
||||||
announcement: NEWS ChangeLog $(rel-files)
|
|
||||||
@./announce-gen \
|
|
||||||
--release-type=$(RELEASE_TYPE) \
|
|
||||||
--package=$(PACKAGE) \
|
|
||||||
--prev=$(PREV_VERSION) \
|
|
||||||
--curr=$(VERSION) \
|
|
||||||
--release-archive-directory=$(release_archive_dir) \
|
|
||||||
--news=NEWS \
|
|
||||||
$(addprefix --url-dir=, $(url_dir_list)) \
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Updating files. ##
|
## Updating files. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
|
WGET = wget
|
||||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||||
www-gnu = http://www.gnu.org
|
|
||||||
|
|
||||||
# Use mv, if you don't have/want move-if-change.
|
# Use mv, if you don't have/want move-if-change.
|
||||||
move_if_change ?= move-if-change
|
move_if_change ?= move-if-change
|
||||||
|
|
||||||
|
|
||||||
# --------------------- #
|
|
||||||
# Updating everything. #
|
|
||||||
# --------------------- #
|
|
||||||
|
|
||||||
.PHONY: update
|
|
||||||
local_updates ?= wget-update cvs-update po-update
|
|
||||||
update: $(local_updates)
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------- #
|
# ------------------- #
|
||||||
# Updating PO files. #
|
# Updating PO files. #
|
||||||
# ------------------- #
|
# ------------------- #
|
||||||
@@ -505,8 +63,7 @@ do-po-update:
|
|||||||
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
|
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
|
||||||
rm -rf $$tmppo && \
|
rm -rf $$tmppo && \
|
||||||
mkdir $$tmppo && \
|
mkdir $$tmppo && \
|
||||||
(cd $$tmppo && \
|
(cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
|
||||||
$(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
|
|
||||||
cp $$tmppo/*.po po
|
cp $$tmppo/*.po po
|
||||||
cd po && $(MAKE) update-po
|
cd po && $(MAKE) update-po
|
||||||
$(MAKE) po-check
|
$(MAKE) po-check
|
||||||
@@ -523,77 +80,267 @@ po-update:
|
|||||||
# The following pseudo table associates a local directory and a URL
|
# The following pseudo table associates a local directory and a URL
|
||||||
# with each of the files that belongs to some other package and is
|
# with each of the files that belongs to some other package and is
|
||||||
# regularly updated from the specified URL.
|
# regularly updated from the specified URL.
|
||||||
wget_files ?= \
|
wget_files ?= $(srcdir)/config.guess $(srcdir)/config.sub \
|
||||||
$(srcdir)/build-aux/config.guess \
|
$(srcdir)/src/ansi2knr.c \
|
||||||
$(srcdir)/build-aux/config.sub \
|
$(srcdir)/doc/texinfo.tex
|
||||||
$(srcdir)/build-aux/texinfo.tex \
|
wget-targets = $(patsubst %, get-%, $(wget_files))
|
||||||
$(srcdir)/src/ansi2knr.c
|
|
||||||
|
|
||||||
get-targets = $(patsubst %, get-%, $(wget_files))
|
config.guess-url_prefix = $(ftp-gnu)/config/
|
||||||
|
config.sub-url_prefix = $(ftp-gnu)/config/
|
||||||
config.guess-url_prefix = $(ftp-gnu)/build-aux/
|
|
||||||
config.sub-url_prefix = $(ftp-gnu)/build-aux/
|
|
||||||
|
|
||||||
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
||||||
|
|
||||||
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
|
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
|
||||||
|
|
||||||
standards.texi-url_prefix = $(www-gnu)/prep/
|
standards.texi-url_prefix = $(ftp-gnu)/GNUinfo/
|
||||||
make-stds.texi-url_prefix = $(standards.texi-url_prefix)
|
make-stds.texi-url_prefix = $(ftp-gnu)/GNUinfo/
|
||||||
|
|
||||||
target = $(patsubst get-%, %, $@)
|
target = $(patsubst get-%, %, $@)
|
||||||
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
|
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
|
||||||
|
|
||||||
.PHONY: $(get-targets)
|
.PHONY: $(wget-targets)
|
||||||
$(get-targets):
|
$(wget-targets):
|
||||||
$(WGET) $(WGETFLAGS) $(url) -O $(target).t \
|
$(WGET) $(url) -O $(target).t \
|
||||||
&& $(move_if_change) $(target).t $(target)
|
&& $(move_if_change) $(target).t $(target)
|
||||||
|
|
||||||
cvs_files ?= \
|
|
||||||
$(srcdir)/build-aux/depcomp \
|
|
||||||
$(srcdir)/build-aux/install-sh \
|
|
||||||
$(srcdir)/build-aux/missing \
|
|
||||||
$(srcdir)/build-aux/mkinstalldirs \
|
|
||||||
$(srcdir)/src/ansi2knr.c
|
|
||||||
automake_repo=:pserver:anoncvs:[email protected]:/cvs/automake
|
|
||||||
.PHONY: wget-update
|
.PHONY: wget-update
|
||||||
wget-update: $(get-targets)
|
wget-update: $(wget-targets)
|
||||||
|
|
||||||
|
|
||||||
|
# Updating tools via CVS.
|
||||||
|
cvs_files ?= depcomp missing
|
||||||
|
cvs-targets = $(patsubst %, get-%, $(cvs_files))
|
||||||
|
|
||||||
|
automake_repo = :pserver:[email protected]:/cvs/automake
|
||||||
|
.PHONY: $(cvs-targets)
|
||||||
|
$(cvs-targets):
|
||||||
|
$(CVS) -d $(automake_repo) co -p automake/lib/$(notdir $(target)) \
|
||||||
|
>$(target).t \
|
||||||
|
&& $(move_if_change) $(target).t $(target);
|
||||||
|
|
||||||
.PHONY: cvs-update
|
.PHONY: cvs-update
|
||||||
cvs-update:
|
cvs-update: $(cvs-targets)
|
||||||
fail=; \
|
|
||||||
for f in $(cvs_files); do \
|
|
||||||
test -f $$f || { echo "*** skipping $$f" 1>&2; continue; }; \
|
|
||||||
cvs diff $$f > /dev/null \
|
|
||||||
|| { echo "*** $$f is locally modified; skipping it" 1>&2; \
|
|
||||||
fail=yes; continue; }; \
|
|
||||||
file=$$(basename $$f); \
|
|
||||||
echo checking out $$file...; \
|
|
||||||
$(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t \
|
|
||||||
&& $(move_if_change) $$f.t $$f; \
|
|
||||||
done; \
|
|
||||||
test "$$fail" && exit 1
|
|
||||||
|
|
||||||
emit_upload_commands:
|
|
||||||
@echo =====================================
|
# --------------------- #
|
||||||
@echo =====================================
|
# Updating everything. #
|
||||||
@echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
|
# --------------------- #
|
||||||
@echo " --to $(gnu_rel_host):coreutils \\"
|
|
||||||
@echo " $(rel-files)"
|
.PHONY: update
|
||||||
@echo '# send the /tmp/announcement e-mail'
|
update: wget-update cvs-update po-update
|
||||||
@echo =====================================
|
|
||||||
@echo =====================================
|
|
||||||
|
|
||||||
|
## --------------- ##
|
||||||
|
## Sanity checks. ##
|
||||||
|
## --------------- ##
|
||||||
|
|
||||||
|
# Checks that don't require cvs. Run `changelog-check' last as
|
||||||
|
# previous test may reveal problems requiring new ChangeLog entries.
|
||||||
|
local-check: po-check copyright-check writable-files changelog-check
|
||||||
|
|
||||||
|
changelog-check:
|
||||||
|
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
||||||
|
:; \
|
||||||
|
else \
|
||||||
|
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||||
|
po-check:
|
||||||
|
if test -f po/POTFILES.in; then \
|
||||||
|
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
|
||||||
|
grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2; \
|
||||||
|
diff -u $@-1 $@-2 || exit 1; \
|
||||||
|
rm -f $@-1 $@-2; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that `make alpha' will not fail at the end of the process.
|
||||||
|
writable-files:
|
||||||
|
if test -d $(release_archive_dir); then :; else \
|
||||||
|
mkdir $(release_archive_dir); \
|
||||||
|
fi
|
||||||
|
for file in $(distdir).tar.gz $(xd-delta) \
|
||||||
|
$(release_archive_dir)/$(distdir).tar.gz \
|
||||||
|
$(release_archive_dir)/$(xd-delta); do \
|
||||||
|
test -e $$file || continue; \
|
||||||
|
test -w $$file \
|
||||||
|
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
||||||
|
done; \
|
||||||
|
test "$$fail" && exit 1 || :
|
||||||
|
|
||||||
|
# Make sure that the copyright date in lib/version-etc.c is up to date.
|
||||||
|
copyright-check:
|
||||||
|
@if test -f lib/version-etc.c; then \
|
||||||
|
grep 'N_("Copyright (C) $(shell date +%Y) Free' lib/version-etc.c \
|
||||||
|
>/dev/null \
|
||||||
|
|| { echo 'out of date copyright in $<; update it' 1>&2; exit 1; }; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Sanity checks with the CVS repository.
|
||||||
|
cvs-tag-check:
|
||||||
|
echo $(this-cvs-tag); \
|
||||||
|
if $(CVS) -n log -h README | grep -e $(this-cvs-tag): >/dev/null; then \
|
||||||
|
echo "$(this-cvs-tag) as already been used; not tagging" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
else :; fi
|
||||||
|
|
||||||
|
cvs-diff-check:
|
||||||
|
if $(CVS) diff >cvs-diffs; then \
|
||||||
|
rm cvs-diffs; \
|
||||||
|
else \
|
||||||
|
echo "Some files are locally modified:" 1>&2; \
|
||||||
|
cat cvs-diffs; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
cvs-check: cvs-diff-check cvs-tag-check
|
||||||
|
|
||||||
|
maintainer-distcheck: changelog-check
|
||||||
|
$(MAKE) distcheck
|
||||||
|
$(MAKE) my-distcheck
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## -------------- ##
|
||||||
|
## Making dists. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# Tag before making distribution. Also, don't make a distribution if
|
||||||
|
# checks fail. Also, make sure the NEWS file is up-to-date.
|
||||||
|
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
|
||||||
|
cvs-dist: local-check cvs-check maintainer-distcheck
|
||||||
|
$(CVS) update po
|
||||||
|
$(CVS) tag -c $(this-cvs-tag)
|
||||||
|
$(MAKE) dist
|
||||||
|
|
||||||
|
# Use this to make sure we don't run these programs when building
|
||||||
|
# from a virgin tgz file, below.
|
||||||
|
null_AM_MAKEFLAGS = \
|
||||||
|
ACLOCAL=false \
|
||||||
|
AUTOCONF=false \
|
||||||
|
AUTOM4TE=false \
|
||||||
|
AUTOMAKE=false \
|
||||||
|
AUTOHEADER=false \
|
||||||
|
MAKEINFO=false
|
||||||
|
|
||||||
|
# Detect format-string/arg-list mismatches that would normally be obscured
|
||||||
|
# by the use of _(). The --disable-nls effectively defines away that macro,
|
||||||
|
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
|
||||||
|
# treated as a failure.
|
||||||
|
t=./=test
|
||||||
|
my-distcheck: writable-files po-check
|
||||||
|
-rm -rf $(t)
|
||||||
|
mkdir $(t)
|
||||||
|
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||||
|
cd $(t)/$(distdir) \
|
||||||
|
&& ./configure --disable-nls \
|
||||||
|
&& $(MAKE) CFLAGS='-Wformat -Werror' \
|
||||||
|
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||||
|
&& $(MAKE) dvi \
|
||||||
|
&& $(MAKE) check \
|
||||||
|
&& $(MAKE) distclean
|
||||||
|
cd $(t) && mv $(distdir) $(distdir).old \
|
||||||
|
&& $(AMTAR) -zxf ../$(distdir).tar.gz
|
||||||
|
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||||
|
-rm -rf $(t)
|
||||||
|
@echo "========================"; \
|
||||||
|
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||||
|
echo "========================"
|
||||||
|
|
||||||
|
# This must be the same name on both hosts.
|
||||||
|
# Make it a symlink that points to the right place.
|
||||||
|
real_dir = fetish-ftp
|
||||||
|
|
||||||
|
url_dir_list = $(foreach x,$(hosts),ftp://$($(x)_host)/$($(x)_url_dir))
|
||||||
|
|
||||||
|
tgz-md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
|
||||||
|
tgz-sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
|
||||||
|
bz2-md5 = $(shell md5sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
||||||
|
bz2-sha1 = $(shell sha1sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
||||||
|
tgz-size = $(shell du --human $(my_distdir).tar.gz|sed 's/\([Mk]\).*/ \1B/')
|
||||||
|
bz2-size = $(shell du --human $(my_distdir).tar.bz2|sed 's/\([Mk]\).*/ \1B/')
|
||||||
|
xd-size = $(shell du --human $(xd-delta)|sed 's/\([Mk]\).*/ \1B/')
|
||||||
|
|
||||||
|
rel-check:
|
||||||
|
tarz=/tmp/rel-check-tarz-$$$$; \
|
||||||
|
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
||||||
|
set -e; \
|
||||||
|
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
||||||
|
$(WGET) -q --output-document=$$tarz $(url); \
|
||||||
|
echo "$(md5) -" > $$md5_tmp; \
|
||||||
|
md5sum -c $$md5_tmp < $$tarz
|
||||||
|
|
||||||
|
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
||||||
|
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
||||||
|
|
||||||
|
GZIP = gzip
|
||||||
|
BZIP2 = bzip2
|
||||||
|
$(my_distdir).tar.bz2: $(my_distdir).tar.gz
|
||||||
|
$(GZIP) -dc $< > $(my_distdir).tar
|
||||||
|
rm -f $@
|
||||||
|
$(BZIP2) -9 $(my_distdir).tar
|
||||||
|
|
||||||
|
rel-files = $(xd-delta) $(distdir).tar.bz2 $(distdir).tar.gz
|
||||||
|
announcement: NEWS ChangeLog $(rel-files)
|
||||||
|
@( \
|
||||||
|
echo Subject: $(my_distdir) released; \
|
||||||
|
echo; \
|
||||||
|
echo FIXME: put comments here; \
|
||||||
|
echo; \
|
||||||
|
for url in $(url_dir_list); do \
|
||||||
|
echo " $$url/$(my_distdir).tar.gz ($(tgz-size))"; \
|
||||||
|
echo " $$url/$(my_distdir).tar.bz2 ($(bz2-size))"; \
|
||||||
|
done; \
|
||||||
|
echo; \
|
||||||
|
echo And here are xdelta-style diffs; \
|
||||||
|
echo; \
|
||||||
|
for url in $(url_dir_list); do \
|
||||||
|
echo " $$url/$(xd-delta) ($(xd-size))"; \
|
||||||
|
done; \
|
||||||
|
echo; \
|
||||||
|
echo "Here are the MD5 and SHA1 signatures for the compressed tar files:"; \
|
||||||
|
echo; \
|
||||||
|
echo "$(tgz-md5) $(my_distdir).tar.gz"; \
|
||||||
|
echo "$(bz2-md5) $(my_distdir).tar.bz2"; \
|
||||||
|
echo "$(tgz-sha1) $(my_distdir).tar.gz"; \
|
||||||
|
echo "$(bz2-sha1) $(my_distdir).tar.bz2"; \
|
||||||
|
echo; \
|
||||||
|
echo NEWS:; \
|
||||||
|
sed -n "/$(THIS_VERSION_REGEXP)[]:]/,/$(PREV_VERSION_REGEXP)[]:]/p" NEWS \
|
||||||
|
| grep -v '^\['; \
|
||||||
|
echo; \
|
||||||
|
echo ChangeLog entries:; \
|
||||||
|
find . -name ChangeLog -maxdepth 2 \
|
||||||
|
| xargs $(CVS) diff -up -r$(prev-cvs-tag) -rHEAD \
|
||||||
|
| sed -n 's/^+//p' \
|
||||||
|
| perl -ne 'm!^\+\+ (\./)?! or print,next;' \
|
||||||
|
-e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
|
||||||
|
)
|
||||||
|
|
||||||
|
define emit-rsync-commands
|
||||||
|
echo =====================================
|
||||||
|
echo =====================================
|
||||||
|
echo 'for host in $(a_host) $(b_host); do \'
|
||||||
|
echo ' rsync -e ssh --pro -av $(xd-delta) $(my_distdir).tar.bz2 \'
|
||||||
|
echo ' $(my_distdir).tar.gz $$host:$(real_dir); done'
|
||||||
|
echo '# send the /tmp/announcement e-mail'
|
||||||
|
echo =====================================
|
||||||
|
echo =====================================
|
||||||
|
endef
|
||||||
|
|
||||||
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
||||||
xdelta delta -9 $^ $@ || :
|
xdelta delta -9 $^ $@ || :
|
||||||
|
|
||||||
.PHONY: alpha beta major
|
alpha:
|
||||||
alpha beta major: news-date-check $(local-check)
|
|
||||||
$(MAKE) cvs-dist
|
$(MAKE) cvs-dist
|
||||||
$(MAKE) $(xd-delta)
|
$(MAKE) $(xd-delta)
|
||||||
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
$(MAKE) -s announcement > /tmp/announce-$(my_distdir)
|
||||||
ln $(rel-files) $(release_archive_dir)
|
ln $(rel-files) $(release_archive_dir)
|
||||||
chmod a-w $(rel-files)
|
chmod a-w $(rel-files)
|
||||||
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
|
|
||||||
echo $(VERSION) > $(prev_version_file)
|
echo $(VERSION) > $(prev_version_file)
|
||||||
$(CVS) ci -m. $(prev_version_file)
|
$(CVS) ci -m. $(prev_version_file)
|
||||||
|
@$(emit-rsync-commands)
|
||||||
|
|||||||
@@ -1,510 +1,20 @@
|
|||||||
Bison News
|
Bison News
|
||||||
----------
|
----------
|
||||||
|
|
||||||
Changes in version 2.1, 2005-09-16:
|
Changes in version 1.30:
|
||||||
|
|
||||||
* Bison-generated parsers now support the translation of diagnostics like
|
* `--defines' and `--graph' have now an optionnal argument which is the
|
||||||
"syntax error" into languages other than English. The default
|
output file name. `-d' and `-g' do not change, they do not take any
|
||||||
language is still English. For details, please see the new
|
|
||||||
Internationalization section of the Bison manual. Software
|
|
||||||
distributors should also see the new PACKAGING file. Thanks to
|
|
||||||
Bruno Haible for this new feature.
|
|
||||||
|
|
||||||
* Wording in the Bison-generated parsers has been changed slightly to
|
|
||||||
simplify translation. In particular, the message "memory exhausted"
|
|
||||||
has replaced "parser stack overflow", as the old message was not
|
|
||||||
always accurate for modern Bison-generated parsers.
|
|
||||||
|
|
||||||
* Destructors are now called when the parser aborts, for all symbols left
|
|
||||||
behind on the stack. Also, the start symbol is now destroyed after a
|
|
||||||
successful parse. In both cases, the behavior was formerly inconsistent.
|
|
||||||
|
|
||||||
* When generating verbose diagnostics, Bison-generated parsers no longer
|
|
||||||
quote the literal strings associated with tokens. For example, for
|
|
||||||
a syntax error associated with '%token NUM "number"' they might
|
|
||||||
print 'syntax error, unexpected number' instead of 'syntax error,
|
|
||||||
unexpected "number"'.
|
|
||||||
|
|
||||||
Changes in version 2.0, 2004-12-25:
|
|
||||||
|
|
||||||
* Possibly-incompatible changes
|
|
||||||
|
|
||||||
- Bison-generated parsers no longer default to using the alloca function
|
|
||||||
(when available) to extend the parser stack, due to widespread
|
|
||||||
problems in unchecked stack-overflow detection. You can "#define
|
|
||||||
YYSTACK_USE_ALLOCA 1" to require the use of alloca, but please read
|
|
||||||
the manual to determine safe values for YYMAXDEPTH in that case.
|
|
||||||
|
|
||||||
- Error token location.
|
|
||||||
During error recovery, the location of the syntax error is updated
|
|
||||||
to cover the whole sequence covered by the error token: it includes
|
|
||||||
the shifted symbols thrown away during the first part of the error
|
|
||||||
recovery, and the lookahead rejected during the second part.
|
|
||||||
|
|
||||||
- Semicolon changes:
|
|
||||||
. Stray semicolons are no longer allowed at the start of a grammar.
|
|
||||||
. Semicolons are now required after in-grammar declarations.
|
|
||||||
|
|
||||||
- Unescaped newlines are no longer allowed in character constants or
|
|
||||||
string literals. They were never portable, and GCC 3.4.0 has
|
|
||||||
dropped support for them. Better diagnostics are now generated if
|
|
||||||
forget a closing quote.
|
|
||||||
|
|
||||||
- NUL bytes are no longer allowed in Bison string literals, unfortunately.
|
|
||||||
|
|
||||||
* New features
|
|
||||||
|
|
||||||
- GLR grammars now support locations.
|
|
||||||
|
|
||||||
- New directive: %initial-action.
|
|
||||||
This directive allows the user to run arbitrary code (including
|
|
||||||
initializing @$) from yyparse before parsing starts.
|
|
||||||
|
|
||||||
- A new directive "%expect-rr N" specifies the expected number of
|
|
||||||
reduce/reduce conflicts in GLR parsers.
|
|
||||||
|
|
||||||
- %token numbers can now be hexadecimal integers, e.g., `%token FOO 0x12d'.
|
|
||||||
This is a GNU extension.
|
|
||||||
|
|
||||||
- The option `--report=lookahead' was changed to `--report=look-ahead'.
|
|
||||||
The old spelling still works, but is not documented and will be
|
|
||||||
removed.
|
|
||||||
|
|
||||||
- Experimental %destructor support has been added to lalr1.cc.
|
|
||||||
|
|
||||||
- New configure option --disable-yacc, to disable installation of the
|
|
||||||
yacc command and -ly library introduced in 1.875 for POSIX conformance.
|
|
||||||
|
|
||||||
* Bug fixes
|
|
||||||
|
|
||||||
- For now, %expect-count violations are now just warnings, not errors.
|
|
||||||
This is for compatibility with Bison 1.75 and earlier (when there are
|
|
||||||
reduce/reduce conflicts) and with Bison 1.30 and earlier (when there
|
|
||||||
are too many or too few shift/reduce conflicts). However, in future
|
|
||||||
versions of Bison we plan to improve the %expect machinery so that
|
|
||||||
these violations will become errors again.
|
|
||||||
|
|
||||||
- Within Bison itself, numbers (e.g., goto numbers) are no longer
|
|
||||||
arbitrarily limited to 16-bit counts.
|
|
||||||
|
|
||||||
- Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
|
|
||||||
|
|
||||||
Changes in version 1.875, 2003-01-01:
|
|
||||||
|
|
||||||
* The documentation license has been upgraded to version 1.2
|
|
||||||
of the GNU Free Documentation License.
|
|
||||||
|
|
||||||
* syntax error processing
|
|
||||||
|
|
||||||
- In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
|
|
||||||
locations too. This fixes bugs in error-location computation.
|
|
||||||
|
|
||||||
- %destructor
|
|
||||||
It is now possible to reclaim the memory associated to symbols
|
|
||||||
discarded during error recovery. This feature is still experimental.
|
|
||||||
|
|
||||||
- %error-verbose
|
|
||||||
This new directive is preferred over YYERROR_VERBOSE.
|
|
||||||
|
|
||||||
- #defining yyerror to steal internal variables is discouraged.
|
|
||||||
It is not guaranteed to work forever.
|
|
||||||
|
|
||||||
* POSIX conformance
|
|
||||||
|
|
||||||
- Semicolons are once again optional at the end of grammar rules.
|
|
||||||
This reverts to the behavior of Bison 1.33 and earlier, and improves
|
|
||||||
compatibility with Yacc.
|
|
||||||
|
|
||||||
- `parse error' -> `syntax error'
|
|
||||||
Bison now uniformly uses the term `syntax error'; formerly, the code
|
|
||||||
and manual sometimes used the term `parse error' instead. POSIX
|
|
||||||
requires `syntax error' in diagnostics, and it was thought better to
|
|
||||||
be consistent.
|
|
||||||
|
|
||||||
- The documentation now emphasizes that yylex and yyerror must be
|
|
||||||
declared before use. C99 requires this.
|
|
||||||
|
|
||||||
- Bison now parses C99 lexical constructs like UCNs and
|
|
||||||
backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires.
|
|
||||||
|
|
||||||
- File names are properly escaped in C output. E.g., foo\bar.y is
|
|
||||||
output as "foo\\bar.y".
|
|
||||||
|
|
||||||
- Yacc command and library now available
|
|
||||||
The Bison distribution now installs a `yacc' command, as POSIX requires.
|
|
||||||
Also, Bison now installs a small library liby.a containing
|
|
||||||
implementations of Yacc-compatible yyerror and main functions.
|
|
||||||
This library is normally not useful, but POSIX requires it.
|
|
||||||
|
|
||||||
- Type clashes now generate warnings, not errors.
|
|
||||||
|
|
||||||
- If the user does not define YYSTYPE as a macro, Bison now declares it
|
|
||||||
using typedef instead of defining it as a macro.
|
|
||||||
For consistency, YYLTYPE is also declared instead of defined.
|
|
||||||
|
|
||||||
* Other compatibility issues
|
|
||||||
|
|
||||||
- %union directives can now have a tag before the `{', e.g., the
|
|
||||||
directive `%union foo {...}' now generates the C code
|
|
||||||
`typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
|
|
||||||
The default union tag is `YYSTYPE', for compatibility with Solaris 9 Yacc.
|
|
||||||
For consistency, YYLTYPE's struct tag is now `YYLTYPE' not `yyltype'.
|
|
||||||
This is for compatibility with both Yacc and Bison 1.35.
|
|
||||||
|
|
||||||
- `;' is output before the terminating `}' of an action, for
|
|
||||||
compatibility with Bison 1.35.
|
|
||||||
|
|
||||||
- Bison now uses a Yacc-style format for conflict reports, e.g.,
|
|
||||||
`conflicts: 2 shift/reduce, 1 reduce/reduce'.
|
|
||||||
|
|
||||||
- `yystype' and `yyltype' are now obsolescent macros instead of being
|
|
||||||
typedefs or tags; they are no longer documented and are planned to be
|
|
||||||
withdrawn in a future release.
|
|
||||||
|
|
||||||
* GLR parser notes
|
|
||||||
|
|
||||||
- GLR and inline
|
|
||||||
Users of Bison have to decide how they handle the portability of the
|
|
||||||
C keyword `inline'.
|
|
||||||
|
|
||||||
- `parsing stack overflow...' -> `parser stack overflow'
|
|
||||||
GLR parsers now report `parser stack overflow' as per the Bison manual.
|
|
||||||
|
|
||||||
* Bison now warns if it detects conflicting outputs to the same file,
|
|
||||||
e.g., it generates a warning for `bison -d -o foo.h foo.y' since
|
|
||||||
that command outputs both code and header to foo.h.
|
|
||||||
|
|
||||||
* #line in output files
|
|
||||||
- --no-line works properly.
|
|
||||||
|
|
||||||
* Bison can no longer be built by a K&R C compiler; it requires C89 or
|
|
||||||
later to be built. This change originally took place a few versions
|
|
||||||
ago, but nobody noticed until we recently asked someone to try
|
|
||||||
building Bison with a K&R C compiler.
|
|
||||||
|
|
||||||
Changes in version 1.75, 2002-10-14:
|
|
||||||
|
|
||||||
* Bison should now work on 64-bit hosts.
|
|
||||||
|
|
||||||
* Indonesian translation thanks to Tedi Heriyanto.
|
|
||||||
|
|
||||||
* GLR parsers
|
|
||||||
Fix spurious parse errors.
|
|
||||||
|
|
||||||
* Pure parsers
|
|
||||||
Some people redefine yyerror to steal yyparse' private variables.
|
|
||||||
Reenable this trick until an official feature replaces it.
|
|
||||||
|
|
||||||
* Type Clashes
|
|
||||||
In agreement with POSIX and with other Yaccs, leaving a default
|
|
||||||
action is valid when $$ is untyped, and $1 typed:
|
|
||||||
|
|
||||||
untyped: ... typed;
|
|
||||||
|
|
||||||
but the converse remains an error:
|
|
||||||
|
|
||||||
typed: ... untyped;
|
|
||||||
|
|
||||||
* Values of mid-rule actions
|
|
||||||
The following code:
|
|
||||||
|
|
||||||
foo: { ... } { $$ = $1; } ...
|
|
||||||
|
|
||||||
was incorrectly rejected: $1 is defined in the second mid-rule
|
|
||||||
action, and is equal to the $$ of the first mid-rule action.
|
|
||||||
|
|
||||||
Changes in version 1.50, 2002-10-04:
|
|
||||||
|
|
||||||
* GLR parsing
|
|
||||||
The declaration
|
|
||||||
%glr-parser
|
|
||||||
causes Bison to produce a Generalized LR (GLR) parser, capable of handling
|
|
||||||
almost any context-free grammar, ambiguous or not. The new declarations
|
|
||||||
%dprec and %merge on grammar rules allow parse-time resolution of
|
|
||||||
ambiguities. Contributed by Paul Hilfinger.
|
|
||||||
|
|
||||||
Unfortunately Bison 1.50 does not work properly on 64-bit hosts
|
|
||||||
like the Alpha, so please stick to 32-bit hosts for now.
|
|
||||||
|
|
||||||
* Output Directory
|
|
||||||
When not in Yacc compatibility mode, when the output file was not
|
|
||||||
specified, running `bison foo/bar.y' created `foo/bar.c'. It
|
|
||||||
now creates `bar.c'.
|
|
||||||
|
|
||||||
* Undefined token
|
|
||||||
The undefined token was systematically mapped to 2 which prevented
|
|
||||||
the use of 2 by the user. This is no longer the case.
|
|
||||||
|
|
||||||
* Unknown token numbers
|
|
||||||
If yylex returned an out of range value, yyparse could die. This is
|
|
||||||
no longer the case.
|
|
||||||
|
|
||||||
* Error token
|
|
||||||
According to POSIX, the error token must be 256.
|
|
||||||
Bison extends this requirement by making it a preference: *if* the
|
|
||||||
user specified that one of her tokens is numbered 256, then error
|
|
||||||
will be mapped onto another number.
|
|
||||||
|
|
||||||
* Verbose error messages
|
|
||||||
They no longer report `..., expecting error or...' for states where
|
|
||||||
error recovery is possible.
|
|
||||||
|
|
||||||
* End token
|
|
||||||
Defaults to `$end' instead of `$'.
|
|
||||||
|
|
||||||
* Error recovery now conforms to documentation and to POSIX
|
|
||||||
When a Bison-generated parser encounters a syntax error, it now pops
|
|
||||||
the stack until it finds a state that allows shifting the error
|
|
||||||
token. Formerly, it popped the stack until it found a state that
|
|
||||||
allowed some non-error action other than a default reduction on the
|
|
||||||
error token. The new behavior has long been the documented behavior,
|
|
||||||
and has long been required by POSIX. For more details, please see
|
|
||||||
Paul Eggert, "Reductions during Bison error handling" (2002-05-20)
|
|
||||||
<http://lists.gnu.org/archive/html/bug-bison/2002-05/msg00038.html>.
|
|
||||||
|
|
||||||
* Traces
|
|
||||||
Popped tokens and nonterminals are now reported.
|
|
||||||
|
|
||||||
* Larger grammars
|
|
||||||
Larger grammars are now supported (larger token numbers, larger grammar
|
|
||||||
size (= sum of the LHS and RHS lengths), larger LALR tables).
|
|
||||||
Formerly, many of these numbers ran afoul of 16-bit limits;
|
|
||||||
now these limits are 32 bits on most hosts.
|
|
||||||
|
|
||||||
* Explicit initial rule
|
|
||||||
Bison used to play hacks with the initial rule, which the user does
|
|
||||||
not write. It is now explicit, and visible in the reports and
|
|
||||||
graphs as rule 0.
|
|
||||||
|
|
||||||
* Useless rules
|
|
||||||
Before, Bison reported the useless rules, but, although not used,
|
|
||||||
included them in the parsers. They are now actually removed.
|
|
||||||
|
|
||||||
* Useless rules, useless nonterminals
|
|
||||||
They are now reported, as a warning, with their locations.
|
|
||||||
|
|
||||||
* Rules never reduced
|
|
||||||
Rules that can never be reduced because of conflicts are now
|
|
||||||
reported.
|
|
||||||
|
|
||||||
* Incorrect `Token not used'
|
|
||||||
On a grammar such as
|
|
||||||
|
|
||||||
%token useless useful
|
|
||||||
%%
|
|
||||||
exp: '0' %prec useful;
|
|
||||||
|
|
||||||
where a token was used to set the precedence of the last rule,
|
|
||||||
bison reported both `useful' and `useless' as useless tokens.
|
|
||||||
|
|
||||||
* Revert the C++ namespace changes introduced in 1.31
|
|
||||||
as they caused too many portability hassles.
|
|
||||||
|
|
||||||
* Default locations
|
|
||||||
By an accident of design, the default computation of @$ was
|
|
||||||
performed after another default computation was performed: @$ = @1.
|
|
||||||
The latter is now removed: YYLLOC_DEFAULT is fully responsible of
|
|
||||||
the computation of @$.
|
|
||||||
|
|
||||||
* Token end-of-file
|
|
||||||
The token end of file may be specified by the user, in which case,
|
|
||||||
the user symbol is used in the reports, the graphs, and the verbose
|
|
||||||
error messages instead of `$end', which remains being the default.
|
|
||||||
For instance
|
|
||||||
%token MYEOF 0
|
|
||||||
or
|
|
||||||
%token MYEOF 0 "end of file"
|
|
||||||
|
|
||||||
* Semantic parser
|
|
||||||
This old option, which has been broken for ages, is removed.
|
|
||||||
|
|
||||||
* New translations
|
|
||||||
Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
|
|
||||||
Croatian, thanks to Denis Lackovic.
|
|
||||||
|
|
||||||
* Incorrect token definitions
|
|
||||||
When given `%token 'a' "A"', Bison used to output `#define 'a' 65'.
|
|
||||||
|
|
||||||
* Token definitions as enums
|
|
||||||
Tokens are output both as the traditional #define's, and, provided
|
|
||||||
the compiler supports ANSI C or is a C++ compiler, as enums.
|
|
||||||
This lets debuggers display names instead of integers.
|
|
||||||
|
|
||||||
* Reports
|
|
||||||
In addition to --verbose, bison supports --report=THINGS, which
|
|
||||||
produces additional information:
|
|
||||||
- itemset
|
|
||||||
complete the core item sets with their closure
|
|
||||||
- lookahead [changed to `look-ahead' in 1.875e and later]
|
|
||||||
explicitly associate look-ahead tokens to items
|
|
||||||
- solved
|
|
||||||
describe shift/reduce conflicts solving.
|
|
||||||
Bison used to systematically output this information on top of
|
|
||||||
the report. Solved conflicts are now attached to their states.
|
|
||||||
|
|
||||||
* Type clashes
|
|
||||||
Previous versions don't complain when there is a type clash on
|
|
||||||
the default action if the rule has a mid-rule action, such as in:
|
|
||||||
|
|
||||||
%type <foo> bar
|
|
||||||
%%
|
|
||||||
bar: '0' {} '0';
|
|
||||||
|
|
||||||
This is fixed.
|
|
||||||
|
|
||||||
* GNU M4 is now required when using Bison.
|
|
||||||
|
|
||||||
Changes in version 1.35, 2002-03-25:
|
|
||||||
|
|
||||||
* C Skeleton
|
|
||||||
Some projects use Bison's C parser with C++ compilers, and define
|
|
||||||
YYSTYPE as a class. The recent adjustment of C parsers for data
|
|
||||||
alignment and 64 bit architectures made this impossible.
|
|
||||||
|
|
||||||
Because for the time being no real solution for C++ parser
|
|
||||||
generation exists, kludges were implemented in the parser to
|
|
||||||
maintain this use. In the future, when Bison has C++ parsers, this
|
|
||||||
kludge will be disabled.
|
|
||||||
|
|
||||||
This kludge also addresses some C++ problems when the stack was
|
|
||||||
extended.
|
|
||||||
|
|
||||||
Changes in version 1.34, 2002-03-12:
|
|
||||||
|
|
||||||
* File name clashes are detected
|
|
||||||
$ bison foo.y -d -o foo.x
|
|
||||||
fatal error: header and parser would both be named `foo.x'
|
|
||||||
|
|
||||||
* A missing `;' at the end of a rule triggers a warning
|
|
||||||
In accordance with POSIX, and in agreement with other
|
|
||||||
Yacc implementations, Bison will mandate this semicolon in the near
|
|
||||||
future. This eases the implementation of a Bison parser of Bison
|
|
||||||
grammars by making this grammar LALR(1) instead of LR(2). To
|
|
||||||
facilitate the transition, this release introduces a warning.
|
|
||||||
|
|
||||||
* Revert the C++ namespace changes introduced in 1.31, as they caused too
|
|
||||||
many portability hassles.
|
|
||||||
|
|
||||||
* DJGPP support added.
|
|
||||||
|
|
||||||
* Fix test suite portability problems.
|
|
||||||
|
|
||||||
Changes in version 1.33, 2002-02-07:
|
|
||||||
|
|
||||||
* Fix C++ issues
|
|
||||||
Groff could not be compiled for the definition of size_t was lacking
|
|
||||||
under some conditions.
|
|
||||||
|
|
||||||
* Catch invalid @n
|
|
||||||
As is done with $n.
|
|
||||||
|
|
||||||
Changes in version 1.32, 2002-01-23:
|
|
||||||
|
|
||||||
* Fix Yacc output file names
|
|
||||||
|
|
||||||
* Portability fixes
|
|
||||||
|
|
||||||
* Italian, Dutch translations
|
|
||||||
|
|
||||||
Changes in version 1.31, 2002-01-14:
|
|
||||||
|
|
||||||
* Many Bug Fixes
|
|
||||||
|
|
||||||
* GNU Gettext and %expect
|
|
||||||
GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that
|
|
||||||
Bison dies on incorrect %expectations, we fear there will be
|
|
||||||
too many bug reports for Gettext, so _for the time being_, %expect
|
|
||||||
does not trigger an error when the input file is named `plural.y'.
|
|
||||||
|
|
||||||
* Use of alloca in parsers
|
|
||||||
If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
|
|
||||||
malloc exclusively. Since 1.29, but was not NEWS'ed.
|
|
||||||
|
|
||||||
alloca is used only when compiled with GCC, to avoid portability
|
|
||||||
problems as on AIX.
|
|
||||||
|
|
||||||
* yyparse now returns 2 if memory is exhausted; formerly it dumped core.
|
|
||||||
|
|
||||||
* When the generated parser lacks debugging code, YYDEBUG is now 0
|
|
||||||
(as POSIX requires) instead of being undefined.
|
|
||||||
|
|
||||||
* User Actions
|
|
||||||
Bison has always permitted actions such as { $$ = $1 }: it adds the
|
|
||||||
ending semicolon. Now if in Yacc compatibility mode, the semicolon
|
|
||||||
is no longer output: one has to write { $$ = $1; }.
|
|
||||||
|
|
||||||
* Better C++ compliance
|
|
||||||
The output parsers try to respect C++ namespaces.
|
|
||||||
[This turned out to be a failed experiment, and it was reverted later.]
|
|
||||||
|
|
||||||
* Reduced Grammars
|
|
||||||
Fixed bugs when reporting useless nonterminals.
|
|
||||||
|
|
||||||
* 64 bit hosts
|
|
||||||
The parsers work properly on 64 bit hosts.
|
|
||||||
|
|
||||||
* Error messages
|
|
||||||
Some calls to strerror resulted in scrambled or missing error messages.
|
|
||||||
|
|
||||||
* %expect
|
|
||||||
When the number of shift/reduce conflicts is correct, don't issue
|
|
||||||
any warning.
|
|
||||||
|
|
||||||
* The verbose report includes the rule line numbers.
|
|
||||||
|
|
||||||
* Rule line numbers are fixed in traces.
|
|
||||||
|
|
||||||
* Swedish translation
|
|
||||||
|
|
||||||
* Parse errors
|
|
||||||
Verbose parse error messages from the parsers are better looking.
|
|
||||||
Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
|
|
||||||
Now: parse error: unexpected '/', expecting "number" or '-' or '('
|
|
||||||
|
|
||||||
* Fixed parser memory leaks.
|
|
||||||
When the generated parser was using malloc to extend its stacks, the
|
|
||||||
previous allocations were not freed.
|
|
||||||
|
|
||||||
* Fixed verbose output file.
|
|
||||||
Some newlines were missing.
|
|
||||||
Some conflicts in state descriptions were missing.
|
|
||||||
|
|
||||||
* Fixed conflict report.
|
|
||||||
Option -v was needed to get the result.
|
|
||||||
|
|
||||||
* %expect
|
|
||||||
Was not used.
|
|
||||||
Mismatches are errors, not warnings.
|
|
||||||
|
|
||||||
* Fixed incorrect processing of some invalid input.
|
|
||||||
|
|
||||||
* Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
|
|
||||||
|
|
||||||
* Fixed some typos in the documentation.
|
|
||||||
|
|
||||||
* %token MY_EOF 0 is supported.
|
|
||||||
Before, MY_EOF was silently renumbered as 257.
|
|
||||||
|
|
||||||
* doc/refcard.tex is updated.
|
|
||||||
|
|
||||||
* %output, %file-prefix, %name-prefix.
|
|
||||||
New.
|
|
||||||
|
|
||||||
* --output
|
|
||||||
New, aliasing `--output-file'.
|
|
||||||
|
|
||||||
Changes in version 1.30, 2001-10-26:
|
|
||||||
|
|
||||||
* `--defines' and `--graph' have now an optional argument which is the
|
|
||||||
output file name. `-d' and `-g' do not change; they do not take any
|
|
||||||
argument.
|
argument.
|
||||||
|
|
||||||
* `%source_extension' and `%header_extension' are removed, failed
|
* `%source_extension' and `%header_extension' are removed, failed
|
||||||
experiment.
|
experiment.
|
||||||
|
|
||||||
* Portability fixes.
|
* The test suite is more portable.
|
||||||
|
|
||||||
Changes in version 1.29, 2001-09-07:
|
* Better portability.
|
||||||
|
|
||||||
|
Changes in version 1.29:
|
||||||
|
|
||||||
* The output file does not define const, as this caused problems when used
|
* The output file does not define const, as this caused problems when used
|
||||||
with common autoconfiguration schemes. If you still use ancient compilers
|
with common autoconfiguration schemes. If you still use ancient compilers
|
||||||
@@ -535,11 +45,8 @@ Changes in version 1.29, 2001-09-07:
|
|||||||
* New directives.
|
* New directives.
|
||||||
`%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
|
`%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
|
||||||
`%debug', `%source_extension' and `%header_extension'.
|
`%debug', `%source_extension' and `%header_extension'.
|
||||||
|
|
||||||
* @$
|
|
||||||
Automatic location tracking.
|
|
||||||
|
|
||||||
Changes in version 1.28, 1999-07-06:
|
Changes in version 1.28:
|
||||||
|
|
||||||
* Should compile better now with K&R compilers.
|
* Should compile better now with K&R compilers.
|
||||||
|
|
||||||
@@ -571,7 +78,7 @@ Changes in version 1.26:
|
|||||||
* Generated parsers should now work even on operating systems which do
|
* Generated parsers should now work even on operating systems which do
|
||||||
not provide alloca().
|
not provide alloca().
|
||||||
|
|
||||||
Changes in version 1.25, 1995-10-16:
|
Changes in version 1.25:
|
||||||
|
|
||||||
* Errors in the input grammar are not fatal; Bison keeps reading
|
* Errors in the input grammar are not fatal; Bison keeps reading
|
||||||
the grammar file, and reports all the errors found in it.
|
the grammar file, and reports all the errors found in it.
|
||||||
@@ -612,29 +119,3 @@ Changes in version 1.22:
|
|||||||
Changes in version 1.20:
|
Changes in version 1.20:
|
||||||
|
|
||||||
Output file does not redefine const for C++.
|
Output file does not redefine const for C++.
|
||||||
|
|
||||||
Local Variables:
|
|
||||||
mode: outline
|
|
||||||
End:
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
|
||||||
Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
|
||||||
|
|
||||||
Bison 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.
|
|
||||||
|
|
||||||
Bison 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 autoconf; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
Packaging hints for binary package distributors
|
|
||||||
===============================================
|
|
||||||
|
|
||||||
Although the source of the bison package comes as a single package,
|
|
||||||
in distributions of binary packages the installed files should
|
|
||||||
be split into two packages:
|
|
||||||
|
|
||||||
bison-runtime
|
|
||||||
Contents: Runtime libraries and programs.
|
|
||||||
Audience: Anyone who wants to run internationalized programs
|
|
||||||
that contain Bison-generated parsers.
|
|
||||||
|
|
||||||
bison
|
|
||||||
Contents: Tools and documentation for developers that use Bison.
|
|
||||||
Audience: Anyone who wants to develop programs that use parsers.
|
|
||||||
Dependencies: requires bison-runtime.
|
|
||||||
|
|
||||||
The 'bison-runtime' binary package is much smaller than the 'bison'
|
|
||||||
binary package. It should be included in any distribution that
|
|
||||||
contains localized programs that use the diagnostics contained in
|
|
||||||
Bison-generated parsers.
|
|
||||||
|
|
||||||
If you want to install both packages at the same time, you simply do
|
|
||||||
at the toplevel directory:
|
|
||||||
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
|
|
||||||
After installation, the file
|
|
||||||
|
|
||||||
$prefix/share/locale/*/LC_MESSAGES/bison-runtime.mo
|
|
||||||
|
|
||||||
belongs to the bison-runtime package; all other installed files belong
|
|
||||||
to the bison package.
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
|
||||||
|
|
||||||
Bison 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.
|
|
||||||
|
|
||||||
Bison 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 autoconf; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
@@ -1,41 +1,24 @@
|
|||||||
This directory contains the Bison parser generator.
|
This directory contains the Bison parser generator.
|
||||||
|
|
||||||
See the file INSTALL for generic compilation and installation instructions.
|
See the file INSTALL for compilation and installation instructions.
|
||||||
See the file doc/FAQ for frequently asked questions.
|
See the file doc/FAQ for frequently asked questions.
|
||||||
|
|
||||||
Bison requires GNU m4 1.4.3 or later. See:
|
It was once true that, when installing Bison on Sequent (or Pyramid?)
|
||||||
|
systems, you had to be in the Berkeley universe. This may no longer
|
||||||
|
be true; we have no way to tell.
|
||||||
|
|
||||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz
|
On VMS, you will probably have to create Makefile from Makefile.in by
|
||||||
|
hand. Remember to do `SET COMMAND BISON' to install the data in
|
||||||
|
`BISON.CLD'.
|
||||||
|
|
||||||
Bison can work with pre-1.4.3 distributions of GNU m4 if they are
|
VMS and MS-DOS builds are probably broken right now. If you are able
|
||||||
sufficiently patched, but if you encounter a bug with an older
|
to build Bison on either platform and you need to make changes to do
|
||||||
distribution and report a bug we will probably suggest that you
|
so, please submit those changes as a bug report.
|
||||||
upgrade to 1.4.3 as the first step in trying to fix it.
|
|
||||||
|
|
||||||
Please send bug reports to <[email protected]>. Please include the
|
Send bug reports to [email protected]. Please include the version
|
||||||
version number from `bison --version', and a complete, self-contained
|
number from `bison --version', and a complete, self-contained test
|
||||||
test case in each bug report.
|
case in each bug report.
|
||||||
|
|
||||||
If you have questions about using Bison and the documentation does
|
If you have questions about using Bison which the documentation does
|
||||||
not answer them, please send mail to <[email protected]>.
|
not answer, send mail to [email protected].
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
|
||||||
|
|
||||||
Bison 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.
|
|
||||||
|
|
||||||
Bison 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 autoconf; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
+6
-21
@@ -7,26 +7,11 @@ The documentation still needs more work. Suggestions welcome.
|
|||||||
Patches even more welcome.
|
Patches even more welcome.
|
||||||
|
|
||||||
Please send comments and problem reports about this test release to
|
Please send comments and problem reports about this test release to
|
||||||
<[email protected]>. This program will get better only if you report
|
[email protected]. This program will get better only if you report
|
||||||
the problems you encounter.
|
the problems you encounter.
|
||||||
|
|
||||||
-----
|
Please, *do not package this*, *do not distribute it* widely, it is
|
||||||
|
not ready for full scale use. Because it is not fully functional, if
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
you distribute this package, we will be buried under bug reports from
|
||||||
|
panicked users. We don't have time to spend on this, and nor do the
|
||||||
This file is part of GNU Bison.
|
users.
|
||||||
|
|
||||||
GNU Bison 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.
|
|
||||||
|
|
||||||
GNU Bison 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 Bison; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
-79
@@ -1,79 +0,0 @@
|
|||||||
-*- outline -*-
|
|
||||||
|
|
||||||
These notes intend to help people working on the CVS versions of
|
|
||||||
Bison.
|
|
||||||
|
|
||||||
* Requirements
|
|
||||||
|
|
||||||
Only the sources are installed in the CVS repository (to ease the
|
|
||||||
maintenance, merges etc.), therefore you will have to get the latest
|
|
||||||
stable versions of the maintainer tools we depend upon, including:
|
|
||||||
|
|
||||||
- Automake <http://www.gnu.org/software/automake/>
|
|
||||||
- Autoconf <http://www.gnu.org/software/autoconf/>
|
|
||||||
- Flex <http://www.gnu.org/software/flex/>
|
|
||||||
- Gettext <http://www.gnu.org/software/gettext/>
|
|
||||||
- Gzip <http://www.gnu.org/software/gzip/>
|
|
||||||
- Tar <http://www.gnu.org/software/tar/>
|
|
||||||
- Wget <http://www.gnu.org/software/wget/>
|
|
||||||
|
|
||||||
As of this writing, the latest stable version of Gzip is 1.2.4 but we
|
|
||||||
suggest using test version 1.3.5 (or later, if one becomes available).
|
|
||||||
|
|
||||||
Valgrind <http://valgrind.org/> is also highly recommended, if
|
|
||||||
Valgrind supports your architecture.
|
|
||||||
|
|
||||||
Bison is written using Bison grammars, so there are bootstrapping
|
|
||||||
issues. The bootstrap script attempts to discover when the C code
|
|
||||||
generated from the grammars is out of date, and to bootstrap with an
|
|
||||||
out-of-date version of the C code, but the process is not foolproof.
|
|
||||||
Also, you may run into similar problems yourself if you modify Bison.
|
|
||||||
|
|
||||||
Only building the initial full source tree will be a bit painful,
|
|
||||||
later, a plain `cvs update -P & make' should be sufficient.
|
|
||||||
|
|
||||||
* First CVS checkout
|
|
||||||
|
|
||||||
Obviously, if you are reading these notes, you did manage to check out
|
|
||||||
Bison from CVS. For the records, you will find all the relevant
|
|
||||||
information on:
|
|
||||||
|
|
||||||
http://savannah.gnu.org/cvs/?group_id=56
|
|
||||||
|
|
||||||
The next step is asking the installation of all the missing files:
|
|
||||||
|
|
||||||
$ ./bootstrap
|
|
||||||
|
|
||||||
And there you are! Just
|
|
||||||
|
|
||||||
$ ./configure && make && make check
|
|
||||||
|
|
||||||
At this point, there should be no difference between your local copy,
|
|
||||||
and the CVS master copy:
|
|
||||||
|
|
||||||
$ cvs diff
|
|
||||||
|
|
||||||
should output no difference.
|
|
||||||
|
|
||||||
Enjoy!
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
|
||||||
|
|
||||||
GNU Bison 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.
|
|
||||||
|
|
||||||
GNU Bison 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 Bison; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
+3
-6
@@ -19,15 +19,12 @@ kludges that Johnson had to perpetrate to make Yacc fit in a PDP-11.
|
|||||||
Also, Bison uses a faster but less space-efficient encoding for the
|
Also, Bison uses a faster but less space-efficient encoding for the
|
||||||
parse tables (see Corbett's PhD thesis from Berkeley, "Static
|
parse tables (see Corbett's PhD thesis from Berkeley, "Static
|
||||||
Semantics in Compiler Error Recovery", June 1985, Report No. UCB/CSD
|
Semantics in Compiler Error Recovery", June 1985, Report No. UCB/CSD
|
||||||
85/251), and more modern technique for generating the look-ahead sets.
|
85/251), and more modern technique for generating the lookahead sets.
|
||||||
(See Frank DeRemer and Thomas Pennello, "Efficient Computation of
|
(See "Efficient Construction of LALR(1) Lookahead Sets" by F. DeRemer
|
||||||
LALR(1) Look-Ahead Sets", ACM Transactions on Programming Languages
|
and A. Pennello, in ACM TOPLS Vol 4 No 4, October 1982. Their
|
||||||
and Systems (TOPLAS) 4, 4 (October 1982), 615-649. Their
|
|
||||||
technique is the standard one now.)
|
technique is the standard one now.)
|
||||||
|
|
||||||
paul rubin
|
paul rubin
|
||||||
free software foundation
|
free software foundation
|
||||||
|
|
||||||
|
|
||||||
[DeRemer-Pennello reference corrected by Paul Eggert <[email protected]>,
|
|
||||||
2004-06-21.]
|
|
||||||
|
|||||||
@@ -1,80 +1,28 @@
|
|||||||
Bison was originally written by Robert Corbett. It would not be what
|
Bison was originally written by Robert Corbett. It would not be what
|
||||||
it is today without the invaluable help of these people:
|
it is today without the invaluable help of these people:
|
||||||
|
|
||||||
Airy Andre [email protected]
|
Airy Andre [email protected]
|
||||||
Akim Demaille akim@freefriends.org
|
Akim Demaille akim@epita.fr
|
||||||
Albert Chin-A-Young [email protected]
|
Albert Chin-A-Young [email protected]
|
||||||
Alexander Belopolsky [email protected]
|
Alexander Belopolsky [email protected]
|
||||||
Alexandre Duret-Lutz [email protected]
|
Daniel Hagerty [email protected]
|
||||||
Andreas Schwab [email protected]
|
David J. MacKenzie [email protected]
|
||||||
Andrew Suffield [email protected]
|
Fabrice Bauzac [email protected]
|
||||||
Anthony Heading [email protected]
|
Hans Aberg [email protected]
|
||||||
Arnold Robbins [email protected]
|
Jesse Thilo [email protected]
|
||||||
Art Haas [email protected]
|
Jim Meyering [email protected]
|
||||||
Baron Schwartz [email protected]
|
Juan Manuel Guerrero [email protected]
|
||||||
Benoit Perrot [email protected]
|
Keith Browne [email protected]
|
||||||
Bert Deknuydt [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
Bruce Lilly [email protected]
|
Marc Autret [email protected]
|
||||||
Bruno Haible [email protected]
|
Neil Booth [email protected]
|
||||||
Charles-Henri de Boysson [email protected]
|
Noah Friedman [email protected]
|
||||||
Cris Bailiff [email protected]
|
Pascal Bart [email protected]
|
||||||
Cris van Pelt [email protected]
|
Paul Eggert [email protected]
|
||||||
Daniel Hagerty [email protected]
|
Piotr Gackiewicz [email protected]
|
||||||
David J. MacKenzie djm@gnu.org
|
Richard Stallman rms@gnu.org
|
||||||
Dick Streefland [email protected]
|
Robert Anisko [email protected]
|
||||||
Enrico Scholz [email protected]
|
Shura [email protected]
|
||||||
Evgeny Stambulchik [email protected]
|
|
||||||
Fabrice Bauzac [email protected]
|
|
||||||
Florian Krohm [email protected]
|
|
||||||
Frank Heckenbach [email protected]
|
|
||||||
Guido Trentalancia [email protected]
|
|
||||||
H. Merijn Brand [email protected]
|
|
||||||
Hans Aberg [email protected]
|
|
||||||
Jan Nieuwenhuizen [email protected]
|
|
||||||
Jesse Thilo [email protected]
|
|
||||||
Jim Kent [email protected]
|
|
||||||
Jim Meyering [email protected]
|
|
||||||
Joel E. Denny [email protected]
|
|
||||||
Juan Manuel Guerrero [email protected]
|
|
||||||
Kees Zeelenberg [email protected]
|
|
||||||
Keith Browne [email protected]
|
|
||||||
Laurent Mascherpa [email protected]
|
|
||||||
Magnus Fromreide [email protected]
|
|
||||||
Marc Autret [email protected]
|
|
||||||
Martin Mokrejs [email protected]
|
|
||||||
Matt Kraai [email protected]
|
|
||||||
Matt Rosing [email protected]
|
|
||||||
Michael Hayes [email protected]
|
|
||||||
Mike Castle [email protected]
|
|
||||||
Neil Booth [email protected]
|
|
||||||
Nelson H. F. Beebe [email protected]
|
|
||||||
Nicolas Burrus [email protected]
|
|
||||||
Nicolas Tisserand [email protected]
|
|
||||||
Noah Friedman [email protected]
|
|
||||||
Pascal Bart [email protected]
|
|
||||||
Paul Eggert [email protected]
|
|
||||||
Paul Hilfinger [email protected]
|
|
||||||
Per Allansson [email protected]
|
|
||||||
Peter Fales [email protected]
|
|
||||||
Peter Hamorsky [email protected]
|
|
||||||
Piotr Gackiewicz [email protected]
|
|
||||||
Quoc Peyrot [email protected]
|
|
||||||
R Blake [email protected]
|
|
||||||
Raja R Harinath [email protected]
|
|
||||||
Richard Stallman [email protected]
|
|
||||||
Robert Anisko [email protected]
|
|
||||||
Shura [email protected]
|
|
||||||
Tim Josling [email protected]
|
|
||||||
Tim Van Holder [email protected]
|
|
||||||
Tom Lane [email protected]
|
|
||||||
Tom Tromey [email protected]
|
|
||||||
Troy A. Johnson [email protected]
|
|
||||||
Vin Shelton [email protected]
|
|
||||||
Wayne Green [email protected]
|
|
||||||
Wolfram Wagner [email protected]
|
|
||||||
Wwp [email protected]
|
|
||||||
Zack Weinberg [email protected]
|
|
||||||
[email protected]
|
|
||||||
|
|
||||||
Many people are not named here because we lost track of them. We
|
Many people are not named here because we lost track of them. We
|
||||||
thank them! Please, help us keeping this list up to date.
|
thank them! Please, help us keeping this list up to date.
|
||||||
|
|||||||
@@ -1,365 +0,0 @@
|
|||||||
-*- outline -*-
|
|
||||||
|
|
||||||
* Header guards
|
|
||||||
|
|
||||||
From Franc,ois: should we keep the directory part in the CPP guard?
|
|
||||||
|
|
||||||
|
|
||||||
* Yacc.c: CPP Macros
|
|
||||||
|
|
||||||
Do some people use YYPURE, YYLSP_NEEDED like we do in the test suite?
|
|
||||||
They should not: it is not documented. But if they need to, let's
|
|
||||||
find something clean (not like YYLSP_NEEDED...).
|
|
||||||
|
|
||||||
|
|
||||||
* Documentation
|
|
||||||
Before releasing, make sure the documentation ("Understanding your
|
|
||||||
parser") refers to the current `output' format.
|
|
||||||
|
|
||||||
* lalr1.cc
|
|
||||||
** vector
|
|
||||||
Move to using vector, drop stack.hh.
|
|
||||||
|
|
||||||
** I18n
|
|
||||||
Catch up with yacc.c.
|
|
||||||
|
|
||||||
* Report
|
|
||||||
|
|
||||||
** GLR
|
|
||||||
How would Paul like to display the conflicted actions? In particular,
|
|
||||||
what when two reductions are possible on a given look-ahead token, but one is
|
|
||||||
part of $default. Should we make the two reductions explicit, or just
|
|
||||||
keep $default? See the following point.
|
|
||||||
|
|
||||||
** Disabled Reductions
|
|
||||||
See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
|
|
||||||
what we want to do.
|
|
||||||
|
|
||||||
** Documentation
|
|
||||||
Extend with error productions. The hard part will probably be finding
|
|
||||||
the right rule so that a single state does not exhibit too many yet
|
|
||||||
undocumented ``features''. Maybe an empty action ought to be
|
|
||||||
presented too. Shall we try to make a single grammar with all these
|
|
||||||
features, or should we have several very small grammars?
|
|
||||||
|
|
||||||
** --report=conflict-path
|
|
||||||
Provide better assistance for understanding the conflicts by providing
|
|
||||||
a sample text exhibiting the (LALR) ambiguity. See the paper from
|
|
||||||
DeRemer and Penello: they already provide the algorithm.
|
|
||||||
|
|
||||||
|
|
||||||
* Extensions
|
|
||||||
|
|
||||||
** Labeling the symbols
|
|
||||||
Have a look at the Lemon parser generator: instead of $1, $2 etc. they
|
|
||||||
can name the values. This is much more pleasant. For instance:
|
|
||||||
|
|
||||||
exp (res): exp (a) '+' exp (b) { $res = $a + $b; };
|
|
||||||
|
|
||||||
I love this. I have been bitten too often by the removal of the
|
|
||||||
symbol, and forgetting to shift all the $n to $n-1. If you are
|
|
||||||
unlucky, it compiles...
|
|
||||||
|
|
||||||
But instead of using $a etc., we can use regular variables. And
|
|
||||||
instead of using (), I propose to use `:' (again). Paul suggests
|
|
||||||
supporting `->' in addition to `:' to separate LHS and RHS. In other
|
|
||||||
words:
|
|
||||||
|
|
||||||
r:exp -> a:exp '+' b:exp { r = a + b; };
|
|
||||||
|
|
||||||
That requires an significant improvement of the grammar parser. Using
|
|
||||||
GLR would be nice. It also requires that Bison know the type of the
|
|
||||||
symbols (which will be useful for %include anyway). So we have some
|
|
||||||
time before...
|
|
||||||
|
|
||||||
Note that there remains the problem of locations: `@r'?
|
|
||||||
|
|
||||||
|
|
||||||
** $-1
|
|
||||||
We should find a means to provide an access to values deep in the
|
|
||||||
stack. For instance, instead of
|
|
||||||
|
|
||||||
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
|
|
||||||
|
|
||||||
we should be able to have:
|
|
||||||
|
|
||||||
foo($foo) bar($bar) baz($bar): qux($qux) { $baz = $foo + $bar + $qux; }
|
|
||||||
|
|
||||||
Or something like this.
|
|
||||||
|
|
||||||
** yysymprint interface
|
|
||||||
It should be improved, in particular when using Bison features such as
|
|
||||||
locations, and YYPARSE_PARAMS. For the time being, it is almost
|
|
||||||
recommended to yyprint to steal internal variables...
|
|
||||||
|
|
||||||
** Several %unions
|
|
||||||
I think this is a pleasant (but useless currently) feature, but in the
|
|
||||||
future, I want a means to %include other bits of grammars, and _then_
|
|
||||||
it will be important for the various bits to define their needs in
|
|
||||||
%union.
|
|
||||||
|
|
||||||
When implementing multiple-%union support, bare the following in mind:
|
|
||||||
|
|
||||||
- when --yacc, this must be flagged as an error. Don't make it fatal
|
|
||||||
though.
|
|
||||||
|
|
||||||
- The #line must now appear *inside* the definition of yystype.
|
|
||||||
Something like
|
|
||||||
|
|
||||||
{
|
|
||||||
#line 12 "foo.y"
|
|
||||||
int ival;
|
|
||||||
#line 23 "foo.y"
|
|
||||||
char *sval;
|
|
||||||
}
|
|
||||||
|
|
||||||
** %if and the like
|
|
||||||
It should be possible to have %if/%else/%endif. The implementation is
|
|
||||||
not clear: should it be lexical or syntactic. Vadim Maslow thinks it
|
|
||||||
must be in the scanner: we must not parse what is in a switched off
|
|
||||||
part of %if. Akim Demaille thinks it should be in the parser, so as
|
|
||||||
to avoid falling into another CPP mistake.
|
|
||||||
|
|
||||||
** -D, --define-muscle NAME=VALUE
|
|
||||||
To define muscles via cli. Or maybe support directly NAME=VALUE?
|
|
||||||
|
|
||||||
** XML Output
|
|
||||||
There are couple of available extensions of Bison targeting some XML
|
|
||||||
output. Some day we should consider including them. One issue is
|
|
||||||
that they seem to be quite orthogonal to the parsing technique, and
|
|
||||||
seem to depend mostly on the possibility to have some code triggered
|
|
||||||
for each reduction. As a matter of fact, such hooks could also be
|
|
||||||
used to generate the yydebug traces. Some generic scheme probably
|
|
||||||
exists in there.
|
|
||||||
|
|
||||||
XML output for GNU Bison and gcc
|
|
||||||
http://www.cs.may.ie/~jpower/Research/bisonXML/
|
|
||||||
|
|
||||||
XML output for GNU Bison
|
|
||||||
http://yaxx.sourceforge.net/
|
|
||||||
|
|
||||||
* Unit rules
|
|
||||||
Maybe we could expand unit rules, i.e., transform
|
|
||||||
|
|
||||||
exp: arith | bool;
|
|
||||||
arith: exp '+' exp;
|
|
||||||
bool: exp '&' exp;
|
|
||||||
|
|
||||||
into
|
|
||||||
|
|
||||||
exp: exp '+' exp | exp '&' exp;
|
|
||||||
|
|
||||||
when there are no actions. This can significantly speed up some
|
|
||||||
grammars. I can't find the papers. In particular the book `LR
|
|
||||||
parsing: Theory and Practice' is impossible to find, but according to
|
|
||||||
`Parsing Techniques: a Practical Guide', it includes information about
|
|
||||||
this issue. Does anybody have it?
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Documentation
|
|
||||||
|
|
||||||
** History/Bibliography
|
|
||||||
Some history of Bison and some bibliography would be most welcome.
|
|
||||||
Are there any Texinfo standards for bibliography?
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Java, Fortran, etc.
|
|
||||||
|
|
||||||
|
|
||||||
** Java
|
|
||||||
|
|
||||||
There are a couple of proposed outputs:
|
|
||||||
|
|
||||||
- BYACC/J
|
|
||||||
which is based on Byacc.
|
|
||||||
<http://troi.lincom-asg.com/~rjamison/byacc/>
|
|
||||||
|
|
||||||
- Bison Java
|
|
||||||
which is based on Bison.
|
|
||||||
<http://www.goice.co.jp/member/mo/hack-progs/bison-java.html>
|
|
||||||
|
|
||||||
Sebastien Serrurier ([email protected]) is working on this: he is
|
|
||||||
expected to contact the authors, design the output, and implement it
|
|
||||||
into Bison.
|
|
||||||
|
|
||||||
|
|
||||||
* Coding system independence
|
|
||||||
Paul notes:
|
|
||||||
|
|
||||||
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
|
|
||||||
255). It also assumes that the 8-bit character encoding is
|
|
||||||
the same for the invocation of 'bison' as it is for the
|
|
||||||
invocation of 'cc', but this is not necessarily true when
|
|
||||||
people run bison on an ASCII host and then use cc on an EBCDIC
|
|
||||||
host. I don't think these topics are worth our time
|
|
||||||
addressing (unless we find a gung-ho volunteer for EBCDIC or
|
|
||||||
PDP-10 ports :-) but they should probably be documented
|
|
||||||
somewhere.
|
|
||||||
|
|
||||||
More importantly, Bison does not currently allow NUL bytes in
|
|
||||||
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
|
||||||
the source code. This should get fixed.
|
|
||||||
|
|
||||||
* --graph
|
|
||||||
Show reductions. []
|
|
||||||
|
|
||||||
* Broken options ?
|
|
||||||
** %no-parser []
|
|
||||||
** %token-table []
|
|
||||||
** Skeleton strategy. []
|
|
||||||
Must we keep %no-parser?
|
|
||||||
%token-table?
|
|
||||||
|
|
||||||
* src/print_graph.c
|
|
||||||
Find the best graph parameters. []
|
|
||||||
|
|
||||||
* doc/bison.texinfo
|
|
||||||
** Update
|
|
||||||
informations about ERROR_VERBOSE. []
|
|
||||||
** Add explanations about
|
|
||||||
skeleton muscles. []
|
|
||||||
%skeleton. []
|
|
||||||
|
|
||||||
* testsuite
|
|
||||||
** tests/pure-parser.at []
|
|
||||||
New tests.
|
|
||||||
|
|
||||||
* BTYacc
|
|
||||||
See if we can integrate backtracking in Bison. Charles-Henri de
|
|
||||||
Boysson <[email protected]> is working on this, and already has some
|
|
||||||
results. Vadim Maslow, the maintainer of BTYacc was contacted, and we
|
|
||||||
stay in touch with him. Adjusting the Bison grammar parser will be
|
|
||||||
needed to support some extra BTYacc features. This is less urgent.
|
|
||||||
|
|
||||||
** Keeping the conflicted actions
|
|
||||||
First, analyze the differences between byacc and btyacc (I'm referring
|
|
||||||
to the executables). Find where the conflicts are preserved.
|
|
||||||
|
|
||||||
** Compare with the GLR tables
|
|
||||||
See how isomorphic the way BTYacc and the way the GLR adjustments in
|
|
||||||
Bison are compatible. *As much as possible* one should try to use the
|
|
||||||
same implementation in the Bison executables. I insist: it should be
|
|
||||||
very feasible to use the very same conflict tables.
|
|
||||||
|
|
||||||
** Adjust the skeletons
|
|
||||||
Import the skeletons for C and C++.
|
|
||||||
|
|
||||||
** Improve the skeletons
|
|
||||||
Have them support yysymprint, yydestruct and so forth.
|
|
||||||
|
|
||||||
|
|
||||||
* Precedence
|
|
||||||
|
|
||||||
** Partial order
|
|
||||||
It is unfortunate that there is a total order for precedence. It
|
|
||||||
makes it impossible to have modular precedence information. We should
|
|
||||||
move to partial orders (sounds like series/parallel orders to me).
|
|
||||||
|
|
||||||
This will be possible with a Bison parser for the grammar, as it will
|
|
||||||
make it much easier to extend the grammar.
|
|
||||||
|
|
||||||
** Correlation b/w precedence and associativity
|
|
||||||
Also, I fail to understand why we have to assign the same
|
|
||||||
associativity to operators with the same precedence. For instance,
|
|
||||||
why can't I decide that the precedence of * and / is the same, but the
|
|
||||||
latter is nonassoc?
|
|
||||||
|
|
||||||
If there is really no profound motivation, we should find a new syntax
|
|
||||||
to allow specifying this.
|
|
||||||
|
|
||||||
** RR conflicts
|
|
||||||
See if we can use precedence between rules to solve RR conflicts. See
|
|
||||||
what POSIX says.
|
|
||||||
|
|
||||||
|
|
||||||
* $undefined
|
|
||||||
From Hans:
|
|
||||||
- If the Bison generated parser experiences an undefined number in the
|
|
||||||
character range, that character is written out in diagnostic messages, an
|
|
||||||
addition to the $undefined value.
|
|
||||||
|
|
||||||
Suggest: Change the name $undefined to undefined; looks better in outputs.
|
|
||||||
|
|
||||||
|
|
||||||
* Default Action
|
|
||||||
From Hans:
|
|
||||||
- For use with my C++ parser, I transported the "switch (yyn)" statement
|
|
||||||
that Bison writes to the bison.simple skeleton file. This way, I can remove
|
|
||||||
the current default rule $$ = $1 implementation, which causes a double
|
|
||||||
assignment to $$ which may not be OK under C++, replacing it with a
|
|
||||||
"default:" part within the switch statement.
|
|
||||||
|
|
||||||
Note that the default rule $$ = $1, when typed, is perfectly OK under C,
|
|
||||||
but in the C++ implementation I made, this rule is different from
|
|
||||||
$<type_name>$ = $<type_name>1. I therefore think that one should implement
|
|
||||||
a Bison option where every typed default rule is explicitly written out
|
|
||||||
(same typed ruled can of course be grouped together).
|
|
||||||
|
|
||||||
Note: Robert Anisko handles this. He knows how to do it.
|
|
||||||
|
|
||||||
|
|
||||||
* Warnings
|
|
||||||
It would be nice to have warning support. See how Autoconf handles
|
|
||||||
them, it is fairly well described there. It would be very nice to
|
|
||||||
implement this in such a way that other programs could use
|
|
||||||
lib/warnings.[ch].
|
|
||||||
|
|
||||||
Don't work on this without first announcing you do, as I already have
|
|
||||||
thought about it, and know many of the components that can be used to
|
|
||||||
implement it.
|
|
||||||
|
|
||||||
|
|
||||||
* Pre and post actions.
|
|
||||||
From: Florian Krohm <[email protected]>
|
|
||||||
Subject: YYACT_EPILOGUE
|
|
||||||
To: [email protected]
|
|
||||||
X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago
|
|
||||||
|
|
||||||
The other day I had the need for explicitly building the parse tree. I
|
|
||||||
used %locations for that and defined YYLLOC_DEFAULT to call a function
|
|
||||||
that returns the tree node for the production. Easy. But I also needed
|
|
||||||
to assign the S-attribute to the tree node. That cannot be done in
|
|
||||||
YYLLOC_DEFAULT, because it is invoked before the action is executed.
|
|
||||||
The way I solved this was to define a macro YYACT_EPILOGUE that would
|
|
||||||
be invoked after the action. For reasons of symmetry I also added
|
|
||||||
YYACT_PROLOGUE. Although I had no use for that I can envision how it
|
|
||||||
might come in handy for debugging purposes.
|
|
||||||
All is needed is to add
|
|
||||||
|
|
||||||
#if YYLSP_NEEDED
|
|
||||||
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
|
|
||||||
#else
|
|
||||||
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
|
|
||||||
|
|
||||||
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
|
||||||
to bison. If you're interested, I'll work on a patch.
|
|
||||||
|
|
||||||
* Move to Graphviz
|
|
||||||
Well, VCG seems really dead. Move to Graphviz instead. Also, equip
|
|
||||||
the parser with a means to create the (visual) parse tree.
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
|
||||||
|
|
||||||
GNU Bison 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.
|
|
||||||
|
|
||||||
GNU Bison 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 Bison; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
Vendored
+1714
File diff suppressed because it is too large
Load Diff
@@ -1,325 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
# Bootstrap this package from CVS.
|
|
||||||
|
|
||||||
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301, USA.
|
|
||||||
|
|
||||||
# Written by Paul Eggert.
|
|
||||||
|
|
||||||
package=bison
|
|
||||||
|
|
||||||
# Ensure file names are sorted consistently across platforms;
|
|
||||||
# e.g., m4/ulonglong_gl.m4 should follow m4/ulonglong.m4.
|
|
||||||
# Also, ensure diagnostics are in English, e.g., "wget --help" below.
|
|
||||||
LC_ALL=C
|
|
||||||
export LC_ALL
|
|
||||||
|
|
||||||
# Parse options.
|
|
||||||
|
|
||||||
for option
|
|
||||||
do
|
|
||||||
case $option in
|
|
||||||
--help)
|
|
||||||
echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
|
|
||||||
exit;;
|
|
||||||
--gnulib-srcdir=*)
|
|
||||||
GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
|
|
||||||
--cvs-user=*)
|
|
||||||
CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;;
|
|
||||||
--skip-po)
|
|
||||||
SKIP_PO=t;;
|
|
||||||
*)
|
|
||||||
echo >&2 "$0: $option: unknown option"
|
|
||||||
exit 1;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "$0: Bootstrapping CVS $package..."
|
|
||||||
|
|
||||||
build_cvs_prefix() {
|
|
||||||
CVS_PREFIX=:${1}:
|
|
||||||
if [ "${2}" != - ]; then
|
|
||||||
CVS_PREFIX=${CVS_PREFIX}${2}@
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get gnulib files.
|
|
||||||
|
|
||||||
case ${GNULIB_SRCDIR--} in
|
|
||||||
-)
|
|
||||||
if [ ! -d gnulib ]; then
|
|
||||||
echo "$0: getting gnulib files..."
|
|
||||||
|
|
||||||
trap exit 1 2 13 15
|
|
||||||
trap 'rm -fr gnulib; exit 1' 0
|
|
||||||
|
|
||||||
case ${CVS_AUTH-anoncvs} in
|
|
||||||
anoncvs)
|
|
||||||
CVS_PREFIX='anoncvs@';;
|
|
||||||
ssh)
|
|
||||||
CVS_PREFIX="$CVS_USER${CVS_USER+@}";;
|
|
||||||
*)
|
|
||||||
echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
|
|
||||||
exit 1;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case $CVS_RSH in
|
|
||||||
'') export CVS_RSH=ssh;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cvs -z3 -q -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib co gnulib || exit
|
|
||||||
|
|
||||||
trap - 0
|
|
||||||
fi
|
|
||||||
GNULIB_SRCDIR=gnulib
|
|
||||||
esac
|
|
||||||
|
|
||||||
<$GNULIB_SRCDIR/gnulib-tool || exit
|
|
||||||
|
|
||||||
gnulib_modules='
|
|
||||||
alloca
|
|
||||||
argmatch
|
|
||||||
dirname
|
|
||||||
error
|
|
||||||
extensions
|
|
||||||
getopt
|
|
||||||
gettext
|
|
||||||
hard-locale
|
|
||||||
hash
|
|
||||||
malloc
|
|
||||||
mbswidth
|
|
||||||
obstack
|
|
||||||
quote
|
|
||||||
quotearg
|
|
||||||
stdbool
|
|
||||||
stdio-safer
|
|
||||||
stpcpy
|
|
||||||
unistd-safer
|
|
||||||
xalloc
|
|
||||||
xalloc-die
|
|
||||||
xstrndup
|
|
||||||
'
|
|
||||||
|
|
||||||
previous_gnulib_modules=
|
|
||||||
while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
|
|
||||||
previous_gnulib_modules=$gnulib_modules
|
|
||||||
gnulib_modules=`
|
|
||||||
(echo "$gnulib_modules"
|
|
||||||
for gnulib_module in $gnulib_modules; do
|
|
||||||
$GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
|
|
||||||
done) | sort -u
|
|
||||||
`
|
|
||||||
done
|
|
||||||
|
|
||||||
gnulib_files=`
|
|
||||||
(for gnulib_module in $gnulib_modules; do
|
|
||||||
$GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
|
|
||||||
done) | sort -u
|
|
||||||
`
|
|
||||||
|
|
||||||
gnulib_dirs=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
|
|
||||||
mkdir -p $gnulib_dirs || exit
|
|
||||||
|
|
||||||
for gnulib_file in $gnulib_files; do
|
|
||||||
dest=$gnulib_file
|
|
||||||
|
|
||||||
case $gnulib_file in
|
|
||||||
m4/onceonly_2_57.m4) dest=m4/onceonly.m4;;
|
|
||||||
# These will be overwritten by autopoint, which still uses
|
|
||||||
# old jm_.* macro names, so we have to keep both copies.
|
|
||||||
# m4/gettext.m4 isn't mentioned here, since it's patched below.
|
|
||||||
m4/glibc21.m4 | m4/inttypes_h.m4 | m4/lib-ld.m4 | \
|
|
||||||
m4/lib-prefix.m4 | m4/po.m4 | m4/stdint_h.m4 | m4/uintmax_t.m4 | \
|
|
||||||
m4/ulonglong.m4)
|
|
||||||
dest=`expr $gnulib_file : '\(.*\).m4'`_gl.m4;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
rm -f $dest &&
|
|
||||||
echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
|
|
||||||
cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
|
|
||||||
done
|
|
||||||
|
|
||||||
# This suppresses a bogus diagnostic
|
|
||||||
# "warning: macro `AM_LANGINFO_CODESET' not found in library".
|
|
||||||
echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
|
|
||||||
sed '
|
|
||||||
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
|
|
||||||
AC_DEFUN([AM_INTL_SUBDIR], [])
|
|
||||||
' m4/gettext.m4 >m4/gettext_gl.m4 || exit
|
|
||||||
|
|
||||||
|
|
||||||
# Get translations.
|
|
||||||
|
|
||||||
case $SKIP_PO in
|
|
||||||
'')
|
|
||||||
case `wget --help` in
|
|
||||||
*'--no-cache'*)
|
|
||||||
no_cache='--no-cache';;
|
|
||||||
*'--cache=on/off'*)
|
|
||||||
no_cache='--cache=off';;
|
|
||||||
*)
|
|
||||||
no_cache='';;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
|
|
||||||
(cd po &&
|
|
||||||
rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'` &&
|
|
||||||
wget -nv -nd -r -l 1 -A .po $no_cache \
|
|
||||||
http://www.iro.umontreal.ca/translation/maint/$package/ &&
|
|
||||||
ls *.po | sed 's/\.po$//' >LINGUAS
|
|
||||||
) || exit
|
|
||||||
|
|
||||||
case $package in
|
|
||||||
bison)
|
|
||||||
echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
|
|
||||||
(cd runtime-po &&
|
|
||||||
rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po$/p'` &&
|
|
||||||
wget -nv -nd -r -l 1 -A .po $no_cache \
|
|
||||||
http://www.iro.umontreal.ca/translation/maint/$package-runtime/ &&
|
|
||||||
|
|
||||||
# For translations that have not yet been upgraded to the new
|
|
||||||
# runtime-po domain, prime the pump by extracting the relevant
|
|
||||||
# strings from the obsolete translations.
|
|
||||||
# This code can be removed once the bison-runtime domain
|
|
||||||
# has been translated by each team.
|
|
||||||
for po in ../po/*.po; do
|
|
||||||
test -f "$po" || continue
|
|
||||||
runpo=`basename $po`
|
|
||||||
test -f $runpo || {
|
|
||||||
msggrep -K \
|
|
||||||
-e 'memory exhausted' \
|
|
||||||
-e 'syntax error' \
|
|
||||||
$po 2>/dev/null |
|
|
||||||
sed '
|
|
||||||
s/^#~ //
|
|
||||||
/^msgid "syntax error; also memory exhausted"$/,/^$/d
|
|
||||||
/^$/,${ /^#/d; }
|
|
||||||
' >$runpo-
|
|
||||||
if cmp -s $runpo- $runpo; then
|
|
||||||
rm $runpo-
|
|
||||||
else
|
|
||||||
mv $runpo- $runpo
|
|
||||||
fi
|
|
||||||
test -s $runpo || rm -f $runpo
|
|
||||||
} || exit
|
|
||||||
done &&
|
|
||||||
|
|
||||||
ls *.po | sed 's/\.po$//' >LINGUAS
|
|
||||||
) || exit
|
|
||||||
esac;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# Generate autoconf and automake snippets.
|
|
||||||
|
|
||||||
(echo '# This file is generated automatically by "bootstrap".' &&
|
|
||||||
echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
|
|
||||||
$GNULIB_SRCDIR/gnulib-tool --extract-autoconf-snippet $gnulib_modules &&
|
|
||||||
echo '])'
|
|
||||||
) >m4/gnulib.m4 || exit
|
|
||||||
|
|
||||||
(echo '# This file is generated automatically by "bootstrap".' &&
|
|
||||||
$GNULIB_SRCDIR/gnulib-tool --extract-automake-snippet $gnulib_modules
|
|
||||||
) >lib/gnulib.mk || exit
|
|
||||||
|
|
||||||
|
|
||||||
# Reconfigure, getting other files.
|
|
||||||
|
|
||||||
echo "$0: autoreconf --verbose --install --force ..."
|
|
||||||
autoreconf --verbose --install --force || exit
|
|
||||||
|
|
||||||
|
|
||||||
# We don't need intl, so remove it.
|
|
||||||
# Remove aclocal.m4 too, so that it gets rebuilt.
|
|
||||||
intl_files_to_remove='
|
|
||||||
aclocal.m4
|
|
||||||
intl
|
|
||||||
m4/codeset.m4
|
|
||||||
m4/gettext.m4
|
|
||||||
m4/glibc2.m4
|
|
||||||
m4/glibc21.m4
|
|
||||||
m4/intdiv0.m4
|
|
||||||
m4/intmax.m4
|
|
||||||
m4/inttypes_h.m4
|
|
||||||
m4/inttypes.m4
|
|
||||||
m4/inttypes-pri.m4
|
|
||||||
m4/isc-posix.m4
|
|
||||||
m4/lcmessage.m4
|
|
||||||
m4/lib-ld.m4
|
|
||||||
m4/lib-prefix.m4
|
|
||||||
m4/longdouble.m4
|
|
||||||
m4/longlong.m4
|
|
||||||
m4/po.m4
|
|
||||||
m4/printf-posix.m4
|
|
||||||
m4/signed.m4
|
|
||||||
m4/size_max.m4
|
|
||||||
m4/stdint_h.m4
|
|
||||||
m4/uintmax_t.m4
|
|
||||||
m4/ulonglong.m4
|
|
||||||
m4/wchar_t.m4
|
|
||||||
m4/wint_t.m4
|
|
||||||
m4/xsize.m4
|
|
||||||
'
|
|
||||||
echo $0: rm -fr $intl_files_to_remove ...
|
|
||||||
rm -fr $intl_files_to_remove || exit
|
|
||||||
|
|
||||||
# Put bug-reporting address into po/Makevars.
|
|
||||||
echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= [email protected]/' po/Makevars.template >po/Makevars ..."
|
|
||||||
sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= [email protected]/' po/Makevars.template >po/Makevars
|
|
||||||
|
|
||||||
# Likewise for runtime-po/Makevars, except also change a few other parameters.
|
|
||||||
sed '
|
|
||||||
s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
|
|
||||||
s/^\(subdir\) *=.*/\1 = runtime-po/
|
|
||||||
s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
|
|
||||||
' <po/Makevars >runtime-po/Makevars
|
|
||||||
|
|
||||||
# Copy identical files from po to runtime-po.
|
|
||||||
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
|
||||||
|
|
||||||
# if src/parse-gram.[ch] are out of date, rebuild them.
|
|
||||||
parse_gram_y=`find src/parse-gram.y \
|
|
||||||
'(' -newer src/parse-gram.c -o -newer src/parse-gram.h ')' \
|
|
||||||
-print` || exit
|
|
||||||
case $parse_gram_y in
|
|
||||||
?*)
|
|
||||||
echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
|
|
||||||
|
|
||||||
echo "$0: touch -c src/parse-gram.[ch] ... "
|
|
||||||
touch -c src/parse-gram.[ch] || exit
|
|
||||||
|
|
||||||
echo "$0: ./configure --disable-nls ..."
|
|
||||||
./configure --disable-nls || exit
|
|
||||||
|
|
||||||
echo "$0: (cd lib && make) ..."
|
|
||||||
(cd lib && make) || exit
|
|
||||||
|
|
||||||
echo "$0: (cd src && make) ..."
|
|
||||||
(cd src && make) || exit
|
|
||||||
|
|
||||||
echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
|
|
||||||
rm -f src/parse-gram.c src/parse-gram.h || exit
|
|
||||||
|
|
||||||
echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
|
|
||||||
(cd src && make parse-gram.c parse-gram.h) || exit
|
|
||||||
|
|
||||||
echo "$0: make distclean ..."
|
|
||||||
make distclean || exit;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "$0: done. Now you can run './configure'."
|
|
||||||
+7
-3
@@ -38,6 +38,10 @@
|
|||||||
*/
|
*/
|
||||||
#undef HAVE_DECL_STPCPY
|
#undef HAVE_DECL_STPCPY
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `strerror', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_STRERROR
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
|
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
|
||||||
don't. */
|
don't. */
|
||||||
#undef HAVE_DECL_STRERROR_R
|
#undef HAVE_DECL_STRERROR_R
|
||||||
@@ -218,9 +222,6 @@
|
|||||||
/* Define if you have the <wctype.h> header file. */
|
/* Define if you have the <wctype.h> header file. */
|
||||||
#undef HAVE_WCTYPE_H
|
#undef HAVE_WCTYPE_H
|
||||||
|
|
||||||
/* Define to 1 if `strerror_r' returns a string. */
|
|
||||||
#undef HAVE_WORKING_STRERROR_R
|
|
||||||
|
|
||||||
/* Define if you have the `__argz_count' function. */
|
/* Define if you have the `__argz_count' function. */
|
||||||
#undef HAVE___ARGZ_COUNT
|
#undef HAVE___ARGZ_COUNT
|
||||||
|
|
||||||
@@ -250,6 +251,9 @@
|
|||||||
/* Define if you have the ANSI C header files. */
|
/* Define if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define to 1 if strerror_r returns char *. */
|
||||||
|
#undef STRERROR_R_CHAR_P
|
||||||
|
|
||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#undef VERSION
|
#undef VERSION
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -1,3 +1,2 @@
|
|||||||
*.t
|
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
*.t
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
EXTRA_DIST = prev-version.txt
|
EXTRA_DIST = move-if-change prev-version.txt
|
||||||
|
|||||||
@@ -0,0 +1,221 @@
|
|||||||
|
# Makefile.in generated by automake 1.5a from Makefile.am.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
SHELL = @SHELL@
|
||||||
|
|
||||||
|
srcdir = @srcdir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
|
||||||
|
bindir = @bindir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
datadir = @datadir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
libdir = @libdir@
|
||||||
|
infodir = @infodir@
|
||||||
|
mandir = @mandir@
|
||||||
|
includedir = @includedir@
|
||||||
|
oldincludedir = /usr/include
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
top_builddir = ..
|
||||||
|
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = @program_transform_name@
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_triplet = @host@
|
||||||
|
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AUTOM4TE = @AUTOM4TE@
|
||||||
|
AWK = @AWK@
|
||||||
|
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
||||||
|
CATALOGS = @CATALOGS@
|
||||||
|
CATOBJEXT = @CATOBJEXT@
|
||||||
|
CC = @CC@
|
||||||
|
CPP = @CPP@
|
||||||
|
DATADIRNAME = @DATADIRNAME@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
GCC = @GCC@
|
||||||
|
GENCAT = @GENCAT@
|
||||||
|
GLIBC21 = @GLIBC21@
|
||||||
|
GMOFILES = @GMOFILES@
|
||||||
|
GMSGFMT = @GMSGFMT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
INSTOBJEXT = @INSTOBJEXT@
|
||||||
|
INTLBISON = @INTLBISON@
|
||||||
|
INTLLIBS = @INTLLIBS@
|
||||||
|
INTLOBJS = @INTLOBJS@
|
||||||
|
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
||||||
|
LIBICONV = @LIBICONV@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||||
|
MSGFMT = @MSGFMT@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
POFILES = @POFILES@
|
||||||
|
POSUB = @POSUB@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
U = @U@
|
||||||
|
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||||
|
USE_NLS = @USE_NLS@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
|
||||||
|
EXTRA_DIST = move-if-change prev-version.txt
|
||||||
|
subdir = config
|
||||||
|
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
||||||
|
CONFIG_HEADER = $(top_builddir)/config.h
|
||||||
|
CONFIG_CLEAN_FILES =
|
||||||
|
DIST_SOURCES =
|
||||||
|
DIST_COMMON = Makefile.am Makefile.in config.guess config.sub depcomp \
|
||||||
|
install-sh mdate-sh missing mkinstalldirs texinfo.tex
|
||||||
|
all: all-am
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||||
|
cd $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu config/Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||||
|
uninstall-info-am:
|
||||||
|
tags: TAGS
|
||||||
|
TAGS:
|
||||||
|
|
||||||
|
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
|
top_distdir = ..
|
||||||
|
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@for file in $(DISTFILES); do \
|
||||||
|
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||||
|
$(mkinstalldirs) "$(distdir)/$$dir"; \
|
||||||
|
fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
cp -pR $$d/$$file $(distdir) \
|
||||||
|
|| exit 1; \
|
||||||
|
else \
|
||||||
|
test -f $(distdir)/$$file \
|
||||||
|
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
check-am: all-am
|
||||||
|
check: check-am
|
||||||
|
all-am: Makefile
|
||||||
|
|
||||||
|
installdirs:
|
||||||
|
|
||||||
|
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:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
`test -z '$(STRIP)' || \
|
||||||
|
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||||
|
|
||||||
|
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-generic mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-am
|
||||||
|
|
||||||
|
distclean-am: clean-am distclean-generic
|
||||||
|
|
||||||
|
dvi: dvi-am
|
||||||
|
|
||||||
|
dvi-am:
|
||||||
|
|
||||||
|
info: info-am
|
||||||
|
|
||||||
|
info-am:
|
||||||
|
|
||||||
|
install-data-am:
|
||||||
|
|
||||||
|
install-exec-am:
|
||||||
|
|
||||||
|
install-info: install-info-am
|
||||||
|
|
||||||
|
install-man:
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-am
|
||||||
|
|
||||||
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-am
|
||||||
|
|
||||||
|
mostlyclean-am: mostlyclean-generic
|
||||||
|
|
||||||
|
uninstall-am: uninstall-info-am
|
||||||
|
|
||||||
|
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||||
|
distclean-generic distdir dvi dvi-am info info-am install \
|
||||||
|
install-am install-data install-data-am install-exec \
|
||||||
|
install-exec-am install-info install-info-am install-man \
|
||||||
|
install-strip installcheck installcheck-am installdirs \
|
||||||
|
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||||
|
mostlyclean-generic uninstall uninstall-am uninstall-info-am
|
||||||
|
|
||||||
|
# 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:
|
||||||
@@ -1,338 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
# Generate an announcement message.
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
use Getopt::Long;
|
|
||||||
use Digest::MD5;
|
|
||||||
use Digest::SHA1;
|
|
||||||
|
|
||||||
(my $VERSION = '$Revision$ ') =~ tr/[0-9].//cd;
|
|
||||||
(my $ME = $0) =~ s|.*/||;
|
|
||||||
|
|
||||||
my %valid_release_types = map {$_ => 1} qw (alpha beta major);
|
|
||||||
|
|
||||||
END
|
|
||||||
{
|
|
||||||
# Nobody ever checks the status of print()s. That's okay, because
|
|
||||||
# if any do fail, we're guaranteed to get an indicator when we close()
|
|
||||||
# the filehandle.
|
|
||||||
#
|
|
||||||
# Close stdout now, and if there were no errors, return happy status.
|
|
||||||
# If stdout has already been closed by the script, though, do nothing.
|
|
||||||
defined fileno STDOUT
|
|
||||||
or return;
|
|
||||||
close STDOUT
|
|
||||||
and return;
|
|
||||||
|
|
||||||
# Errors closing stdout. Indicate that, and hope stderr is OK.
|
|
||||||
warn "$ME: closing standard output: $!\n";
|
|
||||||
|
|
||||||
# Don't be so arrogant as to assume that we're the first END handler
|
|
||||||
# defined, and thus the last one invoked. There may be others yet
|
|
||||||
# to come. $? will be passed on to them, and to the final _exit().
|
|
||||||
#
|
|
||||||
# If it isn't already an error, make it one (and if it _is_ an error,
|
|
||||||
# preserve the value: it might be important).
|
|
||||||
$? ||= 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
|
|
||||||
{
|
|
||||||
my @types = sort keys %valid_release_types;
|
|
||||||
print $STREAM <<EOF;
|
|
||||||
Usage: $ME [OPTIONS]
|
|
||||||
|
|
||||||
OPTIONS:
|
|
||||||
|
|
||||||
Generate an announcement message.
|
|
||||||
|
|
||||||
FIXME: describe the following
|
|
||||||
|
|
||||||
--release-type=TYPE TYPE must be one of @types
|
|
||||||
--package-name=PACKAGE_NAME
|
|
||||||
--previous-version=VER
|
|
||||||
--current-version=VER
|
|
||||||
--release-archive-directory=DIR
|
|
||||||
--url-directory=URL_DIR
|
|
||||||
--news=NEWS_FILE optional
|
|
||||||
|
|
||||||
--help display this help and exit
|
|
||||||
--version output version information and exit
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
exit $exit_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 = <DIFF>))
|
|
||||||
{
|
|
||||||
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 "$ME: warning: `cmd' had unexpected exit code or signal ($?)\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
my $release_type;
|
|
||||||
my $package_name;
|
|
||||||
my $prev_version;
|
|
||||||
my $curr_version;
|
|
||||||
my $release_archive_dir;
|
|
||||||
my @url_dir_list;
|
|
||||||
my $news_file;
|
|
||||||
|
|
||||||
GetOptions
|
|
||||||
(
|
|
||||||
'release-type=s' => \$release_type,
|
|
||||||
'package-name=s' => \$package_name,
|
|
||||||
'previous-version=s' => \$prev_version,
|
|
||||||
'current-version=s' => \$curr_version,
|
|
||||||
'release-archive-directory=s' => \$release_archive_dir,
|
|
||||||
'url-directory=s@' => \@url_dir_list,
|
|
||||||
'news=s@' => \$news_file,
|
|
||||||
|
|
||||||
help => sub { usage 0 },
|
|
||||||
version => sub { print "$ME version $VERSION\n"; exit },
|
|
||||||
) or usage 1;
|
|
||||||
|
|
||||||
my $fail = 0;
|
|
||||||
# Ensure that sure each required option is specified.
|
|
||||||
$release_type
|
|
||||||
or (warn "$ME: release type not specified\n"), $fail = 1;
|
|
||||||
$package_name
|
|
||||||
or (warn "$ME: package name not specified\n"), $fail = 1;
|
|
||||||
$prev_version
|
|
||||||
or (warn "$ME: previous version string not specified\n"), $fail = 1;
|
|
||||||
$curr_version
|
|
||||||
or (warn "$ME: current version string not specified\n"), $fail = 1;
|
|
||||||
$release_archive_dir
|
|
||||||
or (warn "$ME: release directory name not specified\n"), $fail = 1;
|
|
||||||
@url_dir_list
|
|
||||||
or (warn "$ME: URL directory name(s) not specified\n"), $fail = 1;
|
|
||||||
|
|
||||||
exists $valid_release_types{$release_type}
|
|
||||||
or (warn "$ME: `$release_type': invalid release type\n"), $fail = 1;
|
|
||||||
|
|
||||||
@ARGV
|
|
||||||
and (warn "$ME: too many arguments\n"), $fail = 1;
|
|
||||||
$fail
|
|
||||||
and usage 1;
|
|
||||||
|
|
||||||
my $my_distdir = "$package_name-$curr_version";
|
|
||||||
my $tgz = "$my_distdir.tar.gz";
|
|
||||||
my $tbz = "$my_distdir.tar.bz2";
|
|
||||||
my $xd = "$package_name-$prev_version-$curr_version.xdelta";
|
|
||||||
|
|
||||||
my %size;
|
|
||||||
|
|
||||||
foreach my $f (($tgz, $tbz, $xd))
|
|
||||||
{
|
|
||||||
my $cmd = "du --human $f";
|
|
||||||
my $t = `$cmd`;
|
|
||||||
# FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
|
|
||||||
$@
|
|
||||||
and (warn "$ME: command failed: `$cmd'\n"), $fail = 1;
|
|
||||||
chomp $t;
|
|
||||||
$t =~ s/^([\d.]+[MkK]).*/${1}B/;
|
|
||||||
$size{$f} = $t;
|
|
||||||
}
|
|
||||||
|
|
||||||
$fail
|
|
||||||
and exit 1;
|
|
||||||
|
|
||||||
# The markup is escaped as <\# so that when this script is sent by
|
|
||||||
# mail (or part of a diff), Gnus is not triggered.
|
|
||||||
print <<EOF;
|
|
||||||
|
|
||||||
Subject: $my_distdir released
|
|
||||||
|
|
||||||
<\#secure method=pgpmime mode=sign>
|
|
||||||
|
|
||||||
FIXME: put comments here
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
print "Here are the compressed sources:\n";
|
|
||||||
foreach my $url (@url_dir_list)
|
|
||||||
{
|
|
||||||
print " $url/$tgz ($size{$tgz})\n";
|
|
||||||
print " $url/$tbz ($size{$tbz})\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "\nAnd here are xdelta-style diffs:\n";
|
|
||||||
foreach my $url (@url_dir_list)
|
|
||||||
{
|
|
||||||
print " $url/$xd ($size{$xd})\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "\nHere are GPG detached signatures:\n";
|
|
||||||
foreach my $url (@url_dir_list)
|
|
||||||
{
|
|
||||||
print " $url/$tgz.asc\n";
|
|
||||||
print " $url/$tbz.asc\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
# FIXME: clean up upon interrupt or die
|
|
||||||
my $tmpdir = $ENV{TMPDIR} || '/tmp';
|
|
||||||
my $tmp = "$tmpdir/$ME-$$";
|
|
||||||
unlink $tmp; # ignore failure
|
|
||||||
|
|
||||||
print "\nHere are the MD5 and SHA1 signatures:\n";
|
|
||||||
print "\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 "<\#part type=text/plain filename=\"$tmp\" disposition=inline>\n"
|
|
||||||
. "<\#/part>\n";
|
|
||||||
|
|
||||||
open OUT, '>', $tmp
|
|
||||||
or die "$ME: $tmp: cannot open for writing: $!\n";
|
|
||||||
|
|
||||||
foreach my $meth (qw (md5 sha1))
|
|
||||||
{
|
|
||||||
foreach my $f (($tgz, $tbz, $xd))
|
|
||||||
{
|
|
||||||
open IN, '<', $f
|
|
||||||
or die "$ME: $f: cannot open for reading: $!\n";
|
|
||||||
binmode IN;
|
|
||||||
my $dig =
|
|
||||||
($meth eq 'md5'
|
|
||||||
? Digest::MD5->new->addfile(*IN)->hexdigest
|
|
||||||
: Digest::SHA1->new->addfile(*IN)->hexdigest);
|
|
||||||
close IN;
|
|
||||||
print OUT "$dig $f\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
close OUT
|
|
||||||
or die "$ME: $tmp: while writing: $!\n";
|
|
||||||
chmod 0400, $tmp; # ignore failure
|
|
||||||
|
|
||||||
if ($news_file)
|
|
||||||
{
|
|
||||||
print "\nNEWS\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;
|
|
||||||
open NEWS, '<', $news_file
|
|
||||||
or die "$ME: $news_file: cannot open for reading: $!\n";
|
|
||||||
while (defined (my $line = <NEWS>))
|
|
||||||
{
|
|
||||||
if ( ! $in_items)
|
|
||||||
{
|
|
||||||
# Match lines like this one:
|
|
||||||
# * Major changes in release 5.0.1:
|
|
||||||
# but not any other line that starts with a space, *, or -.
|
|
||||||
$line =~ /^(\* Major changes.*|[^ *-].*)\Q$curr_version\E/o
|
|
||||||
or next;
|
|
||||||
$in_items = 1;
|
|
||||||
print $line;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
# Be careful that this regexp cannot match version numbers
|
|
||||||
# in NEWS items -- they might well say `introduced in 4.5.5',
|
|
||||||
# and we don't want that to match.
|
|
||||||
$line =~ /^(\* Major changes.*|[^ *-].*)\Q$prev_version\E/o
|
|
||||||
and last;
|
|
||||||
print $line;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close NEWS;
|
|
||||||
|
|
||||||
$in_items
|
|
||||||
or die "$ME: $news_file: no matching lines for `$curr_version'\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$release_type eq 'major'
|
|
||||||
or print_changelog_deltas ($package_name, $prev_version);
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
+1308
File diff suppressed because it is too large
Load Diff
+1413
File diff suppressed because it is too large
Load Diff
Executable
+411
@@ -0,0 +1,411 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# depcomp - compile a program generating dependencies as side-effects
|
||||||
|
# Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
# 02111-1307, USA.
|
||||||
|
|
||||||
|
# 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 <[email protected]>.
|
||||||
|
|
||||||
|
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
|
||||||
|
# `libtool' can also be set to `yes' or `no'.
|
||||||
|
|
||||||
|
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
|
||||||
|
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||||
|
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
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.
|
||||||
|
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
mv "$tmpdepfile" "$depfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
gcc)
|
||||||
|
## There are various ways to get dependency output from gcc. Here's
|
||||||
|
## why we pick this rather obscure method:
|
||||||
|
## - Don't want to use -MD because we'd like the dependencies to end
|
||||||
|
## up in a subdir. Having to rename by hand is ugly.
|
||||||
|
## (We might end up doing this anyway to support other compilers.)
|
||||||
|
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||||
|
## -MM, not -M (despite what the docs say).
|
||||||
|
## - Using -M directly means running the compiler twice (even worse
|
||||||
|
## than renaming).
|
||||||
|
if test -z "$gccflag"; then
|
||||||
|
gccflag=-MD,
|
||||||
|
fi
|
||||||
|
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||||
|
## 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.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" |
|
||||||
|
## 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.
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -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
|
||||||
|
;;
|
||||||
|
|
||||||
|
sgi)
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||||
|
else
|
||||||
|
"$@" -MDupdate "$tmpdepfile"
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
|
||||||
|
# Clip off the initial element (the dependent). Don't try to be
|
||||||
|
# clever and replace this with sed code, as IRIX sed won't handle
|
||||||
|
# lines with more than a fixed number of characters (4096 in
|
||||||
|
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||||
|
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||||
|
# dependency line.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||||
|
tr '
|
||||||
|
' ' ' >> $depfile
|
||||||
|
echo >> $depfile
|
||||||
|
|
||||||
|
# The second pass generates a dummy entry for each header file.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||||
|
>> $depfile
|
||||||
|
else
|
||||||
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
aix)
|
||||||
|
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||||
|
# in a .u file. 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.
|
||||||
|
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
||||||
|
tmpdepfile="$stripped.u"
|
||||||
|
outname="$stripped.o"
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
"$@" -Wc,-M
|
||||||
|
else
|
||||||
|
"$@" -M
|
||||||
|
fi
|
||||||
|
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
# Each line is of the form `foo.o: dependent.h'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
|
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||||
|
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||||
|
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
tru64)
|
||||||
|
# The Tru64 AIX 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.
|
||||||
|
|
||||||
|
tmpdepfile1="$object.d"
|
||||||
|
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
"$@" -Wc,-MD
|
||||||
|
else
|
||||||
|
"$@" -MD
|
||||||
|
fi
|
||||||
|
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile1"; then
|
||||||
|
tmpdepfile="$tmpdepfile1"
|
||||||
|
else
|
||||||
|
tmpdepfile="$tmpdepfile2"
|
||||||
|
fi
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||||
|
# That's a space and a tab in the [].
|
||||||
|
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
#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 proprocessed file to stdout, regardless of -o,
|
||||||
|
# because we must use -o when running libtool.
|
||||||
|
test -z "$dashmflag" && dashmflag=-M
|
||||||
|
( IFS=" "
|
||||||
|
case " $* " in
|
||||||
|
*" --mode=compile "*) # this is libtool, let us make it quiet
|
||||||
|
for arg
|
||||||
|
do # cycle over the arguments
|
||||||
|
case "$arg" in
|
||||||
|
"--mode=compile")
|
||||||
|
# insert --quiet before "--mode=compile"
|
||||||
|
set fnord "$@" --quiet
|
||||||
|
shift # fnord
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # "$arg"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||||
|
) &
|
||||||
|
proc=$!
|
||||||
|
"$@"
|
||||||
|
stat=$?
|
||||||
|
wait "$proc"
|
||||||
|
if test "$stat" != 0; then exit $stat; fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" | \
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
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)
|
||||||
|
# X makedepend
|
||||||
|
(
|
||||||
|
shift
|
||||||
|
cleared=no
|
||||||
|
for arg in "$@"; do
|
||||||
|
case $cleared in no)
|
||||||
|
set ""; shift
|
||||||
|
cleared=yes
|
||||||
|
esac
|
||||||
|
case "$arg" in
|
||||||
|
-D*|-I*)
|
||||||
|
set fnord "$@" "$arg"; shift;;
|
||||||
|
-*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"; shift;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||||
|
touch "$tmpdepfile"
|
||||||
|
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||||
|
) &
|
||||||
|
proc=$!
|
||||||
|
"$@"
|
||||||
|
stat=$?
|
||||||
|
wait "$proc"
|
||||||
|
if test "$stat" != 0; then exit $stat; fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
|
tail +3 "$tmpdepfile" | tr ' ' '
|
||||||
|
' | \
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
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 proprocessed file to stdout, regardless of -o,
|
||||||
|
# because we must use -o when running libtool.
|
||||||
|
( IFS=" "
|
||||||
|
case " $* " in
|
||||||
|
*" --mode=compile "*)
|
||||||
|
for arg
|
||||||
|
do # cycle over the arguments
|
||||||
|
case $arg in
|
||||||
|
"--mode=compile")
|
||||||
|
# insert --quiet before "--mode=compile"
|
||||||
|
set fnord "$@" --quiet
|
||||||
|
shift # fnord
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # "$arg"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
"$@" -E |
|
||||||
|
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||||
|
sed '$ s: \\$::' > "$tmpdepfile"
|
||||||
|
) &
|
||||||
|
proc=$!
|
||||||
|
"$@"
|
||||||
|
stat=$?
|
||||||
|
wait "$proc"
|
||||||
|
if test "$stat" != 0; then exit $stat; fi
|
||||||
|
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 proprocessed file to stdout, regardless of -o,
|
||||||
|
# because we must use -o when running libtool.
|
||||||
|
( IFS=" "
|
||||||
|
case " $* " in
|
||||||
|
*" --mode=compile "*)
|
||||||
|
for arg
|
||||||
|
do # cycle over the arguments
|
||||||
|
case $arg in
|
||||||
|
"--mode=compile")
|
||||||
|
# insert --quiet before "--mode=compile"
|
||||||
|
set fnord "$@" --quiet
|
||||||
|
shift # fnord
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # "$arg"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
"$@" -E |
|
||||||
|
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||||
|
) &
|
||||||
|
proc=$!
|
||||||
|
"$@"
|
||||||
|
stat=$?
|
||||||
|
wait "$proc"
|
||||||
|
if test "$stat" != 0; then exit $stat; fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||||
|
echo " " >> "$depfile"
|
||||||
|
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
none)
|
||||||
|
exec "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Unknown depmode $depmode" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
Executable
+251
@@ -0,0 +1,251 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# install - install a program, script, or datafile
|
||||||
|
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||||
|
#
|
||||||
|
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||||
|
#
|
||||||
|
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
|
# documentation for any purpose is hereby granted without fee, provided that
|
||||||
|
# the above copyright notice appear in all copies and that both that
|
||||||
|
# copyright notice and this permission notice appear in supporting
|
||||||
|
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||||
|
# publicity pertaining to distribution of the software without specific,
|
||||||
|
# written prior permission. M.I.T. makes no representations about the
|
||||||
|
# suitability of this software for any purpose. It is provided "as is"
|
||||||
|
# without express or implied warranty.
|
||||||
|
#
|
||||||
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
|
# `make' implicit rules from creating a file called install from it
|
||||||
|
# when there is no Makefile.
|
||||||
|
#
|
||||||
|
# This script is compatible with the BSD install script, but was written
|
||||||
|
# from scratch. It can only install one file at a time, a restriction
|
||||||
|
# shared with many OS's install programs.
|
||||||
|
|
||||||
|
|
||||||
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
|
doit="${DOITPROG-}"
|
||||||
|
|
||||||
|
|
||||||
|
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||||
|
|
||||||
|
mvprog="${MVPROG-mv}"
|
||||||
|
cpprog="${CPPROG-cp}"
|
||||||
|
chmodprog="${CHMODPROG-chmod}"
|
||||||
|
chownprog="${CHOWNPROG-chown}"
|
||||||
|
chgrpprog="${CHGRPPROG-chgrp}"
|
||||||
|
stripprog="${STRIPPROG-strip}"
|
||||||
|
rmprog="${RMPROG-rm}"
|
||||||
|
mkdirprog="${MKDIRPROG-mkdir}"
|
||||||
|
|
||||||
|
transformbasename=""
|
||||||
|
transform_arg=""
|
||||||
|
instcmd="$mvprog"
|
||||||
|
chmodcmd="$chmodprog 0755"
|
||||||
|
chowncmd=""
|
||||||
|
chgrpcmd=""
|
||||||
|
stripcmd=""
|
||||||
|
rmcmd="$rmprog -f"
|
||||||
|
mvcmd="$mvprog"
|
||||||
|
src=""
|
||||||
|
dst=""
|
||||||
|
dir_arg=""
|
||||||
|
|
||||||
|
while [ x"$1" != x ]; do
|
||||||
|
case $1 in
|
||||||
|
-c) instcmd="$cpprog"
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-d) dir_arg=true
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-m) chmodcmd="$chmodprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-o) chowncmd="$chownprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-s) stripcmd="$stripprog"
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
*) if [ x"$src" = x ]
|
||||||
|
then
|
||||||
|
src=$1
|
||||||
|
else
|
||||||
|
# this colon is to work around a 386BSD /bin/sh bug
|
||||||
|
:
|
||||||
|
dst=$1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ x"$src" = x ]
|
||||||
|
then
|
||||||
|
echo "install: no input file specified"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ x"$dir_arg" != x ]; then
|
||||||
|
dst=$src
|
||||||
|
src=""
|
||||||
|
|
||||||
|
if [ -d $dst ]; then
|
||||||
|
instcmd=:
|
||||||
|
chmodcmd=""
|
||||||
|
else
|
||||||
|
instcmd=mkdir
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
|
||||||
|
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||||
|
# might cause directories to be created, which would be especially bad
|
||||||
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
|
||||||
|
if [ -f $src -o -d $src ]
|
||||||
|
then
|
||||||
|
true
|
||||||
|
else
|
||||||
|
echo "install: $src does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ x"$dst" = x ]
|
||||||
|
then
|
||||||
|
echo "install: no destination specified"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If destination is a directory, append the input filename; if your system
|
||||||
|
# does not like double slashes in filenames, you may need to add some logic
|
||||||
|
|
||||||
|
if [ -d $dst ]
|
||||||
|
then
|
||||||
|
dst="$dst"/`basename $src`
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
## this sed command emulates the dirname command
|
||||||
|
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||||
|
|
||||||
|
# Make sure that the destination directory exists.
|
||||||
|
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||||
|
|
||||||
|
# Skip lots of stat calls in the usual case.
|
||||||
|
if [ ! -d "$dstdir" ]; then
|
||||||
|
defaultIFS='
|
||||||
|
'
|
||||||
|
IFS="${IFS-${defaultIFS}}"
|
||||||
|
|
||||||
|
oIFS="${IFS}"
|
||||||
|
# Some sh's can't handle IFS=/ for some reason.
|
||||||
|
IFS='%'
|
||||||
|
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||||
|
IFS="${oIFS}"
|
||||||
|
|
||||||
|
pathcomp=''
|
||||||
|
|
||||||
|
while [ $# -ne 0 ] ; do
|
||||||
|
pathcomp="${pathcomp}${1}"
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [ ! -d "${pathcomp}" ] ;
|
||||||
|
then
|
||||||
|
$mkdirprog "${pathcomp}"
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
|
||||||
|
pathcomp="${pathcomp}/"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ x"$dir_arg" != x ]
|
||||||
|
then
|
||||||
|
$doit $instcmd $dst &&
|
||||||
|
|
||||||
|
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||||
|
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||||
|
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||||
|
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||||
|
else
|
||||||
|
|
||||||
|
# If we're going to rename the final executable, determine the name now.
|
||||||
|
|
||||||
|
if [ x"$transformarg" = x ]
|
||||||
|
then
|
||||||
|
dstfile=`basename $dst`
|
||||||
|
else
|
||||||
|
dstfile=`basename $dst $transformbasename |
|
||||||
|
sed $transformarg`$transformbasename
|
||||||
|
fi
|
||||||
|
|
||||||
|
# don't allow the sed command to completely eliminate the filename
|
||||||
|
|
||||||
|
if [ x"$dstfile" = x ]
|
||||||
|
then
|
||||||
|
dstfile=`basename $dst`
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make a temp file name in the proper directory.
|
||||||
|
|
||||||
|
dsttmp=$dstdir/#inst.$$#
|
||||||
|
|
||||||
|
# Move or copy the file name to the temp name
|
||||||
|
|
||||||
|
$doit $instcmd $src $dsttmp &&
|
||||||
|
|
||||||
|
trap "rm -f ${dsttmp}" 0 &&
|
||||||
|
|
||||||
|
# and set any options; do chmod last to preserve setuid bits
|
||||||
|
|
||||||
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
|
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||||
|
|
||||||
|
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||||
|
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||||
|
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||||
|
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
|
||||||
|
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||||
|
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||||
|
|
||||||
|
fi &&
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
||||||
Executable
+97
@@ -0,0 +1,97 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Get modification time of a file or directory and pretty-print it.
|
||||||
|
# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
# written by Ulrich Drepper <[email protected]>, June 1995
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# Prevent date giving response in another language.
|
||||||
|
LANG=C
|
||||||
|
export LANG
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
LC_TIME=C
|
||||||
|
export LC_TIME
|
||||||
|
|
||||||
|
# Get the extended ls output of the file or directory.
|
||||||
|
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||||
|
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||||
|
set - x`ls -L -l -d $1`
|
||||||
|
else
|
||||||
|
set - x`ls -l -d $1`
|
||||||
|
fi
|
||||||
|
# The month is at least the fourth argument
|
||||||
|
# (3 shifts here, the next inside the loop).
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
|
||||||
|
# Find the month. Next argument is day, followed by the year or time.
|
||||||
|
month=
|
||||||
|
until test $month
|
||||||
|
do
|
||||||
|
shift
|
||||||
|
case $1 in
|
||||||
|
Jan) month=January; nummonth=1;;
|
||||||
|
Feb) month=February; nummonth=2;;
|
||||||
|
Mar) month=March; nummonth=3;;
|
||||||
|
Apr) month=April; nummonth=4;;
|
||||||
|
May) month=May; nummonth=5;;
|
||||||
|
Jun) month=June; nummonth=6;;
|
||||||
|
Jul) month=July; nummonth=7;;
|
||||||
|
Aug) month=August; nummonth=8;;
|
||||||
|
Sep) month=September; nummonth=9;;
|
||||||
|
Oct) month=October; nummonth=10;;
|
||||||
|
Nov) month=November; nummonth=11;;
|
||||||
|
Dec) month=December; nummonth=12;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
day=$2
|
||||||
|
|
||||||
|
# Here we have to deal with the problem that the ls output gives either
|
||||||
|
# the time of day or the year.
|
||||||
|
case $3 in
|
||||||
|
*:*) set `date`; eval year=\$$#
|
||||||
|
case $2 in
|
||||||
|
Jan) nummonthtod=1;;
|
||||||
|
Feb) nummonthtod=2;;
|
||||||
|
Mar) nummonthtod=3;;
|
||||||
|
Apr) nummonthtod=4;;
|
||||||
|
May) nummonthtod=5;;
|
||||||
|
Jun) nummonthtod=6;;
|
||||||
|
Jul) nummonthtod=7;;
|
||||||
|
Aug) nummonthtod=8;;
|
||||||
|
Sep) nummonthtod=9;;
|
||||||
|
Oct) nummonthtod=10;;
|
||||||
|
Nov) nummonthtod=11;;
|
||||||
|
Dec) nummonthtod=12;;
|
||||||
|
esac
|
||||||
|
# For the first six month of the year the time notation can also
|
||||||
|
# be used for files modified in the last year.
|
||||||
|
if (expr $nummonth \> $nummonthtod) > /dev/null;
|
||||||
|
then
|
||||||
|
year=`expr $year - 1`
|
||||||
|
fi;;
|
||||||
|
*) year=$3;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# The result.
|
||||||
|
echo $day $month $year
|
||||||
Executable
+336
@@ -0,0 +1,336 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Common stub for a few missing GNU programs while installing.
|
||||||
|
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||||
|
# Originally by Fran,cois Pinard <[email protected]>, 1996.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
# 02111-1307, USA.
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
run=:
|
||||||
|
|
||||||
|
# In the cases where this matters, `missing' is being run in the
|
||||||
|
# srcdir already.
|
||||||
|
if test -f configure.ac; then
|
||||||
|
configure_ac=configure.ac
|
||||||
|
else
|
||||||
|
configure_ac=configure.in
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--run)
|
||||||
|
# Try to run requested program, and just exit if it succeeds.
|
||||||
|
run=
|
||||||
|
shift
|
||||||
|
"$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If it does not exist, or fails to run (possibly an outdated version),
|
||||||
|
# try to emulate it.
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
-h|--h|--he|--hel|--help)
|
||||||
|
echo "\
|
||||||
|
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||||
|
|
||||||
|
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||||
|
error status if there is no known handling for PROGRAM.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help display this help and exit
|
||||||
|
-v, --version output version information and exit
|
||||||
|
--run try to run the given command, and emulate it if it fails
|
||||||
|
|
||||||
|
Supported PROGRAM values:
|
||||||
|
aclocal touch file \`aclocal.m4'
|
||||||
|
autoconf touch file \`configure'
|
||||||
|
autoheader touch file \`config.h.in'
|
||||||
|
automake touch all \`Makefile.in' files
|
||||||
|
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
flex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
help2man touch the output file
|
||||||
|
lex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
makeinfo touch the output file
|
||||||
|
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||||
|
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||||
|
echo "missing 0.4 - GNU automake"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-*)
|
||||||
|
echo 1>&2 "$0: Unknown \`$1' option"
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
aclocal)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||||
|
any GNU archive site."
|
||||||
|
touch aclocal.m4
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoconf)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified \`${configure_ac}'. You might want to install the
|
||||||
|
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||||
|
archive site."
|
||||||
|
touch configure
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoheader)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||||
|
from any GNU archive site."
|
||||||
|
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||||
|
test -z "$files" && files="config.h"
|
||||||
|
touch_files=
|
||||||
|
for f in $files; do
|
||||||
|
case "$f" in
|
||||||
|
*:*) touch_files="$touch_files "`echo "$f" |
|
||||||
|
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||||
|
*) touch_files="$touch_files $f.in";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
touch $touch_files
|
||||||
|
;;
|
||||||
|
|
||||||
|
automake)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||||
|
You might want to install the \`Automake' and \`Perl' packages.
|
||||||
|
Grab them from any GNU archive site."
|
||||||
|
find . -type f -name Makefile.am -print |
|
||||||
|
sed 's/\.am$/.in/' |
|
||||||
|
while read f; do touch "$f"; done
|
||||||
|
;;
|
||||||
|
|
||||||
|
autom4te)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||||
|
system. You might have modified some files without having the
|
||||||
|
proper tools for further handling them.
|
||||||
|
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
|
||||||
|
archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo "#! /bin/sh"
|
||||||
|
echo "# Created by GNU Automake missing as a replacement of"
|
||||||
|
echo "# $ $@"
|
||||||
|
echo "exit 0"
|
||||||
|
chmod +x $file
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
bison|yacc)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified a \`.y' file. You may need the \`Bison' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Bison' from any GNU archive site."
|
||||||
|
rm -f y.tab.c y.tab.h
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case "$LASTARG" in
|
||||||
|
*.y)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||||
|
if [ -f "$SRCFILE" ]; then
|
||||||
|
cp "$SRCFILE" y.tab.c
|
||||||
|
fi
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||||
|
if [ -f "$SRCFILE" ]; then
|
||||||
|
cp "$SRCFILE" y.tab.h
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if [ ! -f y.tab.h ]; then
|
||||||
|
echo >y.tab.h
|
||||||
|
fi
|
||||||
|
if [ ! -f y.tab.c ]; then
|
||||||
|
echo 'main() { return 0; }' >y.tab.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
lex|flex)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified a \`.l' file. You may need the \`Flex' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Flex' from any GNU archive site."
|
||||||
|
rm -f lex.yy.c
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case "$LASTARG" in
|
||||||
|
*.l)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||||
|
if [ -f "$SRCFILE" ]; then
|
||||||
|
cp "$SRCFILE" lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if [ ! -f lex.yy.c ]; then
|
||||||
|
echo 'main() { return 0; }' >lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
help2man)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified a dependency of a manual page. You may need the
|
||||||
|
\`Help2man' package in order for those modifications to take
|
||||||
|
effect. You can get \`Help2man' from any GNU archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||||
|
if test -z "$file"; then
|
||||||
|
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||||
|
fi
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo ".ab help2man is required to generate this page"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
makeinfo)
|
||||||
|
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
||||||
|
# We have makeinfo, but it failed.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||||
|
indirectly affecting the aspect of the manual. The spurious
|
||||||
|
call might also be the consequence of using a buggy \`make' (AIX,
|
||||||
|
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||||
|
the \`GNU make' package. Grab either from any GNU archive site."
|
||||||
|
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||||
|
if test -z "$file"; then
|
||||||
|
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||||
|
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||||
|
fi
|
||||||
|
touch $file
|
||||||
|
;;
|
||||||
|
|
||||||
|
tar)
|
||||||
|
shift
|
||||||
|
if test -n "$run"; then
|
||||||
|
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We have already tried tar in the generic part.
|
||||||
|
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||||
|
# messages.
|
||||||
|
if (gnutar --version > /dev/null 2>&1); then
|
||||||
|
gnutar ${1+"$@"} && exit 0
|
||||||
|
fi
|
||||||
|
if (gtar --version > /dev/null 2>&1); then
|
||||||
|
gtar ${1+"$@"} && exit 0
|
||||||
|
fi
|
||||||
|
firstarg="$1"
|
||||||
|
if shift; then
|
||||||
|
case "$firstarg" in
|
||||||
|
*o*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/o//`
|
||||||
|
tar "$firstarg" ${1+"$@"} && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case "$firstarg" in
|
||||||
|
*h*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/h//`
|
||||||
|
tar "$firstarg" ${1+"$@"} && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||||
|
You may want to install GNU tar or Free paxutils, or check the
|
||||||
|
command line arguments."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||||
|
system. You might have modified some files without having the
|
||||||
|
proper tools for further handling them. Check the \`README' file,
|
||||||
|
it often tells you about the needed prerequirements for installing
|
||||||
|
this package. You may also peek at any GNU archive site, in case
|
||||||
|
some other package would contain this missing \`$1' program."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
Executable
+101
@@ -0,0 +1,101 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# mkinstalldirs --- make directory hierarchy
|
||||||
|
# Author: Noah Friedman <[email protected]>
|
||||||
|
# Created: 1993-05-16
|
||||||
|
# Public domain
|
||||||
|
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
errstatus=0
|
||||||
|
dirmode=""
|
||||||
|
|
||||||
|
usage="\
|
||||||
|
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
|
||||||
|
|
||||||
|
# process command line arguments
|
||||||
|
while test $# -gt 0 ; do
|
||||||
|
case "${1}" in
|
||||||
|
-h | --help | --h* ) # -h for help
|
||||||
|
echo "${usage}" 1>&2; exit 0 ;;
|
||||||
|
-m ) # -m PERM arg
|
||||||
|
shift
|
||||||
|
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
|
||||||
|
dirmode="${1}"
|
||||||
|
shift ;;
|
||||||
|
-- ) shift; break ;; # stop option processing
|
||||||
|
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
|
||||||
|
* ) break ;; # first non-opt arg
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
for file
|
||||||
|
do
|
||||||
|
if test -d "$file"; then
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
case $# in
|
||||||
|
0) exit 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $dirmode in
|
||||||
|
'')
|
||||||
|
if mkdir -p -- . 2>/dev/null; then
|
||||||
|
echo "mkdir -p -- $*"
|
||||||
|
exec mkdir -p -- "$@"
|
||||||
|
fi ;;
|
||||||
|
*)
|
||||||
|
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
|
||||||
|
echo "mkdir -m $dirmode -p -- $*"
|
||||||
|
exec mkdir -m "$dirmode" -p -- "$@"
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
for file
|
||||||
|
do
|
||||||
|
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||||
|
shift
|
||||||
|
|
||||||
|
pathcomp=
|
||||||
|
for d
|
||||||
|
do
|
||||||
|
pathcomp="$pathcomp$d"
|
||||||
|
case "$pathcomp" in
|
||||||
|
-* ) pathcomp=./$pathcomp ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test ! -d "$pathcomp"; then
|
||||||
|
echo "mkdir $pathcomp"
|
||||||
|
|
||||||
|
mkdir "$pathcomp" || lasterr=$?
|
||||||
|
|
||||||
|
if test ! -d "$pathcomp"; then
|
||||||
|
errstatus=$lasterr
|
||||||
|
else
|
||||||
|
if test ! -z "$dirmode"; then
|
||||||
|
echo "chmod $dirmode $pathcomp"
|
||||||
|
|
||||||
|
lasterr=""
|
||||||
|
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||||
|
|
||||||
|
if test ! -z "$lasterr"; then
|
||||||
|
errstatus=$lasterr
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
pathcomp="$pathcomp/"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $errstatus
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-indentation: 3
|
||||||
|
# End:
|
||||||
|
# mkinstalldirs ends here
|
||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Like mv $1 $2, but if the files are the same, just delete $1.
|
||||||
|
# Status is 0 if $2 is changed, 1 otherwise.
|
||||||
|
if
|
||||||
|
test -r $2
|
||||||
|
then
|
||||||
|
if
|
||||||
|
cmp -s $1 $2
|
||||||
|
then
|
||||||
|
echo $2 is unchanged
|
||||||
|
rm -f $1
|
||||||
|
else
|
||||||
|
mv -f $1 $2
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
mv -f $1 $2
|
||||||
|
fi
|
||||||
@@ -1 +1 @@
|
|||||||
2.0
|
1.28
|
||||||
|
|||||||
+6288
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
-142
@@ -1,142 +0,0 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
|
||||||
#
|
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005 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 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
# This file uses AC_CONFIG_MACRO_DIR, so we need Autoconf 2.58 or better.
|
|
||||||
# But Autoconf 2.58 has a bug in the way that it generates tests: it
|
|
||||||
# puts the wrong absolute path names in the tests. So we need at
|
|
||||||
# least Autoconf 2.59.
|
|
||||||
AC_PREREQ(2.59)
|
|
||||||
|
|
||||||
AC_INIT([GNU Bison], [2.1], [[email protected]])
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
|
||||||
|
|
||||||
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
|
||||||
AM_INIT_AUTOMAKE([1.8 check-news readme-alpha dist-bzip2])
|
|
||||||
AC_CONFIG_HEADERS([config.h:config.hin])
|
|
||||||
|
|
||||||
gl_USE_SYSTEM_EXTENSIONS
|
|
||||||
|
|
||||||
# Checks for the compiler.
|
|
||||||
AC_PROG_CC
|
|
||||||
AM_PROG_CC_STDC
|
|
||||||
AC_ARG_ENABLE(gcc-warnings,
|
|
||||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
|
||||||
[case "${enableval}" in
|
|
||||||
yes|no) ;;
|
|
||||||
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
|
||||||
esac],
|
|
||||||
[enableval=no])
|
|
||||||
if test "${enableval}" = yes; then
|
|
||||||
BISON_WARNING(-Werror)
|
|
||||||
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
|
||||||
WARNING_CFLAGS=
|
|
||||||
BISON_WARNING(-W)
|
|
||||||
BISON_WARNING(-Wall)
|
|
||||||
BISON_WARNING(-Wcast-align)
|
|
||||||
BISON_WARNING(-Wcast-qual)
|
|
||||||
BISON_WARNING(-Wformat)
|
|
||||||
BISON_WARNING(-Wwrite-strings)
|
|
||||||
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
|
|
||||||
# The following warnings are not suitable for C++.
|
|
||||||
BISON_WARNING(-Wbad-function-cast)
|
|
||||||
BISON_WARNING(-Wmissing-declarations)
|
|
||||||
BISON_WARNING(-Wmissing-prototypes)
|
|
||||||
BISON_WARNING(-Wnested-externs)
|
|
||||||
BISON_WARNING(-Wshadow)
|
|
||||||
BISON_WARNING(-Wstrict-prototypes)
|
|
||||||
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([yacc],
|
|
||||||
[AC_HELP_STRING([--disable-yacc],
|
|
||||||
[do not build a yacc command or an -ly library])],
|
|
||||||
, [enable_yacc=yes])
|
|
||||||
case $enable_yacc in
|
|
||||||
yes)
|
|
||||||
YACC_SCRIPT=yacc
|
|
||||||
YACC_LIBRARY=liby.a;;
|
|
||||||
*)
|
|
||||||
YACC_SCRIPT=
|
|
||||||
YACC_LIBRARY=;;
|
|
||||||
esac
|
|
||||||
AC_SUBST([YACC_SCRIPT])
|
|
||||||
AC_SUBST([YACC_LIBRARY])
|
|
||||||
|
|
||||||
# Checks for programs.
|
|
||||||
AC_PROG_LEX
|
|
||||||
AC_PROG_YACC
|
|
||||||
AC_PROG_RANLIB
|
|
||||||
BISON_PROG_GNU_M4
|
|
||||||
if test x"$ac_cv_prog_gnu_m4" != xyes; then
|
|
||||||
AC_MSG_ERROR([GNU M4 1.4 is required])
|
|
||||||
fi
|
|
||||||
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
|
||||||
|
|
||||||
# Checks for header files.
|
|
||||||
AC_CHECK_HEADERS_ONCE([locale.h])
|
|
||||||
AM_STDBOOL_H
|
|
||||||
|
|
||||||
# Checks for compiler characteristics.
|
|
||||||
AC_C_INLINE
|
|
||||||
|
|
||||||
# Checks for types.
|
|
||||||
AC_CHECK_TYPES([uintptr_t])
|
|
||||||
|
|
||||||
# Checks for library functions.
|
|
||||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
|
||||||
AM_WITH_DMALLOC
|
|
||||||
BISON_PREREQ_SUBPIPE
|
|
||||||
BISON_PREREQ_TIMEVAR
|
|
||||||
|
|
||||||
# gnulib and gettext.
|
|
||||||
GNULIB_AUTOCONF_SNIPPET
|
|
||||||
# We use po/Makevars, so we need at least gettext 0.12.
|
|
||||||
AM_GNU_GETTEXT_VERSION([0.12])
|
|
||||||
BISON_I18N
|
|
||||||
|
|
||||||
# Internationalized parsers.
|
|
||||||
AC_CONFIG_FILES([runtime-po/Makefile.in])
|
|
||||||
# Autoconf macros for packages using internationalized parsers.
|
|
||||||
aclocaldir='${datadir}/aclocal'
|
|
||||||
AC_SUBST([aclocaldir])
|
|
||||||
|
|
||||||
# Initialize the test suite.
|
|
||||||
AC_CONFIG_TESTDIR(tests)
|
|
||||||
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
|
||||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
|
||||||
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
|
||||||
AC_PROG_CXX
|
|
||||||
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
|
||||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
|
||||||
# Needed by tests/atlocal.in.
|
|
||||||
AC_SUBST([GCC])
|
|
||||||
O0CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]] *//'`
|
|
||||||
AC_SUBST([O0CFLAGS])
|
|
||||||
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
|
|
||||||
AC_SUBST([O0CXXFLAGS])
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
|
||||||
config/Makefile
|
|
||||||
po/Makefile.in
|
|
||||||
data/Makefile
|
|
||||||
examples/Makefile
|
|
||||||
examples/calc++/Makefile
|
|
||||||
lib/Makefile src/Makefile doc/Makefile])
|
|
||||||
AC_OUTPUT
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
@echo off
|
||||||
|
echo Configuring bison for go32
|
||||||
|
rem This batch file assumes a unix-type "sed" program
|
||||||
|
|
||||||
|
echo # Makefile generated by "configure.bat"> Makefile
|
||||||
|
echo all.dos : bison >> Makefile
|
||||||
|
|
||||||
|
if exist config.sed del config.sed
|
||||||
|
|
||||||
|
echo "s/@srcdir@/./g ">> config.sed
|
||||||
|
echo "s/@CC@/gcc/g ">> config.sed
|
||||||
|
echo "s/@INSTALL@//g ">> config.sed
|
||||||
|
echo "s/@INSTALL_PROGRAM@//g ">> config.sed
|
||||||
|
echo "s/@INSTALL_DATA@//g ">> config.sed
|
||||||
|
echo "s/@DEFS@/-DHAVE_STRERROR/g ">> config.sed
|
||||||
|
echo "s/@LIBS@//g ">> config.sed
|
||||||
|
echo "s/@ALLOCA@//g ">> config.sed
|
||||||
|
|
||||||
|
echo "/^bison[ ]*:/,/-o/ { ">> config.sed
|
||||||
|
echo " s/ \$(CC)/ >bison.rf/ ">> config.sed
|
||||||
|
echo " /-o/ a\ ">> config.sed
|
||||||
|
echo " $(CC) @bison.rf ">> config.sed
|
||||||
|
echo "} ">> config.sed
|
||||||
|
|
||||||
|
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
||||||
|
sed -f config2.sed Makefile.in >> Makefile
|
||||||
|
del config.sed
|
||||||
|
del config2.sed
|
||||||
+104
@@ -0,0 +1,104 @@
|
|||||||
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
|
# 02111-1307 USA
|
||||||
|
|
||||||
|
# We need a recent Autoconf to run a recent Autotest.
|
||||||
|
AC_PREREQ(2.52e)
|
||||||
|
|
||||||
|
AC_INIT([GNU Bison], [1.30], [[email protected]])
|
||||||
|
AC_CONFIG_AUX_DIR(config)
|
||||||
|
|
||||||
|
AM_INIT_AUTOMAKE([bison], [1.30])
|
||||||
|
AM_CONFIG_HEADER(config.h:config.hin)
|
||||||
|
|
||||||
|
# Initialize the test suite.
|
||||||
|
AC_CONFIG_TESTDIR(tests)
|
||||||
|
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||||
|
# Needed by tests/atlocal.in.
|
||||||
|
AC_SUBST([GCC])
|
||||||
|
|
||||||
|
# Checks for programs.
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_MINIX
|
||||||
|
AC_ISC_POSIX
|
||||||
|
AM_PROG_CC_STDC
|
||||||
|
AC_PROG_RANLIB
|
||||||
|
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(gcc-warnings,
|
||||||
|
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||||
|
[case "${enableval}" in
|
||||||
|
yes|no) ;;
|
||||||
|
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
||||||
|
esac],
|
||||||
|
[enableval=no])
|
||||||
|
if test "${enableval}" = yes; then
|
||||||
|
BISON_WARNING(-Wall)
|
||||||
|
BISON_WARNING(-W)
|
||||||
|
BISON_WARNING(-Wbad-function-cast)
|
||||||
|
BISON_WARNING(-Wcast-align)
|
||||||
|
BISON_WARNING(-Wcast-qual)
|
||||||
|
BISON_WARNING(-Wformat)
|
||||||
|
BISON_WARNING(-Wmissing-declarations)
|
||||||
|
BISON_WARNING(-Wmissing-prototypes)
|
||||||
|
BISON_WARNING(-Wnested-externs)
|
||||||
|
BISON_WARNING(-Wshadow)
|
||||||
|
BISON_WARNING(-Wstrict-prototypes)
|
||||||
|
BISON_WARNING(-Wwrite-strings)
|
||||||
|
CFLAGS="$CFLAGS $WARNING_CFLAGS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Checks for libraries.
|
||||||
|
AC_DEFINE([_GNU_SOURCE],1,[Define to 1 for GNU C library extensions.])
|
||||||
|
|
||||||
|
# Checks for header files.
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AC_CHECK_HEADERS(ctype.h locale.h memory.h stdlib.h string.h unistd.h)
|
||||||
|
|
||||||
|
# Checks for typedefs.
|
||||||
|
|
||||||
|
# Checks for structures.
|
||||||
|
|
||||||
|
# Checks for compiler characteristics.
|
||||||
|
AC_C_CONST
|
||||||
|
AC_C_INLINE
|
||||||
|
AM_C_PROTOTYPES
|
||||||
|
|
||||||
|
# Checks for library functions.
|
||||||
|
AC_FUNC_ALLOCA
|
||||||
|
AC_CHECK_FUNCS(mkstemp setlocale)
|
||||||
|
AC_CHECK_DECLS([stpcpy, strndup, strnlen, memchr])
|
||||||
|
AC_REPLACE_FUNCS(stpcpy strndup strnlen strspn memchr)
|
||||||
|
jm_FUNC_MALLOC
|
||||||
|
jm_FUNC_REALLOC
|
||||||
|
jm_PREREQ_QUOTEARG
|
||||||
|
jm_PREREQ_ERROR
|
||||||
|
AM_WITH_DMALLOC
|
||||||
|
|
||||||
|
ALL_LINGUAS="de es et fr ja nl tr ru"
|
||||||
|
AM_GNU_GETTEXT
|
||||||
|
|
||||||
|
# This is necessary so that .o files in LIBOBJS are also built via
|
||||||
|
# the ANSI2KNR-filtering rules.
|
||||||
|
LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
|
||||||
|
AC_SUBST(LIBOBJS)
|
||||||
|
|
||||||
|
AC_OUTPUT([Makefile
|
||||||
|
config/Makefile
|
||||||
|
intl/Makefile po/Makefile.in
|
||||||
|
lib/Makefile src/Makefile doc/Makefile
|
||||||
|
m4/Makefile
|
||||||
|
tests/Makefile])
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Makefile.in
|
|
||||||
Makefile
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
## Copyright (C) 2002, 2005 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 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
dist_pkgdata_DATA = README \
|
|
||||||
c.m4 yacc.c glr.c \
|
|
||||||
c++.m4 lalr1.cc
|
|
||||||
|
|
||||||
m4sugardir = $(pkgdatadir)/m4sugar
|
|
||||||
dist_m4sugar_DATA = m4sugar/m4sugar.m4
|
|
||||||
-45
@@ -1,45 +0,0 @@
|
|||||||
-*- outline -*-
|
|
||||||
|
|
||||||
This directory contains Bison skeletons: the general shapes of the
|
|
||||||
different parser kinds, that are specialized for specific grammars by
|
|
||||||
the bison program.
|
|
||||||
|
|
||||||
Currently, there are only three supported skeletons:
|
|
||||||
|
|
||||||
- yacc.c
|
|
||||||
It used to be named bison.simple: it corresponds to C Yacc
|
|
||||||
compatible LALR(1) parsers.
|
|
||||||
|
|
||||||
- lalr1.cc
|
|
||||||
Produces a C++ parser class. It is still very experimental, and not
|
|
||||||
yet supported. Please, subscribe to [email protected].
|
|
||||||
|
|
||||||
- glr.c
|
|
||||||
A Generalized LR C parser based on Bison's LALR(1) tables.
|
|
||||||
|
|
||||||
These skeletons are the only ones supported by the Bison team.
|
|
||||||
Because the interface between skeletons and the bison program is not
|
|
||||||
finished, *we are not bound to it*. In particular, Bison is not
|
|
||||||
mature enough for us to consider that ``foreign skeletons'' are
|
|
||||||
supported.
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
|
||||||
|
|
||||||
GNU Bison 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.
|
|
||||||
|
|
||||||
GNU Bison 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 Bison; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
-121
@@ -1,121 +0,0 @@
|
|||||||
m4_divert(-1)
|
|
||||||
|
|
||||||
# C++ skeleton for Bison
|
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005 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 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
## ---------------- ##
|
|
||||||
## Default values. ##
|
|
||||||
## ---------------- ##
|
|
||||||
|
|
||||||
# Default parser class name.
|
|
||||||
m4_define_default([b4_parser_class_name], [parser])
|
|
||||||
m4_define_default([b4_location_type], [location])
|
|
||||||
m4_define_default([b4_filename_type], [std::string])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
|
||||||
# -----------------------------------------------------
|
|
||||||
# Output the definition of the tokens (if there are) as enums.
|
|
||||||
m4_define([b4_token_enums],
|
|
||||||
[m4_if([$@], [[]], [],
|
|
||||||
[/* Tokens. */
|
|
||||||
enum yytokentype {
|
|
||||||
m4_map_sep([ b4_token_enum], [,
|
|
||||||
],
|
|
||||||
[$@])
|
|
||||||
};
|
|
||||||
])])
|
|
||||||
|
|
||||||
|
|
||||||
## ----------------- ##
|
|
||||||
## Semantic Values. ##
|
|
||||||
## ----------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_lhs_value([TYPE])
|
|
||||||
# --------------------
|
|
||||||
# Expansion of $<TYPE>$.
|
|
||||||
m4_define([b4_lhs_value],
|
|
||||||
[(yyval[]m4_ifval([$1], [.$1]))])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
|
||||||
# --------------------------------------
|
|
||||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
|
||||||
# symbols on RHS.
|
|
||||||
m4_define([b4_rhs_value],
|
|
||||||
[(yysemantic_stack_@{m4_eval([$1 - $2])@}m4_ifval([$3], [.$3]))])
|
|
||||||
|
|
||||||
# b4_lhs_location()
|
|
||||||
# -----------------
|
|
||||||
# Expansion of @$.
|
|
||||||
m4_define([b4_lhs_location],
|
|
||||||
[(yyloc)])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_rhs_location(RULE-LENGTH, NUM)
|
|
||||||
# ---------------------------------
|
|
||||||
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
|
|
||||||
# on RHS.
|
|
||||||
m4_define([b4_rhs_location],
|
|
||||||
[(yylocation_stack_@{m4_eval([$1 - $2])@})])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_parse_param_decl
|
|
||||||
# -------------------
|
|
||||||
# Extra formal arguments of the constructor.
|
|
||||||
# Change the parameter names from "foo" into "foo_yyarg", so that
|
|
||||||
# there is no collision bw the user chosen attribute name, and the
|
|
||||||
# argument name in the constructor.
|
|
||||||
m4_define([b4_parse_param_decl],
|
|
||||||
[m4_ifset([b4_parse_param],
|
|
||||||
[m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
|
|
||||||
|
|
||||||
m4_define([b4_parse_param_decl_1],
|
|
||||||
[$1_yyarg])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_parse_param_cons
|
|
||||||
# -------------------
|
|
||||||
# Extra initialisations of the constructor.
|
|
||||||
m4_define([b4_parse_param_cons],
|
|
||||||
[m4_ifset([b4_parse_param],
|
|
||||||
[,
|
|
||||||
b4_cc_constructor_calls(b4_parse_param)])])
|
|
||||||
m4_define([b4_cc_constructor_calls],
|
|
||||||
[m4_map_sep([b4_cc_constructor_call], [,
|
|
||||||
], [$@])])
|
|
||||||
m4_define([b4_cc_constructor_call],
|
|
||||||
[$2 ($2_yyarg)])
|
|
||||||
|
|
||||||
# b4_parse_param_vars
|
|
||||||
# -------------------
|
|
||||||
# Extra instance variables.
|
|
||||||
m4_define([b4_parse_param_vars],
|
|
||||||
[m4_ifset([b4_parse_param],
|
|
||||||
[
|
|
||||||
/* User arguments. */
|
|
||||||
b4_cc_var_decls(b4_parse_param)])])
|
|
||||||
m4_define([b4_cc_var_decls],
|
|
||||||
[m4_map_sep([b4_cc_var_decl], [
|
|
||||||
], [$@])])
|
|
||||||
m4_define([b4_cc_var_decl],
|
|
||||||
[ $1;])
|
|
||||||
@@ -1,440 +0,0 @@
|
|||||||
m4_divert(-1) -*- Autoconf -*-
|
|
||||||
|
|
||||||
# C M4 Macros for Bison.
|
|
||||||
# Copyright (C) 2002, 2004, 2005 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 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
|
||||||
## Identification. ##
|
|
||||||
## ---------------- ##
|
|
||||||
|
|
||||||
# b4_copyright(TITLE, YEARS)
|
|
||||||
# --------------------------
|
|
||||||
m4_define([b4_copyright],
|
|
||||||
[/* A Bison parser, made by GNU Bison b4_version. */
|
|
||||||
|
|
||||||
/* $1,
|
|
||||||
Copyright (C) $2 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA. */])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_identification
|
|
||||||
# -----------------
|
|
||||||
m4_define([b4_identification],
|
|
||||||
[/* Identify Bison output. */
|
|
||||||
[#]define YYBISON 1
|
|
||||||
|
|
||||||
/* Bison version. */
|
|
||||||
[#]define YYBISON_VERSION "b4_version"
|
|
||||||
|
|
||||||
/* Skeleton name. */
|
|
||||||
[#]define YYSKELETON_NAME b4_skeleton
|
|
||||||
|
|
||||||
/* Pure parsers. */
|
|
||||||
[#]define YYPURE b4_pure
|
|
||||||
|
|
||||||
/* Using locations. */
|
|
||||||
[#]define YYLSP_NEEDED b4_locations_flag
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
|
||||||
## Default values. ##
|
|
||||||
## ---------------- ##
|
|
||||||
|
|
||||||
m4_define_default([b4_epilogue], [])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------------ ##
|
|
||||||
## Pure/impure interfaces. ##
|
|
||||||
## ------------------------ ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_user_args
|
|
||||||
# ------------
|
|
||||||
m4_define([b4_user_args],
|
|
||||||
[m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_parse_param
|
|
||||||
# --------------
|
|
||||||
# If defined, b4_parse_param arrives double quoted, but below we prefer
|
|
||||||
# it to be single quoted.
|
|
||||||
m4_define_default([b4_parse_param])
|
|
||||||
m4_define([b4_parse_param],
|
|
||||||
b4_parse_param))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ------------ ##
|
|
||||||
## Data Types. ##
|
|
||||||
## ------------ ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_ints_in(INT1, INT2, LOW, HIGH)
|
|
||||||
# ---------------------------------
|
|
||||||
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
|
|
||||||
m4_define([b4_ints_in],
|
|
||||||
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_int_type(MIN, MAX)
|
|
||||||
# ---------------------
|
|
||||||
# Return the smallest int type able to handle numbers ranging from
|
|
||||||
# MIN to MAX (included).
|
|
||||||
m4_define([b4_int_type],
|
|
||||||
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
|
|
||||||
b4_ints_in($@, [-128], [127]), [1], [signed char],
|
|
||||||
|
|
||||||
b4_ints_in($@, [0], [65535]), [1], [unsigned short int],
|
|
||||||
b4_ints_in($@, [-32768], [32767]), [1], [short int],
|
|
||||||
|
|
||||||
m4_eval([0 <= $1]), [1], [unsigned int],
|
|
||||||
|
|
||||||
[int])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_int_type_for(NAME)
|
|
||||||
# ---------------------
|
|
||||||
# Return the smallest int type able to handle numbers ranging from
|
|
||||||
# `NAME_min' to `NAME_max' (included).
|
|
||||||
m4_define([b4_int_type_for],
|
|
||||||
[b4_int_type($1_min, $1_max)])
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------ ##
|
|
||||||
## Decoding options. ##
|
|
||||||
## ------------------ ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_location_if(IF-TRUE, IF-FALSE)
|
|
||||||
# ---------------------------------
|
|
||||||
# Expand IF-TRUE, if locations are used, IF-FALSE otherwise.
|
|
||||||
m4_define([b4_location_if],
|
|
||||||
[m4_if(b4_locations_flag, [1],
|
|
||||||
[$1],
|
|
||||||
[$2])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_pure_if(IF-TRUE, IF-FALSE)
|
|
||||||
# -----------------------------
|
|
||||||
# Expand IF-TRUE, if %pure-parser, IF-FALSE otherwise.
|
|
||||||
m4_define([b4_pure_if],
|
|
||||||
[m4_if(b4_pure, [1],
|
|
||||||
[$1],
|
|
||||||
[$2])])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
|
||||||
## Assigning token numbers. ##
|
|
||||||
## ------------------------- ##
|
|
||||||
|
|
||||||
# b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
|
|
||||||
# -----------------------------------------
|
|
||||||
# Output the definition of this token as #define.
|
|
||||||
m4_define([b4_token_define],
|
|
||||||
[#define $1 $2
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
|
||||||
# -------------------------------------------------------
|
|
||||||
# Output the definition of the tokens (if there are) as #defines.
|
|
||||||
m4_define([b4_token_defines],
|
|
||||||
[m4_if([$@], [[]], [],
|
|
||||||
[/* Tokens. */
|
|
||||||
m4_map([b4_token_define], [$@])])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
|
|
||||||
# ---------------------------------------
|
|
||||||
# Output the definition of this token as an enum.
|
|
||||||
m4_define([b4_token_enum],
|
|
||||||
[$1 = $2])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
|
||||||
# -----------------------------------------------------
|
|
||||||
# Output the definition of the tokens (if there are) as enums.
|
|
||||||
m4_define([b4_token_enums],
|
|
||||||
[m4_if([$@], [[]], [],
|
|
||||||
[/* Tokens. */
|
|
||||||
#ifndef YYTOKENTYPE
|
|
||||||
# define YYTOKENTYPE
|
|
||||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
|
||||||
know about them. */
|
|
||||||
enum yytokentype {
|
|
||||||
m4_map_sep([ b4_token_enum], [,
|
|
||||||
],
|
|
||||||
[$@])
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
# Output the definition of the tokens (if there are) as enums and #defines.
|
|
||||||
m4_define([b4_token_enums_defines],
|
|
||||||
[b4_token_enums($@)b4_token_defines($@)
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------------------------------------------- ##
|
|
||||||
## Defining C functions in both K&R and ANSI-C. ##
|
|
||||||
## --------------------------------------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# Declare the function NAME.
|
|
||||||
m4_define([b4_c_function_def],
|
|
||||||
[#if defined (__STDC__) || defined (__cplusplus)
|
|
||||||
b4_c_ansi_function_def($@)
|
|
||||||
#else
|
|
||||||
$2
|
|
||||||
$1 (b4_c_knr_formal_names(m4_shiftn(2, $@)))
|
|
||||||
b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
|
||||||
#endif[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_ansi_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
|
||||||
# ---------------------------------------------------------------
|
|
||||||
# Declare the function NAME in ANSI.
|
|
||||||
m4_define([b4_c_ansi_function_def],
|
|
||||||
[$2
|
|
||||||
$1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_ansi_formals([DECL1, NAME1], ...)
|
|
||||||
# --------------------------------------
|
|
||||||
# Output the arguments ANSI-C definition.
|
|
||||||
m4_define([b4_c_ansi_formals],
|
|
||||||
[m4_case([$@],
|
|
||||||
[], [void],
|
|
||||||
[[]], [void],
|
|
||||||
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
|
||||||
|
|
||||||
m4_define([b4_c_ansi_formal],
|
|
||||||
[$1])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_knr_formal_names([DECL1, NAME1], ...)
|
|
||||||
# ------------------------------------------
|
|
||||||
# Output the argument names.
|
|
||||||
m4_define([b4_c_knr_formal_names],
|
|
||||||
[m4_map_sep([b4_c_knr_formal_name], [, ], [$@])])
|
|
||||||
|
|
||||||
m4_define([b4_c_knr_formal_name],
|
|
||||||
[$2])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_knr_formal_decls([DECL1, NAME1], ...)
|
|
||||||
# ------------------------------------------
|
|
||||||
# Output the K&R argument declarations.
|
|
||||||
m4_define([b4_c_knr_formal_decls],
|
|
||||||
[m4_map_sep([b4_c_knr_formal_decl],
|
|
||||||
[
|
|
||||||
],
|
|
||||||
[$@])])
|
|
||||||
|
|
||||||
m4_define([b4_c_knr_formal_decl],
|
|
||||||
[ $1;])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------------------------------------------------ ##
|
|
||||||
## Declaring (prototyping) C functions in both K&R and ANSI-C. ##
|
|
||||||
## ------------------------------------------------------------ ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
# Declare the function NAME.
|
|
||||||
m4_define([b4_c_function_decl],
|
|
||||||
[#if defined (__STDC__) || defined (__cplusplus)
|
|
||||||
b4_c_ansi_function_decl($@)
|
|
||||||
#else
|
|
||||||
$2 $1 ();
|
|
||||||
#endif[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_ansi_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
|
||||||
# ----------------------------------------------------------------
|
|
||||||
# Declare the function NAME.
|
|
||||||
m4_define([b4_c_ansi_function_decl],
|
|
||||||
[$2 $1 (b4_c_ansi_formals(m4_shiftn(2, $@)));[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------------------- ##
|
|
||||||
## Calling C functions. ##
|
|
||||||
## --------------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_function_call(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
# Call the function NAME with arguments NAME1, NAME2 etc.
|
|
||||||
m4_define([b4_c_function_call],
|
|
||||||
[$1 (b4_c_args(m4_shiftn(2, $@)))[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_c_args([DECL1, NAME1], ...)
|
|
||||||
# ------------------------------
|
|
||||||
# Output the arguments NAME1, NAME2...
|
|
||||||
m4_define([b4_c_args],
|
|
||||||
[m4_map_sep([b4_c_arg], [, ], [$@])])
|
|
||||||
|
|
||||||
m4_define([b4_c_arg],
|
|
||||||
[$2])
|
|
||||||
|
|
||||||
|
|
||||||
## ----------- ##
|
|
||||||
## Synclines. ##
|
|
||||||
## ----------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_syncline(LINE, FILE)
|
|
||||||
# -----------------------
|
|
||||||
m4_define([b4_syncline],
|
|
||||||
[m4_if(b4_synclines_flag, 1,
|
|
||||||
[[#]line $1 $2])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_actions(FILENAME, LINENO,
|
|
||||||
# SYMBOL-TAG, SYMBOL-NUM,
|
|
||||||
# SYMBOL-ACTION, SYMBOL-TYPENAME)
|
|
||||||
# -------------------------------------------------
|
|
||||||
m4_define([b4_symbol_actions],
|
|
||||||
[m4_pushdef([b4_dollar_dollar],
|
|
||||||
[m4_ifval([$6], [(yyvaluep->$6)], [(*yyvaluep)])])dnl
|
|
||||||
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
|
|
||||||
case $4: /* $3 */
|
|
||||||
b4_syncline([$2], [$1])
|
|
||||||
$5;
|
|
||||||
b4_syncline([@oline@], [@ofile@])
|
|
||||||
break;
|
|
||||||
m4_popdef([b4_at_dollar])dnl
|
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_yydestruct_generate(FUNCTION-DECLARATOR)
|
|
||||||
# -------------------------------------------
|
|
||||||
# Generate the "yydestruct" function, which declaration is issued using
|
|
||||||
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
|
||||||
# or "b4_c_function_def" for K&R.
|
|
||||||
m4_define_default([b4_yydestruct_generate],
|
|
||||||
[[/*-----------------------------------------------.
|
|
||||||
| Release the memory associated to this symbol. |
|
|
||||||
`-----------------------------------------------*/
|
|
||||||
|
|
||||||
]$1([yydestruct],
|
|
||||||
[static void],
|
|
||||||
[[const char *yymsg], [yymsg]],
|
|
||||||
[[int yytype], [yytype]],
|
|
||||||
[[YYSTYPE *yyvaluep], [yyvaluep]]b4_location_if([,
|
|
||||||
[[YYLTYPE *yylocationp], [yylocationp]]]))[
|
|
||||||
{
|
|
||||||
/* Pacify ``unused variable'' warnings. */
|
|
||||||
(void) yyvaluep;
|
|
||||||
]b4_location_if([ (void) yylocationp;
|
|
||||||
])[
|
|
||||||
if (!yymsg)
|
|
||||||
yymsg = "Deleting";
|
|
||||||
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
|
||||||
|
|
||||||
switch (yytype)
|
|
||||||
{
|
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_yysymprint_generate(FUNCTION-DECLARATOR)
|
|
||||||
# -------------------------------------------
|
|
||||||
# Generate the "yysymprint" function, which declaration is issued using
|
|
||||||
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
|
||||||
# or "b4_c_function_def" for K&R.
|
|
||||||
m4_define_default([b4_yysymprint_generate],
|
|
||||||
[[/*--------------------------------.
|
|
||||||
| Print this symbol on YYOUTPUT. |
|
|
||||||
`--------------------------------*/
|
|
||||||
|
|
||||||
]$1([yysymprint],
|
|
||||||
[static void],
|
|
||||||
[[FILE *yyoutput], [yyoutput]],
|
|
||||||
[[int yytype], [yytype]],
|
|
||||||
[[YYSTYPE *yyvaluep], [yyvaluep]]b4_location_if([,
|
|
||||||
[[YYLTYPE *yylocationp], [yylocationp]]]))
|
|
||||||
{
|
|
||||||
/* Pacify ``unused variable'' warnings. */
|
|
||||||
(void) yyvaluep;
|
|
||||||
b4_location_if([ (void) yylocationp;
|
|
||||||
])dnl
|
|
||||||
[
|
|
||||||
if (yytype < YYNTOKENS)
|
|
||||||
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
|
||||||
else
|
|
||||||
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
|
||||||
|
|
||||||
]b4_location_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
|
|
||||||
YYFPRINTF (yyoutput, ": ");
|
|
||||||
])dnl
|
|
||||||
[
|
|
||||||
# ifdef YYPRINT
|
|
||||||
if (yytype < YYNTOKENS)
|
|
||||||
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
|
||||||
# endif
|
|
||||||
switch (yytype)
|
|
||||||
{
|
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
|
||||||
[ default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
YYFPRINTF (yyoutput, ")");
|
|
||||||
}
|
|
||||||
]])
|
|
||||||
-2359
File diff suppressed because it is too large
Load Diff
-1363
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
-1447
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,6 @@ bison.dvi
|
|||||||
bison.fn
|
bison.fn
|
||||||
bison.ky
|
bison.ky
|
||||||
bison.log
|
bison.log
|
||||||
bison.pdf
|
|
||||||
bison.pg
|
bison.pg
|
||||||
bison.ps
|
bison.ps
|
||||||
bison.toc
|
bison.toc
|
||||||
@@ -15,7 +14,3 @@ bison.vr
|
|||||||
refcard.dvi
|
refcard.dvi
|
||||||
refcard.log
|
refcard.log
|
||||||
refcard.ps
|
refcard.ps
|
||||||
Makefile.in
|
|
||||||
*.info*
|
|
||||||
stamp-vti
|
|
||||||
version.texi
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ A1. If you're looking for a guarantee or certification, I can't
|
|||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Q2. I can't build Bison because "make" complains that "msgfmt" is not
|
Q2. I can't build Bison because "make" complains that "msgfmt" is not
|
||||||
found. What should I do?
|
fund. What should I do?
|
||||||
|
|
||||||
A2. Like most GNU packages with internationalization support, that
|
A2. Like most GNU packages with internationalization support, that
|
||||||
feature is turned on by default. If you have problems building
|
feature is turned on by default. If you have problems building
|
||||||
|
|||||||
+3
-22
@@ -1,32 +1,13 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
AUTOMAKE_OPTIONS = 1.4
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
|
||||||
## it under the terms of the GNU General Public License as published by
|
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
AM_MAKEINFOFLAGS = --no-split
|
|
||||||
info_TEXINFOS = bison.texinfo
|
info_TEXINFOS = bison.texinfo
|
||||||
man_MANS = bison.1
|
man_MANS = bison.1
|
||||||
bison_TEXINFOS = gpl.texi fdl.texi
|
bison_TEXINFOS = gpl.texi fdl.texi
|
||||||
|
|
||||||
EXTRA_DIST = FAQ bison.1 refcard.tex
|
EXTRA_DIST = FAQ bison.1 bison.rnh refcard.tex
|
||||||
|
|
||||||
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
|
CLEANFILES = refcard.dvi refcard.log refcard.ps
|
||||||
|
|
||||||
clean-local:
|
|
||||||
rm -rf *.t2d
|
|
||||||
|
|
||||||
refcard.dvi: refcard.tex
|
refcard.dvi: refcard.tex
|
||||||
tex refcard.tex
|
tex refcard.tex
|
||||||
|
|||||||
+403
@@ -0,0 +1,403 @@
|
|||||||
|
# Makefile.in generated by automake 1.5a from Makefile.am.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
SHELL = @SHELL@
|
||||||
|
|
||||||
|
srcdir = @srcdir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
|
||||||
|
bindir = @bindir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
datadir = @datadir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
libdir = @libdir@
|
||||||
|
infodir = @infodir@
|
||||||
|
mandir = @mandir@
|
||||||
|
includedir = @includedir@
|
||||||
|
oldincludedir = /usr/include
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
top_builddir = ..
|
||||||
|
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = @program_transform_name@
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_triplet = @host@
|
||||||
|
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AUTOM4TE = @AUTOM4TE@
|
||||||
|
AWK = @AWK@
|
||||||
|
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
||||||
|
CATALOGS = @CATALOGS@
|
||||||
|
CATOBJEXT = @CATOBJEXT@
|
||||||
|
CC = @CC@
|
||||||
|
CPP = @CPP@
|
||||||
|
DATADIRNAME = @DATADIRNAME@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
GCC = @GCC@
|
||||||
|
GENCAT = @GENCAT@
|
||||||
|
GLIBC21 = @GLIBC21@
|
||||||
|
GMOFILES = @GMOFILES@
|
||||||
|
GMSGFMT = @GMSGFMT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
INSTOBJEXT = @INSTOBJEXT@
|
||||||
|
INTLBISON = @INTLBISON@
|
||||||
|
INTLLIBS = @INTLLIBS@
|
||||||
|
INTLOBJS = @INTLOBJS@
|
||||||
|
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
||||||
|
LIBICONV = @LIBICONV@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||||
|
MSGFMT = @MSGFMT@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
POFILES = @POFILES@
|
||||||
|
POSUB = @POSUB@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
U = @U@
|
||||||
|
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||||
|
USE_NLS = @USE_NLS@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.4
|
||||||
|
|
||||||
|
info_TEXINFOS = bison.texinfo
|
||||||
|
man_MANS = bison.1
|
||||||
|
bison_TEXINFOS = gpl.texi fdl.texi
|
||||||
|
|
||||||
|
EXTRA_DIST = FAQ bison.1 bison.rnh refcard.tex
|
||||||
|
|
||||||
|
CLEANFILES = refcard.dvi refcard.log refcard.ps
|
||||||
|
subdir = doc
|
||||||
|
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
||||||
|
CONFIG_HEADER = $(top_builddir)/config.h
|
||||||
|
CONFIG_CLEAN_FILES =
|
||||||
|
DIST_SOURCES =
|
||||||
|
TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex
|
||||||
|
INFO_DEPS = bison.info
|
||||||
|
DVIS = bison.dvi
|
||||||
|
TEXINFOS = bison.texinfo
|
||||||
|
|
||||||
|
NROFF = nroff
|
||||||
|
MANS = $(man_MANS)
|
||||||
|
DIST_COMMON = $(bison_TEXINFOS) Makefile.am Makefile.in stamp-vti \
|
||||||
|
version.texi
|
||||||
|
all: all-am
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .dvi .info .ps .texinfo
|
||||||
|
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||||
|
cd $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu doc/Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||||
|
|
||||||
|
$(srcdir)/version.texi: $(srcdir)/stamp-vti
|
||||||
|
@:
|
||||||
|
$(srcdir)/stamp-vti: bison.texinfo $(top_srcdir)/configure.in
|
||||||
|
@(set `$(SHELL) $(top_srcdir)/config/mdate-sh $(srcdir)/bison.texinfo`; \
|
||||||
|
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)
|
||||||
|
-@rm -f vti.tmp
|
||||||
|
@cp $(srcdir)/version.texi $@
|
||||||
|
|
||||||
|
mostlyclean-vti:
|
||||||
|
-rm -f vti.tmp
|
||||||
|
|
||||||
|
maintainer-clean-vti:
|
||||||
|
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
|
||||||
|
|
||||||
|
bison.info: bison.texinfo $(srcdir)/version.texi $(bison_TEXINFOS)
|
||||||
|
bison.dvi: bison.texinfo $(srcdir)/version.texi $(bison_TEXINFOS)
|
||||||
|
|
||||||
|
.texinfo.info:
|
||||||
|
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||||
|
cd $(srcdir) \
|
||||||
|
&& $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
|
||||||
|
`echo $< | sed 's,.*/,,'`
|
||||||
|
|
||||||
|
.texinfo.dvi:
|
||||||
|
TEXINPUTS="$(top_srcdir)/config$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||||
|
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||||
|
$(TEXI2DVI) $<
|
||||||
|
|
||||||
|
.texinfo:
|
||||||
|
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||||
|
cd $(srcdir) \
|
||||||
|
&& $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
|
||||||
|
`echo $< | sed 's,.*/,,'`
|
||||||
|
|
||||||
|
MAKEINFO = @MAKEINFO@
|
||||||
|
TEXI2DVI = texi2dvi
|
||||||
|
DVIPS = dvips
|
||||||
|
.dvi.ps:
|
||||||
|
$(DVIPS) $< -o $@
|
||||||
|
|
||||||
|
uninstall-info-am:
|
||||||
|
$(PRE_UNINSTALL)
|
||||||
|
@if (install-info --version && \
|
||||||
|
install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \
|
||||||
|
list='$(INFO_DEPS)'; \
|
||||||
|
for file in $$list; do \
|
||||||
|
echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \
|
||||||
|
install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \
|
||||||
|
done; \
|
||||||
|
else :; fi
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(INFO_DEPS)'; \
|
||||||
|
for file in $$list; do \
|
||||||
|
(if cd $(DESTDIR)$(infodir); then \
|
||||||
|
echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \
|
||||||
|
rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \
|
||||||
|
else :; fi); \
|
||||||
|
done
|
||||||
|
|
||||||
|
dist-info: $(INFO_DEPS)
|
||||||
|
list='$(INFO_DEPS)'; \
|
||||||
|
for base in $$list; do \
|
||||||
|
d=$(srcdir); \
|
||||||
|
for file in $$d/$$base*; do \
|
||||||
|
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
|
||||||
|
test -f $(distdir)/$$relfile || \
|
||||||
|
cp -p $$file $(distdir)/$$relfile; \
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
|
||||||
|
mostlyclean-aminfo:
|
||||||
|
-rm -f bison.aux bison.cp bison.cps bison.dvi bison.fn bison.ky bison.log \
|
||||||
|
bison.pg bison.ps bison.toc bison.tp bison.vr
|
||||||
|
|
||||||
|
maintainer-clean-aminfo:
|
||||||
|
cd $(srcdir) && \
|
||||||
|
for i in $(INFO_DEPS); do \
|
||||||
|
rm -f $$i; \
|
||||||
|
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
|
||||||
|
rm -f $$i-[0-9]*; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
|
||||||
|
man1dir = $(mandir)/man1
|
||||||
|
install-man1: $(man1_MANS) $(man_MANS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||||
|
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||||
|
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||||
|
for i in $$l2; do \
|
||||||
|
case "$$i" in \
|
||||||
|
*.1*) list="$$list $$i" ;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
for i in $$list; do \
|
||||||
|
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||||
|
else file=$$i; fi; \
|
||||||
|
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||||
|
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||||
|
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||||
|
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||||
|
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||||
|
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||||
|
done
|
||||||
|
uninstall-man1:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||||
|
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||||
|
for i in $$l2; do \
|
||||||
|
case "$$i" in \
|
||||||
|
*.1*) list="$$list $$i" ;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
for i in $$list; do \
|
||||||
|
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||||
|
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||||
|
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||||
|
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||||
|
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||||
|
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||||
|
done
|
||||||
|
tags: TAGS
|
||||||
|
TAGS:
|
||||||
|
|
||||||
|
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
|
top_distdir = ..
|
||||||
|
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@for file in $(DISTFILES); do \
|
||||||
|
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||||
|
$(mkinstalldirs) "$(distdir)/$$dir"; \
|
||||||
|
fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
cp -pR $$d/$$file $(distdir) \
|
||||||
|
|| 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:
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir)
|
||||||
|
|
||||||
|
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:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
`test -z '$(STRIP)' || \
|
||||||
|
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||||
|
|
||||||
|
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-generic mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-am
|
||||||
|
|
||||||
|
distclean-am: clean-am distclean-generic
|
||||||
|
|
||||||
|
dvi: dvi-am
|
||||||
|
|
||||||
|
dvi-am: $(DVIS)
|
||||||
|
|
||||||
|
info: info-am
|
||||||
|
|
||||||
|
info-am: $(INFO_DEPS)
|
||||||
|
|
||||||
|
install-data-am: install-info-am install-man
|
||||||
|
|
||||||
|
install-exec-am:
|
||||||
|
|
||||||
|
install-info: install-info-am
|
||||||
|
|
||||||
|
install-info-am: $(INFO_DEPS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||||
|
@list='$(INFO_DEPS)'; \
|
||||||
|
for file in $$list; do \
|
||||||
|
d=$(srcdir); \
|
||||||
|
for ifile in echo $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \
|
||||||
|
if test -f $$ifile; then \
|
||||||
|
relfile=`expr "$$ifile" : "$$d/\(.*\)"`; \
|
||||||
|
echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
|
||||||
|
$(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \
|
||||||
|
else : ; fi; \
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
@$(POST_INSTALL)
|
||||||
|
@if (install-info --version && \
|
||||||
|
install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \
|
||||||
|
list='$(INFO_DEPS)'; \
|
||||||
|
for file in $$list; do \
|
||||||
|
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
|
||||||
|
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
|
||||||
|
done; \
|
||||||
|
else : ; fi
|
||||||
|
install-man: install-man1
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-am
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
uninstall-am: uninstall-info-am uninstall-man
|
||||||
|
|
||||||
|
uninstall-man: uninstall-man1
|
||||||
|
|
||||||
|
.PHONY: all all-am check check-am clean clean-generic dist-info \
|
||||||
|
distclean distclean-generic distdir dvi dvi-am info info-am \
|
||||||
|
install install-am install-data install-data-am install-exec \
|
||||||
|
install-exec-am install-info install-info-am install-man \
|
||||||
|
install-man1 install-strip installcheck installcheck-am \
|
||||||
|
installdirs maintainer-clean maintainer-clean-aminfo \
|
||||||
|
maintainer-clean-generic maintainer-clean-vti mostlyclean \
|
||||||
|
mostlyclean-aminfo mostlyclean-generic mostlyclean-vti \
|
||||||
|
uninstall uninstall-am uninstall-info-am uninstall-man \
|
||||||
|
uninstall-man1
|
||||||
|
|
||||||
|
|
||||||
|
refcard.dvi: refcard.tex
|
||||||
|
tex refcard.tex
|
||||||
|
|
||||||
|
refcard.ps: refcard.dvi
|
||||||
|
# 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:
|
||||||
+43
-41
@@ -59,11 +59,6 @@ bison \- GNU Project parser generator (yacc replacement)
|
|||||||
.B \-\-fixed-output-files
|
.B \-\-fixed-output-files
|
||||||
]
|
]
|
||||||
file
|
file
|
||||||
.br
|
|
||||||
.B yacc
|
|
||||||
[
|
|
||||||
.I "similar options and operands"
|
|
||||||
]
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I Bison
|
.I Bison
|
||||||
is a parser generator in the style of
|
is a parser generator in the style of
|
||||||
@@ -80,10 +75,10 @@ Unlike
|
|||||||
.IR yacc ,
|
.IR yacc ,
|
||||||
the generated files do not have fixed names, but instead use the prefix
|
the generated files do not have fixed names, but instead use the prefix
|
||||||
of the input file.
|
of the input file.
|
||||||
Moreover, if you need to put
|
Moreover, if you need to put
|
||||||
.I C++
|
.IR C++
|
||||||
code in the input file, you can end his name by a C++-like extension
|
code in the input file, you can end his name by a C++-like extension
|
||||||
(.ypp or .y++), then bison will follow your extension to name the
|
(.ypp or .y++), then bison will follow your extension to name the
|
||||||
output file (.cpp or .c++).
|
output file (.cpp or .c++).
|
||||||
For instance, a grammar description file named
|
For instance, a grammar description file named
|
||||||
.B parse.yxx
|
.B parse.yxx
|
||||||
@@ -91,10 +86,10 @@ would produce the generated parser in a file named
|
|||||||
.BR parse.tab.cxx ,
|
.BR parse.tab.cxx ,
|
||||||
instead of
|
instead of
|
||||||
.IR yacc 's
|
.IR yacc 's
|
||||||
.B y.tab.c
|
.BR y.tab.c
|
||||||
or old
|
or old
|
||||||
.I Bison
|
.IR Bison
|
||||||
version's
|
versions
|
||||||
.BR parse.tab.c .
|
.BR parse.tab.c .
|
||||||
.PP
|
.PP
|
||||||
This description of the options that can be given to
|
This description of the options that can be given to
|
||||||
@@ -127,7 +122,7 @@ Specify a prefix to use for all
|
|||||||
.I bison
|
.I bison
|
||||||
output file names. The names are
|
output file names. The names are
|
||||||
chosen as if the input file were named
|
chosen as if the input file were named
|
||||||
\fIfile-prefix\fP\fB.c\fP.
|
\fIfile-prefix\fB.c\fR.
|
||||||
.TP
|
.TP
|
||||||
.B \-d
|
.B \-d
|
||||||
.br
|
.br
|
||||||
@@ -140,10 +135,10 @@ as well as a few
|
|||||||
variable declarations.
|
variable declarations.
|
||||||
.sp
|
.sp
|
||||||
If the parser output file is named
|
If the parser output file is named
|
||||||
.IB name .c
|
\fIname\fB.c\fR
|
||||||
then this file
|
then this file
|
||||||
is named
|
is named
|
||||||
\fIname\fP\fB.h\fP.
|
\fIname\fB.h\fR.
|
||||||
.sp
|
.sp
|
||||||
This output file is essential if you wish to put the definition of
|
This output file is essential if you wish to put the definition of
|
||||||
.B yylex
|
.B yylex
|
||||||
@@ -153,29 +148,29 @@ needs to be able to refer to token type codes and the variable
|
|||||||
.BR yylval .
|
.BR yylval .
|
||||||
.TP
|
.TP
|
||||||
.BI \-\-defines= defines-file
|
.BI \-\-defines= defines-file
|
||||||
The behavior of
|
The behaviour of
|
||||||
.B \-\-defines
|
.BI \-\-defines
|
||||||
is the same than
|
is the same than
|
||||||
.B \-d
|
.BI \-d
|
||||||
option.
|
option.
|
||||||
The only difference is that it has an optional argument which is
|
The only difference is that it has an optionnal argument which is
|
||||||
the name of the output filename.
|
the name of the output filename.
|
||||||
.TP
|
.TP
|
||||||
.BI \-g
|
.BI \-g
|
||||||
.br
|
.br
|
||||||
.ns
|
.ns
|
||||||
Output a VCG definition of the LALR(1) grammar automaton computed by
|
Output a VCG definition of the LALR(1) grammar automaton computed by
|
||||||
Bison. If the grammar file is
|
Bison. If the grammar file is
|
||||||
.BR foo.y
|
.BR foo.y
|
||||||
, the VCG output file will be
|
, the VCG output file will be
|
||||||
.BR foo.vcg .
|
.BR foo.vcg .
|
||||||
.TP
|
.TP
|
||||||
.BI \-\-graph= graph-file
|
.BI \-\-graph= graph-file
|
||||||
The behavior of
|
The behaviour of
|
||||||
.BI \-\-graph
|
.BI \-\-graph
|
||||||
is the same than
|
is the same than
|
||||||
.BI \-g
|
.BI \-g
|
||||||
option. The only difference is that it has an optional argument which
|
option. The only difference is that it has an optionnal argument which
|
||||||
is the name of the output graph filename.
|
is the name of the output graph filename.
|
||||||
.TP
|
.TP
|
||||||
.B \-k
|
.B \-k
|
||||||
@@ -183,10 +178,8 @@ is the name of the output graph filename.
|
|||||||
.ns
|
.ns
|
||||||
.TP
|
.TP
|
||||||
.B \-\-token-table
|
.B \-\-token-table
|
||||||
This switch causes the
|
This switch causes the \fIname\fB.tab.c\fR output to include a list of
|
||||||
.IB name .tab.c
|
token names in order by their token numbers; this is defined in the array
|
||||||
output to include a list of
|
|
||||||
token names in order by their token numbers; this is defined in the array
|
|
||||||
.IR yytname .
|
.IR yytname .
|
||||||
Also generated
|
Also generated
|
||||||
are #defines for
|
are #defines for
|
||||||
@@ -216,13 +209,9 @@ parser file, treating it an independent source file in its own right.
|
|||||||
.ns
|
.ns
|
||||||
.TP
|
.TP
|
||||||
.B \-\-no-parser
|
.B \-\-no-parser
|
||||||
Do not generate the parser code into the output; generate only
|
Do not generate the parser code into the output; generate only
|
||||||
declarations. The generated
|
declarations. The generated \fIname\fB.tab.c\fR file will have only
|
||||||
.IB name .tab.c
|
constant declarations. In addition, a \fIname\fB.act\fR file is
|
||||||
file will have only
|
|
||||||
constant declarations. In addition, a
|
|
||||||
.IB name .act
|
|
||||||
file is
|
|
||||||
generated containing a switch statement body containing all the
|
generated containing a switch statement body containing all the
|
||||||
translated actions.
|
translated actions.
|
||||||
.TP
|
.TP
|
||||||
@@ -273,9 +262,9 @@ and so on.
|
|||||||
.ns
|
.ns
|
||||||
.TP
|
.TP
|
||||||
.B \-\-debug
|
.B \-\-debug
|
||||||
In the parser file, define the macro
|
Output a definition of the macro
|
||||||
.B YYDEBUG
|
.B YYDEBUG
|
||||||
to 1 if it is not already defined,
|
into the parser file,
|
||||||
so that the debugging facilities are compiled.
|
so that the debugging facilities are compiled.
|
||||||
.TP
|
.TP
|
||||||
.B \-v
|
.B \-v
|
||||||
@@ -345,16 +334,29 @@ The purpose of this switch is to imitate
|
|||||||
.IR yacc 's
|
.IR yacc 's
|
||||||
output file name conventions.
|
output file name conventions.
|
||||||
Thus, the following shell script can substitute for
|
Thus, the following shell script can substitute for
|
||||||
.I yacc
|
|
||||||
and is often installed as
|
|
||||||
.IR yacc :
|
.IR yacc :
|
||||||
.sp
|
.sp
|
||||||
.RS
|
.RS
|
||||||
.ft B
|
.ft B
|
||||||
bison \-y "$@"
|
bison \-y $*
|
||||||
.ft R
|
.ft R
|
||||||
.sp
|
.sp
|
||||||
.RE
|
.RE
|
||||||
|
.SH FILES
|
||||||
|
/usr/local/share/bison/bison.simple simple parser
|
||||||
|
.br
|
||||||
|
/usr/local/share/bison/bison.hairy complicated parser
|
||||||
|
.SH "ENVIRONMENT VARIABLES"
|
||||||
|
.TP
|
||||||
|
.SM BISON_SIMPLE
|
||||||
|
If this is set, it specifies the location in which the
|
||||||
|
.B bison.simple
|
||||||
|
parser can be found.
|
||||||
|
.TP
|
||||||
|
.SM BISON_HAIRY
|
||||||
|
If this is set, it specifies the location in which the
|
||||||
|
.B bison.hairy
|
||||||
|
parser can be found.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.IR yacc (1)
|
.IR yacc (1)
|
||||||
.br
|
.br
|
||||||
|
|||||||
+145
@@ -0,0 +1,145 @@
|
|||||||
|
Ceci est le fichier Info bison.info, produit par Makeinfo version 4.0b
|
||||||
|
à partir bison.texinfo.
|
||||||
|
|
||||||
|
START-INFO-DIR-ENTRY
|
||||||
|
* bison: (bison). GNU Project parser generator (yacc replacement).
|
||||||
|
END-INFO-DIR-ENTRY
|
||||||
|
|
||||||
|
This file documents the Bison parser generator.
|
||||||
|
|
||||||
|
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1998, 1999,
|
||||||
|
2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Permission is granted to make and distribute verbatim copies of this
|
||||||
|
manual provided the copyright notice and this permission notice are
|
||||||
|
preserved on all copies.
|
||||||
|
|
||||||
|
Permission is granted to copy and distribute modified versions of
|
||||||
|
this manual under the conditions for verbatim copying, provided also
|
||||||
|
that the sections entitled "GNU General Public License" and "Conditions
|
||||||
|
for Using Bison" are included exactly as in the original, and provided
|
||||||
|
that the entire resulting derived work is distributed under the terms
|
||||||
|
of a permission notice identical to this one.
|
||||||
|
|
||||||
|
Permission is granted to copy and distribute translations of this
|
||||||
|
manual into another language, under the above conditions for modified
|
||||||
|
versions, except that the sections entitled "GNU General Public
|
||||||
|
License", "Conditions for Using Bison" and this permission notice may be
|
||||||
|
included in translations approved by the Free Software Foundation
|
||||||
|
instead of in the original English.
|
||||||
|
|
||||||
|
|
||||||
|
Indirect:
|
||||||
|
bison.info-1: 1313
|
||||||
|
bison.info-2: 50689
|
||||||
|
bison.info-3: 100579
|
||||||
|
bison.info-4: 150129
|
||||||
|
bison.info-5: 197906
|
||||||
|
|
||||||
|
Tag Table:
|
||||||
|
(Indirect)
|
||||||
|
Node: Top1313
|
||||||
|
Node: Introduction8968
|
||||||
|
Node: Conditions10242
|
||||||
|
Node: Copying11706
|
||||||
|
Node: Concepts30909
|
||||||
|
Node: Language and Grammar31988
|
||||||
|
Node: Grammar in Bison37004
|
||||||
|
Node: Semantic Values38928
|
||||||
|
Node: Semantic Actions41029
|
||||||
|
Node: Locations Overview42218
|
||||||
|
Node: Bison Parser43665
|
||||||
|
Node: Stages45977
|
||||||
|
Node: Grammar Layout47260
|
||||||
|
Node: Examples48517
|
||||||
|
Node: RPN Calc49715
|
||||||
|
Node: Rpcalc Decls50689
|
||||||
|
Node: Rpcalc Rules52276
|
||||||
|
Node: Rpcalc Input54076
|
||||||
|
Node: Rpcalc Line55537
|
||||||
|
Node: Rpcalc Expr56652
|
||||||
|
Node: Rpcalc Lexer58597
|
||||||
|
Node: Rpcalc Main61169
|
||||||
|
Node: Rpcalc Error61567
|
||||||
|
Node: Rpcalc Gen62575
|
||||||
|
Node: Rpcalc Compile63724
|
||||||
|
Node: Infix Calc64599
|
||||||
|
Node: Simple Error Recovery67306
|
||||||
|
Node: Location Tracking Calc69195
|
||||||
|
Node: Ltcalc Decls69925
|
||||||
|
Node: Ltcalc Rules70834
|
||||||
|
Node: Ltcalc Lexer72895
|
||||||
|
Node: Multi-function Calc75233
|
||||||
|
Node: Mfcalc Decl76800
|
||||||
|
Node: Mfcalc Rules78823
|
||||||
|
Node: Mfcalc Symtab80203
|
||||||
|
Node: Exercises86576
|
||||||
|
Node: Grammar File87082
|
||||||
|
Node: Grammar Outline87930
|
||||||
|
Node: C Declarations88664
|
||||||
|
Node: Bison Declarations89244
|
||||||
|
Node: Grammar Rules89656
|
||||||
|
Node: C Code90116
|
||||||
|
Node: Symbols91046
|
||||||
|
Node: Rules96127
|
||||||
|
Node: Recursion97766
|
||||||
|
Node: Semantics99485
|
||||||
|
Node: Value Type100579
|
||||||
|
Node: Multiple Types101251
|
||||||
|
Node: Actions102268
|
||||||
|
Node: Action Types105053
|
||||||
|
Node: Mid-Rule Actions106356
|
||||||
|
Node: Locations111926
|
||||||
|
Node: Location Type112574
|
||||||
|
Node: Actions and Locations113132
|
||||||
|
Node: Location Default Action115288
|
||||||
|
Node: Declarations116751
|
||||||
|
Node: Token Decl118070
|
||||||
|
Node: Precedence Decl120083
|
||||||
|
Node: Union Decl121634
|
||||||
|
Node: Type Decl122478
|
||||||
|
Node: Expect Decl123384
|
||||||
|
Node: Start Decl124930
|
||||||
|
Node: Pure Decl125308
|
||||||
|
Node: Decl Summary126985
|
||||||
|
Node: Multiple Parsers132368
|
||||||
|
Node: Interface133862
|
||||||
|
Node: Parser Function134734
|
||||||
|
Node: Lexical135569
|
||||||
|
Node: Calling Convention136975
|
||||||
|
Node: Token Values139746
|
||||||
|
Node: Token Positions140895
|
||||||
|
Node: Pure Calling141780
|
||||||
|
Node: Error Reporting144712
|
||||||
|
Node: Action Features146834
|
||||||
|
Node: Algorithm150129
|
||||||
|
Node: Look-Ahead152422
|
||||||
|
Node: Shift/Reduce154554
|
||||||
|
Node: Precedence157466
|
||||||
|
Node: Why Precedence158117
|
||||||
|
Node: Using Precedence159982
|
||||||
|
Node: Precedence Examples160950
|
||||||
|
Node: How Precedence161651
|
||||||
|
Node: Contextual Precedence162800
|
||||||
|
Node: Parser States164591
|
||||||
|
Node: Reduce/Reduce165834
|
||||||
|
Node: Mystery Conflicts169395
|
||||||
|
Node: Stack Overflow172781
|
||||||
|
Node: Error Recovery174154
|
||||||
|
Node: Context Dependency179290
|
||||||
|
Node: Semantic Tokens180138
|
||||||
|
Node: Lexical Tie-ins183155
|
||||||
|
Node: Tie-in Recovery184703
|
||||||
|
Node: Debugging186875
|
||||||
|
Node: Invocation190176
|
||||||
|
Node: Bison Options191428
|
||||||
|
Node: Environment Variables195396
|
||||||
|
Node: Option Cross Key196244
|
||||||
|
Node: VMS Invocation197122
|
||||||
|
Node: Table of Symbols197906
|
||||||
|
Node: Glossary205545
|
||||||
|
Node: Copying This Manual211849
|
||||||
|
Node: GNU Free Documentation License212058
|
||||||
|
Node: Index231923
|
||||||
|
|
||||||
|
End Tag Table
|
||||||
+1076
File diff suppressed because it is too large
Load Diff
+1427
File diff suppressed because it is too large
Load Diff
+1317
File diff suppressed because it is too large
Load Diff
+1261
File diff suppressed because it is too large
Load Diff
+1036
File diff suppressed because it is too large
Load Diff
+191
@@ -0,0 +1,191 @@
|
|||||||
|
.!
|
||||||
|
.! RUNOFF source file for BISON.HLP
|
||||||
|
.!
|
||||||
|
.! This is a RUNOFF input file which will produce a VMS help file
|
||||||
|
.! for the VMS HELP library.
|
||||||
|
.!
|
||||||
|
.! Eric Youngdale and Wilfred J. Hansen ([email protected]).
|
||||||
|
.!
|
||||||
|
.literal
|
||||||
|
.end literal
|
||||||
|
.no paging
|
||||||
|
.no flags all
|
||||||
|
.right margin 70
|
||||||
|
.left margin 1
|
||||||
|
|
||||||
|
.indent -1
|
||||||
|
1 BISON
|
||||||
|
.skip
|
||||||
|
The BISON command invokes the GNU BISON parser generator.
|
||||||
|
.skip
|
||||||
|
.literal
|
||||||
|
BISON file-spec
|
||||||
|
.end literal
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 Parameters
|
||||||
|
.skip
|
||||||
|
file-spec
|
||||||
|
.skip
|
||||||
|
Here file-spec is the grammar file name, which usually ends in
|
||||||
|
.y. The parser file's name is made by replacing the .y
|
||||||
|
with _tab.c. Thus, the command bison foo.y yields
|
||||||
|
foo_tab.c.
|
||||||
|
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 Qualifiers
|
||||||
|
.skip
|
||||||
|
The following is the list of available qualifiers for BISON:
|
||||||
|
.literal
|
||||||
|
/DEBUG
|
||||||
|
/DEFINES
|
||||||
|
/FILE_PREFIX=prefix
|
||||||
|
/FIXED_OUTFILES
|
||||||
|
/NAME_PREFIX=prefix
|
||||||
|
/NOLINES
|
||||||
|
/NOPARSER
|
||||||
|
/OUTPUT=outfilefile
|
||||||
|
/RAW
|
||||||
|
/TOKEN_TABLE
|
||||||
|
/VERBOSE
|
||||||
|
/VERSION
|
||||||
|
/YACC
|
||||||
|
.end literal
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /DEBUG
|
||||||
|
.skip
|
||||||
|
Output a definition of the macro YYDEBUG into the parser file,
|
||||||
|
so that the debugging facilities are compiled.
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /DEFINES
|
||||||
|
.skip
|
||||||
|
Write an extra output file containing macro definitions for the token
|
||||||
|
type names defined in the grammar and the semantic value type
|
||||||
|
YYSTYPE, as well as a extern variable declarations.
|
||||||
|
.skip
|
||||||
|
If the parser output file is named "name.c" then this file
|
||||||
|
is named "name.h".
|
||||||
|
.skip
|
||||||
|
This output file is essential if you wish to put the definition of
|
||||||
|
yylex in a separate source file, because yylex needs to
|
||||||
|
be able to refer to token type codes and the variable
|
||||||
|
yylval.
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /FILE_PREFIX
|
||||||
|
.skip
|
||||||
|
.literal
|
||||||
|
/FILIE_PREFIX=prefix
|
||||||
|
.end literal
|
||||||
|
.skip
|
||||||
|
Specify a prefix to use for all Bison output file names. The names are
|
||||||
|
chosen as if the input file were named prefix.c
|
||||||
|
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /FIXED_OUTFILES
|
||||||
|
.skip
|
||||||
|
Equivalent to /OUTPUT=y_tab.c; the parser output file is called
|
||||||
|
y_tab.c, and the other outputs are called y.output and
|
||||||
|
y_tab.h. The purpose of this switch is to imitate Yacc's output
|
||||||
|
file name conventions. The /YACC qualifier is functionally equivalent
|
||||||
|
to /FIXED_OUTFILES. The following command definition will
|
||||||
|
work as a substitute for Yacc:
|
||||||
|
|
||||||
|
.literal
|
||||||
|
$YACC:==BISON/FIXED_OUTFILES
|
||||||
|
.end literal
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /NAME_PREFIX
|
||||||
|
.skip
|
||||||
|
.literal
|
||||||
|
/NAME_PREFIX=prefix
|
||||||
|
.end literal
|
||||||
|
.skip
|
||||||
|
Rename the external symbols used in the parser so that they start with
|
||||||
|
"prefix" instead of "yy". The precise list of symbols renamed
|
||||||
|
is yyparse, yylex, yyerror, yylval, yychar and yydebug.
|
||||||
|
|
||||||
|
For example, if you use /NAME_PREFIX="c", the names become cparse,
|
||||||
|
clex, and so on.
|
||||||
|
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /NOLINES
|
||||||
|
.skip
|
||||||
|
Don't put any "#line" preprocessor commands in the parser file.
|
||||||
|
Ordinarily Bison puts them in the parser file so that the C compiler
|
||||||
|
and debuggers will associate errors with your source file, the
|
||||||
|
grammar file. This option causes them to associate errors with the
|
||||||
|
parser file, treating it an independent source file in its own right.
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /NOPARSER
|
||||||
|
.skip
|
||||||
|
Do not generate the parser code into the output; generate only
|
||||||
|
declarations. The generated name_tab.c file will have only
|
||||||
|
constant declarations. In addition, a name.act file is
|
||||||
|
generated containing a switch statement body containing all the
|
||||||
|
translated actions.
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /OUTPUT
|
||||||
|
.skip
|
||||||
|
.literal
|
||||||
|
/OUTPUT=outfile
|
||||||
|
.end literal
|
||||||
|
.skip
|
||||||
|
Specify the name "outfile" for the parser file.
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /RAW
|
||||||
|
.skip
|
||||||
|
When this switch is specified, the .tab.h file defines the tokens to
|
||||||
|
have the bison token numbers rather than the yacc compatible numbers.
|
||||||
|
To employ this switch you would have to have your own parser.
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /TOKEN_TABLE
|
||||||
|
.skip
|
||||||
|
This switch causes the name_tab.c output to include a list of
|
||||||
|
token names in order by their token numbers; this is defined in the array
|
||||||
|
yytname. Also generated are #defines for YYNTOKENS, YYNNTS, YYNRULES,
|
||||||
|
and YYNSTATES.
|
||||||
|
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /VERBOSE
|
||||||
|
.skip
|
||||||
|
Write an extra output file containing verbose descriptions of the
|
||||||
|
parser states and what is done for each type of look-ahead token in
|
||||||
|
that state.
|
||||||
|
.skip
|
||||||
|
This file also describes all the conflicts, both those resolved by
|
||||||
|
operator precedence and the unresolved ones.
|
||||||
|
.skip
|
||||||
|
The file's name is made by removing _tab.c or .c from
|
||||||
|
the parser output file name, and adding .output instead.
|
||||||
|
.skip
|
||||||
|
Therefore, if the input file is foo.y, then the parser file is
|
||||||
|
called foo_tab.c by default. As a consequence, the verbose
|
||||||
|
output file is called foo.output.
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /VERSION
|
||||||
|
.skip
|
||||||
|
Print the version number of Bison.
|
||||||
|
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
2 /YACC
|
||||||
|
.skip
|
||||||
|
See /FIXED_OUTFILES.
|
||||||
|
.skip
|
||||||
|
.indent -1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+1066
-3809
File diff suppressed because it is too large
Load Diff
+89
-140
@@ -1,13 +1,12 @@
|
|||||||
|
|
||||||
@node GNU Free Documentation License
|
@node GNU Free Documentation License
|
||||||
@appendixsec GNU Free Documentation License
|
@appendixsec GNU Free Documentation License
|
||||||
|
|
||||||
@cindex FDL, GNU Free Documentation License
|
@cindex FDL, GNU Free Documentation License
|
||||||
@center Version 1.2, November 2002
|
@center Version 1.1, March 2000
|
||||||
|
|
||||||
@display
|
@display
|
||||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
Copyright @copyright{} 2000 Free Software Foundation, Inc.
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
@@ -18,12 +17,12 @@ of this license document, but changing it is not allowed.
|
|||||||
PREAMBLE
|
PREAMBLE
|
||||||
|
|
||||||
The purpose of this License is to make a manual, textbook, or other
|
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
|
written document @dfn{free} in the sense of freedom: to assure everyone
|
||||||
assure everyone the effective freedom to copy and redistribute it,
|
the effective freedom to copy and redistribute it, with or without
|
||||||
with or without modifying it, either commercially or noncommercially.
|
modifying it, either commercially or noncommercially. Secondarily,
|
||||||
Secondarily, this License preserves for the author and publisher a way
|
this License preserves for the author and publisher a way to get
|
||||||
to get credit for their work, while not being considered responsible
|
credit for their work, while not being considered responsible for
|
||||||
for modifications made by others.
|
modifications made by others.
|
||||||
|
|
||||||
This License is a kind of ``copyleft'', which means that derivative
|
This License is a kind of ``copyleft'', which means that derivative
|
||||||
works of the document must themselves be free in the same sense. It
|
works of the document must themselves be free in the same sense. It
|
||||||
@@ -41,69 +40,57 @@ principally for works whose purpose is instruction or reference.
|
|||||||
@item
|
@item
|
||||||
APPLICABILITY AND DEFINITIONS
|
APPLICABILITY AND DEFINITIONS
|
||||||
|
|
||||||
This License applies to any manual or other work, in any medium, that
|
This License applies to any manual or other work that contains a
|
||||||
contains a notice placed by the copyright holder saying it can be
|
notice placed by the copyright holder saying it can be distributed
|
||||||
distributed under the terms of this License. Such a notice grants a
|
under the terms of this License. The ``Document'', below, refers to any
|
||||||
world-wide, royalty-free license, unlimited in duration, to use that
|
such manual or work. Any member of the public is a licensee, and is
|
||||||
work under the conditions stated herein. The ``Document'', below,
|
addressed as ``you''.
|
||||||
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
|
A ``Modified Version'' of the Document means any work containing the
|
||||||
Document or a portion of it, either copied verbatim, or with
|
Document or a portion of it, either copied verbatim, or with
|
||||||
modifications and/or translated into another language.
|
modifications and/or translated into another language.
|
||||||
|
|
||||||
A ``Secondary Section'' is a named appendix or a front-matter section
|
A ``Secondary Section'' is a named appendix or a front-matter section of
|
||||||
of the Document that deals exclusively with the relationship of the
|
the Document that deals exclusively with the relationship of the
|
||||||
publishers or authors of the Document to the Document's overall
|
publishers or authors of the Document to the Document's overall subject
|
||||||
subject (or to related matters) and contains nothing that could fall
|
(or to related matters) and contains nothing that could fall directly
|
||||||
directly within that overall subject. (Thus, if the Document is in
|
within that overall subject. (For example, if the Document is in part a
|
||||||
part a textbook of mathematics, a Secondary Section may not explain
|
textbook of mathematics, a Secondary Section may not explain any
|
||||||
any mathematics.) The relationship could be a matter of historical
|
mathematics.) The relationship could be a matter of historical
|
||||||
connection with the subject or with related matters, or of legal,
|
connection with the subject or with related matters, or of legal,
|
||||||
commercial, philosophical, ethical or political position regarding
|
commercial, philosophical, ethical or political position regarding
|
||||||
them.
|
them.
|
||||||
|
|
||||||
The ``Invariant Sections'' are certain Secondary Sections whose titles
|
The ``Invariant Sections'' are certain Secondary Sections whose titles
|
||||||
are designated, as being those of Invariant Sections, in the notice
|
are designated, as being those of Invariant Sections, in the notice
|
||||||
that says that the Document is released under this License. If a
|
that says that the Document is released under this License.
|
||||||
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,
|
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
|
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
|
the Document is released under this License.
|
||||||
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,
|
A ``Transparent'' copy of the Document means a machine-readable copy,
|
||||||
represented in a format whose specification is available to the
|
represented in a format whose specification is available to the
|
||||||
general public, that is suitable for revising the document
|
general public, whose contents can be viewed and edited directly and
|
||||||
straightforwardly with generic text editors or (for images composed of
|
straightforwardly with generic text editors or (for images composed of
|
||||||
pixels) generic paint programs or (for drawings) some widely available
|
pixels) generic paint programs or (for drawings) some widely available
|
||||||
drawing editor, and that is suitable for input to text formatters or
|
drawing editor, and that is suitable for input to text formatters or
|
||||||
for automatic translation to a variety of formats suitable for input
|
for automatic translation to a variety of formats suitable for input
|
||||||
to text formatters. A copy made in an otherwise Transparent file
|
to text formatters. A copy made in an otherwise Transparent file
|
||||||
format whose markup, or absence of markup, has been arranged to thwart
|
format whose markup has been designed to thwart or discourage
|
||||||
or discourage subsequent modification by readers is not Transparent.
|
subsequent modification by readers is not Transparent. A copy that is
|
||||||
An image format is not Transparent if used for any substantial amount
|
not ``Transparent'' is called ``Opaque''.
|
||||||
of text. A copy that is not ``Transparent'' is called ``Opaque''.
|
|
||||||
|
|
||||||
Examples of suitable formats for Transparent copies include plain
|
Examples of suitable formats for Transparent copies include plain
|
||||||
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
|
@sc{ascii} without markup, Texinfo input format, La@TeX{} input format,
|
||||||
format, @acronym{SGML} or @acronym{XML} using a publicly available
|
@acronym{SGML} or @acronym{XML} using a publicly available
|
||||||
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
|
@acronym{DTD}, and standard-conforming simple @acronym{HTML} designed
|
||||||
PostScript or @acronym{PDF} designed for human modification. Examples
|
for human modification. Opaque formats include PostScript,
|
||||||
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
|
@acronym{PDF}, proprietary formats that can be read and edited only by
|
||||||
@acronym{JPG}. Opaque formats include proprietary formats that can be
|
proprietary word processors, @acronym{SGML} or @acronym{XML} for which
|
||||||
read and edited only by proprietary word processors, @acronym{SGML} or
|
the @acronym{DTD} and/or processing tools are not generally available,
|
||||||
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
|
and the machine-generated @acronym{HTML} produced by some word
|
||||||
not generally available, and the machine-generated @acronym{HTML},
|
processors for output purposes only.
|
||||||
PostScript or @acronym{PDF} produced by some word processors for
|
|
||||||
output purposes only.
|
|
||||||
|
|
||||||
The ``Title Page'' means, for a printed book, the title page itself,
|
The ``Title Page'' means, for a printed book, the title page itself,
|
||||||
plus such following pages as are needed to hold, legibly, the material
|
plus such following pages as are needed to hold, legibly, the material
|
||||||
@@ -112,21 +99,6 @@ 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,
|
the text near the most prominent appearance of the work's title,
|
||||||
preceding the beginning of the body of the text.
|
preceding the beginning of the body of the text.
|
||||||
|
|
||||||
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
|
@item
|
||||||
VERBATIM COPYING
|
VERBATIM COPYING
|
||||||
|
|
||||||
@@ -146,10 +118,9 @@ you may publicly display copies.
|
|||||||
@item
|
@item
|
||||||
COPYING IN QUANTITY
|
COPYING IN QUANTITY
|
||||||
|
|
||||||
If you publish printed copies (or copies in media that commonly have
|
If you publish printed copies of the Document numbering more than 100,
|
||||||
printed covers) of the Document, numbering more than 100, and the
|
and the Document's license notice requires Cover Texts, you must enclose
|
||||||
Document's license notice requires Cover Texts, you must enclose the
|
the copies in covers that carry, clearly and legibly, all these Cover
|
||||||
copies in covers that carry, clearly and legibly, all these Cover
|
|
||||||
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
||||||
the back cover. Both covers must also clearly and legibly identify
|
the back cover. Both covers must also clearly and legibly identify
|
||||||
you as the publisher of these copies. The front cover must present
|
you as the publisher of these copies. The front cover must present
|
||||||
@@ -167,15 +138,16 @@ pages.
|
|||||||
If you publish or distribute Opaque copies of the Document numbering
|
If you publish or distribute Opaque copies of the Document numbering
|
||||||
more than 100, you must either include a machine-readable Transparent
|
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
|
copy along with each Opaque copy, or state in or with each Opaque copy
|
||||||
a computer-network location from which the general network-using
|
a publicly-accessible computer-network location containing a complete
|
||||||
public has access to download using public-standard network protocols
|
Transparent copy of the Document, free of added material, which the
|
||||||
a complete Transparent copy of the Document, free of added material.
|
general network-using public has access to download anonymously at no
|
||||||
If you use the latter option, you must take reasonably prudent steps,
|
charge using public-standard network protocols. If you use the latter
|
||||||
when you begin distribution of Opaque copies in quantity, to ensure
|
option, you must take reasonably prudent steps, when you begin
|
||||||
that this Transparent copy will remain thus accessible at the stated
|
distribution of Opaque copies in quantity, to ensure that this
|
||||||
location until at least one year after the last time you distribute an
|
Transparent copy will remain thus accessible at the stated location
|
||||||
Opaque copy (directly or through your agents or retailers) of that
|
until at least one year after the last time you distribute an Opaque
|
||||||
edition to the public.
|
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
|
It is requested, but not required, that you contact the authors of the
|
||||||
Document well before redistributing any large number of copies, to give
|
Document well before redistributing any large number of copies, to give
|
||||||
@@ -203,8 +175,7 @@ if the original publisher of that version gives permission.
|
|||||||
List on the Title Page, as authors, one or more persons or entities
|
List on the Title Page, as authors, one or more persons or entities
|
||||||
responsible for authorship of the modifications in the Modified
|
responsible for authorship of the modifications in the Modified
|
||||||
Version, together with at least five of the principal authors of the
|
Version, together with at least five of the principal authors of the
|
||||||
Document (all of its principal authors, if it has fewer than five),
|
Document (all of its principal authors, if it has less than five).
|
||||||
unless they release you from this requirement.
|
|
||||||
|
|
||||||
@item
|
@item
|
||||||
State on the Title page the name of the publisher of the
|
State on the Title page the name of the publisher of the
|
||||||
@@ -230,10 +201,10 @@ and required Cover Texts given in the Document's license notice.
|
|||||||
Include an unaltered copy of this License.
|
Include an unaltered copy of this License.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Preserve the section Entitled ``History'', Preserve its Title, and add
|
Preserve the section entitled ``History'', and its title, and add to
|
||||||
to it an item stating at least the title, year, new authors, and
|
it an item stating at least the title, year, new authors, and
|
||||||
publisher of the Modified Version as given on the Title Page. If
|
publisher of the Modified Version as given on the Title Page. If
|
||||||
there is no section Entitled ``History'' in the Document, create one
|
there is no section entitled ``History'' in the Document, create one
|
||||||
stating the title, year, authors, and publisher of the Document as
|
stating the title, year, authors, and publisher of the Document as
|
||||||
given on its Title Page, then add an item describing the Modified
|
given on its Title Page, then add an item describing the Modified
|
||||||
Version as stated in the previous sentence.
|
Version as stated in the previous sentence.
|
||||||
@@ -248,10 +219,10 @@ least four years before the Document itself, or if the original
|
|||||||
publisher of the version it refers to gives permission.
|
publisher of the version it refers to gives permission.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
|
In any section entitled ``Acknowledgments'' or ``Dedications'',
|
||||||
the Title of the section, and preserve in the section all the
|
preserve the section's title, and preserve in the section all the
|
||||||
substance and tone of each of the contributor acknowledgements and/or
|
substance and tone of each of the contributor acknowledgments
|
||||||
dedications given therein.
|
and/or dedications given therein.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Preserve all the Invariant Sections of the Document,
|
Preserve all the Invariant Sections of the Document,
|
||||||
@@ -259,15 +230,12 @@ unaltered in their text and in their titles. Section numbers
|
|||||||
or the equivalent are not considered part of the section titles.
|
or the equivalent are not considered part of the section titles.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Delete any section Entitled ``Endorsements''. Such a section
|
Delete any section entitled ``Endorsements''. Such a section
|
||||||
may not be included in the Modified Version.
|
may not be included in the Modified Version.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Do not retitle any existing section to be Entitled ``Endorsements'' or
|
Do not retitle any existing section as ``Endorsements''
|
||||||
to conflict in title with any Invariant Section.
|
or to conflict in title with any Invariant Section.
|
||||||
|
|
||||||
@item
|
|
||||||
Preserve any Warranty Disclaimers.
|
|
||||||
@end enumerate
|
@end enumerate
|
||||||
|
|
||||||
If the Modified Version includes new front-matter sections or
|
If the Modified Version includes new front-matter sections or
|
||||||
@@ -277,7 +245,7 @@ of these sections as invariant. To do this, add their titles to the
|
|||||||
list of Invariant Sections in the Modified Version's license notice.
|
list of Invariant Sections in the Modified Version's license notice.
|
||||||
These titles must be distinct from any other section titles.
|
These titles must be distinct from any other section titles.
|
||||||
|
|
||||||
You may add a section Entitled ``Endorsements'', provided it contains
|
You may add a section entitled ``Endorsements'', provided it contains
|
||||||
nothing but endorsements of your Modified Version by various
|
nothing but endorsements of your Modified Version by various
|
||||||
parties---for example, statements of peer review or that the text has
|
parties---for example, statements of peer review or that the text has
|
||||||
been approved by an organization as the authoritative definition of a
|
been approved by an organization as the authoritative definition of a
|
||||||
@@ -305,7 +273,7 @@ License, under the terms defined in section 4 above for modified
|
|||||||
versions, provided that you include in the combination all of the
|
versions, provided that you include in the combination all of the
|
||||||
Invariant Sections of all of the original documents, unmodified, and
|
Invariant Sections of all of the original documents, unmodified, and
|
||||||
list them all as Invariant Sections of your combined work in its
|
list them all as Invariant Sections of your combined work in its
|
||||||
license notice, and that you preserve all their Warranty Disclaimers.
|
license notice.
|
||||||
|
|
||||||
The combined work need only contain one copy of this License, and
|
The combined work need only contain one copy of this License, and
|
||||||
multiple identical Invariant Sections may be replaced with a single
|
multiple identical Invariant Sections may be replaced with a single
|
||||||
@@ -316,11 +284,11 @@ 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
|
Make the same adjustment to the section titles in the list of
|
||||||
Invariant Sections in the license notice of the combined work.
|
Invariant Sections in the license notice of the combined work.
|
||||||
|
|
||||||
In the combination, you must combine any sections Entitled ``History''
|
In the combination, you must combine any sections entitled ``History''
|
||||||
in the various original documents, forming one section Entitled
|
in the various original documents, forming one section entitled
|
||||||
``History''; likewise combine any sections Entitled ``Acknowledgements'',
|
``History''; likewise combine any sections entitled ``Acknowledgments'',
|
||||||
and any sections Entitled ``Dedications''. You must delete all
|
and any sections entitled ``Dedications''. You must delete all sections
|
||||||
sections Entitled ``Endorsements.''
|
entitled ``Endorsements.''
|
||||||
|
|
||||||
@item
|
@item
|
||||||
COLLECTIONS OF DOCUMENTS
|
COLLECTIONS OF DOCUMENTS
|
||||||
@@ -341,20 +309,18 @@ AGGREGATION WITH INDEPENDENT WORKS
|
|||||||
|
|
||||||
A compilation of the Document or its derivatives with other separate
|
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
|
and independent documents or works, in or on a volume of a storage or
|
||||||
distribution medium, is called an ``aggregate'' if the copyright
|
distribution medium, does not as a whole count as a Modified Version
|
||||||
resulting from the compilation is not used to limit the legal rights
|
of the Document, provided no compilation copyright is claimed for the
|
||||||
of the compilation's users beyond what the individual works permit.
|
compilation. Such a compilation is called an ``aggregate'', and this
|
||||||
When the Document is included in an aggregate, this License does not
|
License does not apply to the other self-contained works thus compiled
|
||||||
apply to the other works in the aggregate which are not themselves
|
with the Document, on account of their being thus compiled, if they
|
||||||
derivative works of the Document.
|
are not themselves derivative works of the Document.
|
||||||
|
|
||||||
If the Cover Text requirement of section 3 is applicable to these
|
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
|
copies of the Document, then if the Document is less than one quarter
|
||||||
the entire aggregate, the Document's Cover Texts may be placed on
|
of the entire aggregate, the Document's Cover Texts may be placed on
|
||||||
covers that bracket the Document within the aggregate, or the
|
covers that surround only the Document within the aggregate.
|
||||||
electronic equivalent of covers if the Document is in electronic form.
|
Otherwise they must appear on covers around the whole aggregate.
|
||||||
Otherwise they must appear on printed covers that bracket the whole
|
|
||||||
aggregate.
|
|
||||||
|
|
||||||
@item
|
@item
|
||||||
TRANSLATION
|
TRANSLATION
|
||||||
@@ -365,17 +331,10 @@ Replacing Invariant Sections with translations requires special
|
|||||||
permission from their copyright holders, but you may include
|
permission from their copyright holders, but you may include
|
||||||
translations of some or all Invariant Sections in addition to the
|
translations of some or all Invariant Sections in addition to the
|
||||||
original versions of these Invariant Sections. You may include a
|
original versions of these Invariant Sections. You may include a
|
||||||
translation of this License, and all the license notices in the
|
translation of this License provided that you also include the
|
||||||
Document, and any Warranty Disclaimers, provided that you also include
|
original English version of this License. In case of a disagreement
|
||||||
the original English version of this License and the original versions
|
between the translation and the original English version of this
|
||||||
of those notices and disclaimers. In case of a disagreement between
|
License, the original English version will prevail.
|
||||||
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
|
@item
|
||||||
TERMINATION
|
TERMINATION
|
||||||
@@ -418,28 +377,19 @@ license notices just after the title page:
|
|||||||
@group
|
@group
|
||||||
Copyright (C) @var{year} @var{your name}.
|
Copyright (C) @var{year} @var{your name}.
|
||||||
Permission is granted to copy, distribute and/or modify this document
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
under the terms of the GNU Free Documentation License, Version 1.2
|
under the terms of the GNU Free Documentation License, Version 1.1
|
||||||
or any later version published by the Free Software Foundation;
|
or any later version published by the Free Software Foundation;
|
||||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
with the Invariant Sections being @var{list their titles}, with the
|
||||||
Texts. A copy of the license is included in the section entitled ``GNU
|
Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
|
||||||
|
A copy of the license is included in the section entitled ``GNU
|
||||||
Free Documentation License''.
|
Free Documentation License''.
|
||||||
@end group
|
@end group
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
If you have no Invariant Sections, write ``with no Invariant Sections''
|
||||||
replace the ``with...Texts.'' line with this:
|
instead of saying which ones are invariant. If you have no
|
||||||
|
Front-Cover Texts, write ``no Front-Cover Texts'' instead of
|
||||||
@smallexample
|
``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
|
||||||
@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
|
If your document contains nontrivial examples of program code, we
|
||||||
recommend releasing these examples in parallel under your choice of
|
recommend releasing these examples in parallel under your choice of
|
||||||
@@ -449,4 +399,3 @@ to permit their use in free software.
|
|||||||
@c Local Variables:
|
@c Local Variables:
|
||||||
@c ispell-local-pdict: "ispell-dict"
|
@c ispell-local-pdict: "ispell-dict"
|
||||||
@c End:
|
@c End:
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
@display
|
@display
|
||||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
@@ -352,7 +352,7 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|||||||
+44
-50
@@ -6,7 +6,7 @@
|
|||||||
% This file can be printed with 1 or 2 columns per page (see below).
|
% This file can be printed with 1 or 2 columns per page (see below).
|
||||||
% Specify how many you want here. Nothing else needs to be changed
|
% Specify how many you want here. Nothing else needs to be changed
|
||||||
% unless you are maintaining the documentation.
|
% unless you are maintaining the documentation.
|
||||||
% For printing reference cards to use in books, specify one column
|
% For printing reference cards to use in books, specify one column
|
||||||
% per page and reduce to 80%.
|
% per page and reduce to 80%.
|
||||||
% Note that if columnsperpage is set to 2, there will be a few overfull
|
% Note that if columnsperpage is set to 2, there will be a few overfull
|
||||||
% boxes, but they are not serious. Just uncomment \finalout.
|
% boxes, but they are not serious. Just uncomment \finalout.
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
\def\finalout{\overfullrule=0pt}
|
\def\finalout{\overfullrule=0pt}
|
||||||
%\finalout
|
%\finalout
|
||||||
|
|
||||||
% Copyright (c) 1998, 2001 Free Software Foundation, Inc.
|
% Copyright (c) 1998 Free Software Foundation, Inc.
|
||||||
%
|
%
|
||||||
% This file is part of Bison.
|
% This file is part of Bison.
|
||||||
%
|
%
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
%
|
%
|
||||||
% You should have received a copy of the GNU General Public License
|
% You should have received a copy of the GNU General Public License
|
||||||
% along with either Flex or Bison; see the file COPYING. If not, write
|
% along with either Flex or Bison; see the file COPYING. If not, write
|
||||||
% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
% Boston, MA 02110-1301, USA.
|
% Boston, MA 02111-1307, USA.
|
||||||
%
|
%
|
||||||
% This file is intended to be processed by plain TeX (TeX82).
|
% This file is intended to be processed by plain TeX (TeX82).
|
||||||
%
|
%
|
||||||
@@ -51,11 +51,11 @@
|
|||||||
% Which mode to use is controlled by setting \columnsperpage above.
|
% Which mode to use is controlled by setting \columnsperpage above.
|
||||||
%
|
%
|
||||||
% Authors:
|
% Authors:
|
||||||
% Brendan Kehoe
|
% Brendan Kehoe
|
||||||
% UUCP: widener!brendan
|
% UUCP: widener!brendan
|
||||||
% Internet: [email protected]
|
% Internet: [email protected]
|
||||||
%
|
%
|
||||||
% Gavin Nicol
|
% Gavin Nicol
|
||||||
% Internet: [email protected]
|
% Internet: [email protected]
|
||||||
%
|
%
|
||||||
% This refcard format was created by Steve Gildea.
|
% This refcard format was created by Steve Gildea.
|
||||||
@@ -66,12 +66,12 @@
|
|||||||
% We only change the following to change the version numbers and
|
% We only change the following to change the version numbers and
|
||||||
% such.
|
% such.
|
||||||
|
|
||||||
\def\bisonversion{1.31} % the bison version
|
\def\bisonversion{1.20} % the bison version
|
||||||
|
|
||||||
\def\refcardversion{0.5} % reference card version
|
\def\refcardversion{0.4a} % reference card version
|
||||||
\def\month{November} % month
|
\def\month{August} % month
|
||||||
\def\year{2001} % year
|
\def\year{1998} % year
|
||||||
\def\version{\month\ \year, Bison Refcard Version \refcardversion}
|
\def\version{\month\ \year, Bison Refcard Version \refcardversion}
|
||||||
|
|
||||||
% for copyright notices
|
% for copyright notices
|
||||||
\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
|
\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
|
||||||
@@ -90,15 +90,15 @@
|
|||||||
|
|
||||||
Permission is granted to make and distribute copies of this card
|
Permission is granted to make and distribute copies of this card
|
||||||
provided the copyright notice and this permission notice
|
provided the copyright notice and this permission notice
|
||||||
are preserved on all copies.
|
are preserved on all copies.
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
For information, write to the:
|
For information, write to the:
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{Free Software Foundation, Inc.}
|
\centerline{Free Software Foundation, Inc.}
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{51 Franklin Street, Fifth Floor}
|
\centerline{59 Temple Place - Suite 330}
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{Boston, MA 02110-1301 USA}
|
\centerline{Boston, MA 02111-1307 USA}
|
||||||
\endgroup}
|
\endgroup}
|
||||||
|
|
||||||
%%%% smallcopyrightnotice for two column printing on one page.
|
%%%% smallcopyrightnotice for two column printing on one page.
|
||||||
@@ -115,15 +115,15 @@ For information, write to the:
|
|||||||
|
|
||||||
Permission is granted to make and distribute copies of this card
|
Permission is granted to make and distribute copies of this card
|
||||||
provided the copyright notice and this permission notice
|
provided the copyright notice and this permission notice
|
||||||
are preserved on all copies.
|
are preserved on all copies.
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
For information, write to the:
|
For information, write to the:
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{Free Software Foundation, Inc.}
|
\centerline{Free Software Foundation, Inc.}
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{51 Franklin Street, Fifth Floor}
|
\centerline{59 Temple Place - Suite 330}
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{Boston, MA 02110-1301 USA}
|
\centerline{Boston, MA 02111-1307 USA}
|
||||||
\endgroup}
|
\endgroup}
|
||||||
|
|
||||||
% make \bye not \outer so that the \def\bye in the \else clause below
|
% make \bye not \outer so that the \def\bye in the \else clause below
|
||||||
@@ -136,7 +136,7 @@ For information, write to the:
|
|||||||
|
|
||||||
\def\ncolumns{\the\columnsperpage}
|
\def\ncolumns{\the\columnsperpage}
|
||||||
|
|
||||||
\message{[\ncolumns\space
|
\message{[\ncolumns\space
|
||||||
column\if 1\ncolumns\else s\fi\space per page]}
|
column\if 1\ncolumns\else s\fi\space per page]}
|
||||||
|
|
||||||
\def\scaledmag#1{ scaled \magstep #1}
|
\def\scaledmag#1{ scaled \magstep #1}
|
||||||
@@ -227,7 +227,7 @@ For information, write to the:
|
|||||||
\def\bye{\par\vfill\supereject
|
\def\bye{\par\vfill\supereject
|
||||||
\if a\abc \else\null\vfill\eject\fi
|
\if a\abc \else\null\vfill\eject\fi
|
||||||
\if a\abc \else\null\vfill\eject\fi
|
\if a\abc \else\null\vfill\eject\fi
|
||||||
\end}
|
\end}
|
||||||
\fi
|
\fi
|
||||||
|
|
||||||
% we won't be using math mode much, so redefine some of the characters
|
% we won't be using math mode much, so redefine some of the characters
|
||||||
@@ -316,44 +316,41 @@ Options can be used as: \kbd{bison {\it options} {\it filename}}
|
|||||||
\section{Command Line Options}
|
\section{Command Line Options}
|
||||||
%*****************************
|
%*****************************
|
||||||
|
|
||||||
\key{Display usage information.} {-h}
|
|
||||||
\key{Display version information.} {-V}
|
|
||||||
\key{Generate token and {\tt YYSTYPE} definitions.} {-d}
|
\key{Generate token and {\tt YYSTYPE} definitions.} {-d}
|
||||||
\key{Prepend a prefix to external symbols.} {-p {\it prefix}}
|
|
||||||
\key{Don't put {\tt \#line} directives in the parser.} {-l}
|
\key{Don't put {\tt \#line} directives in the parser.} {-l}
|
||||||
\key{Specify the output file.} {-o {\it filename}}
|
\key{Specify the output file.} {-o {\it filename}}
|
||||||
\key{Debug or {\it trace} mode.} {-t}
|
\key{Debug or {\it trace} mode.} {-t}
|
||||||
\key{Verbose description of the parser.} {-v}
|
\key{Verbose description of the parser.} {-v}
|
||||||
\key{Emulate {\tt yacc} (generate {\tt y.tab.*} files).} {-y}
|
\key{Emulate {\tt yacc} (generate {\tt y.tab.*} files).} {-y}
|
||||||
|
|
||||||
\vskip .10truein
|
\vskip .10truein
|
||||||
{\bf Note:} The token and {\tt YYSTYPE} definitions are generated
|
{\bf Note:} The token and {\tt YYSTYPE} definitions are generated
|
||||||
to a file called {\tt y.tab.h} if the {\tt -y} option is used,
|
to a file called {\tt y.tab.h} if the {\tt -y} option is used,
|
||||||
otherwise it will have the format {\tt {\it name}.tab.h}, where
|
otherwise it will have the format {\tt {\it name}.tab.h}, where
|
||||||
{\it name} is the leading part of the parser definition filename.
|
{\it name} is the leading part of the parser definition filename.
|
||||||
|
|
||||||
\section{Definitions}
|
\section{Definitions}
|
||||||
%********************
|
%********************
|
||||||
|
|
||||||
\key{Declare a terminal symbol.}{\%token <{\it t\/}>
|
\key{Declare a terminal symbol.}{\%token <{\it t\/}>
|
||||||
{\it n}}
|
{\it n}}
|
||||||
|
|
||||||
\key{Declare a terminal symbol, and define its association.}
|
\key{Declare a terminal symbol, and define its association.}
|
||||||
{{\it association} <{\it t\/}> {\it n}}
|
{{\it association} <{\it t\/}> {\it n}}
|
||||||
|
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\key{Generate a reentrant (pure) parser.}
|
\key{Generate a reentrant (pure) parser.}
|
||||||
{\%pure_parser}
|
{\%pure_parser}
|
||||||
|
|
||||||
\key{Define the union of all data types used in the parser.}
|
\key{Define the union of all data types used in the parser.}
|
||||||
{\%union\{{\it field list}\} }
|
{\%union\{{\it field list}\} }
|
||||||
|
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\key{Tell {\tt bison} where to start parsing.}
|
\key{Tell {\tt bison} where to start parsing.}
|
||||||
{\%start {\it m}}
|
{\%start {\it m}}
|
||||||
|
|
||||||
\key{Tell {\tt bison} the data type of symbols.}
|
\key{Tell {\tt bison} the data type of symbols.}
|
||||||
{\%type <{\it t\/}> {\it s1}\dots{\it sn}}
|
{\%type <{\it t\/}> {\it s1}\dots{\it sn}}
|
||||||
|
|
||||||
\vskip .10truein
|
\vskip .10truein
|
||||||
|
|
||||||
@@ -365,8 +362,8 @@ definition, {\it n} is a {\it terminal} symbol name, {\it m} is a
|
|||||||
\vskip .10truein
|
\vskip .10truein
|
||||||
|
|
||||||
The {\tt <{\it t\/}>} after {\tt \%token, \%left, \%right} and {\tt
|
The {\tt <{\it t\/}>} after {\tt \%token, \%left, \%right} and {\tt
|
||||||
\%nonassoc} is optional. Additionally, precedence may be overridden
|
\%nonassoc} is optional. Additionally, precedence may be overridden with
|
||||||
in the rules with {\tt \%prec} commands.
|
embedded {\tt \%prec} commands.
|
||||||
|
|
||||||
\section{Parser Definition Files}
|
\section{Parser Definition Files}
|
||||||
%*********************************
|
%*********************************
|
||||||
@@ -382,7 +379,7 @@ The general form for a parser definition is:
|
|||||||
|
|
||||||
\%\%
|
\%\%
|
||||||
|
|
||||||
Rule definition 1
|
Rule definition 1
|
||||||
\vdots
|
\vdots
|
||||||
Rule definition {\it n}
|
Rule definition {\it n}
|
||||||
|
|
||||||
@@ -400,9 +397,8 @@ The general form for a parser definition is:
|
|||||||
|
|
||||||
Rules take the form:
|
Rules take the form:
|
||||||
|
|
||||||
\vskip -\baselineskip
|
|
||||||
\beginexample
|
\beginexample
|
||||||
non-terminal : {\it statement} 1
|
non-terminal : {\it statement} 1
|
||||||
| {\it statement} 2
|
| {\it statement} 2
|
||||||
\vdots
|
\vdots
|
||||||
| {\it statement n}
|
| {\it statement n}
|
||||||
@@ -410,12 +406,12 @@ Rules take the form:
|
|||||||
\endexample
|
\endexample
|
||||||
|
|
||||||
Where {\it statements} can be either empty, or contain
|
Where {\it statements} can be either empty, or contain
|
||||||
a mixture of C code (enclosed in {\tt \{...\}}), and the
|
a mixture of C code (enclosed in {\tt \{...\}}), and the
|
||||||
symbols that make up the non-terminal. For example:
|
symbols that make up the non-terminal. For example:
|
||||||
|
|
||||||
\vskip -\baselineskip
|
\vskip -\baselineskip
|
||||||
\beginexample
|
\beginexample
|
||||||
expression : number '$+$' number \{ \$\$ $=$ \$1 $+$ \$3 \}
|
expression : number '$+$' number \{ \$\$ $=$ \$1 $+$ \$3 \}
|
||||||
| number '$-$' number \{ \$\$ $=$ \$1 $-$ \$3 \}
|
| number '$-$' number \{ \$\$ $=$ \$1 $-$ \$3 \}
|
||||||
| number '$/$' number \{ \$\$ $=$ \$1 $/$ \$3 \}
|
| number '$/$' number \{ \$\$ $=$ \$1 $/$ \$3 \}
|
||||||
| number '$*$' number \{ \$\$ $=$ \$1 $*$ \$3 \}
|
| number '$*$' number \{ \$\$ $=$ \$1 $*$ \$3 \}
|
||||||
@@ -432,7 +428,7 @@ For altering the precedence of a symbol use:
|
|||||||
For example:
|
For example:
|
||||||
\vskip -\baselineskip
|
\vskip -\baselineskip
|
||||||
\beginexample
|
\beginexample
|
||||||
foo : gnu bar gnu \%prec bar
|
foo : gnu bar gnu \%prec bar
|
||||||
;
|
;
|
||||||
\endexample
|
\endexample
|
||||||
|
|
||||||
@@ -442,18 +438,16 @@ For example:
|
|||||||
\key{Recognize an error \& continue parsing.}{error}
|
\key{Recognize an error \& continue parsing.}{error}
|
||||||
\key{Access data associated with a symbol.} {\$\$, \$0\dots\${\it n}}
|
\key{Access data associated with a symbol.} {\$\$, \$0\dots\${\it n}}
|
||||||
\key{Access a field of the data union.} {\$\$.{\it t},
|
\key{Access a field of the data union.} {\$\$.{\it t},
|
||||||
\$0.{\it t}\dots\${\it n}.{\it t}}
|
\$0.{\it t}\dots\${\it n}.{\it t}}
|
||||||
\key{Access symbol's location.} {@\$, @0\dots@{\it n}}
|
\key{Access data's line position.} {@{\it n}.{\it line\_spec}}
|
||||||
\key{Access data's line location.} {@{\it x}.{\it line\_spec}}
|
\key{Access data's column position.} {@{\it n}.{\it column\_spec}}
|
||||||
\key{Access data's column location.} {@{\it x}.{\it column\_spec}}
|
|
||||||
|
|
||||||
|
|
||||||
\vskip .10truein
|
\vskip .10truein
|
||||||
%
|
|
||||||
Where {\it t} is a type defined in the {\tt \%union}, {\it n} is a
|
Where {\it t} is a type defined in the {\tt \%union}, {\it n} is a
|
||||||
number, {\it x} is a number or \$, {\it line\_spec} one of {\tt
|
number, {\it line\_spec} one of {\tt first_line} and {\tt last_line},
|
||||||
first_line} and {\tt last_line}, and {\it column\_spec} is specified
|
and {\it column\_spec} is specified as either {\tt first_column} or {\tt
|
||||||
as either {\tt first_column} or {\tt last_column}.
|
last_column}.
|
||||||
|
|
||||||
\section {Variables and Types}
|
\section {Variables and Types}
|
||||||
%*****************************
|
%*****************************
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
@set UPDATED 20 September 2001
|
||||||
|
@set UPDATED-MONTH September 2001
|
||||||
|
@set EDITION 1.30
|
||||||
|
@set VERSION 1.30
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
@set UPDATED 20 September 2001
|
||||||
|
@set UPDATED-MONTH September 2001
|
||||||
|
@set EDITION 1.30
|
||||||
|
@set VERSION 1.30
|
||||||
Executable
+300
@@ -0,0 +1,300 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# clcommit version 0.9.5
|
||||||
|
|
||||||
|
# Copyright (C) 1999, 2000, Free Software Foundation
|
||||||
|
|
||||||
|
# This script is Free Software, and it can be copied, distributed and
|
||||||
|
# modified as defined in the GNU General Public License. A copy of
|
||||||
|
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
|
# Originally by Gary V. Vaughan <[email protected]>
|
||||||
|
# Pretty much rewritten by Alexandre Oliva <[email protected]>
|
||||||
|
|
||||||
|
# This scripts eases checking in changes to CVS-maintained projects
|
||||||
|
# with ChangeLog files. It will check that there have been no
|
||||||
|
# conflicting commits in the CVS repository and print which files it
|
||||||
|
# is going to commit to stderr. A list of files to compare and to
|
||||||
|
# check in can be given in the command line. If it is not given, all
|
||||||
|
# files in the current directory (and below, unless `-l' is given) are
|
||||||
|
# considered for check in.
|
||||||
|
|
||||||
|
# The commit message will be extracted from the differences between a
|
||||||
|
# file named ChangeLog* in the commit list, or named after -C, and the
|
||||||
|
# one in the repository (unless a message was specified with `-m' or
|
||||||
|
# `-F'). An empty message is not accepted (but a blank line is). If
|
||||||
|
# the message is acceptable, it will be presented for verification
|
||||||
|
# (and possible edition) using the $PAGER environment variable (or
|
||||||
|
# `more', if it is not set, or `cat', if the `-f' switch is given).
|
||||||
|
# If $PAGER exits successfully, the modified files (at that moment)
|
||||||
|
# are checked in, unless `-n' was specified, in which case nothing is
|
||||||
|
# checked in.
|
||||||
|
|
||||||
|
# usage: clcommit [-v] [-h] [-f] [-l] [-n] [-q] [-z N] [-C ChangeLog_file]
|
||||||
|
# [-m msg|-F msg_file|-1] [--] [file|dir ...]
|
||||||
|
|
||||||
|
# -f --force don't check (unless *followed* by -n), and just
|
||||||
|
# display commit message instead of running $PAGER
|
||||||
|
# -l --local don't descend into subdirectories
|
||||||
|
# -m msg --message=msg set commit message
|
||||||
|
# --msg=msg same as -m
|
||||||
|
# -F file --file=file read commit message from file
|
||||||
|
# -1 --first extract first entry from ChangeLog, no cvs diff
|
||||||
|
# -C file --changelog=file extract commit message from specified ChangeLog
|
||||||
|
# --fast same as --force --first
|
||||||
|
# -n --dry-run don't commit anything
|
||||||
|
# -q --quiet run cvs in quiet mode
|
||||||
|
# -zN --compress=N set compression level (0-9, 0=none, 9=max)
|
||||||
|
# -v --version print version information
|
||||||
|
# -h,-? --help print short or long help message
|
||||||
|
|
||||||
|
name=clcommit
|
||||||
|
: ${CVS=cvs}
|
||||||
|
cvsopt=
|
||||||
|
updateopt=
|
||||||
|
commitopt=
|
||||||
|
dry_run=false
|
||||||
|
commit=:
|
||||||
|
update=:
|
||||||
|
log_file="${TMPDIR-/tmp}/commitlog.$$"
|
||||||
|
first=false
|
||||||
|
|
||||||
|
rm -f "$log_file"
|
||||||
|
trap 'rm -f "$log_file"; exit 1' 1 2 15
|
||||||
|
|
||||||
|
# this just eases exit handling
|
||||||
|
main_repeat=":"
|
||||||
|
while $main_repeat; do
|
||||||
|
|
||||||
|
repeat="test $# -gt 0"
|
||||||
|
while $repeat; do
|
||||||
|
case "$1" in
|
||||||
|
--fast)
|
||||||
|
shift
|
||||||
|
set fnord --force --first ${1+"$@"}
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-f|--force)
|
||||||
|
update=false
|
||||||
|
PAGER=cat
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-l|--local)
|
||||||
|
updateopt="$updateopt -l"
|
||||||
|
commitopt="$commitopt -l"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-m|--message|--msg)
|
||||||
|
if test $# = 1; then
|
||||||
|
echo "$name: missing argument for $1" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if $first || test -f "$log_file"; then
|
||||||
|
echo "$name: you can have at most one of -m, -F and -1" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
echo "$1" > "$log_file"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-F|--file)
|
||||||
|
if $first || test -f "$log_file"; then
|
||||||
|
echo "$name: you can have at most one of -m, -F and -1" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if test $# = 1; then
|
||||||
|
echo "$name: missing argument for $1" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
if cat < "$1" > "$log_file"; then :; else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-1|--first)
|
||||||
|
if test -f "$log_File"; then
|
||||||
|
echo "$name: you can have at most one of -m, -F and -1" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
first=:
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-C|--[cC]hange[lL]og)
|
||||||
|
if test $# = 1; then
|
||||||
|
echo "$name: missing argument for $1" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
if test ! -f "$1"; then
|
||||||
|
echo "$name: ChangeLog file \`$1' does not exist" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
ChangeLog="$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-n|--dry-run)
|
||||||
|
commit=false
|
||||||
|
update=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-q|--quiet)
|
||||||
|
cvsopt="$cvsopt -q"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-v|--verbose)
|
||||||
|
cvsopt="$cvsopt -t"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-z|--compress)
|
||||||
|
if test $# = 1; then
|
||||||
|
echo "$name: missing argument for $1" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
case "$2" in
|
||||||
|
[0-9]) :;;
|
||||||
|
*) echo "$name: invalid argument for $1" >&2
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
cvsopt="$cvsopt -z$2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-m*|-F*|-C*|-z*)
|
||||||
|
opt=`echo "$1" | sed '1s/^\(..\).*$/\1/;q'`
|
||||||
|
arg=`echo "$1" | sed '1s/^-[a-zA-Z0-9]//'`
|
||||||
|
shift
|
||||||
|
set -- "$opt" "$arg" ${1+"$@"}
|
||||||
|
;;
|
||||||
|
--message=*|--msg=*|--file=*|--[Cc]hange[Ll]og=*|--compress=*)
|
||||||
|
opt=`echo "$1" | sed '1s/^\(--[^=]*\)=.*/\1/;q'`
|
||||||
|
arg=`echo "$1" | sed '1s/^--[^=]*=//'`
|
||||||
|
shift
|
||||||
|
set -- "$opt" "$arg" ${1+"$@"}
|
||||||
|
;;
|
||||||
|
|
||||||
|
-v|--version)
|
||||||
|
sed '/^# '$name' version /,/^# Heavily modified by/ { s/^# //; p; }; d' < $0
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
-\?|-h)
|
||||||
|
sed '/^# usage:/,/# -h/ { s/^# //; p; }; d' < $0 &&
|
||||||
|
echo
|
||||||
|
echo "run \`$name --help | more' for full usage"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--help)
|
||||||
|
sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
shift
|
||||||
|
repeat=false
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
echo "$name: invalid flag $1" >&2
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
repeat=false
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
# might have used break 2 within the previous loop, but so what
|
||||||
|
$repeat && break
|
||||||
|
|
||||||
|
$update && \
|
||||||
|
if echo "$name: checking for conflicts..." >&2
|
||||||
|
($CVS $cvsopt -q -n update $updateopt ${1+"$@"} 2>/dev/null \
|
||||||
|
| while read line; do
|
||||||
|
echo "$line"
|
||||||
|
echo "$line" >&3
|
||||||
|
done | grep '^C') 3>&1 >/dev/null; then
|
||||||
|
echo "$name: some conflicts were found, aborting..." >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test ! -f "$log_file"; then
|
||||||
|
if test -z "$ChangeLog"; then
|
||||||
|
for f in ${1+"$@"}; do
|
||||||
|
case "$f" in
|
||||||
|
ChangeLog* | */ChangeLog*)
|
||||||
|
if test -z "$ChangeLog"; then
|
||||||
|
ChangeLog="$f"
|
||||||
|
else
|
||||||
|
echo "$name: multiple ChangeLog files: $ChangeLog and $f" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$name: checking commit message..." >&2
|
||||||
|
if $first; then
|
||||||
|
skipping=:
|
||||||
|
sed 's,^,+,' < ${ChangeLog-ChangeLog} |
|
||||||
|
while read line; do
|
||||||
|
case "$line" in
|
||||||
|
"+2"*) if $skipping; then skipping=false; else break; fi;;
|
||||||
|
"+ "*)
|
||||||
|
echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
|
||||||
|
echo "$line" | sed 's/^.//' >&2;;
|
||||||
|
"+ "*)
|
||||||
|
$skipping || echo "$line" ;;
|
||||||
|
esac
|
||||||
|
done |
|
||||||
|
sed 's,^\+ ,,' > "$log_file" || break
|
||||||
|
else
|
||||||
|
$CVS $cvsopt diff -u ${ChangeLog-ChangeLog} |
|
||||||
|
while read line; do
|
||||||
|
case $line in
|
||||||
|
"--- "*) :;;
|
||||||
|
"-"*)
|
||||||
|
echo "$name: *** Warning: the following line in ChangeLog diff is suspicious:" >&2
|
||||||
|
echo "$line" | sed 's/^.//' >&2;;
|
||||||
|
"+ "*)
|
||||||
|
echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
|
||||||
|
echo "$line" | sed 's/^.//' >&2;;
|
||||||
|
"+") echo;;
|
||||||
|
"+ "*) echo "$line";;
|
||||||
|
esac
|
||||||
|
done |
|
||||||
|
sed -e 's,\+ ,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
|
||||||
|
|| break
|
||||||
|
fi
|
||||||
|
# The sed script above removes "+TAB" from the beginning of a line, then
|
||||||
|
# deletes the first and/or the last line, when they happen to be empty
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep '[^ ]' < "$log_file" > /dev/null; then :; else
|
||||||
|
echo "$name: empty commit message, aborting" >&2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep '^$' < "$log_file" > /dev/null; then
|
||||||
|
echo "$name: *** Warning: blank lines should not appear within commit messages." >&2
|
||||||
|
echo "$name: *** They should be used to separate distinct commits." >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
${PAGER-more} "$log_file" || break
|
||||||
|
|
||||||
|
sleep 1 # give the user some time for a ^C
|
||||||
|
|
||||||
|
# Do not check for empty $log_file again, even though the user might have
|
||||||
|
# zeroed it out. If s/he did, it was probably intentional.
|
||||||
|
|
||||||
|
if $commit; then
|
||||||
|
$CVS $cvsopt commit $commitopt -F $log_file ${1+"$@"} || break
|
||||||
|
fi
|
||||||
|
|
||||||
|
main_repeat=false
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -f "$log_file"
|
||||||
|
|
||||||
|
# if main_repeat was not set to `false', we failed
|
||||||
|
$main_repeat && exit 1
|
||||||
|
exit 0
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
|
||||||
## Copyright (C) 2005 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 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
SUBDIRS = calc++
|
|
||||||
|
|
||||||
dist_noinst_SCRIPTS = extexi
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
*.cc
|
|
||||||
*.hh
|
|
||||||
*.ll
|
|
||||||
*.output
|
|
||||||
*.stamp
|
|
||||||
*.tmp
|
|
||||||
*.yy
|
|
||||||
.deps
|
|
||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
calc++
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
|
||||||
## Copyright (C) 2005 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 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
## ------------------------------------- ##
|
|
||||||
## Running the bison from this tarball. ##
|
|
||||||
## ------------------------------------- ##
|
|
||||||
|
|
||||||
BISON = $(top_builddir)/tests/bison
|
|
||||||
BISON_IN = $(top_srcdir)/tests/bison.in
|
|
||||||
|
|
||||||
$(BISON): $(BISON_IN)
|
|
||||||
cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) bison
|
|
||||||
|
|
||||||
## ------------ ##
|
|
||||||
## Extracting. ##
|
|
||||||
## ------------ ##
|
|
||||||
|
|
||||||
doc = $(top_srcdir)/doc/bison.texinfo
|
|
||||||
extexi = $(top_srcdir)/examples/extexi
|
|
||||||
# Extract in src.
|
|
||||||
$(calc_extracted): $(doc) $(extexi)
|
|
||||||
cd $(srcdir) && \
|
|
||||||
$(AWK) -f ../extexi ../../doc/bison.texinfo -- \
|
|
||||||
calc++-parser.yy \
|
|
||||||
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------- ##
|
|
||||||
## Parser generation. ##
|
|
||||||
## ------------------- ##
|
|
||||||
|
|
||||||
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
|
||||||
CLEANFILES = $(srcdir)/*.output *.tmp
|
|
||||||
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
|
||||||
|
|
||||||
# Compile the parser and save cycles.
|
|
||||||
# This code comes from "Handling Tools that Produce Many Outputs",
|
|
||||||
# from the Automake documentation.
|
|
||||||
EXTRA_DIST = $(srcdir)/calc++-parser.stamp $(srcdir)/calc++-parser.yy
|
|
||||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
|
||||||
# in srcdir, including during distcheck, which is forbidden.
|
|
||||||
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
|
||||||
@rm -f calc++-parser.tmp
|
|
||||||
@touch calc++-parser.tmp
|
|
||||||
$(BISON) -d -ra -S lalr1.cc -o $(srcdir)/calc++-parser.cc \
|
|
||||||
$(srcdir)/calc++-parser.yy
|
|
||||||
@mv -f calc++-parser.tmp $@
|
|
||||||
|
|
||||||
$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
|
||||||
@if test -f $@; then :; else \
|
|
||||||
rm -f $(srcdir)/calc++-parser.stamp && \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
## --------------------------- ##
|
|
||||||
## Building & testing calc++. ##
|
|
||||||
## --------------------------- ##
|
|
||||||
|
|
||||||
noinst_PROGRAMS = calc++
|
|
||||||
|
|
||||||
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
|
||||||
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
|
||||||
calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
|
|
||||||
calc_sources_generated = \
|
|
||||||
$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
|
|
||||||
$(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
|
|
||||||
|
|
||||||
calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
|
|
||||||
|
|
||||||
TESTS = test
|
|
||||||
EXTRA_DIST += $(TESTS)
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
set +e
|
|
||||||
cat >input <<EOF
|
|
||||||
a := 1
|
|
||||||
b := 2
|
|
||||||
c := 3
|
|
||||||
d := a + b * c
|
|
||||||
d
|
|
||||||
EOF
|
|
||||||
|
|
||||||
./calc++ input
|
|
||||||
./calc++ -p input
|
|
||||||
|
|
||||||
cat >input <<EOF
|
|
||||||
a := 1
|
|
||||||
d := a + b * c
|
|
||||||
EOF
|
|
||||||
./calc++ input
|
|
||||||
|
|
||||||
set -x
|
|
||||||
echo toto
|
|
||||||
cat >input <<EOF
|
|
||||||
toto := 1
|
|
||||||
toto
|
|
||||||
EOF
|
|
||||||
./calc++ -s input
|
|
||||||
|
|
||||||
rm input
|
|
||||||
-136
@@ -1,136 +0,0 @@
|
|||||||
# Extract all examples from the manual source. -*- AWK -*-
|
|
||||||
|
|
||||||
# This file is part of GNU Bison
|
|
||||||
# Copyright 1992, 2000, 2001, 2005 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 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
||||||
# 02111-1307 USA
|
|
||||||
|
|
||||||
# This script is for use with any Awk that conforms to POSIX.
|
|
||||||
# It was derived from a similar script tests/generate.awk in GNU m4.
|
|
||||||
#
|
|
||||||
# Usage: extexi input-file.texi ... -- [FILES to extract]
|
|
||||||
BEGIN {
|
|
||||||
if (!output_dir)
|
|
||||||
output_dir = ".";
|
|
||||||
for (argc = 1; argc < ARGC; ++argc)
|
|
||||||
if (ARGV[argc] == "--")
|
|
||||||
break;
|
|
||||||
for (i = argc + 1; i < ARGC; ++i)
|
|
||||||
file_wanted[ARGV[i]] = 1;
|
|
||||||
ARGC = argc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/^@node / {
|
|
||||||
if (seq > 0)
|
|
||||||
print "AT_CLEANUP";
|
|
||||||
|
|
||||||
split ($0, tmp, ",");
|
|
||||||
node = substr(tmp[1], 7);
|
|
||||||
seq = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/^@comment file: / {
|
|
||||||
if (!file_wanted[$3])
|
|
||||||
message("ignoring " $3);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message("extracting " $3);
|
|
||||||
file = $3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/^@example$/, /^@end example$/ {
|
|
||||||
if (!file)
|
|
||||||
next;
|
|
||||||
|
|
||||||
if ($0 ~ /^@example$/)
|
|
||||||
{
|
|
||||||
input = files_output[file] ? "\n" : "";
|
|
||||||
|
|
||||||
# FNR is starting at 0 instead of 1, and
|
|
||||||
# #line report the line number of the *next* line.
|
|
||||||
# => + 2.
|
|
||||||
# Note that recent Bison support it, but not Flex.
|
|
||||||
if (file ~ /\.[chy]*$/)
|
|
||||||
input = "#line " (FNR + 1) " \"" FILENAME "\"\n";
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($0 ~ /^@end example$/)
|
|
||||||
{
|
|
||||||
if (input == "")
|
|
||||||
fatal("no contents: " file);
|
|
||||||
|
|
||||||
input = normalize(input);
|
|
||||||
# No spurious end of line: use printf.
|
|
||||||
if (files_output[file])
|
|
||||||
printf ("%s", input) >> output_dir "/" file;
|
|
||||||
else
|
|
||||||
printf ("%s", input) > output_dir "/" file;
|
|
||||||
close (output_dir "/" file);
|
|
||||||
files_output[file] = 1;
|
|
||||||
|
|
||||||
file = input = "";
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
input = input $0 "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# We have to handle CONTENTS line per line, since anchors in AWK are
|
|
||||||
# referring to the whole string, not the lines.
|
|
||||||
function normalize(contents, i, lines, n, line, res) {
|
|
||||||
# Remove the Texinfo tags.
|
|
||||||
n = split (contents, lines, "\n");
|
|
||||||
# We don't want the last field which empty: it's behind the last \n.
|
|
||||||
for (i = 1; i < n; ++i)
|
|
||||||
{
|
|
||||||
line = lines[i];
|
|
||||||
|
|
||||||
# Whole line commands.
|
|
||||||
if (line ~ /^@(c |comment|dots|end (ignore|group)|ignore|group)/)
|
|
||||||
# Gperf accepts empty lines as valid input!!!
|
|
||||||
if (file ~ /\.gperf$/)
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
line = "";
|
|
||||||
|
|
||||||
gsub (/^@result\{\}/, "", line);
|
|
||||||
gsub (/^@error\{\}/, "", line);
|
|
||||||
gsub ("@[{]", "{", line);
|
|
||||||
gsub ("@}", "}", line);
|
|
||||||
gsub ("@@", "@", line);
|
|
||||||
gsub ("@comment.*", "", line);
|
|
||||||
|
|
||||||
res = res line "\n";
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function message(msg) {
|
|
||||||
if (! message_printed[msg])
|
|
||||||
{
|
|
||||||
print "extexi: " msg > "/dev/stderr";
|
|
||||||
message_printed[msg] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function fatal(msg) {
|
|
||||||
message(msg);
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Makefile
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
2001-09-13 GNU <[email protected]>
|
||||||
|
|
||||||
|
* Version 0.10.40 released.
|
||||||
|
|
||||||
@@ -0,0 +1,313 @@
|
|||||||
|
# Makefile for directory with message catalog handling in GNU NLS Utilities.
|
||||||
|
# Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Library 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
|
||||||
|
# Library General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Library General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
# USA.
|
||||||
|
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
srcdir = @srcdir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
top_builddir = ..
|
||||||
|
VPATH = @srcdir@
|
||||||
|
|
||||||
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
transform = @program_transform_name@
|
||||||
|
libdir = @libdir@
|
||||||
|
includedir = @includedir@
|
||||||
|
datadir = @datadir@
|
||||||
|
localedir = $(datadir)/locale
|
||||||
|
gettextsrcdir = $(datadir)/gettext/intl
|
||||||
|
aliaspath = $(localedir)
|
||||||
|
subdir = intl
|
||||||
|
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||||
|
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
||||||
|
|
||||||
|
l = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
||||||
|
|
||||||
|
AR = ar
|
||||||
|
CC = @CC@
|
||||||
|
LIBTOOL = @LIBTOOL@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
YACC = @INTLBISON@ -y -d
|
||||||
|
YFLAGS = --name-prefix=__gettext
|
||||||
|
|
||||||
|
DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
|
||||||
|
-DLIBDIR=\"$(libdir)\" @DEFS@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
|
||||||
|
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||||
|
|
||||||
|
HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
|
||||||
|
COMHDRS = gettext.h gettextP.h hash-string.h
|
||||||
|
SOURCES = $(COMSRCS) intl-compat.c
|
||||||
|
COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
|
||||||
|
finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
|
||||||
|
explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
|
||||||
|
localcharset.c
|
||||||
|
OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
|
||||||
|
finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
|
||||||
|
explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
|
||||||
|
plural.$lo localcharset.$lo
|
||||||
|
GETTOBJS = intl-compat.$lo
|
||||||
|
DISTFILES.common = Makefile.in \
|
||||||
|
config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
|
||||||
|
DISTFILES.generated = plural.c
|
||||||
|
DISTFILES.normal = VERSION
|
||||||
|
DISTFILES.gettext = COPYING.LIB-2 COPYING.LIB-2.1 libintl.glibc
|
||||||
|
DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c
|
||||||
|
|
||||||
|
# Libtool's library version information for libintl.
|
||||||
|
# Before making a gettext release, the gettext maintainer must change this
|
||||||
|
# according to the libtool documentation, section "Library interface versions".
|
||||||
|
# Maintainers of other packages that include the intl directory must *not*
|
||||||
|
# change these values.
|
||||||
|
LTV_CURRENT=1
|
||||||
|
LTV_REVISION=1
|
||||||
|
LTV_AGE=0
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .c .y .o .lo .sin .sed
|
||||||
|
.c.o:
|
||||||
|
$(COMPILE) $<
|
||||||
|
.c.lo:
|
||||||
|
$(LIBTOOL) --mode=compile $(COMPILE) $<
|
||||||
|
|
||||||
|
.y.c:
|
||||||
|
$(YACC) $(YFLAGS) --output $@ $<
|
||||||
|
rm -f $*.h
|
||||||
|
|
||||||
|
.sin.sed:
|
||||||
|
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
|
||||||
|
mv t-$@ $@
|
||||||
|
|
||||||
|
INCLUDES = -I.. -I. -I$(top_srcdir)/intl
|
||||||
|
|
||||||
|
all: all-@USE_INCLUDED_LIBINTL@
|
||||||
|
all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
|
||||||
|
all-no: all-no-@BUILD_INCLUDED_LIBINTL@
|
||||||
|
all-no-yes: libgnuintl.$la
|
||||||
|
all-no-no:
|
||||||
|
|
||||||
|
libintl.a libgnuintl.a: $(OBJECTS)
|
||||||
|
rm -f $@
|
||||||
|
$(AR) cru $@ $(OBJECTS)
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libintl.la libgnuintl.la: $(OBJECTS)
|
||||||
|
$(LIBTOOL) --mode=link \
|
||||||
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
|
||||||
|
$(OBJECTS) @LIBICONV@ \
|
||||||
|
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
|
||||||
|
-rpath $(libdir) \
|
||||||
|
-no-undefined
|
||||||
|
|
||||||
|
libintl.h: libgnuintl.h
|
||||||
|
cp $(srcdir)/libgnuintl.h libintl.h
|
||||||
|
|
||||||
|
charset.alias: config.charset
|
||||||
|
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
|
||||||
|
mv t-$@ $@
|
||||||
|
|
||||||
|
check: all
|
||||||
|
|
||||||
|
# This installation goal is only used in GNU gettext. Packages which
|
||||||
|
# only use the library should use install instead.
|
||||||
|
|
||||||
|
# We must not install the libintl.h/libintl.a files if we are on a
|
||||||
|
# system which has the GNU gettext() function in its C library or in a
|
||||||
|
# separate library.
|
||||||
|
# If you want to use the one which comes with this version of the
|
||||||
|
# package, you have to use `configure --with-included-gettext'.
|
||||||
|
install: install-exec install-data
|
||||||
|
install-exec: all
|
||||||
|
if test "$(PACKAGE)" = "gettext" \
|
||||||
|
&& test '@INTLOBJS@' = '$(GETTOBJS)'; then \
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
|
||||||
|
$(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
|
||||||
|
$(LIBTOOL) --mode=install \
|
||||||
|
$(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
|
||||||
|
else \
|
||||||
|
: ; \
|
||||||
|
fi
|
||||||
|
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(libdir); \
|
||||||
|
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
|
||||||
|
dest=$(DESTDIR)$(libdir)/charset.alias; \
|
||||||
|
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
|
||||||
|
orig=$(DESTDIR)$(libdir)/charset.alias; \
|
||||||
|
sed -f ref-add.sed $$orig > $$temp; \
|
||||||
|
$(INSTALL_DATA) $$temp $$dest; \
|
||||||
|
rm -f $$temp; \
|
||||||
|
else \
|
||||||
|
if test @GLIBC21@ = no; then \
|
||||||
|
orig=charset.alias; \
|
||||||
|
sed -f ref-add.sed $$orig > $$temp; \
|
||||||
|
$(INSTALL_DATA) $$temp $$dest; \
|
||||||
|
rm -f $$temp; \
|
||||||
|
fi; \
|
||||||
|
fi; \
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(localedir); \
|
||||||
|
test -f $(DESTDIR)$(localedir)/locale.alias \
|
||||||
|
&& orig=$(DESTDIR)$(localedir)/locale.alias \
|
||||||
|
|| orig=$(srcdir)/locale.alias; \
|
||||||
|
temp=$(DESTDIR)$(localedir)/t-locale.alias; \
|
||||||
|
dest=$(DESTDIR)$(localedir)/locale.alias; \
|
||||||
|
sed -f ref-add.sed $$orig > $$temp; \
|
||||||
|
$(INSTALL_DATA) $$temp $$dest; \
|
||||||
|
rm -f $$temp; \
|
||||||
|
else \
|
||||||
|
: ; \
|
||||||
|
fi
|
||||||
|
install-data: all
|
||||||
|
if test "$(PACKAGE)" = "gettext"; then \
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
||||||
|
$(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
|
||||||
|
$(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
|
||||||
|
dists="COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common)"; \
|
||||||
|
for file in $$dists; do \
|
||||||
|
$(INSTALL_DATA) $(srcdir)/$$file \
|
||||||
|
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||||
|
done; \
|
||||||
|
chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
|
||||||
|
dists="$(DISTFILES.generated)"; \
|
||||||
|
for file in $$dists; do \
|
||||||
|
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
||||||
|
$(INSTALL_DATA) $$dir/$$file \
|
||||||
|
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||||
|
done; \
|
||||||
|
dists="$(DISTFILES.obsolete)"; \
|
||||||
|
for file in $$dists; do \
|
||||||
|
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||||
|
done; \
|
||||||
|
else \
|
||||||
|
: ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Define this as empty until I found a useful application.
|
||||||
|
installcheck:
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
if test "$(PACKAGE)" = "gettext" \
|
||||||
|
&& test '@INTLOBJS@' = '$(GETTOBJS)'; then \
|
||||||
|
rm -f $(DESTDIR)$(includedir)/libintl.h; \
|
||||||
|
$(LIBTOOL) --mode=uninstall \
|
||||||
|
rm -f $(DESTDIR)$(libdir)/libintl.$la; \
|
||||||
|
else \
|
||||||
|
: ; \
|
||||||
|
fi
|
||||||
|
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
||||||
|
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
|
||||||
|
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
|
||||||
|
dest=$(DESTDIR)$(libdir)/charset.alias; \
|
||||||
|
sed -f ref-del.sed $$dest > $$temp; \
|
||||||
|
if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
|
||||||
|
rm -f $$dest; \
|
||||||
|
else \
|
||||||
|
$(INSTALL_DATA) $$temp $$dest; \
|
||||||
|
fi; \
|
||||||
|
rm -f $$temp; \
|
||||||
|
fi; \
|
||||||
|
if test -f $(DESTDIR)$(localedir)/locale.alias; then \
|
||||||
|
temp=$(DESTDIR)$(localedir)/t-locale.alias; \
|
||||||
|
dest=$(DESTDIR)$(localedir)/locale.alias; \
|
||||||
|
sed -f ref-del.sed $$dest > $$temp; \
|
||||||
|
if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
|
||||||
|
rm -f $$dest; \
|
||||||
|
else \
|
||||||
|
$(INSTALL_DATA) $$temp $$dest; \
|
||||||
|
fi; \
|
||||||
|
rm -f $$temp; \
|
||||||
|
fi; \
|
||||||
|
else \
|
||||||
|
: ; \
|
||||||
|
fi
|
||||||
|
if test "$(PACKAGE)" = "gettext"; then \
|
||||||
|
for file in VERSION ChangeLog COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
|
||||||
|
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||||
|
done; \
|
||||||
|
else \
|
||||||
|
: ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
info dvi:
|
||||||
|
|
||||||
|
$(OBJECTS): ../config.h libgnuintl.h
|
||||||
|
bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
|
||||||
|
dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
|
||||||
|
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
TAGS: $(HEADERS) $(SOURCES)
|
||||||
|
here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
|
||||||
|
|
||||||
|
id: ID
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES)
|
||||||
|
here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
|
||||||
|
|
||||||
|
|
||||||
|
mostlyclean:
|
||||||
|
rm -f *.a *.la *.o *.lo core core.*
|
||||||
|
rm -f libintl.h charset.alias ref-add.sed ref-del.sed
|
||||||
|
rm -f -r .libs _libs
|
||||||
|
|
||||||
|
clean: mostlyclean
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f Makefile ID TAGS
|
||||||
|
if test "$(PACKAGE)" = gettext; then \
|
||||||
|
rm -f ChangeLog.inst $(DISTFILES.normal); \
|
||||||
|
else \
|
||||||
|
: ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
maintainer-clean: distclean
|
||||||
|
@echo "This command is intended for maintainers to use;"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
|
||||||
|
|
||||||
|
# GNU gettext needs not contain the file `VERSION' but contains some
|
||||||
|
# other files which should not be distributed in other packages.
|
||||||
|
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||||
|
dist distdir: Makefile
|
||||||
|
if test "$(PACKAGE)" = gettext; then \
|
||||||
|
additional="$(DISTFILES.gettext)"; \
|
||||||
|
else \
|
||||||
|
additional="$(DISTFILES.normal)"; \
|
||||||
|
fi; \
|
||||||
|
$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
|
||||||
|
for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
|
||||||
|
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
||||||
|
ln $$dir/$$file $(distdir) 2> /dev/null \
|
||||||
|
|| cp -p $$dir/$$file $(distdir); \
|
||||||
|
done
|
||||||
|
|
||||||
|
Makefile: Makefile.in ../config.status
|
||||||
|
cd .. \
|
||||||
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||||
|
|
||||||
|
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
GNU gettext library from gettext-0.10.40
|
||||||
@@ -0,0 +1,369 @@
|
|||||||
|
/* Implementation of the bindtextdomain(3) function
|
||||||
|
Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <libintl.h>
|
||||||
|
#else
|
||||||
|
# include "libgnuintl.h"
|
||||||
|
#endif
|
||||||
|
#include "gettextP.h"
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* We have to handle multi-threaded applications. */
|
||||||
|
# include <bits/libc-lock.h>
|
||||||
|
#else
|
||||||
|
/* Provide dummy implementation if this is outside glibc. */
|
||||||
|
# define __libc_rwlock_define(CLASS, NAME)
|
||||||
|
# define __libc_rwlock_wrlock(NAME)
|
||||||
|
# define __libc_rwlock_unlock(NAME)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The internal variables in the standalone libintl.a must have different
|
||||||
|
names than the internal variables in GNU libc, otherwise programs
|
||||||
|
using libintl.a cannot be linked statically. */
|
||||||
|
#if !defined _LIBC
|
||||||
|
# define _nl_default_dirname _nl_default_dirname__
|
||||||
|
# define _nl_domain_bindings _nl_domain_bindings__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
|
||||||
|
#ifndef offsetof
|
||||||
|
# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
/* Contains the default location of the message catalogs. */
|
||||||
|
extern const char _nl_default_dirname[];
|
||||||
|
|
||||||
|
/* List with bindings of specific domains. */
|
||||||
|
extern struct binding *_nl_domain_bindings;
|
||||||
|
|
||||||
|
/* Lock variable to protect the global data in the gettext implementation. */
|
||||||
|
__libc_rwlock_define (extern, _nl_state_lock)
|
||||||
|
|
||||||
|
|
||||||
|
/* Names for the libintl functions are a problem. They must not clash
|
||||||
|
with existing names and they should follow ANSI C. But this source
|
||||||
|
code is also used in GNU C Library where the names have a __
|
||||||
|
prefix. So we have to make a difference here. */
|
||||||
|
#ifdef _LIBC
|
||||||
|
# define BINDTEXTDOMAIN __bindtextdomain
|
||||||
|
# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset
|
||||||
|
# ifndef strdup
|
||||||
|
# define strdup(str) __strdup (str)
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define BINDTEXTDOMAIN bindtextdomain__
|
||||||
|
# define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Prototypes for local functions. */
|
||||||
|
static void set_binding_values PARAMS ((const char *domainname,
|
||||||
|
const char **dirnamep,
|
||||||
|
const char **codesetp));
|
||||||
|
|
||||||
|
/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
|
||||||
|
to be used for the DOMAINNAME message catalog.
|
||||||
|
If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
|
||||||
|
modified, only the current value is returned.
|
||||||
|
If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
|
||||||
|
modified nor returned. */
|
||||||
|
static void
|
||||||
|
set_binding_values (domainname, dirnamep, codesetp)
|
||||||
|
const char *domainname;
|
||||||
|
const char **dirnamep;
|
||||||
|
const char **codesetp;
|
||||||
|
{
|
||||||
|
struct binding *binding;
|
||||||
|
int modified;
|
||||||
|
|
||||||
|
/* Some sanity checks. */
|
||||||
|
if (domainname == NULL || domainname[0] == '\0')
|
||||||
|
{
|
||||||
|
if (dirnamep)
|
||||||
|
*dirnamep = NULL;
|
||||||
|
if (codesetp)
|
||||||
|
*codesetp = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
__libc_rwlock_wrlock (_nl_state_lock);
|
||||||
|
|
||||||
|
modified = 0;
|
||||||
|
|
||||||
|
for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
|
||||||
|
{
|
||||||
|
int compare = strcmp (domainname, binding->domainname);
|
||||||
|
if (compare == 0)
|
||||||
|
/* We found it! */
|
||||||
|
break;
|
||||||
|
if (compare < 0)
|
||||||
|
{
|
||||||
|
/* It is not in the list. */
|
||||||
|
binding = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (binding != NULL)
|
||||||
|
{
|
||||||
|
if (dirnamep)
|
||||||
|
{
|
||||||
|
const char *dirname = *dirnamep;
|
||||||
|
|
||||||
|
if (dirname == NULL)
|
||||||
|
/* The current binding has be to returned. */
|
||||||
|
*dirnamep = binding->dirname;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* The domain is already bound. If the new value and the old
|
||||||
|
one are equal we simply do nothing. Otherwise replace the
|
||||||
|
old binding. */
|
||||||
|
char *result = binding->dirname;
|
||||||
|
if (strcmp (dirname, result) != 0)
|
||||||
|
{
|
||||||
|
if (strcmp (dirname, _nl_default_dirname) == 0)
|
||||||
|
result = (char *) _nl_default_dirname;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#if defined _LIBC || defined HAVE_STRDUP
|
||||||
|
result = strdup (dirname);
|
||||||
|
#else
|
||||||
|
size_t len = strlen (dirname) + 1;
|
||||||
|
result = (char *) malloc (len);
|
||||||
|
if (__builtin_expect (result != NULL, 1))
|
||||||
|
memcpy (result, dirname, len);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (__builtin_expect (result != NULL, 1))
|
||||||
|
{
|
||||||
|
if (binding->dirname != _nl_default_dirname)
|
||||||
|
free (binding->dirname);
|
||||||
|
|
||||||
|
binding->dirname = result;
|
||||||
|
modified = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*dirnamep = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (codesetp)
|
||||||
|
{
|
||||||
|
const char *codeset = *codesetp;
|
||||||
|
|
||||||
|
if (codeset == NULL)
|
||||||
|
/* The current binding has be to returned. */
|
||||||
|
*codesetp = binding->codeset;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* The domain is already bound. If the new value and the old
|
||||||
|
one are equal we simply do nothing. Otherwise replace the
|
||||||
|
old binding. */
|
||||||
|
char *result = binding->codeset;
|
||||||
|
if (result == NULL || strcmp (codeset, result) != 0)
|
||||||
|
{
|
||||||
|
#if defined _LIBC || defined HAVE_STRDUP
|
||||||
|
result = strdup (codeset);
|
||||||
|
#else
|
||||||
|
size_t len = strlen (codeset) + 1;
|
||||||
|
result = (char *) malloc (len);
|
||||||
|
if (__builtin_expect (result != NULL, 1))
|
||||||
|
memcpy (result, codeset, len);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (__builtin_expect (result != NULL, 1))
|
||||||
|
{
|
||||||
|
if (binding->codeset != NULL)
|
||||||
|
free (binding->codeset);
|
||||||
|
|
||||||
|
binding->codeset = result;
|
||||||
|
binding->codeset_cntr++;
|
||||||
|
modified = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*codesetp = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((dirnamep == NULL || *dirnamep == NULL)
|
||||||
|
&& (codesetp == NULL || *codesetp == NULL))
|
||||||
|
{
|
||||||
|
/* Simply return the default values. */
|
||||||
|
if (dirnamep)
|
||||||
|
*dirnamep = _nl_default_dirname;
|
||||||
|
if (codesetp)
|
||||||
|
*codesetp = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* We have to create a new binding. */
|
||||||
|
size_t len = strlen (domainname) + 1;
|
||||||
|
struct binding *new_binding =
|
||||||
|
(struct binding *) malloc (offsetof (struct binding, domainname) + len);
|
||||||
|
|
||||||
|
if (__builtin_expect (new_binding == NULL, 0))
|
||||||
|
goto failed;
|
||||||
|
|
||||||
|
memcpy (new_binding->domainname, domainname, len);
|
||||||
|
|
||||||
|
if (dirnamep)
|
||||||
|
{
|
||||||
|
const char *dirname = *dirnamep;
|
||||||
|
|
||||||
|
if (dirname == NULL)
|
||||||
|
/* The default value. */
|
||||||
|
dirname = _nl_default_dirname;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (strcmp (dirname, _nl_default_dirname) == 0)
|
||||||
|
dirname = _nl_default_dirname;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *result;
|
||||||
|
#if defined _LIBC || defined HAVE_STRDUP
|
||||||
|
result = strdup (dirname);
|
||||||
|
if (__builtin_expect (result == NULL, 0))
|
||||||
|
goto failed_dirname;
|
||||||
|
#else
|
||||||
|
size_t len = strlen (dirname) + 1;
|
||||||
|
result = (char *) malloc (len);
|
||||||
|
if (__builtin_expect (result == NULL, 0))
|
||||||
|
goto failed_dirname;
|
||||||
|
memcpy (result, dirname, len);
|
||||||
|
#endif
|
||||||
|
dirname = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*dirnamep = dirname;
|
||||||
|
new_binding->dirname = (char *) dirname;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* The default value. */
|
||||||
|
new_binding->dirname = (char *) _nl_default_dirname;
|
||||||
|
|
||||||
|
new_binding->codeset_cntr = 0;
|
||||||
|
|
||||||
|
if (codesetp)
|
||||||
|
{
|
||||||
|
const char *codeset = *codesetp;
|
||||||
|
|
||||||
|
if (codeset != NULL)
|
||||||
|
{
|
||||||
|
char *result;
|
||||||
|
|
||||||
|
#if defined _LIBC || defined HAVE_STRDUP
|
||||||
|
result = strdup (codeset);
|
||||||
|
if (__builtin_expect (result == NULL, 0))
|
||||||
|
goto failed_codeset;
|
||||||
|
#else
|
||||||
|
size_t len = strlen (codeset) + 1;
|
||||||
|
result = (char *) malloc (len);
|
||||||
|
if (__builtin_expect (result == NULL, 0))
|
||||||
|
goto failed_codeset;
|
||||||
|
memcpy (result, codeset, len);
|
||||||
|
#endif
|
||||||
|
codeset = result;
|
||||||
|
new_binding->codeset_cntr++;
|
||||||
|
}
|
||||||
|
*codesetp = codeset;
|
||||||
|
new_binding->codeset = (char *) codeset;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
new_binding->codeset = NULL;
|
||||||
|
|
||||||
|
/* Now enqueue it. */
|
||||||
|
if (_nl_domain_bindings == NULL
|
||||||
|
|| strcmp (domainname, _nl_domain_bindings->domainname) < 0)
|
||||||
|
{
|
||||||
|
new_binding->next = _nl_domain_bindings;
|
||||||
|
_nl_domain_bindings = new_binding;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
binding = _nl_domain_bindings;
|
||||||
|
while (binding->next != NULL
|
||||||
|
&& strcmp (domainname, binding->next->domainname) > 0)
|
||||||
|
binding = binding->next;
|
||||||
|
|
||||||
|
new_binding->next = binding->next;
|
||||||
|
binding->next = new_binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
modified = 1;
|
||||||
|
|
||||||
|
/* Here we deal with memory allocation failures. */
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
failed_codeset:
|
||||||
|
if (new_binding->dirname != _nl_default_dirname)
|
||||||
|
free (new_binding->dirname);
|
||||||
|
failed_dirname:
|
||||||
|
free (new_binding);
|
||||||
|
failed:
|
||||||
|
if (dirnamep)
|
||||||
|
*dirnamep = NULL;
|
||||||
|
if (codesetp)
|
||||||
|
*codesetp = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we modified any binding, we flush the caches. */
|
||||||
|
if (modified)
|
||||||
|
++_nl_msg_cat_cntr;
|
||||||
|
|
||||||
|
__libc_rwlock_unlock (_nl_state_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Specify that the DOMAINNAME message catalog will be found
|
||||||
|
in DIRNAME rather than in the system locale data base. */
|
||||||
|
char *
|
||||||
|
BINDTEXTDOMAIN (domainname, dirname)
|
||||||
|
const char *domainname;
|
||||||
|
const char *dirname;
|
||||||
|
{
|
||||||
|
set_binding_values (domainname, &dirname, NULL);
|
||||||
|
return (char *) dirname;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Specify the character encoding in which the messages from the
|
||||||
|
DOMAINNAME message catalog will be returned. */
|
||||||
|
char *
|
||||||
|
BIND_TEXTDOMAIN_CODESET (domainname, codeset)
|
||||||
|
const char *domainname;
|
||||||
|
const char *codeset;
|
||||||
|
{
|
||||||
|
set_binding_values (domainname, NULL, &codeset);
|
||||||
|
return (char *) codeset;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* Aliases for function names in GNU C Library. */
|
||||||
|
weak_alias (__bindtextdomain, bindtextdomain);
|
||||||
|
weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
|
||||||
|
#endif
|
||||||
Executable
+438
@@ -0,0 +1,438 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Output a system dependent table of character encoding aliases.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2000-2001 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Library 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
|
||||||
|
# Library General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Library General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
# USA.
|
||||||
|
#
|
||||||
|
# The table consists of lines of the form
|
||||||
|
# ALIAS CANONICAL
|
||||||
|
#
|
||||||
|
# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
|
||||||
|
# ALIAS is compared in a case sensitive way.
|
||||||
|
#
|
||||||
|
# CANONICAL is the GNU canonical name for this character encoding.
|
||||||
|
# It must be an encoding supported by libiconv. Support by GNU libc is
|
||||||
|
# also desirable. CANONICAL is case insensitive. Usually an upper case
|
||||||
|
# MIME charset name is preferred.
|
||||||
|
# The current list of GNU canonical charset names is as follows.
|
||||||
|
#
|
||||||
|
# name used by which systems a MIME name?
|
||||||
|
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd
|
||||||
|
# ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes
|
||||||
|
# ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes
|
||||||
|
# ISO-8859-3 glibc yes
|
||||||
|
# ISO-8859-4 osf solaris freebsd yes
|
||||||
|
# ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes
|
||||||
|
# ISO-8859-6 glibc aix hpux solaris yes
|
||||||
|
# ISO-8859-7 glibc aix hpux irix osf solaris yes
|
||||||
|
# ISO-8859-8 glibc aix hpux osf solaris yes
|
||||||
|
# ISO-8859-9 glibc aix hpux irix osf solaris yes
|
||||||
|
# ISO-8859-13 glibc
|
||||||
|
# ISO-8859-15 glibc aix osf solaris freebsd
|
||||||
|
# KOI8-R glibc solaris freebsd yes
|
||||||
|
# KOI8-U glibc freebsd yes
|
||||||
|
# CP437 dos
|
||||||
|
# CP775 dos
|
||||||
|
# CP850 aix osf dos
|
||||||
|
# CP852 dos
|
||||||
|
# CP855 dos
|
||||||
|
# CP856 aix
|
||||||
|
# CP857 dos
|
||||||
|
# CP861 dos
|
||||||
|
# CP862 dos
|
||||||
|
# CP864 dos
|
||||||
|
# CP865 dos
|
||||||
|
# CP866 freebsd dos
|
||||||
|
# CP869 dos
|
||||||
|
# CP874 win32 dos
|
||||||
|
# CP922 aix
|
||||||
|
# CP932 aix win32 dos
|
||||||
|
# CP943 aix
|
||||||
|
# CP949 osf win32 dos
|
||||||
|
# CP950 win32 dos
|
||||||
|
# CP1046 aix
|
||||||
|
# CP1124 aix
|
||||||
|
# CP1129 aix
|
||||||
|
# CP1250 win32
|
||||||
|
# CP1251 glibc win32
|
||||||
|
# CP1252 aix win32
|
||||||
|
# CP1253 win32
|
||||||
|
# CP1254 win32
|
||||||
|
# CP1255 win32
|
||||||
|
# CP1256 win32
|
||||||
|
# CP1257 win32
|
||||||
|
# GB2312 glibc aix hpux irix solaris freebsd yes
|
||||||
|
# EUC-JP glibc aix hpux irix osf solaris freebsd yes
|
||||||
|
# EUC-KR glibc aix hpux irix osf solaris freebsd yes
|
||||||
|
# EUC-TW glibc aix hpux irix osf solaris
|
||||||
|
# BIG5 glibc aix hpux osf solaris freebsd yes
|
||||||
|
# BIG5-HKSCS glibc
|
||||||
|
# GBK aix osf win32 dos
|
||||||
|
# GB18030 glibc
|
||||||
|
# SHIFT_JIS hpux osf solaris freebsd yes
|
||||||
|
# JOHAB glibc win32
|
||||||
|
# TIS-620 glibc aix hpux osf solaris
|
||||||
|
# VISCII glibc yes
|
||||||
|
# HP-ROMAN8 hpux
|
||||||
|
# HP-ARABIC8 hpux
|
||||||
|
# HP-GREEK8 hpux
|
||||||
|
# HP-HEBREW8 hpux
|
||||||
|
# HP-TURKISH8 hpux
|
||||||
|
# HP-KANA8 hpux
|
||||||
|
# DEC-KANJI osf
|
||||||
|
# DEC-HANYU osf
|
||||||
|
# UTF-8 glibc aix hpux osf solaris yes
|
||||||
|
#
|
||||||
|
# Note: Names which are not marked as being a MIME name should not be used in
|
||||||
|
# Internet protocols for information interchange (mail, news, etc.).
|
||||||
|
#
|
||||||
|
# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
|
||||||
|
# must understand both names and treat them as equivalent.
|
||||||
|
#
|
||||||
|
# The first argument passed to this file is the canonical host specification,
|
||||||
|
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||||
|
# or
|
||||||
|
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||||
|
|
||||||
|
host="$1"
|
||||||
|
os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
|
||||||
|
echo "# This file contains a table of character encoding aliases,"
|
||||||
|
echo "# suitable for operating system '${os}'."
|
||||||
|
echo "# It was automatically generated from config.charset."
|
||||||
|
# List of references, updated during installation:
|
||||||
|
echo "# Packages using this file: "
|
||||||
|
case "$os" in
|
||||||
|
linux* | *-gnu*)
|
||||||
|
# With glibc-2.1 or newer, we don't need any canonicalization,
|
||||||
|
# because glibc has iconv and both glibc and libiconv support all
|
||||||
|
# GNU canonical names directly. Therefore, the Makefile does not
|
||||||
|
# need to install the alias file at all.
|
||||||
|
# The following applies only to glibc-2.0.x and older libcs.
|
||||||
|
echo "ISO_646.IRV:1983 ASCII"
|
||||||
|
;;
|
||||||
|
aix*)
|
||||||
|
echo "ISO8859-1 ISO-8859-1"
|
||||||
|
echo "ISO8859-2 ISO-8859-2"
|
||||||
|
echo "ISO8859-5 ISO-8859-5"
|
||||||
|
echo "ISO8859-6 ISO-8859-6"
|
||||||
|
echo "ISO8859-7 ISO-8859-7"
|
||||||
|
echo "ISO8859-8 ISO-8859-8"
|
||||||
|
echo "ISO8859-9 ISO-8859-9"
|
||||||
|
echo "ISO8859-15 ISO-8859-15"
|
||||||
|
echo "IBM-850 CP850"
|
||||||
|
echo "IBM-856 CP856"
|
||||||
|
echo "IBM-921 ISO-8859-13"
|
||||||
|
echo "IBM-922 CP922"
|
||||||
|
echo "IBM-932 CP932"
|
||||||
|
echo "IBM-943 CP943"
|
||||||
|
echo "IBM-1046 CP1046"
|
||||||
|
echo "IBM-1124 CP1124"
|
||||||
|
echo "IBM-1129 CP1129"
|
||||||
|
echo "IBM-1252 CP1252"
|
||||||
|
echo "IBM-eucCN GB2312"
|
||||||
|
echo "IBM-eucJP EUC-JP"
|
||||||
|
echo "IBM-eucKR EUC-KR"
|
||||||
|
echo "IBM-eucTW EUC-TW"
|
||||||
|
echo "big5 BIG5"
|
||||||
|
echo "GBK GBK"
|
||||||
|
echo "TIS-620 TIS-620"
|
||||||
|
echo "UTF-8 UTF-8"
|
||||||
|
;;
|
||||||
|
hpux*)
|
||||||
|
echo "iso88591 ISO-8859-1"
|
||||||
|
echo "iso88592 ISO-8859-2"
|
||||||
|
echo "iso88595 ISO-8859-5"
|
||||||
|
echo "iso88596 ISO-8859-6"
|
||||||
|
echo "iso88597 ISO-8859-7"
|
||||||
|
echo "iso88598 ISO-8859-8"
|
||||||
|
echo "iso88599 ISO-8859-9"
|
||||||
|
echo "iso885915 ISO-8859-15"
|
||||||
|
echo "roman8 HP-ROMAN8"
|
||||||
|
echo "arabic8 HP-ARABIC8"
|
||||||
|
echo "greek8 HP-GREEK8"
|
||||||
|
echo "hebrew8 HP-HEBREW8"
|
||||||
|
echo "turkish8 HP-TURKISH8"
|
||||||
|
echo "kana8 HP-KANA8"
|
||||||
|
echo "tis620 TIS-620"
|
||||||
|
echo "big5 BIG5"
|
||||||
|
echo "eucJP EUC-JP"
|
||||||
|
echo "eucKR EUC-KR"
|
||||||
|
echo "eucTW EUC-TW"
|
||||||
|
echo "hp15CN GB2312"
|
||||||
|
#echo "ccdc ?" # what is this?
|
||||||
|
echo "SJIS SHIFT_JIS"
|
||||||
|
echo "utf8 UTF-8"
|
||||||
|
;;
|
||||||
|
irix*)
|
||||||
|
echo "ISO8859-1 ISO-8859-1"
|
||||||
|
echo "ISO8859-2 ISO-8859-2"
|
||||||
|
echo "ISO8859-5 ISO-8859-5"
|
||||||
|
echo "ISO8859-7 ISO-8859-7"
|
||||||
|
echo "ISO8859-9 ISO-8859-9"
|
||||||
|
echo "eucCN GB2312"
|
||||||
|
echo "eucJP EUC-JP"
|
||||||
|
echo "eucKR EUC-KR"
|
||||||
|
echo "eucTW EUC-TW"
|
||||||
|
;;
|
||||||
|
osf*)
|
||||||
|
echo "ISO8859-1 ISO-8859-1"
|
||||||
|
echo "ISO8859-2 ISO-8859-2"
|
||||||
|
echo "ISO8859-4 ISO-8859-4"
|
||||||
|
echo "ISO8859-5 ISO-8859-5"
|
||||||
|
echo "ISO8859-7 ISO-8859-7"
|
||||||
|
echo "ISO8859-8 ISO-8859-8"
|
||||||
|
echo "ISO8859-9 ISO-8859-9"
|
||||||
|
echo "ISO8859-15 ISO-8859-15"
|
||||||
|
echo "cp850 CP850"
|
||||||
|
echo "big5 BIG5"
|
||||||
|
echo "dechanyu DEC-HANYU"
|
||||||
|
echo "dechanzi GB2312"
|
||||||
|
echo "deckanji DEC-KANJI"
|
||||||
|
echo "deckorean EUC-KR"
|
||||||
|
echo "eucJP EUC-JP"
|
||||||
|
echo "eucKR EUC-KR"
|
||||||
|
echo "eucTW EUC-TW"
|
||||||
|
echo "GBK GBK"
|
||||||
|
echo "KSC5601 CP949"
|
||||||
|
echo "sdeckanji EUC-JP"
|
||||||
|
echo "SJIS SHIFT_JIS"
|
||||||
|
echo "TACTIS TIS-620"
|
||||||
|
echo "UTF-8 UTF-8"
|
||||||
|
;;
|
||||||
|
solaris*)
|
||||||
|
echo "646 ASCII"
|
||||||
|
echo "ISO8859-1 ISO-8859-1"
|
||||||
|
echo "ISO8859-2 ISO-8859-2"
|
||||||
|
echo "ISO8859-4 ISO-8859-4"
|
||||||
|
echo "ISO8859-5 ISO-8859-5"
|
||||||
|
echo "ISO8859-6 ISO-8859-6"
|
||||||
|
echo "ISO8859-7 ISO-8859-7"
|
||||||
|
echo "ISO8859-8 ISO-8859-8"
|
||||||
|
echo "ISO8859-9 ISO-8859-9"
|
||||||
|
echo "ISO8859-15 ISO-8859-15"
|
||||||
|
echo "koi8-r KOI8-R"
|
||||||
|
echo "BIG5 BIG5"
|
||||||
|
echo "gb2312 GB2312"
|
||||||
|
echo "cns11643 EUC-TW"
|
||||||
|
echo "5601 EUC-KR"
|
||||||
|
echo "eucJP EUC-JP"
|
||||||
|
echo "PCK SHIFT_JIS"
|
||||||
|
echo "TIS620.2533 TIS-620"
|
||||||
|
#echo "sun_eu_greek ?" # what is this?
|
||||||
|
echo "UTF-8 UTF-8"
|
||||||
|
;;
|
||||||
|
freebsd*)
|
||||||
|
# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
|
||||||
|
# localcharset.c falls back to using the full locale name
|
||||||
|
# from the environment variables.
|
||||||
|
echo "C ASCII"
|
||||||
|
echo "US-ASCII ASCII"
|
||||||
|
for l in la_LN lt_LN; do
|
||||||
|
echo "$l.ASCII ASCII"
|
||||||
|
done
|
||||||
|
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
|
||||||
|
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
|
||||||
|
lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
|
||||||
|
echo "$l.ISO_8859-1 ISO-8859-1"
|
||||||
|
echo "$l.DIS_8859-15 ISO-8859-15"
|
||||||
|
done
|
||||||
|
for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
|
||||||
|
echo "$l.ISO_8859-2 ISO-8859-2"
|
||||||
|
done
|
||||||
|
for l in la_LN lt_LT; do
|
||||||
|
echo "$l.ISO_8859-4 ISO-8859-4"
|
||||||
|
done
|
||||||
|
for l in ru_RU ru_SU; do
|
||||||
|
echo "$l.KOI8-R KOI8-R"
|
||||||
|
echo "$l.ISO_8859-5 ISO-8859-5"
|
||||||
|
echo "$l.CP866 CP866"
|
||||||
|
done
|
||||||
|
echo "uk_UA.KOI8-U KOI8-U"
|
||||||
|
echo "zh_TW.BIG5 BIG5"
|
||||||
|
echo "zh_TW.Big5 BIG5"
|
||||||
|
echo "zh_CN.EUC GB2312"
|
||||||
|
echo "ja_JP.EUC EUC-JP"
|
||||||
|
echo "ja_JP.SJIS SHIFT_JIS"
|
||||||
|
echo "ja_JP.Shift_JIS SHIFT_JIS"
|
||||||
|
echo "ko_KR.EUC EUC-KR"
|
||||||
|
;;
|
||||||
|
beos*)
|
||||||
|
# BeOS has a single locale, and it has UTF-8 encoding.
|
||||||
|
echo "* UTF-8"
|
||||||
|
;;
|
||||||
|
msdosdjgpp*)
|
||||||
|
# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
|
||||||
|
# localcharset.c falls back to using the full locale name
|
||||||
|
# from the environment variables.
|
||||||
|
echo "#"
|
||||||
|
echo "# The encodings given here may not all be correct."
|
||||||
|
echo "# If you find that the encoding given for your language and"
|
||||||
|
echo "# country is not the one your DOS machine actually uses, just"
|
||||||
|
echo "# correct it in this file, and send a mail to"
|
||||||
|
echo "# Juan Manuel Guerrero <[email protected]>"
|
||||||
|
echo "# and Bruno Haible <[email protected]>."
|
||||||
|
echo "#"
|
||||||
|
echo "C ASCII"
|
||||||
|
# ISO-8859-1 languages
|
||||||
|
echo "ca CP850"
|
||||||
|
echo "ca_ES CP850"
|
||||||
|
echo "da CP865" # not CP850 ??
|
||||||
|
echo "da_DK CP865" # not CP850 ??
|
||||||
|
echo "de CP850"
|
||||||
|
echo "de_AT CP850"
|
||||||
|
echo "de_CH CP850"
|
||||||
|
echo "de_DE CP850"
|
||||||
|
echo "en CP850"
|
||||||
|
echo "en_AU CP850" # not CP437 ??
|
||||||
|
echo "en_CA CP850"
|
||||||
|
echo "en_GB CP850"
|
||||||
|
echo "en_NZ CP437"
|
||||||
|
echo "en_US CP437"
|
||||||
|
echo "en_ZA CP850" # not CP437 ??
|
||||||
|
echo "es CP850"
|
||||||
|
echo "es_AR CP850"
|
||||||
|
echo "es_BO CP850"
|
||||||
|
echo "es_CL CP850"
|
||||||
|
echo "es_CO CP850"
|
||||||
|
echo "es_CR CP850"
|
||||||
|
echo "es_CU CP850"
|
||||||
|
echo "es_DO CP850"
|
||||||
|
echo "es_EC CP850"
|
||||||
|
echo "es_ES CP850"
|
||||||
|
echo "es_GT CP850"
|
||||||
|
echo "es_HN CP850"
|
||||||
|
echo "es_MX CP850"
|
||||||
|
echo "es_NI CP850"
|
||||||
|
echo "es_PA CP850"
|
||||||
|
echo "es_PY CP850"
|
||||||
|
echo "es_PE CP850"
|
||||||
|
echo "es_SV CP850"
|
||||||
|
echo "es_UY CP850"
|
||||||
|
echo "es_VE CP850"
|
||||||
|
echo "et CP850"
|
||||||
|
echo "et_EE CP850"
|
||||||
|
echo "eu CP850"
|
||||||
|
echo "eu_ES CP850"
|
||||||
|
echo "fi CP850"
|
||||||
|
echo "fi_FI CP850"
|
||||||
|
echo "fr CP850"
|
||||||
|
echo "fr_BE CP850"
|
||||||
|
echo "fr_CA CP850"
|
||||||
|
echo "fr_CH CP850"
|
||||||
|
echo "fr_FR CP850"
|
||||||
|
echo "ga CP850"
|
||||||
|
echo "ga_IE CP850"
|
||||||
|
echo "gd CP850"
|
||||||
|
echo "gd_GB CP850"
|
||||||
|
echo "gl CP850"
|
||||||
|
echo "gl_ES CP850"
|
||||||
|
echo "id CP850" # not CP437 ??
|
||||||
|
echo "id_ID CP850" # not CP437 ??
|
||||||
|
echo "is CP861" # not CP850 ??
|
||||||
|
echo "is_IS CP861" # not CP850 ??
|
||||||
|
echo "it CP850"
|
||||||
|
echo "it_CH CP850"
|
||||||
|
echo "it_IT CP850"
|
||||||
|
echo "lt CP775"
|
||||||
|
echo "lt_LT CP775"
|
||||||
|
echo "lv CP775"
|
||||||
|
echo "lv_LV CP775"
|
||||||
|
echo "nb CP865" # not CP850 ??
|
||||||
|
echo "nb_NO CP865" # not CP850 ??
|
||||||
|
echo "nl CP850"
|
||||||
|
echo "nl_BE CP850"
|
||||||
|
echo "nl_NL CP850"
|
||||||
|
echo "nn CP865" # not CP850 ??
|
||||||
|
echo "nn_NO CP865" # not CP850 ??
|
||||||
|
echo "no CP865" # not CP850 ??
|
||||||
|
echo "no_NO CP865" # not CP850 ??
|
||||||
|
echo "pt CP850"
|
||||||
|
echo "pt_BR CP850"
|
||||||
|
echo "pt_PT CP850"
|
||||||
|
echo "sv CP850"
|
||||||
|
echo "sv_SE CP850"
|
||||||
|
# ISO-8859-2 languages
|
||||||
|
echo "cs CP852"
|
||||||
|
echo "cs_CZ CP852"
|
||||||
|
echo "hr CP852"
|
||||||
|
echo "hr_HR CP852"
|
||||||
|
echo "hu CP852"
|
||||||
|
echo "hu_HU CP852"
|
||||||
|
echo "pl CP852"
|
||||||
|
echo "pl_PL CP852"
|
||||||
|
echo "ro CP852"
|
||||||
|
echo "ro_RO CP852"
|
||||||
|
echo "sk CP852"
|
||||||
|
echo "sk_SK CP852"
|
||||||
|
echo "sl CP852"
|
||||||
|
echo "sl_SI CP852"
|
||||||
|
echo "sq CP852"
|
||||||
|
echo "sq_AL CP852"
|
||||||
|
echo "sr CP852" # CP852 or CP866 or CP855 ??
|
||||||
|
echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
|
||||||
|
# ISO-8859-3 languages
|
||||||
|
echo "mt CP850"
|
||||||
|
echo "mt_MT CP850"
|
||||||
|
# ISO-8859-5 languages
|
||||||
|
echo "be CP866"
|
||||||
|
echo "be_BE CP866"
|
||||||
|
echo "bg CP866" # not CP855 ??
|
||||||
|
echo "bg_BG CP866" # not CP855 ??
|
||||||
|
echo "mk CP866" # not CP855 ??
|
||||||
|
echo "mk_MK CP866" # not CP855 ??
|
||||||
|
echo "ru KOI8-R" # not CP866 ??
|
||||||
|
echo "ru_RU KOI8-R" # not CP866 ??
|
||||||
|
# ISO-8859-6 languages
|
||||||
|
echo "ar CP864"
|
||||||
|
echo "ar_AE CP864"
|
||||||
|
echo "ar_DZ CP864"
|
||||||
|
echo "ar_EG CP864"
|
||||||
|
echo "ar_IQ CP864"
|
||||||
|
echo "ar_IR CP864"
|
||||||
|
echo "ar_JO CP864"
|
||||||
|
echo "ar_KW CP864"
|
||||||
|
echo "ar_MA CP864"
|
||||||
|
echo "ar_OM CP864"
|
||||||
|
echo "ar_QA CP864"
|
||||||
|
echo "ar_SA CP864"
|
||||||
|
echo "ar_SY CP864"
|
||||||
|
# ISO-8859-7 languages
|
||||||
|
echo "el CP869"
|
||||||
|
echo "el_GR CP869"
|
||||||
|
# ISO-8859-8 languages
|
||||||
|
echo "he CP862"
|
||||||
|
echo "he_IL CP862"
|
||||||
|
# ISO-8859-9 languages
|
||||||
|
echo "tr CP857"
|
||||||
|
echo "tr_TR CP857"
|
||||||
|
# Japanese
|
||||||
|
echo "ja CP932"
|
||||||
|
echo "ja_JP CP932"
|
||||||
|
# Chinese
|
||||||
|
echo "zh_CN GBK"
|
||||||
|
echo "zh_TW CP950" # not CP938 ??
|
||||||
|
# Korean
|
||||||
|
echo "kr CP949" # not CP934 ??
|
||||||
|
echo "kr_KR CP949" # not CP934 ??
|
||||||
|
# Thai
|
||||||
|
echo "th CP874"
|
||||||
|
echo "th_TH CP874"
|
||||||
|
# Other
|
||||||
|
echo "eo CP850"
|
||||||
|
echo "eo_EO CP850"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
/* Implementation of the dcgettext(3) function.
|
||||||
|
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "gettextP.h"
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <libintl.h>
|
||||||
|
#else
|
||||||
|
# include "libgnuintl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
/* Names for the libintl functions are a problem. They must not clash
|
||||||
|
with existing names and they should follow ANSI C. But this source
|
||||||
|
code is also used in GNU C Library where the names have a __
|
||||||
|
prefix. So we have to make a difference here. */
|
||||||
|
#ifdef _LIBC
|
||||||
|
# define DCGETTEXT __dcgettext
|
||||||
|
# define DCIGETTEXT __dcigettext
|
||||||
|
#else
|
||||||
|
# define DCGETTEXT dcgettext__
|
||||||
|
# define DCIGETTEXT dcigettext__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||||
|
locale. */
|
||||||
|
char *
|
||||||
|
DCGETTEXT (domainname, msgid, category)
|
||||||
|
const char *domainname;
|
||||||
|
const char *msgid;
|
||||||
|
int category;
|
||||||
|
{
|
||||||
|
return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* Alias for function name in GNU C Library. */
|
||||||
|
weak_alias (__dcgettext, dcgettext);
|
||||||
|
#endif
|
||||||
+1259
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,60 @@
|
|||||||
|
/* Implementation of the dcngettext(3) function.
|
||||||
|
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "gettextP.h"
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <libintl.h>
|
||||||
|
#else
|
||||||
|
# include "libgnuintl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
/* Names for the libintl functions are a problem. They must not clash
|
||||||
|
with existing names and they should follow ANSI C. But this source
|
||||||
|
code is also used in GNU C Library where the names have a __
|
||||||
|
prefix. So we have to make a difference here. */
|
||||||
|
#ifdef _LIBC
|
||||||
|
# define DCNGETTEXT __dcngettext
|
||||||
|
# define DCIGETTEXT __dcigettext
|
||||||
|
#else
|
||||||
|
# define DCNGETTEXT dcngettext__
|
||||||
|
# define DCIGETTEXT dcigettext__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||||
|
locale. */
|
||||||
|
char *
|
||||||
|
DCNGETTEXT (domainname, msgid1, msgid2, n, category)
|
||||||
|
const char *domainname;
|
||||||
|
const char *msgid1;
|
||||||
|
const char *msgid2;
|
||||||
|
unsigned long int n;
|
||||||
|
int category;
|
||||||
|
{
|
||||||
|
return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* Alias for function name in GNU C Library. */
|
||||||
|
weak_alias (__dcngettext, dcngettext);
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/* Implementation of the dgettext(3) function.
|
||||||
|
Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
|
#include "gettextP.h"
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <libintl.h>
|
||||||
|
#else
|
||||||
|
# include "libgnuintl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
/* Names for the libintl functions are a problem. They must not clash
|
||||||
|
with existing names and they should follow ANSI C. But this source
|
||||||
|
code is also used in GNU C Library where the names have a __
|
||||||
|
prefix. So we have to make a difference here. */
|
||||||
|
#ifdef _LIBC
|
||||||
|
# define DGETTEXT __dgettext
|
||||||
|
# define DCGETTEXT __dcgettext
|
||||||
|
#else
|
||||||
|
# define DGETTEXT dgettext__
|
||||||
|
# define DCGETTEXT dcgettext__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Look up MSGID in the DOMAINNAME message catalog of the current
|
||||||
|
LC_MESSAGES locale. */
|
||||||
|
char *
|
||||||
|
DGETTEXT (domainname, msgid)
|
||||||
|
const char *domainname;
|
||||||
|
const char *msgid;
|
||||||
|
{
|
||||||
|
return DCGETTEXT (domainname, msgid, LC_MESSAGES);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* Alias for function name in GNU C Library. */
|
||||||
|
weak_alias (__dgettext, dgettext);
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/* Implementation of the dngettext(3) function.
|
||||||
|
Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
|
#include "gettextP.h"
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <libintl.h>
|
||||||
|
#else
|
||||||
|
# include "libgnuintl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
/* Names for the libintl functions are a problem. They must not clash
|
||||||
|
with existing names and they should follow ANSI C. But this source
|
||||||
|
code is also used in GNU C Library where the names have a __
|
||||||
|
prefix. So we have to make a difference here. */
|
||||||
|
#ifdef _LIBC
|
||||||
|
# define DNGETTEXT __dngettext
|
||||||
|
# define DCNGETTEXT __dcngettext
|
||||||
|
#else
|
||||||
|
# define DNGETTEXT dngettext__
|
||||||
|
# define DCNGETTEXT dcngettext__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Look up MSGID in the DOMAINNAME message catalog of the current
|
||||||
|
LC_MESSAGES locale and skip message according to the plural form. */
|
||||||
|
char *
|
||||||
|
DNGETTEXT (domainname, msgid1, msgid2, n)
|
||||||
|
const char *domainname;
|
||||||
|
const char *msgid1;
|
||||||
|
const char *msgid2;
|
||||||
|
unsigned long int n;
|
||||||
|
{
|
||||||
|
return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* Alias for function name in GNU C Library. */
|
||||||
|
weak_alias (__dngettext, dngettext);
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
Contributed by Ulrich Drepper <[email protected]>, 1995.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "loadinfo.h"
|
||||||
|
|
||||||
|
/* On some strange systems still no definition of NULL is found. Sigh! */
|
||||||
|
#ifndef NULL
|
||||||
|
# if defined __STDC__ && __STDC__
|
||||||
|
# define NULL ((void *) 0)
|
||||||
|
# else
|
||||||
|
# define NULL 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
char *
|
||||||
|
_nl_find_language (name)
|
||||||
|
const char *name;
|
||||||
|
{
|
||||||
|
while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
|
||||||
|
&& name[0] != '+' && name[0] != ',')
|
||||||
|
++name;
|
||||||
|
|
||||||
|
return (char *) name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
_nl_explode_name (name, language, modifier, territory, codeset,
|
||||||
|
normalized_codeset, special, sponsor, revision)
|
||||||
|
char *name;
|
||||||
|
const char **language;
|
||||||
|
const char **modifier;
|
||||||
|
const char **territory;
|
||||||
|
const char **codeset;
|
||||||
|
const char **normalized_codeset;
|
||||||
|
const char **special;
|
||||||
|
const char **sponsor;
|
||||||
|
const char **revision;
|
||||||
|
{
|
||||||
|
enum { undecided, xpg, cen } syntax;
|
||||||
|
char *cp;
|
||||||
|
int mask;
|
||||||
|
|
||||||
|
*modifier = NULL;
|
||||||
|
*territory = NULL;
|
||||||
|
*codeset = NULL;
|
||||||
|
*normalized_codeset = NULL;
|
||||||
|
*special = NULL;
|
||||||
|
*sponsor = NULL;
|
||||||
|
*revision = NULL;
|
||||||
|
|
||||||
|
/* Now we determine the single parts of the locale name. First
|
||||||
|
look for the language. Termination symbols are `_' and `@' if
|
||||||
|
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
|
||||||
|
mask = 0;
|
||||||
|
syntax = undecided;
|
||||||
|
*language = cp = name;
|
||||||
|
cp = _nl_find_language (*language);
|
||||||
|
|
||||||
|
if (*language == cp)
|
||||||
|
/* This does not make sense: language has to be specified. Use
|
||||||
|
this entry as it is without exploding. Perhaps it is an alias. */
|
||||||
|
cp = strchr (*language, '\0');
|
||||||
|
else if (cp[0] == '_')
|
||||||
|
{
|
||||||
|
/* Next is the territory. */
|
||||||
|
cp[0] = '\0';
|
||||||
|
*territory = ++cp;
|
||||||
|
|
||||||
|
while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
|
||||||
|
&& cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
|
||||||
|
++cp;
|
||||||
|
|
||||||
|
mask |= TERRITORY;
|
||||||
|
|
||||||
|
if (cp[0] == '.')
|
||||||
|
{
|
||||||
|
/* Next is the codeset. */
|
||||||
|
syntax = xpg;
|
||||||
|
cp[0] = '\0';
|
||||||
|
*codeset = ++cp;
|
||||||
|
|
||||||
|
while (cp[0] != '\0' && cp[0] != '@')
|
||||||
|
++cp;
|
||||||
|
|
||||||
|
mask |= XPG_CODESET;
|
||||||
|
|
||||||
|
if (*codeset != cp && (*codeset)[0] != '\0')
|
||||||
|
{
|
||||||
|
*normalized_codeset = _nl_normalize_codeset (*codeset,
|
||||||
|
cp - *codeset);
|
||||||
|
if (strcmp (*codeset, *normalized_codeset) == 0)
|
||||||
|
free ((char *) *normalized_codeset);
|
||||||
|
else
|
||||||
|
mask |= XPG_NORM_CODESET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
|
||||||
|
{
|
||||||
|
/* Next is the modifier. */
|
||||||
|
syntax = cp[0] == '@' ? xpg : cen;
|
||||||
|
cp[0] = '\0';
|
||||||
|
*modifier = ++cp;
|
||||||
|
|
||||||
|
while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
|
||||||
|
&& cp[0] != ',' && cp[0] != '_')
|
||||||
|
++cp;
|
||||||
|
|
||||||
|
mask |= XPG_MODIFIER | CEN_AUDIENCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
|
||||||
|
{
|
||||||
|
syntax = cen;
|
||||||
|
|
||||||
|
if (cp[0] == '+')
|
||||||
|
{
|
||||||
|
/* Next is special application (CEN syntax). */
|
||||||
|
cp[0] = '\0';
|
||||||
|
*special = ++cp;
|
||||||
|
|
||||||
|
while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
|
||||||
|
++cp;
|
||||||
|
|
||||||
|
mask |= CEN_SPECIAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cp[0] == ',')
|
||||||
|
{
|
||||||
|
/* Next is sponsor (CEN syntax). */
|
||||||
|
cp[0] = '\0';
|
||||||
|
*sponsor = ++cp;
|
||||||
|
|
||||||
|
while (cp[0] != '\0' && cp[0] != '_')
|
||||||
|
++cp;
|
||||||
|
|
||||||
|
mask |= CEN_SPONSOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cp[0] == '_')
|
||||||
|
{
|
||||||
|
/* Next is revision (CEN syntax). */
|
||||||
|
cp[0] = '\0';
|
||||||
|
*revision = ++cp;
|
||||||
|
|
||||||
|
mask |= CEN_REVISION;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* For CEN syntax values it might be important to have the
|
||||||
|
separator character in the file name, not for XPG syntax. */
|
||||||
|
if (syntax == xpg)
|
||||||
|
{
|
||||||
|
if (*territory != NULL && (*territory)[0] == '\0')
|
||||||
|
mask &= ~TERRITORY;
|
||||||
|
|
||||||
|
if (*codeset != NULL && (*codeset)[0] == '\0')
|
||||||
|
mask &= ~XPG_CODESET;
|
||||||
|
|
||||||
|
if (*modifier != NULL && (*modifier)[0] == '\0')
|
||||||
|
mask &= ~XPG_MODIFIER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mask;
|
||||||
|
}
|
||||||
@@ -0,0 +1,198 @@
|
|||||||
|
/* Handle list of needed message catalogs
|
||||||
|
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
Written by Ulrich Drepper <[email protected]>, 1995.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#if defined HAVE_UNISTD_H || defined _LIBC
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "gettextP.h"
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <libintl.h>
|
||||||
|
#else
|
||||||
|
# include "libgnuintl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
/* List of already loaded domains. */
|
||||||
|
static struct loaded_l10nfile *_nl_loaded_domains;
|
||||||
|
|
||||||
|
|
||||||
|
/* Return a data structure describing the message catalog described by
|
||||||
|
the DOMAINNAME and CATEGORY parameters with respect to the currently
|
||||||
|
established bindings. */
|
||||||
|
struct loaded_l10nfile *
|
||||||
|
internal_function
|
||||||
|
_nl_find_domain (dirname, locale, domainname, domainbinding)
|
||||||
|
const char *dirname;
|
||||||
|
char *locale;
|
||||||
|
const char *domainname;
|
||||||
|
struct binding *domainbinding;
|
||||||
|
{
|
||||||
|
struct loaded_l10nfile *retval;
|
||||||
|
const char *language;
|
||||||
|
const char *modifier;
|
||||||
|
const char *territory;
|
||||||
|
const char *codeset;
|
||||||
|
const char *normalized_codeset;
|
||||||
|
const char *special;
|
||||||
|
const char *sponsor;
|
||||||
|
const char *revision;
|
||||||
|
const char *alias_value;
|
||||||
|
int mask;
|
||||||
|
|
||||||
|
/* LOCALE can consist of up to four recognized parts for the XPG syntax:
|
||||||
|
|
||||||
|
language[_territory[.codeset]][@modifier]
|
||||||
|
|
||||||
|
and six parts for the CEN syntax:
|
||||||
|
|
||||||
|
language[_territory][+audience][+special][,[sponsor][_revision]]
|
||||||
|
|
||||||
|
Beside the first part all of them are allowed to be missing. If
|
||||||
|
the full specified locale is not found, the less specific one are
|
||||||
|
looked for. The various parts will be stripped off according to
|
||||||
|
the following order:
|
||||||
|
(1) revision
|
||||||
|
(2) sponsor
|
||||||
|
(3) special
|
||||||
|
(4) codeset
|
||||||
|
(5) normalized codeset
|
||||||
|
(6) territory
|
||||||
|
(7) audience/modifier
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* If we have already tested for this locale entry there has to
|
||||||
|
be one data set in the list of loaded domains. */
|
||||||
|
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
||||||
|
strlen (dirname) + 1, 0, locale, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, NULL, NULL, domainname, 0);
|
||||||
|
if (retval != NULL)
|
||||||
|
{
|
||||||
|
/* We know something about this locale. */
|
||||||
|
int cnt;
|
||||||
|
|
||||||
|
if (retval->decided == 0)
|
||||||
|
_nl_load_domain (retval, domainbinding);
|
||||||
|
|
||||||
|
if (retval->data != NULL)
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
|
||||||
|
{
|
||||||
|
if (retval->successor[cnt]->decided == 0)
|
||||||
|
_nl_load_domain (retval->successor[cnt], domainbinding);
|
||||||
|
|
||||||
|
if (retval->successor[cnt]->data != NULL)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return cnt >= 0 ? retval : NULL;
|
||||||
|
/* NOTREACHED */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* See whether the locale value is an alias. If yes its value
|
||||||
|
*overwrites* the alias name. No test for the original value is
|
||||||
|
done. */
|
||||||
|
alias_value = _nl_expand_alias (locale);
|
||||||
|
if (alias_value != NULL)
|
||||||
|
{
|
||||||
|
#if defined _LIBC || defined HAVE_STRDUP
|
||||||
|
locale = strdup (alias_value);
|
||||||
|
if (locale == NULL)
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
|
size_t len = strlen (alias_value) + 1;
|
||||||
|
locale = (char *) malloc (len);
|
||||||
|
if (locale == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
memcpy (locale, alias_value, len);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Now we determine the single parts of the locale name. First
|
||||||
|
look for the language. Termination symbols are `_' and `@' if
|
||||||
|
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
|
||||||
|
mask = _nl_explode_name (locale, &language, &modifier, &territory,
|
||||||
|
&codeset, &normalized_codeset, &special,
|
||||||
|
&sponsor, &revision);
|
||||||
|
|
||||||
|
/* Create all possible locale entries which might be interested in
|
||||||
|
generalization. */
|
||||||
|
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
||||||
|
strlen (dirname) + 1, mask, language, territory,
|
||||||
|
codeset, normalized_codeset, modifier, special,
|
||||||
|
sponsor, revision, domainname, 1);
|
||||||
|
if (retval == NULL)
|
||||||
|
/* This means we are out of core. */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (retval->decided == 0)
|
||||||
|
_nl_load_domain (retval, domainbinding);
|
||||||
|
if (retval->data == NULL)
|
||||||
|
{
|
||||||
|
int cnt;
|
||||||
|
for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
|
||||||
|
{
|
||||||
|
if (retval->successor[cnt]->decided == 0)
|
||||||
|
_nl_load_domain (retval->successor[cnt], domainbinding);
|
||||||
|
if (retval->successor[cnt]->data != NULL)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The room for an alias was dynamically allocated. Free it now. */
|
||||||
|
if (alias_value != NULL)
|
||||||
|
free (locale);
|
||||||
|
|
||||||
|
/* The space for normalized_codeset is dynamically allocated. Free it. */
|
||||||
|
if (mask & XPG_NORM_CODESET)
|
||||||
|
free ((void *) normalized_codeset);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
static void __attribute__ ((unused))
|
||||||
|
free_mem (void)
|
||||||
|
{
|
||||||
|
struct loaded_l10nfile *runp = _nl_loaded_domains;
|
||||||
|
|
||||||
|
while (runp != NULL)
|
||||||
|
{
|
||||||
|
struct loaded_l10nfile *here = runp;
|
||||||
|
if (runp->data != NULL)
|
||||||
|
_nl_unload_domain ((struct loaded_domain *) runp->data);
|
||||||
|
runp = runp->next;
|
||||||
|
free ((char *) here->filename);
|
||||||
|
free (here);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
text_set_element (__libc_subfreeres, free_mem);
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/* Implementation of gettext(3) function.
|
||||||
|
Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
# define __need_NULL
|
||||||
|
# include <stddef.h>
|
||||||
|
#else
|
||||||
|
# include <stdlib.h> /* Just for NULL. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "gettextP.h"
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <libintl.h>
|
||||||
|
#else
|
||||||
|
# include "libgnuintl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
/* Names for the libintl functions are a problem. They must not clash
|
||||||
|
with existing names and they should follow ANSI C. But this source
|
||||||
|
code is also used in GNU C Library where the names have a __
|
||||||
|
prefix. So we have to make a difference here. */
|
||||||
|
#ifdef _LIBC
|
||||||
|
# define GETTEXT __gettext
|
||||||
|
# define DCGETTEXT __dcgettext
|
||||||
|
#else
|
||||||
|
# define GETTEXT gettext__
|
||||||
|
# define DCGETTEXT dcgettext__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Look up MSGID in the current default message catalog for the current
|
||||||
|
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
||||||
|
text). */
|
||||||
|
char *
|
||||||
|
GETTEXT (msgid)
|
||||||
|
const char *msgid;
|
||||||
|
{
|
||||||
|
return DCGETTEXT (NULL, msgid, LC_MESSAGES);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* Alias for function name in GNU C Library. */
|
||||||
|
weak_alias (__gettext, gettext);
|
||||||
|
#endif
|
||||||
+102
@@ -0,0 +1,102 @@
|
|||||||
|
/* Description of GNU message catalog format: general file layout.
|
||||||
|
Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifndef _GETTEXT_H
|
||||||
|
#define _GETTEXT_H 1
|
||||||
|
|
||||||
|
#if HAVE_LIMITS_H || _LIBC
|
||||||
|
# include <limits.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
/* The magic number of the GNU message catalog format. */
|
||||||
|
#define _MAGIC 0x950412de
|
||||||
|
#define _MAGIC_SWAPPED 0xde120495
|
||||||
|
|
||||||
|
/* Revision number of the currently used .mo (binary) file format. */
|
||||||
|
#define MO_REVISION_NUMBER 0
|
||||||
|
|
||||||
|
/* The following contortions are an attempt to use the C preprocessor
|
||||||
|
to determine an unsigned integral type that is 32 bits wide. An
|
||||||
|
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
||||||
|
as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
|
||||||
|
when cross-compiling. */
|
||||||
|
|
||||||
|
#if __STDC__
|
||||||
|
# define UINT_MAX_32_BITS 4294967295U
|
||||||
|
#else
|
||||||
|
# define UINT_MAX_32_BITS 0xFFFFFFFF
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
|
||||||
|
This should be valid for all systems GNU cares about because
|
||||||
|
that doesn't include 16-bit systems, and only modern systems
|
||||||
|
(that certainly have <limits.h>) have 64+-bit integral types. */
|
||||||
|
|
||||||
|
#ifndef UINT_MAX
|
||||||
|
# define UINT_MAX UINT_MAX_32_BITS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if UINT_MAX == UINT_MAX_32_BITS
|
||||||
|
typedef unsigned nls_uint32;
|
||||||
|
#else
|
||||||
|
# if USHRT_MAX == UINT_MAX_32_BITS
|
||||||
|
typedef unsigned short nls_uint32;
|
||||||
|
# else
|
||||||
|
# if ULONG_MAX == UINT_MAX_32_BITS
|
||||||
|
typedef unsigned long nls_uint32;
|
||||||
|
# else
|
||||||
|
/* The following line is intended to throw an error. Using #error is
|
||||||
|
not portable enough. */
|
||||||
|
"Cannot determine unsigned 32-bit data type."
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Header for binary .mo file format. */
|
||||||
|
struct mo_file_header
|
||||||
|
{
|
||||||
|
/* The magic number. */
|
||||||
|
nls_uint32 magic;
|
||||||
|
/* The revision number of the file format. */
|
||||||
|
nls_uint32 revision;
|
||||||
|
/* The number of strings pairs. */
|
||||||
|
nls_uint32 nstrings;
|
||||||
|
/* Offset of table with start offsets of original strings. */
|
||||||
|
nls_uint32 orig_tab_offset;
|
||||||
|
/* Offset of table with start offsets of translation strings. */
|
||||||
|
nls_uint32 trans_tab_offset;
|
||||||
|
/* Size of hashing table. */
|
||||||
|
nls_uint32 hash_tab_size;
|
||||||
|
/* Offset of first hashing entry. */
|
||||||
|
nls_uint32 hash_tab_offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct string_desc
|
||||||
|
{
|
||||||
|
/* Length of addressed string. */
|
||||||
|
nls_uint32 length;
|
||||||
|
/* Offset of string in file. */
|
||||||
|
nls_uint32 offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* @@ begin of epilog @@ */
|
||||||
|
|
||||||
|
#endif /* gettext.h */
|
||||||
+252
@@ -0,0 +1,252 @@
|
|||||||
|
/* Header describing internals of libintl library.
|
||||||
|
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
Written by Ulrich Drepper <[email protected]>, 1995.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifndef _GETTEXTP_H
|
||||||
|
#define _GETTEXTP_H
|
||||||
|
|
||||||
|
#include <stddef.h> /* Get size_t. */
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include "../iconv/gconv_int.h"
|
||||||
|
#else
|
||||||
|
# if HAVE_ICONV
|
||||||
|
# include <iconv.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "loadinfo.h"
|
||||||
|
|
||||||
|
#include "gettext.h" /* Get nls_uint32. */
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
#ifndef PARAMS
|
||||||
|
# if __STDC__
|
||||||
|
# define PARAMS(args) args
|
||||||
|
# else
|
||||||
|
# define PARAMS(args) ()
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef internal_function
|
||||||
|
# define internal_function
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Tell the compiler when a conditional or integer expression is
|
||||||
|
almost always true or almost always false. */
|
||||||
|
#ifndef HAVE_BUILTIN_EXPECT
|
||||||
|
# define __builtin_expect(expr, val) (expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef W
|
||||||
|
# define W(flag, data) ((flag) ? SWAP (data) : (data))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <byteswap.h>
|
||||||
|
# define SWAP(i) bswap_32 (i)
|
||||||
|
#else
|
||||||
|
static inline nls_uint32
|
||||||
|
SWAP (i)
|
||||||
|
nls_uint32 i;
|
||||||
|
{
|
||||||
|
return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* This is the representation of the expressions to determine the
|
||||||
|
plural form. */
|
||||||
|
struct expression
|
||||||
|
{
|
||||||
|
int nargs; /* Number of arguments. */
|
||||||
|
enum operator
|
||||||
|
{
|
||||||
|
/* Without arguments: */
|
||||||
|
var, /* The variable "n". */
|
||||||
|
num, /* Decimal number. */
|
||||||
|
/* Unary operators: */
|
||||||
|
lnot, /* Logical NOT. */
|
||||||
|
/* Binary operators: */
|
||||||
|
mult, /* Multiplication. */
|
||||||
|
divide, /* Division. */
|
||||||
|
module, /* Module operation. */
|
||||||
|
plus, /* Addition. */
|
||||||
|
minus, /* Subtraction. */
|
||||||
|
less_than, /* Comparison. */
|
||||||
|
greater_than, /* Comparison. */
|
||||||
|
less_or_equal, /* Comparison. */
|
||||||
|
greater_or_equal, /* Comparison. */
|
||||||
|
equal, /* Comparision for equality. */
|
||||||
|
not_equal, /* Comparision for inequality. */
|
||||||
|
land, /* Logical AND. */
|
||||||
|
lor, /* Logical OR. */
|
||||||
|
/* Ternary operators: */
|
||||||
|
qmop /* Question mark operator. */
|
||||||
|
} operation;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
unsigned long int num; /* Number value for `num'. */
|
||||||
|
struct expression *args[3]; /* Up to three arguments. */
|
||||||
|
} val;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* This is the data structure to pass information to the parser and get
|
||||||
|
the result in a thread-safe way. */
|
||||||
|
struct parse_args
|
||||||
|
{
|
||||||
|
const char *cp;
|
||||||
|
struct expression *res;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* The representation of an opened message catalog. */
|
||||||
|
struct loaded_domain
|
||||||
|
{
|
||||||
|
const char *data;
|
||||||
|
int use_mmap;
|
||||||
|
size_t mmap_size;
|
||||||
|
int must_swap;
|
||||||
|
nls_uint32 nstrings;
|
||||||
|
struct string_desc *orig_tab;
|
||||||
|
struct string_desc *trans_tab;
|
||||||
|
nls_uint32 hash_size;
|
||||||
|
nls_uint32 *hash_tab;
|
||||||
|
int codeset_cntr;
|
||||||
|
#ifdef _LIBC
|
||||||
|
__gconv_t conv;
|
||||||
|
#else
|
||||||
|
# if HAVE_ICONV
|
||||||
|
iconv_t conv;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
char **conv_tab;
|
||||||
|
|
||||||
|
struct expression *plural;
|
||||||
|
unsigned long int nplurals;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* We want to allocate a string at the end of the struct. But ISO C
|
||||||
|
doesn't allow zero sized arrays. */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# define ZERO 0
|
||||||
|
#else
|
||||||
|
# define ZERO 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* A set of settings bound to a message domain. Used to store settings
|
||||||
|
from bindtextdomain() and bind_textdomain_codeset(). */
|
||||||
|
struct binding
|
||||||
|
{
|
||||||
|
struct binding *next;
|
||||||
|
char *dirname;
|
||||||
|
int codeset_cntr; /* Incremented each time codeset changes. */
|
||||||
|
char *codeset;
|
||||||
|
char domainname[ZERO];
|
||||||
|
};
|
||||||
|
|
||||||
|
/* A counter which is incremented each time some previous translations
|
||||||
|
become invalid.
|
||||||
|
This variable is part of the external ABI of the GNU libintl. */
|
||||||
|
extern int _nl_msg_cat_cntr;
|
||||||
|
|
||||||
|
struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
|
||||||
|
char *__locale,
|
||||||
|
const char *__domainname,
|
||||||
|
struct binding *__domainbinding))
|
||||||
|
internal_function;
|
||||||
|
void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
|
||||||
|
struct binding *__domainbinding))
|
||||||
|
internal_function;
|
||||||
|
void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
|
||||||
|
internal_function;
|
||||||
|
const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
|
||||||
|
struct loaded_domain *__domain,
|
||||||
|
struct binding *__domainbinding))
|
||||||
|
internal_function;
|
||||||
|
void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
|
||||||
|
internal_function;
|
||||||
|
|
||||||
|
char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
|
||||||
|
struct binding *domainbinding,
|
||||||
|
const char *msgid, size_t *lengthp))
|
||||||
|
internal_function;
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
extern char *__gettext PARAMS ((const char *__msgid));
|
||||||
|
extern char *__dgettext PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid));
|
||||||
|
extern char *__dcgettext PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid, int __category));
|
||||||
|
extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
|
||||||
|
unsigned long int __n));
|
||||||
|
extern char *__dngettext PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid1, const char *__msgid2,
|
||||||
|
unsigned long int n));
|
||||||
|
extern char *__dcngettext PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid1, const char *__msgid2,
|
||||||
|
unsigned long int __n, int __category));
|
||||||
|
extern char *__dcigettext PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid1, const char *__msgid2,
|
||||||
|
int __plural, unsigned long int __n,
|
||||||
|
int __category));
|
||||||
|
extern char *__textdomain PARAMS ((const char *__domainname));
|
||||||
|
extern char *__bindtextdomain PARAMS ((const char *__domainname,
|
||||||
|
const char *__dirname));
|
||||||
|
extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
|
||||||
|
const char *__codeset));
|
||||||
|
#else
|
||||||
|
extern char *gettext__ PARAMS ((const char *__msgid));
|
||||||
|
extern char *dgettext__ PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid));
|
||||||
|
extern char *dcgettext__ PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid, int __category));
|
||||||
|
extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
|
||||||
|
unsigned long int __n));
|
||||||
|
extern char *dngettext__ PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid1, const char *__msgid2,
|
||||||
|
unsigned long int __n));
|
||||||
|
extern char *dcngettext__ PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid1, const char *__msgid2,
|
||||||
|
unsigned long int __n, int __category));
|
||||||
|
extern char *dcigettext__ PARAMS ((const char *__domainname,
|
||||||
|
const char *__msgid1, const char *__msgid2,
|
||||||
|
int __plural, unsigned long int __n,
|
||||||
|
int __category));
|
||||||
|
extern char *textdomain__ PARAMS ((const char *__domainname));
|
||||||
|
extern char *bindtextdomain__ PARAMS ((const char *__domainname,
|
||||||
|
const char *__dirname));
|
||||||
|
extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
|
||||||
|
const char *__codeset));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
extern void __gettext_free_exp PARAMS ((struct expression *exp))
|
||||||
|
internal_function;
|
||||||
|
extern int __gettextparse PARAMS ((void *arg));
|
||||||
|
#else
|
||||||
|
extern void gettext_free_exp__ PARAMS ((struct expression *exp))
|
||||||
|
internal_function;
|
||||||
|
extern int gettextparse__ PARAMS ((void *arg));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ begin of epilog @@ */
|
||||||
|
|
||||||
|
#endif /* gettextP.h */
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/* Description of GNU message catalog format: string hashing function.
|
||||||
|
Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
#ifndef PARAMS
|
||||||
|
# if __STDC__
|
||||||
|
# define PARAMS(Args) Args
|
||||||
|
# else
|
||||||
|
# define PARAMS(Args) ()
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* We assume to have `unsigned long int' value with at least 32 bits. */
|
||||||
|
#define HASHWORDBITS 32
|
||||||
|
|
||||||
|
|
||||||
|
/* Defines the so called `hashpjw' function by P.J. Weinberger
|
||||||
|
[see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
|
||||||
|
1986, 1987 Bell Telephone Laboratories, Inc.] */
|
||||||
|
static unsigned long int hash_string PARAMS ((const char *__str_param));
|
||||||
|
|
||||||
|
static inline unsigned long int
|
||||||
|
hash_string (str_param)
|
||||||
|
const char *str_param;
|
||||||
|
{
|
||||||
|
unsigned long int hval, g;
|
||||||
|
const char *str = str_param;
|
||||||
|
|
||||||
|
/* Compute the hash value for the given string. */
|
||||||
|
hval = 0;
|
||||||
|
while (*str != '\0')
|
||||||
|
{
|
||||||
|
hval <<= 4;
|
||||||
|
hval += (unsigned long int) *str++;
|
||||||
|
g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
|
||||||
|
if (g != 0)
|
||||||
|
{
|
||||||
|
hval ^= g >> (HASHWORDBITS - 8);
|
||||||
|
hval ^= g;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hval;
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
|
||||||
|
Library.
|
||||||
|
Copyright (C) 1995, 2000, 2001 Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "libgnuintl.h"
|
||||||
|
#include "gettextP.h"
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
/* This file redirects the gettext functions (without prefix or suffix) to
|
||||||
|
those defined in the included GNU gettext library (with "__" suffix).
|
||||||
|
It is compiled into libintl when the included GNU gettext library is
|
||||||
|
configured --with-included-gettext.
|
||||||
|
|
||||||
|
This redirection works also in the case that the system C library or
|
||||||
|
the system libintl library contain gettext/textdomain/... functions.
|
||||||
|
If it didn't, we would need to add preprocessor level redirections to
|
||||||
|
libgnuintl.h of the following form:
|
||||||
|
|
||||||
|
# define gettext gettext__
|
||||||
|
# define dgettext dgettext__
|
||||||
|
# define dcgettext dcgettext__
|
||||||
|
# define ngettext ngettext__
|
||||||
|
# define dngettext dngettext__
|
||||||
|
# define dcngettext dcngettext__
|
||||||
|
# define textdomain textdomain__
|
||||||
|
# define bindtextdomain bindtextdomain__
|
||||||
|
# define bind_textdomain_codeset bind_textdomain_codeset__
|
||||||
|
|
||||||
|
How does this redirection work? There are two cases.
|
||||||
|
A. When libintl.a is linked into an executable, it works because
|
||||||
|
functions defined in the executable always override functions in
|
||||||
|
the shared libraries.
|
||||||
|
B. When libintl.so is used, it works because
|
||||||
|
1. those systems defining gettext/textdomain/... in the C library
|
||||||
|
(namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are
|
||||||
|
ELF systems and define these symbols as weak, thus explicitly
|
||||||
|
letting other shared libraries override it.
|
||||||
|
2. those systems defining gettext/textdomain/... in a standalone
|
||||||
|
libintl.so library (namely, Solaris 2.3 and newer) have this
|
||||||
|
shared library in /usr/lib, and the linker will search /usr/lib
|
||||||
|
*after* the directory where the GNU gettext library is installed.
|
||||||
|
|
||||||
|
A third case, namely when libintl.a is linked into a shared library
|
||||||
|
whose name is not libintl.so, is not supported. In this case, on
|
||||||
|
Solaris, when -lintl precedes the linker option for the shared library
|
||||||
|
containing GNU gettext, the system's gettext would indeed override
|
||||||
|
the GNU gettext. Anyone doing this kind of stuff must be clever enough
|
||||||
|
to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker
|
||||||
|
command line. */
|
||||||
|
|
||||||
|
|
||||||
|
#undef gettext
|
||||||
|
#undef dgettext
|
||||||
|
#undef dcgettext
|
||||||
|
#undef ngettext
|
||||||
|
#undef dngettext
|
||||||
|
#undef dcngettext
|
||||||
|
#undef textdomain
|
||||||
|
#undef bindtextdomain
|
||||||
|
#undef bind_textdomain_codeset
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
gettext (msgid)
|
||||||
|
const char *msgid;
|
||||||
|
{
|
||||||
|
return gettext__ (msgid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
dgettext (domainname, msgid)
|
||||||
|
const char *domainname;
|
||||||
|
const char *msgid;
|
||||||
|
{
|
||||||
|
return dgettext__ (domainname, msgid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
dcgettext (domainname, msgid, category)
|
||||||
|
const char *domainname;
|
||||||
|
const char *msgid;
|
||||||
|
int category;
|
||||||
|
{
|
||||||
|
return dcgettext__ (domainname, msgid, category);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
ngettext (msgid1, msgid2, n)
|
||||||
|
const char *msgid1;
|
||||||
|
const char *msgid2;
|
||||||
|
unsigned long int n;
|
||||||
|
{
|
||||||
|
return ngettext__ (msgid1, msgid2, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
dngettext (domainname, msgid1, msgid2, n)
|
||||||
|
const char *domainname;
|
||||||
|
const char *msgid1;
|
||||||
|
const char *msgid2;
|
||||||
|
unsigned long int n;
|
||||||
|
{
|
||||||
|
return dngettext__ (domainname, msgid1, msgid2, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
dcngettext (domainname, msgid1, msgid2, n, category)
|
||||||
|
const char *domainname;
|
||||||
|
const char *msgid1;
|
||||||
|
const char *msgid2;
|
||||||
|
unsigned long int n;
|
||||||
|
int category;
|
||||||
|
{
|
||||||
|
return dcngettext__ (domainname, msgid1, msgid2, n, category);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
textdomain (domainname)
|
||||||
|
const char *domainname;
|
||||||
|
{
|
||||||
|
return textdomain__ (domainname);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
bindtextdomain (domainname, dirname)
|
||||||
|
const char *domainname;
|
||||||
|
const char *dirname;
|
||||||
|
{
|
||||||
|
return bindtextdomain__ (domainname, dirname);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
bind_textdomain_codeset (domainname, codeset)
|
||||||
|
const char *domainname;
|
||||||
|
const char *codeset;
|
||||||
|
{
|
||||||
|
return bind_textdomain_codeset__ (domainname, codeset);
|
||||||
|
}
|
||||||
@@ -0,0 +1,405 @@
|
|||||||
|
/* Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
Contributed by Ulrich Drepper <[email protected]>, 1995.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
/* Tell glibc's <string.h> to provide a prototype for stpcpy().
|
||||||
|
This must come before <config.h> because <config.h> may include
|
||||||
|
<features.h>, and once <features.h> has been included, it's too late. */
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
# define _GNU_SOURCE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#if !HAVE_STRCHR && !defined _LIBC
|
||||||
|
# ifndef strchr
|
||||||
|
# define strchr index
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined _LIBC || defined HAVE_ARGZ_H
|
||||||
|
# include <argz.h>
|
||||||
|
#endif
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "loadinfo.h"
|
||||||
|
|
||||||
|
/* On some strange systems still no definition of NULL is found. Sigh! */
|
||||||
|
#ifndef NULL
|
||||||
|
# if defined __STDC__ && __STDC__
|
||||||
|
# define NULL ((void *) 0)
|
||||||
|
# else
|
||||||
|
# define NULL 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* Rename the non ANSI C functions. This is required by the standard
|
||||||
|
because some ANSI C functions will require linking with this object
|
||||||
|
file and the name space must not be polluted. */
|
||||||
|
# ifndef stpcpy
|
||||||
|
# define stpcpy(dest, src) __stpcpy(dest, src)
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifndef HAVE_STPCPY
|
||||||
|
static char *stpcpy PARAMS ((char *dest, const char *src));
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define function which are usually not available. */
|
||||||
|
|
||||||
|
#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
|
||||||
|
/* Returns the number of strings in ARGZ. */
|
||||||
|
static size_t argz_count__ PARAMS ((const char *argz, size_t len));
|
||||||
|
|
||||||
|
static size_t
|
||||||
|
argz_count__ (argz, len)
|
||||||
|
const char *argz;
|
||||||
|
size_t len;
|
||||||
|
{
|
||||||
|
size_t count = 0;
|
||||||
|
while (len > 0)
|
||||||
|
{
|
||||||
|
size_t part_len = strlen (argz);
|
||||||
|
argz += part_len + 1;
|
||||||
|
len -= part_len + 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
# undef __argz_count
|
||||||
|
# define __argz_count(argz, len) argz_count__ (argz, len)
|
||||||
|
#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
|
||||||
|
|
||||||
|
#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
|
||||||
|
/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
|
||||||
|
except the last into the character SEP. */
|
||||||
|
static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
|
||||||
|
|
||||||
|
static void
|
||||||
|
argz_stringify__ (argz, len, sep)
|
||||||
|
char *argz;
|
||||||
|
size_t len;
|
||||||
|
int sep;
|
||||||
|
{
|
||||||
|
while (len > 0)
|
||||||
|
{
|
||||||
|
size_t part_len = strlen (argz);
|
||||||
|
argz += part_len;
|
||||||
|
len -= part_len + 1;
|
||||||
|
if (len > 0)
|
||||||
|
*argz++ = sep;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# undef __argz_stringify
|
||||||
|
# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
|
||||||
|
#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
|
||||||
|
|
||||||
|
#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
|
||||||
|
static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
|
||||||
|
const char *entry));
|
||||||
|
|
||||||
|
static char *
|
||||||
|
argz_next__ (argz, argz_len, entry)
|
||||||
|
char *argz;
|
||||||
|
size_t argz_len;
|
||||||
|
const char *entry;
|
||||||
|
{
|
||||||
|
if (entry)
|
||||||
|
{
|
||||||
|
if (entry < argz + argz_len)
|
||||||
|
entry = strchr (entry, '\0') + 1;
|
||||||
|
|
||||||
|
return entry >= argz + argz_len ? NULL : (char *) entry;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (argz_len > 0)
|
||||||
|
return argz;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
# undef __argz_next
|
||||||
|
# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
|
||||||
|
#endif /* !_LIBC && !HAVE___ARGZ_NEXT */
|
||||||
|
|
||||||
|
|
||||||
|
/* Return number of bits set in X. */
|
||||||
|
static int pop PARAMS ((int x));
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
pop (x)
|
||||||
|
int x;
|
||||||
|
{
|
||||||
|
/* We assume that no more than 16 bits are used. */
|
||||||
|
x = ((x & ~0x5555) >> 1) + (x & 0x5555);
|
||||||
|
x = ((x & ~0x3333) >> 2) + (x & 0x3333);
|
||||||
|
x = ((x >> 4) + x) & 0x0f0f;
|
||||||
|
x = ((x >> 8) + x) & 0xff;
|
||||||
|
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct loaded_l10nfile *
|
||||||
|
_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||||
|
territory, codeset, normalized_codeset, modifier, special,
|
||||||
|
sponsor, revision, filename, do_allocate)
|
||||||
|
struct loaded_l10nfile **l10nfile_list;
|
||||||
|
const char *dirlist;
|
||||||
|
size_t dirlist_len;
|
||||||
|
int mask;
|
||||||
|
const char *language;
|
||||||
|
const char *territory;
|
||||||
|
const char *codeset;
|
||||||
|
const char *normalized_codeset;
|
||||||
|
const char *modifier;
|
||||||
|
const char *special;
|
||||||
|
const char *sponsor;
|
||||||
|
const char *revision;
|
||||||
|
const char *filename;
|
||||||
|
int do_allocate;
|
||||||
|
{
|
||||||
|
char *abs_filename;
|
||||||
|
struct loaded_l10nfile *last = NULL;
|
||||||
|
struct loaded_l10nfile *retval;
|
||||||
|
char *cp;
|
||||||
|
size_t entries;
|
||||||
|
int cnt;
|
||||||
|
|
||||||
|
/* Allocate room for the full file name. */
|
||||||
|
abs_filename = (char *) malloc (dirlist_len
|
||||||
|
+ strlen (language)
|
||||||
|
+ ((mask & TERRITORY) != 0
|
||||||
|
? strlen (territory) + 1 : 0)
|
||||||
|
+ ((mask & XPG_CODESET) != 0
|
||||||
|
? strlen (codeset) + 1 : 0)
|
||||||
|
+ ((mask & XPG_NORM_CODESET) != 0
|
||||||
|
? strlen (normalized_codeset) + 1 : 0)
|
||||||
|
+ (((mask & XPG_MODIFIER) != 0
|
||||||
|
|| (mask & CEN_AUDIENCE) != 0)
|
||||||
|
? strlen (modifier) + 1 : 0)
|
||||||
|
+ ((mask & CEN_SPECIAL) != 0
|
||||||
|
? strlen (special) + 1 : 0)
|
||||||
|
+ (((mask & CEN_SPONSOR) != 0
|
||||||
|
|| (mask & CEN_REVISION) != 0)
|
||||||
|
? (1 + ((mask & CEN_SPONSOR) != 0
|
||||||
|
? strlen (sponsor) + 1 : 0)
|
||||||
|
+ ((mask & CEN_REVISION) != 0
|
||||||
|
? strlen (revision) + 1 : 0)) : 0)
|
||||||
|
+ 1 + strlen (filename) + 1);
|
||||||
|
|
||||||
|
if (abs_filename == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
retval = NULL;
|
||||||
|
last = NULL;
|
||||||
|
|
||||||
|
/* Construct file name. */
|
||||||
|
memcpy (abs_filename, dirlist, dirlist_len);
|
||||||
|
__argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR);
|
||||||
|
cp = abs_filename + (dirlist_len - 1);
|
||||||
|
*cp++ = '/';
|
||||||
|
cp = stpcpy (cp, language);
|
||||||
|
|
||||||
|
if ((mask & TERRITORY) != 0)
|
||||||
|
{
|
||||||
|
*cp++ = '_';
|
||||||
|
cp = stpcpy (cp, territory);
|
||||||
|
}
|
||||||
|
if ((mask & XPG_CODESET) != 0)
|
||||||
|
{
|
||||||
|
*cp++ = '.';
|
||||||
|
cp = stpcpy (cp, codeset);
|
||||||
|
}
|
||||||
|
if ((mask & XPG_NORM_CODESET) != 0)
|
||||||
|
{
|
||||||
|
*cp++ = '.';
|
||||||
|
cp = stpcpy (cp, normalized_codeset);
|
||||||
|
}
|
||||||
|
if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
|
||||||
|
{
|
||||||
|
/* This component can be part of both syntaces but has different
|
||||||
|
leading characters. For CEN we use `+', else `@'. */
|
||||||
|
*cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
|
||||||
|
cp = stpcpy (cp, modifier);
|
||||||
|
}
|
||||||
|
if ((mask & CEN_SPECIAL) != 0)
|
||||||
|
{
|
||||||
|
*cp++ = '+';
|
||||||
|
cp = stpcpy (cp, special);
|
||||||
|
}
|
||||||
|
if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
|
||||||
|
{
|
||||||
|
*cp++ = ',';
|
||||||
|
if ((mask & CEN_SPONSOR) != 0)
|
||||||
|
cp = stpcpy (cp, sponsor);
|
||||||
|
if ((mask & CEN_REVISION) != 0)
|
||||||
|
{
|
||||||
|
*cp++ = '_';
|
||||||
|
cp = stpcpy (cp, revision);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*cp++ = '/';
|
||||||
|
stpcpy (cp, filename);
|
||||||
|
|
||||||
|
/* Look in list of already loaded domains whether it is already
|
||||||
|
available. */
|
||||||
|
last = NULL;
|
||||||
|
for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
|
||||||
|
if (retval->filename != NULL)
|
||||||
|
{
|
||||||
|
int compare = strcmp (retval->filename, abs_filename);
|
||||||
|
if (compare == 0)
|
||||||
|
/* We found it! */
|
||||||
|
break;
|
||||||
|
if (compare < 0)
|
||||||
|
{
|
||||||
|
/* It's not in the list. */
|
||||||
|
retval = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
last = retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (retval != NULL || do_allocate == 0)
|
||||||
|
{
|
||||||
|
free (abs_filename);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
retval = (struct loaded_l10nfile *)
|
||||||
|
malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
|
||||||
|
* (1 << pop (mask))
|
||||||
|
* sizeof (struct loaded_l10nfile *)));
|
||||||
|
if (retval == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
retval->filename = abs_filename;
|
||||||
|
retval->decided = (__argz_count (dirlist, dirlist_len) != 1
|
||||||
|
|| ((mask & XPG_CODESET) != 0
|
||||||
|
&& (mask & XPG_NORM_CODESET) != 0));
|
||||||
|
retval->data = NULL;
|
||||||
|
|
||||||
|
if (last == NULL)
|
||||||
|
{
|
||||||
|
retval->next = *l10nfile_list;
|
||||||
|
*l10nfile_list = retval;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retval->next = last->next;
|
||||||
|
last->next = retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
entries = 0;
|
||||||
|
/* If the DIRLIST is a real list the RETVAL entry corresponds not to
|
||||||
|
a real file. So we have to use the DIRLIST separation mechanism
|
||||||
|
of the inner loop. */
|
||||||
|
cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
|
||||||
|
for (; cnt >= 0; --cnt)
|
||||||
|
if ((cnt & ~mask) == 0
|
||||||
|
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
|
||||||
|
&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
|
||||||
|
{
|
||||||
|
/* Iterate over all elements of the DIRLIST. */
|
||||||
|
char *dir = NULL;
|
||||||
|
|
||||||
|
while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
|
||||||
|
!= NULL)
|
||||||
|
retval->successor[entries++]
|
||||||
|
= _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
|
||||||
|
language, territory, codeset,
|
||||||
|
normalized_codeset, modifier, special,
|
||||||
|
sponsor, revision, filename, 1);
|
||||||
|
}
|
||||||
|
retval->successor[entries] = NULL;
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Normalize codeset name. There is no standard for the codeset
|
||||||
|
names. Normalization allows the user to use any of the common
|
||||||
|
names. The return value is dynamically allocated and has to be
|
||||||
|
freed by the caller. */
|
||||||
|
const char *
|
||||||
|
_nl_normalize_codeset (codeset, name_len)
|
||||||
|
const char *codeset;
|
||||||
|
size_t name_len;
|
||||||
|
{
|
||||||
|
int len = 0;
|
||||||
|
int only_digit = 1;
|
||||||
|
char *retval;
|
||||||
|
char *wp;
|
||||||
|
size_t cnt;
|
||||||
|
|
||||||
|
for (cnt = 0; cnt < name_len; ++cnt)
|
||||||
|
if (isalnum (codeset[cnt]))
|
||||||
|
{
|
||||||
|
++len;
|
||||||
|
|
||||||
|
if (isalpha (codeset[cnt]))
|
||||||
|
only_digit = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
|
||||||
|
|
||||||
|
if (retval != NULL)
|
||||||
|
{
|
||||||
|
if (only_digit)
|
||||||
|
wp = stpcpy (retval, "iso");
|
||||||
|
else
|
||||||
|
wp = retval;
|
||||||
|
|
||||||
|
for (cnt = 0; cnt < name_len; ++cnt)
|
||||||
|
if (isalpha (codeset[cnt]))
|
||||||
|
*wp++ = tolower (codeset[cnt]);
|
||||||
|
else if (isdigit (codeset[cnt]))
|
||||||
|
*wp++ = codeset[cnt];
|
||||||
|
|
||||||
|
*wp = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
return (const char *) retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* @@ begin of epilog @@ */
|
||||||
|
|
||||||
|
/* We don't want libintl.a to depend on any other library. So we
|
||||||
|
avoid the non-standard function stpcpy. In GNU C Library this
|
||||||
|
function is available, though. Also allow the symbol HAVE_STPCPY
|
||||||
|
to be defined. */
|
||||||
|
#if !_LIBC && !HAVE_STPCPY
|
||||||
|
static char *
|
||||||
|
stpcpy (dest, src)
|
||||||
|
char *dest;
|
||||||
|
const char *src;
|
||||||
|
{
|
||||||
|
while ((*dest++ = *src++) != '\0')
|
||||||
|
/* Do nothing. */ ;
|
||||||
|
return dest - 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||||
|
Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifndef _LIBGETTEXT_H
|
||||||
|
#define _LIBGETTEXT_H 1
|
||||||
|
|
||||||
|
/* NLS can be disabled through the configure --disable-nls option. */
|
||||||
|
#if ENABLE_NLS
|
||||||
|
|
||||||
|
/* Get declarations of GNU message catalog functions. */
|
||||||
|
# include <libintl.h>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
# define gettext(Msgid) (Msgid)
|
||||||
|
# define dgettext(Domainname, Msgid) (Msgid)
|
||||||
|
# define dcgettext(Domainname, Msgid, Category) (Msgid)
|
||||||
|
# define ngettext(Msgid1, Msgid2, N) \
|
||||||
|
((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
|
||||||
|
# define dngettext(Domainname, Msgid1, Msgid2, N) \
|
||||||
|
((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
|
||||||
|
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
|
||||||
|
((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
|
||||||
|
# define textdomain(Domainname) ((char *) (Domainname))
|
||||||
|
# define bindtextdomain(Domainname, Dirname) ((char *) (Dirname))
|
||||||
|
# define bind_textdomain_codeset(Domainname, Codeset) ((char *) (Codeset))
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For automatical extraction of messages sometimes no real
|
||||||
|
translation is needed. Instead the string itself is the result. */
|
||||||
|
#define gettext_noop(Str) (Str)
|
||||||
|
|
||||||
|
#endif /* _LIBGETTEXT_H */
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
/* Message catalogs for internationalization.
|
||||||
|
Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifndef _LIBINTL_H
|
||||||
|
#define _LIBINTL_H 1
|
||||||
|
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
|
/* The LC_MESSAGES locale category is the category used by the functions
|
||||||
|
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
|
||||||
|
On systems that don't define it, use an arbitrary value instead.
|
||||||
|
On Solaris, <locale.h> defines __LOCALE_H then includes <libintl.h> (i.e.
|
||||||
|
this file!) and then only defines LC_MESSAGES. To avoid a redefinition
|
||||||
|
warning, don't define LC_MESSAGES in this case. */
|
||||||
|
#if !defined LC_MESSAGES && !defined __LOCALE_H
|
||||||
|
# define LC_MESSAGES 1729
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* We define an additional symbol to signal that we use the GNU
|
||||||
|
implementation of gettext. */
|
||||||
|
#define __USE_GNU_GETTEXT 1
|
||||||
|
|
||||||
|
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
|
||||||
|
precedence over _conio_gettext. */
|
||||||
|
#ifdef __DJGPP__
|
||||||
|
# undef gettext
|
||||||
|
# define gettext gettext
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PARAMS
|
||||||
|
# if __STDC__ || defined __cplusplus
|
||||||
|
# define PARAMS(args) args
|
||||||
|
# else
|
||||||
|
# define PARAMS(args) ()
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Look up MSGID in the current default message catalog for the current
|
||||||
|
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
||||||
|
text). */
|
||||||
|
extern char *gettext PARAMS ((const char *__msgid));
|
||||||
|
|
||||||
|
/* Look up MSGID in the DOMAINNAME message catalog for the current
|
||||||
|
LC_MESSAGES locale. */
|
||||||
|
extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
|
||||||
|
|
||||||
|
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||||
|
locale. */
|
||||||
|
extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
|
||||||
|
int __category));
|
||||||
|
|
||||||
|
|
||||||
|
/* Similar to `gettext' but select the plural form corresponding to the
|
||||||
|
number N. */
|
||||||
|
extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
|
||||||
|
unsigned long int __n));
|
||||||
|
|
||||||
|
/* Similar to `dgettext' but select the plural form corresponding to the
|
||||||
|
number N. */
|
||||||
|
extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1,
|
||||||
|
const char *__msgid2, unsigned long int __n));
|
||||||
|
|
||||||
|
/* Similar to `dcgettext' but select the plural form corresponding to the
|
||||||
|
number N. */
|
||||||
|
extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1,
|
||||||
|
const char *__msgid2, unsigned long int __n,
|
||||||
|
int __category));
|
||||||
|
|
||||||
|
|
||||||
|
/* Set the current default message catalog to DOMAINNAME.
|
||||||
|
If DOMAINNAME is null, return the current default.
|
||||||
|
If DOMAINNAME is "", reset to the default of "messages". */
|
||||||
|
extern char *textdomain PARAMS ((const char *__domainname));
|
||||||
|
|
||||||
|
/* Specify that the DOMAINNAME message catalog will be found
|
||||||
|
in DIRNAME rather than in the system locale data base. */
|
||||||
|
extern char *bindtextdomain PARAMS ((const char *__domainname,
|
||||||
|
const char *__dirname));
|
||||||
|
|
||||||
|
/* Specify the character encoding in which the messages from the
|
||||||
|
DOMAINNAME message catalog will be returned. */
|
||||||
|
extern char *bind_textdomain_codeset PARAMS ((const char *__domainname,
|
||||||
|
const char *__codeset));
|
||||||
|
|
||||||
|
|
||||||
|
/* Optimized version of the functions above. */
|
||||||
|
#if defined __OPTIMIZED
|
||||||
|
/* These are macros, but could also be inline functions. */
|
||||||
|
|
||||||
|
# define gettext(msgid) \
|
||||||
|
dgettext (NULL, msgid)
|
||||||
|
|
||||||
|
# define dgettext(domainname, msgid) \
|
||||||
|
dcgettext (domainname, msgid, LC_MESSAGES)
|
||||||
|
|
||||||
|
# define ngettext(msgid1, msgid2, n) \
|
||||||
|
dngettext (NULL, msgid1, msgid2, n)
|
||||||
|
|
||||||
|
# define dngettext(domainname, msgid1, msgid2, n) \
|
||||||
|
dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
|
||||||
|
|
||||||
|
#endif /* Optimizing. */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* libintl.h */
|
||||||
+109
@@ -0,0 +1,109 @@
|
|||||||
|
/* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by Ulrich Drepper <[email protected]>, 1996.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifndef _LOADINFO_H
|
||||||
|
#define _LOADINFO_H 1
|
||||||
|
|
||||||
|
#ifndef PARAMS
|
||||||
|
# if __STDC__
|
||||||
|
# define PARAMS(args) args
|
||||||
|
# else
|
||||||
|
# define PARAMS(args) ()
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef internal_function
|
||||||
|
# define internal_function
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Tell the compiler when a conditional or integer expression is
|
||||||
|
almost always true or almost always false. */
|
||||||
|
#ifndef HAVE_BUILTIN_EXPECT
|
||||||
|
# define __builtin_expect(expr, val) (expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Separator in PATH like lists of pathnames. */
|
||||||
|
#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
|
||||||
|
/* Win32, OS/2, DOS */
|
||||||
|
# define PATH_SEPARATOR ';'
|
||||||
|
#else
|
||||||
|
/* Unix */
|
||||||
|
# define PATH_SEPARATOR ':'
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Encoding of locale name parts. */
|
||||||
|
#define CEN_REVISION 1
|
||||||
|
#define CEN_SPONSOR 2
|
||||||
|
#define CEN_SPECIAL 4
|
||||||
|
#define XPG_NORM_CODESET 8
|
||||||
|
#define XPG_CODESET 16
|
||||||
|
#define TERRITORY 32
|
||||||
|
#define CEN_AUDIENCE 64
|
||||||
|
#define XPG_MODIFIER 128
|
||||||
|
|
||||||
|
#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
|
||||||
|
#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
|
||||||
|
|
||||||
|
|
||||||
|
struct loaded_l10nfile
|
||||||
|
{
|
||||||
|
const char *filename;
|
||||||
|
int decided;
|
||||||
|
|
||||||
|
const void *data;
|
||||||
|
|
||||||
|
struct loaded_l10nfile *next;
|
||||||
|
struct loaded_l10nfile *successor[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* Normalize codeset name. There is no standard for the codeset
|
||||||
|
names. Normalization allows the user to use any of the common
|
||||||
|
names. The return value is dynamically allocated and has to be
|
||||||
|
freed by the caller. */
|
||||||
|
extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
|
||||||
|
size_t name_len));
|
||||||
|
|
||||||
|
extern struct loaded_l10nfile *
|
||||||
|
_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
|
||||||
|
const char *dirlist, size_t dirlist_len, int mask,
|
||||||
|
const char *language, const char *territory,
|
||||||
|
const char *codeset,
|
||||||
|
const char *normalized_codeset,
|
||||||
|
const char *modifier, const char *special,
|
||||||
|
const char *sponsor, const char *revision,
|
||||||
|
const char *filename, int do_allocate));
|
||||||
|
|
||||||
|
|
||||||
|
extern const char *_nl_expand_alias PARAMS ((const char *name));
|
||||||
|
|
||||||
|
/* normalized_codeset is dynamically allocated and has to be freed by
|
||||||
|
the caller. */
|
||||||
|
extern int _nl_explode_name PARAMS ((char *name, const char **language,
|
||||||
|
const char **modifier,
|
||||||
|
const char **territory,
|
||||||
|
const char **codeset,
|
||||||
|
const char **normalized_codeset,
|
||||||
|
const char **special,
|
||||||
|
const char **sponsor,
|
||||||
|
const char **revision));
|
||||||
|
|
||||||
|
extern char *_nl_find_language PARAMS ((const char *name));
|
||||||
|
|
||||||
|
#endif /* loadinfo.h */
|
||||||
@@ -0,0 +1,567 @@
|
|||||||
|
/* Load needed message catalogs.
|
||||||
|
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
|
||||||
|
This must come before <config.h> because <config.h> may include
|
||||||
|
<features.h>, and once <features.h> has been included, it's too late. */
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
# define _GNU_SOURCE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# define alloca __builtin_alloca
|
||||||
|
# define HAVE_ALLOCA 1
|
||||||
|
#else
|
||||||
|
# if defined HAVE_ALLOCA_H || defined _LIBC
|
||||||
|
# include <alloca.h>
|
||||||
|
# else
|
||||||
|
# ifdef _AIX
|
||||||
|
#pragma alloca
|
||||||
|
# else
|
||||||
|
# ifndef alloca
|
||||||
|
char *alloca ();
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#if defined HAVE_UNISTD_H || defined _LIBC
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include <langinfo.h>
|
||||||
|
# include <locale.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|
||||||
|
|| (defined _LIBC && defined _POSIX_MAPPED_FILES)
|
||||||
|
# include <sys/mman.h>
|
||||||
|
# undef HAVE_MMAP
|
||||||
|
# define HAVE_MMAP 1
|
||||||
|
#else
|
||||||
|
# undef HAVE_MMAP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "gettext.h"
|
||||||
|
#include "gettextP.h"
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include "../locale/localeinfo.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @@ end of prolog @@ */
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
/* Rename the non ISO C functions. This is required by the standard
|
||||||
|
because some ISO C functions will require linking with this object
|
||||||
|
file and the name space must not be polluted. */
|
||||||
|
# define open __open
|
||||||
|
# define close __close
|
||||||
|
# define read __read
|
||||||
|
# define mmap __mmap
|
||||||
|
# define munmap __munmap
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Names for the libintl functions are a problem. They must not clash
|
||||||
|
with existing names and they should follow ANSI C. But this source
|
||||||
|
code is also used in GNU C Library where the names have a __
|
||||||
|
prefix. So we have to make a difference here. */
|
||||||
|
#ifdef _LIBC
|
||||||
|
# define PLURAL_PARSE __gettextparse
|
||||||
|
#else
|
||||||
|
# define PLURAL_PARSE gettextparse__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For those losing systems which don't have `alloca' we have to add
|
||||||
|
some additional code emulating it. */
|
||||||
|
#ifdef HAVE_ALLOCA
|
||||||
|
# define freea(p) /* nothing */
|
||||||
|
#else
|
||||||
|
# define alloca(n) malloc (n)
|
||||||
|
# define freea(p) free (p)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For systems that distinguish between text and binary I/O.
|
||||||
|
O_BINARY is usually declared in <fcntl.h>. */
|
||||||
|
#if !defined O_BINARY && defined _O_BINARY
|
||||||
|
/* For MSC-compatible compilers. */
|
||||||
|
# define O_BINARY _O_BINARY
|
||||||
|
# define O_TEXT _O_TEXT
|
||||||
|
#endif
|
||||||
|
#ifdef __BEOS__
|
||||||
|
/* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
|
||||||
|
# undef O_BINARY
|
||||||
|
# undef O_TEXT
|
||||||
|
#endif
|
||||||
|
/* On reasonable systems, binary I/O is the default. */
|
||||||
|
#ifndef O_BINARY
|
||||||
|
# define O_BINARY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* We need a sign, whether a new catalog was loaded, which can be associated
|
||||||
|
with all translations. This is important if the translations are
|
||||||
|
cached by one of GCC's features. */
|
||||||
|
int _nl_msg_cat_cntr;
|
||||||
|
|
||||||
|
#if (defined __GNUC__ && !defined __APPLE_CC__) \
|
||||||
|
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
|
||||||
|
|
||||||
|
/* These structs are the constant expression for the germanic plural
|
||||||
|
form determination. It represents the expression "n != 1". */
|
||||||
|
static const struct expression plvar =
|
||||||
|
{
|
||||||
|
.nargs = 0,
|
||||||
|
.operation = var,
|
||||||
|
};
|
||||||
|
static const struct expression plone =
|
||||||
|
{
|
||||||
|
.nargs = 0,
|
||||||
|
.operation = num,
|
||||||
|
.val =
|
||||||
|
{
|
||||||
|
.num = 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
static struct expression germanic_plural =
|
||||||
|
{
|
||||||
|
.nargs = 2,
|
||||||
|
.operation = not_equal,
|
||||||
|
.val =
|
||||||
|
{
|
||||||
|
.args =
|
||||||
|
{
|
||||||
|
[0] = (struct expression *) &plvar,
|
||||||
|
[1] = (struct expression *) &plone
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
# define INIT_GERMANIC_PLURAL()
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* For compilers without support for ISO C 99 struct/union initializers:
|
||||||
|
Initialization at run-time. */
|
||||||
|
|
||||||
|
static struct expression plvar;
|
||||||
|
static struct expression plone;
|
||||||
|
static struct expression germanic_plural;
|
||||||
|
|
||||||
|
static void
|
||||||
|
init_germanic_plural ()
|
||||||
|
{
|
||||||
|
if (plone.val.num == 0)
|
||||||
|
{
|
||||||
|
plvar.nargs = 0;
|
||||||
|
plvar.operation = var;
|
||||||
|
|
||||||
|
plone.nargs = 0;
|
||||||
|
plone.operation = num;
|
||||||
|
plone.val.num = 1;
|
||||||
|
|
||||||
|
germanic_plural.nargs = 2;
|
||||||
|
germanic_plural.operation = not_equal;
|
||||||
|
germanic_plural.val.args[0] = &plvar;
|
||||||
|
germanic_plural.val.args[1] = &plone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Initialize the codeset dependent parts of an opened message catalog.
|
||||||
|
Return the header entry. */
|
||||||
|
const char *
|
||||||
|
internal_function
|
||||||
|
_nl_init_domain_conv (domain_file, domain, domainbinding)
|
||||||
|
struct loaded_l10nfile *domain_file;
|
||||||
|
struct loaded_domain *domain;
|
||||||
|
struct binding *domainbinding;
|
||||||
|
{
|
||||||
|
/* Find out about the character set the file is encoded with.
|
||||||
|
This can be found (in textual form) in the entry "". If this
|
||||||
|
entry does not exist or if this does not contain the `charset='
|
||||||
|
information, we will assume the charset matches the one the
|
||||||
|
current locale and we don't have to perform any conversion. */
|
||||||
|
char *nullentry;
|
||||||
|
size_t nullentrylen;
|
||||||
|
|
||||||
|
/* Preinitialize fields, to avoid recursion during _nl_find_msg. */
|
||||||
|
domain->codeset_cntr =
|
||||||
|
(domainbinding != NULL ? domainbinding->codeset_cntr : 0);
|
||||||
|
#ifdef _LIBC
|
||||||
|
domain->conv = (__gconv_t) -1;
|
||||||
|
#else
|
||||||
|
# if HAVE_ICONV
|
||||||
|
domain->conv = (iconv_t) -1;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
domain->conv_tab = NULL;
|
||||||
|
|
||||||
|
/* Get the header entry. */
|
||||||
|
nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen);
|
||||||
|
|
||||||
|
if (nullentry != NULL)
|
||||||
|
{
|
||||||
|
#if defined _LIBC || HAVE_ICONV
|
||||||
|
const char *charsetstr;
|
||||||
|
|
||||||
|
charsetstr = strstr (nullentry, "charset=");
|
||||||
|
if (charsetstr != NULL)
|
||||||
|
{
|
||||||
|
size_t len;
|
||||||
|
char *charset;
|
||||||
|
const char *outcharset;
|
||||||
|
|
||||||
|
charsetstr += strlen ("charset=");
|
||||||
|
len = strcspn (charsetstr, " \t\n");
|
||||||
|
|
||||||
|
charset = (char *) alloca (len + 1);
|
||||||
|
# if defined _LIBC || HAVE_MEMPCPY
|
||||||
|
*((char *) mempcpy (charset, charsetstr, len)) = '\0';
|
||||||
|
# else
|
||||||
|
memcpy (charset, charsetstr, len);
|
||||||
|
charset[len] = '\0';
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* The output charset should normally be determined by the
|
||||||
|
locale. But sometimes the locale is not used or not correctly
|
||||||
|
set up, so we provide a possibility for the user to override
|
||||||
|
this. Moreover, the value specified through
|
||||||
|
bind_textdomain_codeset overrides both. */
|
||||||
|
if (domainbinding != NULL && domainbinding->codeset != NULL)
|
||||||
|
outcharset = domainbinding->codeset;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outcharset = getenv ("OUTPUT_CHARSET");
|
||||||
|
if (outcharset == NULL || outcharset[0] == '\0')
|
||||||
|
{
|
||||||
|
# ifdef _LIBC
|
||||||
|
outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string;
|
||||||
|
# else
|
||||||
|
# if HAVE_ICONV
|
||||||
|
extern const char *locale_charset (void);
|
||||||
|
outcharset = locale_charset ();
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ifdef _LIBC
|
||||||
|
/* We always want to use transliteration. */
|
||||||
|
outcharset = norm_add_slashes (outcharset, "TRANSLIT");
|
||||||
|
charset = norm_add_slashes (charset, NULL);
|
||||||
|
if (__gconv_open (outcharset, charset, &domain->conv,
|
||||||
|
GCONV_AVOID_NOCONV)
|
||||||
|
!= __GCONV_OK)
|
||||||
|
domain->conv = (__gconv_t) -1;
|
||||||
|
# else
|
||||||
|
# if HAVE_ICONV
|
||||||
|
/* When using GNU libiconv, we want to use transliteration. */
|
||||||
|
# if _LIBICONV_VERSION >= 0x0105
|
||||||
|
len = strlen (outcharset);
|
||||||
|
{
|
||||||
|
char *tmp = (char *) alloca (len + 10 + 1);
|
||||||
|
memcpy (tmp, outcharset, len);
|
||||||
|
memcpy (tmp + len, "//TRANSLIT", 10 + 1);
|
||||||
|
outcharset = tmp;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
domain->conv = iconv_open (outcharset, charset);
|
||||||
|
# if _LIBICONV_VERSION >= 0x0105
|
||||||
|
freea (outcharset);
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
freea (charset);
|
||||||
|
}
|
||||||
|
#endif /* _LIBC || HAVE_ICONV */
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullentry;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Frees the codeset dependent parts of an opened message catalog. */
|
||||||
|
void
|
||||||
|
internal_function
|
||||||
|
_nl_free_domain_conv (domain)
|
||||||
|
struct loaded_domain *domain;
|
||||||
|
{
|
||||||
|
if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1)
|
||||||
|
free (domain->conv_tab);
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
if (domain->conv != (__gconv_t) -1)
|
||||||
|
__gconv_close (domain->conv);
|
||||||
|
#else
|
||||||
|
# if HAVE_ICONV
|
||||||
|
if (domain->conv != (iconv_t) -1)
|
||||||
|
iconv_close (domain->conv);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Load the message catalogs specified by FILENAME. If it is no valid
|
||||||
|
message catalog do nothing. */
|
||||||
|
void
|
||||||
|
internal_function
|
||||||
|
_nl_load_domain (domain_file, domainbinding)
|
||||||
|
struct loaded_l10nfile *domain_file;
|
||||||
|
struct binding *domainbinding;
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
size_t size;
|
||||||
|
#ifdef _LIBC
|
||||||
|
struct stat64 st;
|
||||||
|
#else
|
||||||
|
struct stat st;
|
||||||
|
#endif
|
||||||
|
struct mo_file_header *data = (struct mo_file_header *) -1;
|
||||||
|
int use_mmap = 0;
|
||||||
|
struct loaded_domain *domain;
|
||||||
|
const char *nullentry;
|
||||||
|
|
||||||
|
domain_file->decided = 1;
|
||||||
|
domain_file->data = NULL;
|
||||||
|
|
||||||
|
/* Note that it would be useless to store domainbinding in domain_file
|
||||||
|
because domainbinding might be == NULL now but != NULL later (after
|
||||||
|
a call to bind_textdomain_codeset). */
|
||||||
|
|
||||||
|
/* If the record does not represent a valid locale the FILENAME
|
||||||
|
might be NULL. This can happen when according to the given
|
||||||
|
specification the locale file name is different for XPG and CEN
|
||||||
|
syntax. */
|
||||||
|
if (domain_file->filename == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Try to open the addressed file. */
|
||||||
|
fd = open (domain_file->filename, O_RDONLY | O_BINARY);
|
||||||
|
if (fd == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* We must know about the size of the file. */
|
||||||
|
if (
|
||||||
|
#ifdef _LIBC
|
||||||
|
__builtin_expect (fstat64 (fd, &st) != 0, 0)
|
||||||
|
#else
|
||||||
|
__builtin_expect (fstat (fd, &st) != 0, 0)
|
||||||
|
#endif
|
||||||
|
|| __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
|
||||||
|
|| __builtin_expect (size < sizeof (struct mo_file_header), 0))
|
||||||
|
{
|
||||||
|
/* Something went wrong. */
|
||||||
|
close (fd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
|
/* Now we are ready to load the file. If mmap() is available we try
|
||||||
|
this first. If not available or it failed we try to load it. */
|
||||||
|
data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
|
||||||
|
MAP_PRIVATE, fd, 0);
|
||||||
|
|
||||||
|
if (__builtin_expect (data != (struct mo_file_header *) -1, 1))
|
||||||
|
{
|
||||||
|
/* mmap() call was successful. */
|
||||||
|
close (fd);
|
||||||
|
use_mmap = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* If the data is not yet available (i.e. mmap'ed) we try to load
|
||||||
|
it manually. */
|
||||||
|
if (data == (struct mo_file_header *) -1)
|
||||||
|
{
|
||||||
|
size_t to_read;
|
||||||
|
char *read_ptr;
|
||||||
|
|
||||||
|
data = (struct mo_file_header *) malloc (size);
|
||||||
|
if (data == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
to_read = size;
|
||||||
|
read_ptr = (char *) data;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
long int nb = (long int) read (fd, read_ptr, to_read);
|
||||||
|
if (nb <= 0)
|
||||||
|
{
|
||||||
|
#ifdef EINTR
|
||||||
|
if (nb == -1 && errno == EINTR)
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
close (fd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
read_ptr += nb;
|
||||||
|
to_read -= nb;
|
||||||
|
}
|
||||||
|
while (to_read > 0);
|
||||||
|
|
||||||
|
close (fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Using the magic number we can test whether it really is a message
|
||||||
|
catalog file. */
|
||||||
|
if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED,
|
||||||
|
0))
|
||||||
|
{
|
||||||
|
/* The magic number is wrong: not a message catalog file. */
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
|
if (use_mmap)
|
||||||
|
munmap ((caddr_t) data, size);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
free (data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
|
||||||
|
if (domain == NULL)
|
||||||
|
return;
|
||||||
|
domain_file->data = domain;
|
||||||
|
|
||||||
|
domain->data = (char *) data;
|
||||||
|
domain->use_mmap = use_mmap;
|
||||||
|
domain->mmap_size = size;
|
||||||
|
domain->must_swap = data->magic != _MAGIC;
|
||||||
|
|
||||||
|
/* Fill in the information about the available tables. */
|
||||||
|
switch (W (domain->must_swap, data->revision))
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
domain->nstrings = W (domain->must_swap, data->nstrings);
|
||||||
|
domain->orig_tab = (struct string_desc *)
|
||||||
|
((char *) data + W (domain->must_swap, data->orig_tab_offset));
|
||||||
|
domain->trans_tab = (struct string_desc *)
|
||||||
|
((char *) data + W (domain->must_swap, data->trans_tab_offset));
|
||||||
|
domain->hash_size = W (domain->must_swap, data->hash_tab_size);
|
||||||
|
domain->hash_tab = (nls_uint32 *)
|
||||||
|
((char *) data + W (domain->must_swap, data->hash_tab_offset));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* This is an invalid revision. */
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
|
if (use_mmap)
|
||||||
|
munmap ((caddr_t) data, size);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
free (data);
|
||||||
|
free (domain);
|
||||||
|
domain_file->data = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Now initialize the character set converter from the character set
|
||||||
|
the file is encoded with (found in the header entry) to the domain's
|
||||||
|
specified character set or the locale's character set. */
|
||||||
|
nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding);
|
||||||
|
|
||||||
|
/* Also look for a plural specification. */
|
||||||
|
if (nullentry != NULL)
|
||||||
|
{
|
||||||
|
const char *plural;
|
||||||
|
const char *nplurals;
|
||||||
|
|
||||||
|
plural = strstr (nullentry, "plural=");
|
||||||
|
nplurals = strstr (nullentry, "nplurals=");
|
||||||
|
if (plural == NULL || nplurals == NULL)
|
||||||
|
goto no_plural;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* First get the number. */
|
||||||
|
char *endp;
|
||||||
|
unsigned long int n;
|
||||||
|
struct parse_args args;
|
||||||
|
|
||||||
|
nplurals += 9;
|
||||||
|
while (*nplurals != '\0' && isspace (*nplurals))
|
||||||
|
++nplurals;
|
||||||
|
#if defined HAVE_STRTOUL || defined _LIBC
|
||||||
|
n = strtoul (nplurals, &endp, 10);
|
||||||
|
#else
|
||||||
|
for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
|
||||||
|
n = n * 10 + (*endp - '0');
|
||||||
|
#endif
|
||||||
|
domain->nplurals = n;
|
||||||
|
if (nplurals == endp)
|
||||||
|
goto no_plural;
|
||||||
|
|
||||||
|
/* Due to the restrictions bison imposes onto the interface of the
|
||||||
|
scanner function we have to put the input string and the result
|
||||||
|
passed up from the parser into the same structure which address
|
||||||
|
is passed down to the parser. */
|
||||||
|
plural += 7;
|
||||||
|
args.cp = plural;
|
||||||
|
if (PLURAL_PARSE (&args) != 0)
|
||||||
|
goto no_plural;
|
||||||
|
domain->plural = args.res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* By default we are using the Germanic form: singular form only
|
||||||
|
for `one', the plural form otherwise. Yes, this is also what
|
||||||
|
English is using since English is a Germanic language. */
|
||||||
|
no_plural:
|
||||||
|
INIT_GERMANIC_PLURAL ();
|
||||||
|
domain->plural = &germanic_plural;
|
||||||
|
domain->nplurals = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
void
|
||||||
|
internal_function
|
||||||
|
_nl_unload_domain (domain)
|
||||||
|
struct loaded_domain *domain;
|
||||||
|
{
|
||||||
|
if (domain->plural != &germanic_plural)
|
||||||
|
__gettext_free_exp (domain->plural);
|
||||||
|
|
||||||
|
_nl_free_domain_conv (domain);
|
||||||
|
|
||||||
|
# ifdef _POSIX_MAPPED_FILES
|
||||||
|
if (domain->use_mmap)
|
||||||
|
munmap ((caddr_t) domain->data, domain->mmap_size);
|
||||||
|
else
|
||||||
|
# endif /* _POSIX_MAPPED_FILES */
|
||||||
|
free ((void *) domain->data);
|
||||||
|
|
||||||
|
free (domain);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,271 @@
|
|||||||
|
/* Determine a canonical name for the current locale's character encoding.
|
||||||
|
|
||||||
|
Copyright (C) 2000-2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
/* Written by Bruno Haible <[email protected]>. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_STDDEF_H
|
||||||
|
# include <stddef.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#if HAVE_STRING_H
|
||||||
|
# include <string.h>
|
||||||
|
#else
|
||||||
|
# include <strings.h>
|
||||||
|
#endif
|
||||||
|
#if HAVE_STDLIB_H
|
||||||
|
# include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined _WIN32 || defined __WIN32__
|
||||||
|
# undef WIN32 /* avoid warning on mingw32 */
|
||||||
|
# define WIN32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
# if HAVE_LANGINFO_CODESET
|
||||||
|
# include <langinfo.h>
|
||||||
|
# else
|
||||||
|
# if HAVE_SETLOCALE
|
||||||
|
# include <locale.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#else /* WIN32 */
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef DIRECTORY_SEPARATOR
|
||||||
|
# define DIRECTORY_SEPARATOR '/'
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ISSLASH
|
||||||
|
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The following static variable is declared 'volatile' to avoid a
|
||||||
|
possible multithread problem in the function get_charset_aliases. If we
|
||||||
|
are running in a threaded environment, and if two threads initialize
|
||||||
|
'charset_aliases' simultaneously, both will produce the same value,
|
||||||
|
and everything will be ok if the two assignments to 'charset_aliases'
|
||||||
|
are atomic. But I don't know what will happen if the two assignments mix. */
|
||||||
|
#if __STDC__ != 1
|
||||||
|
# define volatile /* empty */
|
||||||
|
#endif
|
||||||
|
/* Pointer to the contents of the charset.alias file, if it has already been
|
||||||
|
read, else NULL. Its format is:
|
||||||
|
ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
|
||||||
|
static const char * volatile charset_aliases;
|
||||||
|
|
||||||
|
/* Return a pointer to the contents of the charset.alias file. */
|
||||||
|
static const char *
|
||||||
|
get_charset_aliases ()
|
||||||
|
{
|
||||||
|
const char *cp;
|
||||||
|
|
||||||
|
cp = charset_aliases;
|
||||||
|
if (cp == NULL)
|
||||||
|
{
|
||||||
|
#ifndef WIN32
|
||||||
|
FILE *fp;
|
||||||
|
const char *dir = LIBDIR;
|
||||||
|
const char *base = "charset.alias";
|
||||||
|
char *file_name;
|
||||||
|
|
||||||
|
/* Concatenate dir and base into freshly allocated file_name. */
|
||||||
|
{
|
||||||
|
size_t dir_len = strlen (dir);
|
||||||
|
size_t base_len = strlen (base);
|
||||||
|
int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
|
||||||
|
file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
|
||||||
|
if (file_name != NULL)
|
||||||
|
{
|
||||||
|
memcpy (file_name, dir, dir_len);
|
||||||
|
if (add_slash)
|
||||||
|
file_name[dir_len] = DIRECTORY_SEPARATOR;
|
||||||
|
memcpy (file_name + dir_len + add_slash, base, base_len + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
|
||||||
|
/* Out of memory or file not found, treat it as empty. */
|
||||||
|
cp = "";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Parse the file's contents. */
|
||||||
|
int c;
|
||||||
|
char buf1[50+1];
|
||||||
|
char buf2[50+1];
|
||||||
|
char *res_ptr = NULL;
|
||||||
|
size_t res_size = 0;
|
||||||
|
size_t l1, l2;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
c = getc (fp);
|
||||||
|
if (c == EOF)
|
||||||
|
break;
|
||||||
|
if (c == '\n' || c == ' ' || c == '\t')
|
||||||
|
continue;
|
||||||
|
if (c == '#')
|
||||||
|
{
|
||||||
|
/* Skip comment, to end of line. */
|
||||||
|
do
|
||||||
|
c = getc (fp);
|
||||||
|
while (!(c == EOF || c == '\n'));
|
||||||
|
if (c == EOF)
|
||||||
|
break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ungetc (c, fp);
|
||||||
|
if (fscanf(fp, "%50s %50s", buf1, buf2) < 2)
|
||||||
|
break;
|
||||||
|
l1 = strlen (buf1);
|
||||||
|
l2 = strlen (buf2);
|
||||||
|
if (res_size == 0)
|
||||||
|
{
|
||||||
|
res_size = l1 + 1 + l2 + 1;
|
||||||
|
res_ptr = malloc (res_size + 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res_size += l1 + 1 + l2 + 1;
|
||||||
|
res_ptr = realloc (res_ptr, res_size + 1);
|
||||||
|
}
|
||||||
|
if (res_ptr == NULL)
|
||||||
|
{
|
||||||
|
/* Out of memory. */
|
||||||
|
res_size = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
|
||||||
|
strcpy (res_ptr + res_size - (l2 + 1), buf2);
|
||||||
|
}
|
||||||
|
fclose (fp);
|
||||||
|
if (res_size == 0)
|
||||||
|
cp = "";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*(res_ptr + res_size) = '\0';
|
||||||
|
cp = res_ptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_name != NULL)
|
||||||
|
free (file_name);
|
||||||
|
|
||||||
|
#else /* WIN32 */
|
||||||
|
|
||||||
|
/* To avoid the troubles of installing a separate file in the same
|
||||||
|
directory as the DLL and of retrieving the DLL's directory at
|
||||||
|
runtime, simply inline the aliases here. */
|
||||||
|
|
||||||
|
cp = "CP936" "\0" "GBK" "\0"
|
||||||
|
"CP1361" "\0" "JOHAB" "\0";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
charset_aliases = cp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return cp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Determine the current locale's character encoding, and canonicalize it
|
||||||
|
into one of the canonical names listed in config.charset.
|
||||||
|
The result must not be freed; it is statically allocated.
|
||||||
|
If the canonical name cannot be determined, the result is a non-canonical
|
||||||
|
name. */
|
||||||
|
|
||||||
|
#ifdef STATIC
|
||||||
|
STATIC
|
||||||
|
#endif
|
||||||
|
const char *
|
||||||
|
locale_charset ()
|
||||||
|
{
|
||||||
|
const char *codeset;
|
||||||
|
const char *aliases;
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
|
||||||
|
# if HAVE_LANGINFO_CODESET
|
||||||
|
|
||||||
|
/* Most systems support nl_langinfo (CODESET) nowadays. */
|
||||||
|
codeset = nl_langinfo (CODESET);
|
||||||
|
|
||||||
|
# else
|
||||||
|
|
||||||
|
/* On old systems which lack it, use setlocale or getenv. */
|
||||||
|
const char *locale = NULL;
|
||||||
|
|
||||||
|
/* But most old systems don't have a complete set of locales. Some
|
||||||
|
(like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
|
||||||
|
use setlocale here; it would return "C" when it doesn't support the
|
||||||
|
locale name the user has set. */
|
||||||
|
# if HAVE_SETLOCALE && 0
|
||||||
|
locale = setlocale (LC_CTYPE, NULL);
|
||||||
|
# endif
|
||||||
|
if (locale == NULL || locale[0] == '\0')
|
||||||
|
{
|
||||||
|
locale = getenv ("LC_ALL");
|
||||||
|
if (locale == NULL || locale[0] == '\0')
|
||||||
|
{
|
||||||
|
locale = getenv ("LC_CTYPE");
|
||||||
|
if (locale == NULL || locale[0] == '\0')
|
||||||
|
locale = getenv ("LANG");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* On some old systems, one used to set locale = "iso8859_1". On others,
|
||||||
|
you set it to "language_COUNTRY.charset". In any case, we resolve it
|
||||||
|
through the charset.alias file. */
|
||||||
|
codeset = locale;
|
||||||
|
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#else /* WIN32 */
|
||||||
|
|
||||||
|
static char buf[2 + 10 + 1];
|
||||||
|
|
||||||
|
/* Win32 has a function returning the locale's codepage as a number. */
|
||||||
|
sprintf (buf, "CP%u", GetACP ());
|
||||||
|
codeset = buf;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (codeset == NULL)
|
||||||
|
/* The canonical name cannot be determined. */
|
||||||
|
codeset = "";
|
||||||
|
|
||||||
|
/* Resolve alias. */
|
||||||
|
for (aliases = get_charset_aliases ();
|
||||||
|
*aliases != '\0';
|
||||||
|
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
|
||||||
|
if (strcmp (codeset, aliases) == 0
|
||||||
|
|| (aliases[0] == '*' && aliases[1] == '\0'))
|
||||||
|
{
|
||||||
|
codeset = aliases + strlen (aliases) + 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return codeset;
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
# Locale name alias data base.
|
||||||
|
# Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Library 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
|
||||||
|
# Library General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Library General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
# USA.
|
||||||
|
|
||||||
|
# The format of this file is the same as for the corresponding file of
|
||||||
|
# the X Window System, which normally can be found in
|
||||||
|
# /usr/lib/X11/locale/locale.alias
|
||||||
|
# A single line contains two fields: an alias and a substitution value.
|
||||||
|
# All entries are case independent.
|
||||||
|
|
||||||
|
# Note: This file is far from being complete. If you have a value for
|
||||||
|
# your own site which you think might be useful for others too, share
|
||||||
|
# it with the rest of us. Send it using the `glibcbug' script to
|
||||||
|
# [email protected].
|
||||||
|
|
||||||
|
# Packages using this file:
|
||||||
|
|
||||||
|
bokmal no_NO.ISO-8859-1
|
||||||
|
bokmål no_NO.ISO-8859-1
|
||||||
|
catalan ca_ES.ISO-8859-1
|
||||||
|
croatian hr_HR.ISO-8859-2
|
||||||
|
czech cs_CZ.ISO-8859-2
|
||||||
|
danish da_DK.ISO-8859-1
|
||||||
|
dansk da_DK.ISO-8859-1
|
||||||
|
deutsch de_DE.ISO-8859-1
|
||||||
|
dutch nl_NL.ISO-8859-1
|
||||||
|
eesti et_EE.ISO-8859-1
|
||||||
|
estonian et_EE.ISO-8859-1
|
||||||
|
finnish fi_FI.ISO-8859-1
|
||||||
|
français fr_FR.ISO-8859-1
|
||||||
|
french fr_FR.ISO-8859-1
|
||||||
|
galego gl_ES.ISO-8859-1
|
||||||
|
galician gl_ES.ISO-8859-1
|
||||||
|
german de_DE.ISO-8859-1
|
||||||
|
greek el_GR.ISO-8859-7
|
||||||
|
hebrew he_IL.ISO-8859-8
|
||||||
|
hrvatski hr_HR.ISO-8859-2
|
||||||
|
hungarian hu_HU.ISO-8859-2
|
||||||
|
icelandic is_IS.ISO-8859-1
|
||||||
|
italian it_IT.ISO-8859-1
|
||||||
|
japanese ja_JP.eucJP
|
||||||
|
japanese.euc ja_JP.eucJP
|
||||||
|
ja_JP ja_JP.eucJP
|
||||||
|
ja_JP.ujis ja_JP.eucJP
|
||||||
|
japanese.sjis ja_JP.SJIS
|
||||||
|
korean ko_KR.eucKR
|
||||||
|
korean.euc ko_KR.eucKR
|
||||||
|
ko_KR ko_KR.eucKR
|
||||||
|
lithuanian lt_LT.ISO-8859-13
|
||||||
|
nb_NO no_NO.ISO-8859-1
|
||||||
|
nb_NO.ISO-8859-1 no_NO.ISO-8859-1
|
||||||
|
norwegian no_NO.ISO-8859-1
|
||||||
|
nynorsk nn_NO.ISO-8859-1
|
||||||
|
polish pl_PL.ISO-8859-2
|
||||||
|
portuguese pt_PT.ISO-8859-1
|
||||||
|
romanian ro_RO.ISO-8859-2
|
||||||
|
russian ru_RU.ISO-8859-5
|
||||||
|
slovak sk_SK.ISO-8859-2
|
||||||
|
slovene sl_SI.ISO-8859-2
|
||||||
|
slovenian sl_SI.ISO-8859-2
|
||||||
|
spanish es_ES.ISO-8859-1
|
||||||
|
swedish sv_SE.ISO-8859-1
|
||||||
|
thai th_TH.TIS-620
|
||||||
|
turkish tr_TR.ISO-8859-9
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user