From 825804561fab7e467a543c1edadff62841681555 Mon Sep 17 00:00:00 2001 From: Jinkun Jang Date: Wed, 13 Mar 2013 01:53:29 +0900 Subject: [PATCH] Tizen 2.1 base --- ABOUT-NLS | 769 ++++ AUTHORS | 6 + COPYING | 340 ++ ChangeLog | 2409 +++++++++++ INSTALL | 229 + Makefile.am | 22 + Makefile.in | 706 ++++ NEWS | 217 + README | 120 + TODO | 0 aclocal.m4 | 8137 ++++++++++++++++++++++++++++++++++++ autogen.sh | 2 + bootstrap | 9 + config.guess | 1516 +++++++ config.h.in | 437 ++ config.rpath | 548 +++ config.sub | 1622 +++++++ configure.ac | 155 + data/101kana.sty | 126 + data/Makefile.am | 41 + data/Makefile.in | 464 ++ data/atok.sty | 326 ++ data/azik.sty | 683 +++ data/canna.sty | 330 ++ data/msime.sty | 377 ++ data/nicola-a.sty | 97 + data/nicola-f.sty | 98 + data/nicola-j.sty | 97 + data/oasys100j.sty | 97 + data/scim-anthy-dict.png | Bin 0 -> 1924 bytes data/scim-anthy-swap-colors.png | Bin 0 -> 236 bytes data/scim-anthy.png | Bin 0 -> 1722 bytes data/tron-dvorak.sty | 94 + data/tron-qwerty-jp.sty | 99 + data/tsuki-2-203-101.sty | 90 + data/tsuki-2-203-106.sty | 91 + data/vje-delta.sty | 339 ++ data/wnn.sty | 311 ++ depcomp | 584 +++ install-sh | 507 +++ intl/ChangeLog | 4 + intl/Makefile.in | 493 +++ intl/VERSION | 1 + intl/bindtextdom.c | 363 ++ intl/config.charset | 608 +++ intl/dcgettext.c | 56 + intl/dcigettext.c | 1219 ++++++ intl/dcngettext.c | 57 + intl/dgettext.c | 58 + intl/dngettext.c | 59 + intl/eval-plural.h | 108 + intl/explodename.c | 185 + intl/finddomain.c | 192 + intl/gettext.c | 63 + intl/gettextP.h | 215 + intl/gmo.h | 149 + intl/hash-string.h | 48 + intl/intl-compat.c | 131 + intl/l10nflist.c | 421 ++ intl/libgnuintl.h.in | 383 ++ intl/loadinfo.h | 145 + intl/loadmsgcat.c | 1420 +++++++ intl/localcharset.c | 398 ++ intl/localcharset.h | 42 + intl/locale.alias | 78 + intl/localealias.c | 414 ++ intl/localename.c | 1142 +++++ intl/log.c | 98 + intl/ngettext.c | 65 + intl/os2compat.c | 98 + intl/os2compat.h | 46 + intl/osdep.c | 24 + intl/plural-exp.c | 154 + intl/plural-exp.h | 118 + intl/plural.c | 1490 +++++++ intl/plural.y | 381 ++ intl/printf-args.c | 119 + intl/printf-args.h | 137 + intl/printf-parse.c | 537 +++ intl/printf-parse.h | 75 + intl/printf.c | 371 ++ intl/ref-add.sin | 31 + intl/ref-del.sin | 26 + intl/relocatable.c | 449 ++ intl/relocatable.h | 77 + intl/textdomain.c | 141 + intl/vasnprintf.c | 887 ++++ intl/vasnprintf.h | 61 + intl/vasnwprintf.h | 46 + intl/wprintf-parse.h | 75 + intl/xsize.h | 109 + ltmain.sh | 6938 ++++++++++++++++++++++++++++++ m4/ChangeLog | 32 + m4/Makefile.am | 1 + m4/Makefile.in | 390 ++ m4/codeset.m4 | 23 + m4/gettext.m4 | 487 +++ m4/glibc21.m4 | 32 + m4/iconv.m4 | 103 + m4/intdiv0.m4 | 72 + m4/intmax.m4 | 32 + m4/inttypes-pri.m4 | 32 + m4/inttypes.m4 | 27 + m4/inttypes_h.m4 | 28 + m4/isc-posix.m4 | 26 + m4/lcmessage.m4 | 32 + m4/lib-ld.m4 | 112 + m4/lib-link.m4 | 551 +++ m4/lib-prefix.m4 | 155 + m4/longdouble.m4 | 30 + m4/longlong.m4 | 25 + m4/nls.m4 | 49 + m4/po.m4 | 426 ++ m4/printf-posix.m4 | 46 + m4/progtest.m4 | 91 + m4/signed.m4 | 19 + m4/size_max.m4 | 61 + m4/stdint_h.m4 | 28 + m4/uintmax_t.m4 | 32 + m4/ulonglong.m4 | 25 + m4/wchar_t.m4 | 22 + m4/wint_t.m4 | 22 + m4/xsize.m4 | 14 + missing | 367 ++ mkinstalldirs | 40 + packaging/ise-engine-anthy.changes | 9 + packaging/ise-engine-anthy.spec | 40 + po/ChangeLog | 11 + po/Makefile.in.in | 366 ++ po/Makevars | 41 + po/POTFILES.in | 8 + po/Rules-quot | 47 + po/boldquot.sed | 10 + po/de.po | 1669 ++++++++ po/en@boldquot.header | 25 + po/en@quot.header | 22 + po/insert-header.sin | 23 + po/ja.po | 1661 ++++++++ po/quot.sed | 6 + po/remove-potcdate.sin | 19 + po/scim-anthy.pot | 1483 +++++++ po/stamp-po | 1 + src/Makefile.am | 144 + src/Makefile.in | 949 +++++ src/scim_anthy_action.cpp | 86 + src/scim_anthy_action.h | 62 + src/scim_anthy_color_button.cpp | 485 +++ src/scim_anthy_color_button.h | 81 + src/scim_anthy_conversion.cpp | 866 ++++ src/scim_anthy_conversion.h | 150 + src/scim_anthy_default_tables.cpp | 1115 +++++ src/scim_anthy_default_tables.h | 120 + src/scim_anthy_factory.cpp | 782 ++++ src/scim_anthy_factory.h | 142 + src/scim_anthy_helper.cpp | 270 ++ src/scim_anthy_helper.h | 34 + src/scim_anthy_imengine.cpp | 2385 +++++++++++ src/scim_anthy_imengine.h | 279 ++ src/scim_anthy_intl.h | 40 + src/scim_anthy_kana.cpp | 251 ++ src/scim_anthy_kana.h | 71 + src/scim_anthy_key2kana.cpp | 323 ++ src/scim_anthy_key2kana.h | 86 + src/scim_anthy_key2kana_base.h | 74 + src/scim_anthy_key2kana_table.cpp | 511 +++ src/scim_anthy_key2kana_table.h | 190 + src/scim_anthy_nicola.cpp | 638 +++ src/scim_anthy_nicola.h | 131 + src/scim_anthy_preedit.cpp | 623 +++ src/scim_anthy_preedit.h | 160 + src/scim_anthy_prefs.cpp | 1339 ++++++ src/scim_anthy_prefs.h | 390 ++ src/scim_anthy_reading.cpp | 750 ++++ src/scim_anthy_reading.h | 141 + src/scim_anthy_setup.cpp | 2121 ++++++++++ src/scim_anthy_setup.h | 64 + src/scim_anthy_setup_kana.cpp | 959 +++++ src/scim_anthy_setup_kana.h | 43 + src/scim_anthy_setup_romaji.cpp | 525 +++ src/scim_anthy_setup_romaji.h | 42 + src/scim_anthy_style_file.cpp | 729 ++++ src/scim_anthy_style_file.h | 152 + src/scim_anthy_table_editor.cpp | 532 +++ src/scim_anthy_table_editor.h | 67 + src/scim_anthy_utils.cpp | 330 ++ src/scim_anthy_utils.h | 59 + 186 files changed, 71264 insertions(+) create mode 100755 ABOUT-NLS create mode 100755 AUTHORS create mode 100755 COPYING create mode 100755 ChangeLog create mode 100755 INSTALL create mode 100755 Makefile.am create mode 100755 Makefile.in create mode 100755 NEWS create mode 100755 README create mode 100755 TODO create mode 100755 aclocal.m4 create mode 100755 autogen.sh create mode 100755 bootstrap create mode 100755 config.guess create mode 100755 config.h.in create mode 100755 config.rpath create mode 100755 config.sub create mode 100755 configure.ac create mode 100755 data/101kana.sty create mode 100755 data/Makefile.am create mode 100755 data/Makefile.in create mode 100755 data/atok.sty create mode 100755 data/azik.sty create mode 100755 data/canna.sty create mode 100755 data/msime.sty create mode 100755 data/nicola-a.sty create mode 100755 data/nicola-f.sty create mode 100755 data/nicola-j.sty create mode 100755 data/oasys100j.sty create mode 100755 data/scim-anthy-dict.png create mode 100755 data/scim-anthy-swap-colors.png create mode 100755 data/scim-anthy.png create mode 100755 data/tron-dvorak.sty create mode 100755 data/tron-qwerty-jp.sty create mode 100755 data/tsuki-2-203-101.sty create mode 100755 data/tsuki-2-203-106.sty create mode 100755 data/vje-delta.sty create mode 100755 data/wnn.sty create mode 100755 depcomp create mode 100755 install-sh create mode 100755 intl/ChangeLog create mode 100755 intl/Makefile.in create mode 100755 intl/VERSION create mode 100755 intl/bindtextdom.c create mode 100755 intl/config.charset create mode 100755 intl/dcgettext.c create mode 100755 intl/dcigettext.c create mode 100755 intl/dcngettext.c create mode 100755 intl/dgettext.c create mode 100755 intl/dngettext.c create mode 100755 intl/eval-plural.h create mode 100755 intl/explodename.c create mode 100755 intl/finddomain.c create mode 100755 intl/gettext.c create mode 100755 intl/gettextP.h create mode 100755 intl/gmo.h create mode 100755 intl/hash-string.h create mode 100755 intl/intl-compat.c create mode 100755 intl/l10nflist.c create mode 100755 intl/libgnuintl.h.in create mode 100755 intl/loadinfo.h create mode 100755 intl/loadmsgcat.c create mode 100755 intl/localcharset.c create mode 100755 intl/localcharset.h create mode 100755 intl/locale.alias create mode 100755 intl/localealias.c create mode 100755 intl/localename.c create mode 100755 intl/log.c create mode 100755 intl/ngettext.c create mode 100755 intl/os2compat.c create mode 100755 intl/os2compat.h create mode 100755 intl/osdep.c create mode 100755 intl/plural-exp.c create mode 100755 intl/plural-exp.h create mode 100755 intl/plural.c create mode 100755 intl/plural.y create mode 100755 intl/printf-args.c create mode 100755 intl/printf-args.h create mode 100755 intl/printf-parse.c create mode 100755 intl/printf-parse.h create mode 100755 intl/printf.c create mode 100755 intl/ref-add.sin create mode 100755 intl/ref-del.sin create mode 100755 intl/relocatable.c create mode 100755 intl/relocatable.h create mode 100755 intl/textdomain.c create mode 100755 intl/vasnprintf.c create mode 100755 intl/vasnprintf.h create mode 100755 intl/vasnwprintf.h create mode 100755 intl/wprintf-parse.h create mode 100755 intl/xsize.h create mode 100755 ltmain.sh create mode 100755 m4/ChangeLog create mode 100755 m4/Makefile.am create mode 100755 m4/Makefile.in create mode 100755 m4/codeset.m4 create mode 100755 m4/gettext.m4 create mode 100755 m4/glibc21.m4 create mode 100755 m4/iconv.m4 create mode 100755 m4/intdiv0.m4 create mode 100755 m4/intmax.m4 create mode 100755 m4/inttypes-pri.m4 create mode 100755 m4/inttypes.m4 create mode 100755 m4/inttypes_h.m4 create mode 100755 m4/isc-posix.m4 create mode 100755 m4/lcmessage.m4 create mode 100755 m4/lib-ld.m4 create mode 100755 m4/lib-link.m4 create mode 100755 m4/lib-prefix.m4 create mode 100755 m4/longdouble.m4 create mode 100755 m4/longlong.m4 create mode 100755 m4/nls.m4 create mode 100755 m4/po.m4 create mode 100755 m4/printf-posix.m4 create mode 100755 m4/progtest.m4 create mode 100755 m4/signed.m4 create mode 100755 m4/size_max.m4 create mode 100755 m4/stdint_h.m4 create mode 100755 m4/uintmax_t.m4 create mode 100755 m4/ulonglong.m4 create mode 100755 m4/wchar_t.m4 create mode 100755 m4/wint_t.m4 create mode 100755 m4/xsize.m4 create mode 100755 missing create mode 100755 mkinstalldirs create mode 100644 packaging/ise-engine-anthy.changes create mode 100755 packaging/ise-engine-anthy.spec create mode 100755 po/ChangeLog create mode 100755 po/Makefile.in.in create mode 100755 po/Makevars create mode 100755 po/POTFILES.in create mode 100755 po/Rules-quot create mode 100755 po/boldquot.sed create mode 100755 po/de.po create mode 100755 po/en@boldquot.header create mode 100755 po/en@quot.header create mode 100755 po/insert-header.sin create mode 100755 po/ja.po create mode 100755 po/quot.sed create mode 100755 po/remove-potcdate.sin create mode 100755 po/scim-anthy.pot create mode 100755 po/stamp-po create mode 100755 src/Makefile.am create mode 100755 src/Makefile.in create mode 100755 src/scim_anthy_action.cpp create mode 100755 src/scim_anthy_action.h create mode 100755 src/scim_anthy_color_button.cpp create mode 100755 src/scim_anthy_color_button.h create mode 100755 src/scim_anthy_conversion.cpp create mode 100755 src/scim_anthy_conversion.h create mode 100755 src/scim_anthy_default_tables.cpp create mode 100755 src/scim_anthy_default_tables.h create mode 100755 src/scim_anthy_factory.cpp create mode 100755 src/scim_anthy_factory.h create mode 100755 src/scim_anthy_helper.cpp create mode 100755 src/scim_anthy_helper.h create mode 100755 src/scim_anthy_imengine.cpp create mode 100755 src/scim_anthy_imengine.h create mode 100755 src/scim_anthy_intl.h create mode 100755 src/scim_anthy_kana.cpp create mode 100755 src/scim_anthy_kana.h create mode 100755 src/scim_anthy_key2kana.cpp create mode 100755 src/scim_anthy_key2kana.h create mode 100755 src/scim_anthy_key2kana_base.h create mode 100755 src/scim_anthy_key2kana_table.cpp create mode 100755 src/scim_anthy_key2kana_table.h create mode 100755 src/scim_anthy_nicola.cpp create mode 100755 src/scim_anthy_nicola.h create mode 100755 src/scim_anthy_preedit.cpp create mode 100755 src/scim_anthy_preedit.h create mode 100755 src/scim_anthy_prefs.cpp create mode 100755 src/scim_anthy_prefs.h create mode 100755 src/scim_anthy_reading.cpp create mode 100755 src/scim_anthy_reading.h create mode 100755 src/scim_anthy_setup.cpp create mode 100755 src/scim_anthy_setup.h create mode 100755 src/scim_anthy_setup_kana.cpp create mode 100755 src/scim_anthy_setup_kana.h create mode 100755 src/scim_anthy_setup_romaji.cpp create mode 100755 src/scim_anthy_setup_romaji.h create mode 100755 src/scim_anthy_style_file.cpp create mode 100755 src/scim_anthy_style_file.h create mode 100755 src/scim_anthy_table_editor.cpp create mode 100755 src/scim_anthy_table_editor.h create mode 100755 src/scim_anthy_utils.cpp create mode 100755 src/scim_anthy_utils.h diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100755 index 0000000..dd2659f --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,769 @@ +Notes on the Free Translation Project +************************************* + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work on translations can contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +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 included GNU +`gettext' library will be used. This library is wholly contained +within this package, usually in the `intl/' subdirectory, so prior +installation of the GNU `gettext' package is _not_ required. +Installers may use special options at configuration time for changing +the default behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will, respectively, bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might not be desirable. You should use +the more recent version of the GNU `gettext' library. I.e. if the file +`intl/VERSION' shows that the library which comes with this package is +more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages usually have many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +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. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your country by running the command +`locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +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 `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' 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 January +2004. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files af am ar az be bg bs ca cs da de el en en_GB eo es + +----------------------------------------------------+ + a2ps | [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | | + ap-utils | | + aspell | [] | + bash | [] [] [] [] | + batchelor | | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] | + bluez-pin | [] [] [] | + clisp | | + clisp | [] [] [] | + console-tools | [] [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + darkstat | [] () [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] () [] [] [] [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] [] [] | + flex | [] [] [] [] | + fslint | | + gas | [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] [] | + gettext | [] [] [] [] [] | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] [] [] [] | + gliv | | + glunarclock | [] [] | + gnubiff | [] | + gnucash | [] () [] [] | + gnucash-glossary | [] () [] | + gnupg | [] () [] [] [] [] | + gpe-aerial | [] | + gpe-beam | [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] [] | + gprof | [] [] [] | + gpsdrive | () () () | + gramadoir | [] | + grep | [] [] [] [] [] [] | + gretl | [] | + gtick | [] () | + hello | [] [] [] [] [] [] | + id-utils | [] [] | + indent | [] [] [] [] | + iso_3166 | [] [] [] [] [] [] [] [] [] [] | + iso_3166_1 | [] [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] | + iso_639 | | + jpilot | [] [] [] | + jtag | | + jwhois | [] | + kbd | [] [] [] [] [] | + latrine | () | + ld | [] [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] | + libiconv | [] [] [] [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lingoteach_lessons | () () | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] | + man-db | [] () [] [] () | + minicom | [] [] [] | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] | + nano_1_0 | [] () [] [] [] | + opcodes | [] | + parted | [] [] [] [] [] | + ptx | [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] | + sed | [] [] [] [] [] [] | + sh-utils | [] [] [] | + shared-mime-info | | + sharutils | [] [] [] [] [] [] | + silky | () | + skencil | [] () [] | + sketch | [] () [] | + soundtracker | [] [] [] | + sp | [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + textutils | [] [] [] [] | + tin | () () | + tp-robot | | + tuxpaint | [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] [] [] [] [] | + xchat | [] [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] | + +----------------------------------------------------+ + af am ar az be bg bs ca cs da de el en en_GB eo es + 4 0 0 1 9 4 1 40 41 60 78 17 1 5 13 68 + + et eu fa fi fr ga gl he hr hu id is it ja ko lg + +-------------------------------------------------+ + a2ps | [] [] [] () () | + aegis | | + ant-phone | [] | + anubis | [] | + ap-utils | [] | + aspell | [] [] | + bash | [] [] | + batchelor | [] [] | + bfd | [] | + binutils | [] [] | + bison | [] [] [] [] | + bluez-pin | [] [] [] [] [] | + clisp | | + clisp | [] | + console-tools | | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] [] | + darkstat | () [] [] [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | | + enscript | [] [] | + error | [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] [] [] [] [] [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | [] | + gawk | [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext | [] [] [] | + gettext-examples | [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] | + gliv | () | + glunarclock | [] [] [] [] | + gnubiff | [] | + gnucash | () [] | + gnucash-glossary | [] | + gnupg | [] [] [] [] [] [] [] | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] [] [] | + gpe-clock | [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] | + gpe-sketchbook | [] | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] [] [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] | + gprof | [] [] | + gpsdrive | () () () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] [] | + gtick | [] [] [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + indent | [] [] [] [] [] [] [] [] [] | + iso_3166 | [] [] [] [] [] [] [] | + iso_3166_1 | [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | | + iso_4217 | [] [] [] [] [] [] | + iso_639 | | + jpilot | [] () | + jtag | [] | + jwhois | [] [] [] [] | + kbd | [] | + latrine | [] | + ld | [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] [] [] | + libiconv | [] [] [] [] [] [] [] [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] | + lingoteach_lessons | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | | + make | [] [] [] [] [] [] | + man-db | () () | + minicom | [] [] [] [] | + mysecretdiary | [] [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] | + parted | [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] | + sed | [] [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] | + sharutils | [] [] [] [] [] | + silky | () [] () () | + skencil | [] | + sketch | [] | + soundtracker | [] [] | + sp | [] () | + tar | [] [] [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] [] [] [] | + tin | [] () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux | [] [] [] [] () [] | + vorbis-tools | [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] | + xchat | [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] [] | + +-------------------------------------------------+ + et eu fa fi fr ga gl he hr hu id is it ja ko lg + 22 2 1 26 106 28 24 8 10 41 33 1 26 33 12 0 + + lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru + +-----------------------------------------------------+ + a2ps | [] [] () () [] [] [] | + aegis | () () () | + ant-phone | [] [] | + anubis | [] [] [] [] [] [] | + ap-utils | [] () [] | + aspell | [] | + bash | [] [] [] | + batchelor | [] | + bfd | [] | + binutils | [] | + bison | [] [] [] [] [] | + bluez-pin | [] [] [] | + clisp | | + clisp | [] | + console-tools | [] | + coreutils | [] [] | + cpio | [] [] [] [] [] | + darkstat | [] [] [] [] | + diffutils | [] [] [] [] [] [] | + e2fsprogs | [] | + enscript | [] [] [] [] | + error | [] [] [] | + fetchmail | [] [] () [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] | + fslint | [] [] | + gas | | + gawk | [] [] [] | + gbiff | [] [] | + gcal | | + gcc | | + gettext | [] [] [] | + gettext-examples | [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] | + gliv | [] [] [] | + glunarclock | [] [] [] [] | + gnubiff | [] | + gnucash | [] [] () [] | + gnucash-glossary | [] [] | + gnupg | [] | + gpe-aerial | [] [] [] [] | + gpe-beam | [] [] [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] [] | + gpe-ownerinfo | [] [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] | + gprof | [] [] | + gpsdrive | () () [] | + gramadoir | () [] | + grep | [] [] [] [] [] | + gretl | | + gtick | [] [] [] | + hello | [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + indent | [] [] [] [] | + iso_3166 | [] [] [] | + iso_3166_1 | [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] [] [] [] [] | + iso_639 | [] | + jpilot | () () | + jtag | | + jwhois | [] [] [] [] () | + kbd | [] [] [] | + latrine | [] | + ld | | + libc | [] [] [] [] | + libgpewidget | [] [] [] | + libiconv | [] [] [] [] [] | + lifelines | | + lilypond | | + lingoteach | | + lingoteach_lessons | | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailutils | [] [] [] | + make | [] [] [] [] | + man-db | [] | + minicom | [] [] [] [] | + mysecretdiary | [] [] [] | + nano | [] [] [] [] [] | + nano_1_0 | [] [] [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + ptx | [] [] [] [] [] [] [] [] | + python | | + radius | [] [] | + recode | [] [] [] [] | + rpm | [] [] [] | + screem | | + scrollkeeper | [] [] [] [] [] | + sed | [] [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] | + sharutils | [] [] | + silky | () | + skencil | [] [] | + sketch | [] [] | + soundtracker | | + sp | | + tar | [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] | + tin | | + tp-robot | [] | + tuxpaint | [] [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] | + vorbis-tools | [] [] [] | + wastesedge | | + wdiff | [] [] [] [] [] | + wget | [] [] [] | + xchat | [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] [] | + +-----------------------------------------------------+ + lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru + 1 2 0 3 12 0 10 69 6 7 1 40 26 36 76 63 + + sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu + +-----------------------------------------------------+ + a2ps | [] [] [] [] | 16 + aegis | | 0 + ant-phone | | 3 + anubis | [] [] | 9 + ap-utils | () | 3 + aspell | | 4 + bash | | 9 + batchelor | | 3 + bfd | [] [] | 6 + binutils | [] [] [] | 8 + bison | [] [] | 14 + bluez-pin | [] [] [] | 14 + clisp | | 0 + clisp | | 5 + console-tools | | 3 + coreutils | [] [] [] [] | 16 + cpio | [] [] | 14 + darkstat | [] [] [] () () | 12 + diffutils | [] [] [] | 23 + e2fsprogs | [] [] | 6 + enscript | [] [] | 12 + error | [] [] [] | 15 + fetchmail | [] [] | 11 + fileutils | [] [] [] [] [] | 17 + findutils | [] [] [] [] [] [] | 29 + flex | [] [] | 13 + fslint | | 3 + gas | [] | 3 + gawk | [] [] | 12 + gbiff | | 4 + gcal | [] [] | 4 + gcc | [] | 4 + gettext | [] [] [] [] [] | 16 + gettext-examples | [] [] [] [] [] | 14 + gettext-runtime | [] [] [] [] [] [] [] [] | 22 + gettext-tools | [] [] [] [] [] [] | 14 + gimp-print | [] [] | 10 + gliv | | 3 + glunarclock | [] [] [] | 13 + gnubiff | | 3 + gnucash | [] [] | 9 + gnucash-glossary | [] [] [] | 8 + gnupg | [] [] [] [] | 17 + gpe-aerial | [] | 7 + gpe-beam | [] | 8 + gpe-calendar | [] [] [] [] | 13 + gpe-clock | [] [] [] | 10 + gpe-conf | [] [] | 9 + gpe-contacts | [] [] [] | 11 + gpe-edit | [] [] [] [] [] | 12 + gpe-go | | 5 + gpe-login | [] [] [] [] [] | 13 + gpe-ownerinfo | [] [] [] [] | 13 + gpe-sketchbook | [] [] | 9 + gpe-su | [] [] [] | 10 + gpe-taskmanager | [] [] [] | 10 + gpe-timesheet | [] [] [] [] | 12 + gpe-today | [] [] [] [] [] | 13 + gpe-todo | [] [] [] [] | 12 + gphoto2 | [] [] [] | 11 + gprof | [] [] | 9 + gpsdrive | [] [] | 3 + gramadoir | [] | 5 + grep | [] [] [] [] | 26 + gretl | | 3 + gtick | | 7 + hello | [] [] [] [] [] | 34 + id-utils | [] [] | 12 + indent | [] [] [] [] | 21 + iso_3166 | [] [] [] [] [] [] [] | 27 + iso_3166_1 | [] [] [] | 16 + iso_3166_2 | | 0 + iso_3166_3 | | 2 + iso_4217 | [] [] [] [] [] [] | 24 + iso_639 | | 1 + jpilot | [] [] [] [] [] | 9 + jtag | [] | 2 + jwhois | () [] [] | 11 + kbd | [] [] | 11 + latrine | | 2 + ld | [] [] | 5 + libc | [] [] [] [] | 20 + libgpewidget | [] [] [] [] | 13 + libiconv | [] [] [] [] [] [] [] [] | 27 + lifelines | [] | 2 + lilypond | [] | 3 + lingoteach | | 2 + lingoteach_lessons | () | 0 + lynx | [] [] [] | 14 + m4 | [] [] | 15 + mailutils | | 5 + make | [] [] [] | 16 + man-db | [] | 5 + minicom | | 11 + mysecretdiary | [] [] | 10 + nano | [] [] [] [] | 17 + nano_1_0 | [] [] [] | 17 + opcodes | [] [] | 6 + parted | [] [] [] | 15 + ptx | [] [] | 22 + python | | 0 + radius | | 4 + recode | [] [] [] | 20 + rpm | [] [] | 9 + screem | [] [] | 2 + scrollkeeper | [] [] [] | 15 + sed | [] [] [] [] [] [] | 24 + sh-utils | [] [] | 14 + shared-mime-info | [] [] | 7 + sharutils | [] [] [] [] | 17 + silky | () | 3 + skencil | [] | 6 + sketch | [] | 6 + soundtracker | [] [] | 7 + sp | [] | 3 + tar | [] [] [] [] [] | 24 + texinfo | [] [] [] | 14 + textutils | [] [] [] [] | 16 + tin | | 1 + tp-robot | | 2 + tuxpaint | [] [] [] [] [] | 29 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux | [] [] | 15 + vorbis-tools | | 8 + wastesedge | | 0 + wdiff | [] [] [] | 18 + wget | [] [] [] [] [] [] [] [] | 24 + xchat | [] [] [] [] [] | 15 + xfree86_xkb_xml | [] [] [] [] [] | 11 + xpad | | 5 + +-----------------------------------------------------+ + 63 teams sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu + 131 domains 47 19 28 83 0 0 59 13 1 1 11 0 22 22 0 1373 + + 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 January 2004 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 +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. + diff --git a/AUTHORS b/AUTHORS new file mode 100755 index 0000000..87f88db --- /dev/null +++ b/AUTHORS @@ -0,0 +1,6 @@ +Developer: + Takuro Ashie + Hiroyuki Ikezoe + +Art work: + SHIMODA Hiroshi diff --git a/COPYING b/COPYING new file mode 100755 index 0000000..d60c31a --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100755 index 0000000..a8321df --- /dev/null +++ b/ChangeLog @@ -0,0 +1,2409 @@ +2012-11-25 Li Zhang + + * commit preedit string when reset, Version-0.0.0125. + +2009-0l-29 Takuro Ashie + + * configure.ac: Version-1.2.7. + +2009-01-25 Takuro Ashie + + * src/scim_anthy_conversion.cpp: Add missing include file. + Thanks Utumi-san, Ikuya-san. + +2009-0l-15 Takuro Ashie + + * src/scim_anthy_conversion.cpp, src/scim_anthy_setup.cpp, + src/scim_anthy_prefs.h: + Set UTF-8 as default encoding (ported from 1.4 branch). + +2009-0l-14 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Removed a needless line. + +2008-08-04 Takuro Ashie + + * src/scim_anthy_reading.cpp: Set NICOLA engine as case sensitive. + +2008-03-29 Takuro Ashie + + * configure.ac: Version-1.2.6. + +2008-03-28 Takuro Ashie + + * src/scim_anthy_factory.cpp, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.cpp: + Fix typo. Thanks Malcolm Parsons and Ikuya Awashiro. + +2008-02-29 Takuro Ashie + + * configure.ac: Version-1.2.5. + +2008-02-26 Takuro Ashie + + * src/scim_anthy_setup.cpp: Sort style file list by name. + +2008-02-25 Takuro Ashie + + * src/scim_anthy_factory.cpp: Update credit. + +2008-01-23 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_kana.cpp, + src/scim_anthy_preedit.cpp, src/scim_anthy_prefs.cpp, + src/scim_anthy_setup.cpp, src/scim_anthy_utils.cpp: + Added missing include files to build against gcc-4.3. + +2007-10-12 Takuro Ashie + + * po/de.po: Add. Thanks Gerrit Sangel. + * data/nicola-f.sty: Backport from trunk. + +2007-05-29 Takuro Ashie + + * configure.ac: Version-1.2.4. + +2007-05-21 Takuro Ashie + + * src/scim_color_button.{cpp,h}: Renamed to + scim_anthy_color_button.{cpp,h}. + * src/scim_anthy_color_button.{cpp.h]: Added. + * src/Makefile.am, scim_anthy_setup.cpp: Renamed to + scim_anthy_color_button* and ScimAnthyColorButton*. + +2007-05-14 Takuro Ashie + + * src/scim_anthy_key2kana.cpp: Clear m_last_key on clear(). + +2007-05-14 Takuro Ashie + + * src/scim_anthy_key2kana.cpp: Fix a bug that voiced consonants are + gone after inputing "Ro" has been fixed. Thanks MORIYAMA Masayuki. + +2007-04-29 Takuro Ashie + + * configure.ac: Version-1.2.3. + +2007-04-16 Takuro Ashie + + * src/Makefile.am: Remove binary version from the install path of the + helper module. + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_key2kana.{cpp,h}, + src/scim_anthy_prefs.h, src/scim_anthy_default_table.cpp: + Add spcial treatment for "RO" key of JIS kana layout. It requires + scim-1.4.6 or later (it is not released yet). + +2007-03-28 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}: Show aux string again if the lookup + table is activated on focus in event. + Thanks TAGOH-san and somebody who contributes the patch. + +2007-01-06 Takuro Ashie + + * src/scim_anthy_utils.h: Include missing header files. + Thanks Gregor Waltz. + +2006-11-14 Takuro Ashie + + * configure.ac; Version-1.2.2. + +2006-10-30 Takuro Ashie + + * src/scim_anthy_conversion.cpp: Fix a bug that a wrong partial string + is converted on direct kana conversion after commiting a piece of + segments. + +2006-09-29 Takuro Ashie + + * configure.ac: Version-1.2.1. + +2006-09-25 Takuro Ashie + + * src/scim_anthy_setup.cpp: Enable dictionary encoding prefs. + * src/scim_anthy_prefs.h: Revert default dictionary encoding to EUC-JP. + +2006-09-25 Takuro Ashie + + * src/scim_anthy_reading.cpp, src/scim_anthy_key2kana.cpp: + Apply TAGOH-san's solution for the previous problem. Thanks. + +2006-09-25 Takuro Ashie + + * src/scim_anthy_reading.cpp: Give a first aid to the problem that + codes of pseudo ASCII mode breaks pending state of normal kana input + mode. Thanks Ryo Dairiki for your report. + Fix indent. + * src/scim_anthy_key2kana.cpp: Fix indent. + +2006-09-11 Takuro Ashie + + * README, src/scim_anthy_factory.cpp: Change Dairiki-san's mail address. + * po/ja.po: Update. + +2006-08-06 Takuro Ashie + + * configure.ac: Add AC_SUBST(LIBTOOL_EXPORT_OPTIONS). + Thanks Kouhei Sutou. + +2006-07-31 Takuro Ashie + + * NEWS: Add a missing entry (The description about the tsuki layout). + +2006-07-29 Takuro Ashie + + * configure.ac: Version-1.2.0. + +2006-07-25 Takuro Ashie + + * src/scim_anthy_factory.cpp: Raise priority of "pseudo ascii mode + cancel" key. + * src/scim_anthy_imengine.cpp: Ignore key event without relation + at AnthyInstance::action_cancel_pseudo_ascii_mode(). + * src/scim_anthy_prefs.h: Add "Escape" into + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT key. + +2006-07-25 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Insert a half space on pressing space + key during pseudo ascii mode. + +2006-07-24 Takuro Ashie + + * src/scim_anthy_setup.cpp: Hide dictionary encoding option. + +2006-07-24 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.{cpp,h}, + src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_reading.cpp, + src/scim_anthy_setup.cpp, src/scim_anthy_setup_romaji.cpp: + DIC_ENCODING -> DICT_ENCODING. And fix compile time warnings. + +2006-07-21 Takuro Ashie + + * src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp: + EUCJP-MS -> EUC-JP-MS and set default encoding as EUC-JP-MS. + * po/ja.po: Update. + +2006-07-20 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.{cpp,h}, + src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp: + Add "Encoding of dictionary" preference to improve + interoperatability with Microsoft Windows. + * src/scim_anthy_key2kana_base.h: Fix compile time warning. + * po/ja.po: Update. + +2006-07-18 Takuro Ashie + + * src/scim_anthy_prefs.cpp: Fix some messages. + * po/ja.po: Update. + +2006-07-13 Akira TAGOH + + * src/scim_anthy_action.{cpp,h}, src/scim_anthy_factory.{cpp,h}, + src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_kana.{cpp,h}, + src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_key2kana_base.h, + src/scim_anthy_nicola.{cpp,h}, src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_reading.{cpp,h}, + src/scim_anthy_setup.cpp, src/scim_anthy_setup_romaji.cpp: + Enable to enter space during pseudo ASCII mode. + +2006-07-11 Takuro Ashie + + * data/Makefile.am, data/tsuki-2-203-101.sty, + data/tsuki-2-203-106.sty: Add "tsuki" layout. Thanks Tatsuki Sugiura. + +2006-07-11 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Enable reconversion feature on non-GTK+ + application. But it's a ad-hoc solution. + Thank you for your patch > Takashi Nakamoto + +2006-07-10 Takuro Ashie + + * src/scim_anthy_conversion.cpp: Fix a bug that scim-anthy never + switch to conversion mode when the auto prediction feature is enabled. + +2006-07-04 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_prefs.h, + src/scim_anthy_setup.cpp: Add a preference to choose behavior on + focus out. + +2006-06-26 Takuro Ashie + + * src/scim_anthy_setup.cpp: Fix indent. + +2006-06-26 Takuro Ashie + + * src/scim_anthy_preedit.h: Fix some comments. + +2006-06-18 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_preedit.{cpp,h}: Add an arguemnt to Preedit::clear() + and Conversion::clear() to specify segment_id to enable partial clear. + It is needed for commiting without learn. Thanks Jun Oizumi for your + report. + +2006-06-17 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Fix a typo in a comment. + +2006-06-02 Ikuya Awashiro + + * data/msime.sty: Add predict keys. + * data/wnn.sty: ditto. + * data/canna.sty: ditto. + +2006-06-01 Takuro Ashie + + * data/atok.sty, data/msime.sty: Fix some wrong entries in Romaji + table. Thanks Jun Oizumi. + +2006-05-31 Takuro Ashie + + * src/scim_anthy_imengine.cpp: The bug that direct select keys didn't + work while predicting has been fixed. Thank you for reporting > + TAGOH-san, UTUMI-san, Bando-san. + +2006-04-10 Akira TAGOH + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_key2kana_base.h, + src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_prefs.{cpp,h}, + src/scim_anthy_reading.{cpp,h}, src/scim_anthy_setup_romaji.cpp: + Add pseudo ASCII input mode. + +2006-03-29 Takuro Ashie + + * configure.ac: Version-1.0.0. + +2006-03-29 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Don't activate direct select key when + the lookup window isn't shown. Thanks TAGOH-san. + +2006-02-28 Takuro Ashie + + * src/scim_anthy_conversion.cpp: Strange bihavior of resizing segment + after partial commit has been fixed. + +2006-02-14 Takuro Ashie + + * src/scim_anthy_setup.cpp: Modify order of symbol style. + +2006-02-14 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Install symbol style properties. + * src/scim_anthy_setup.cpp: Show check box for symbol style label. + +2006-02-13 Takuro Ashie + + * data/atok.sty, data/canna.sty, data/msime.sty, data/vje-delta.sty, + data/wnn.sty: "/", "[", "]" entries in romaji table aren't needed + anymore. + +2006-02-13 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp: + Add a preference to show or hide symbol style label on toolbar. + But label itself is not added yet. + +2006-02-13 Takuro Ashie + + * src/scim_anthy_setup.cpp: Split symbol related preferences from + "Common" page. Change order of candidates in some combos. + +2006-02-13 Takuro Ashie + + * src/scim_anthy_factory.cpp: Fix credit. + * po/ja.po: Update. + +2006-02-08 Takuro Ashie + + * po/ja.po: Update. + +2006-02-08 Takuro Ashie + + * src/scim_anthy_setup.cpp: Add version information. + +2006-02-08 Akira TAGOH + + * src/scim_anthy_default_tables.{cpp,h}, + src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.{cpp,h}, + src/scim_anthy_key2kana_table.{cpp,h}, + src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_prefs.{cpp,h}, + src/scim_anthy_reading.{cpp,h}, src/scim_anthy_setup.cpp: + Add symbol style preference. + +2006-01-29 Takuro Ashie + + * configure.ac: Version-0.9.0. + +2006-01-21 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Fix double commiting on wide latin mode. + Thanks UTUMI-san and Dairiki-san. + +2006-01-13 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Fix typo (ANthy -> Anthy). + +2005-12-27 Takuro Ashie + + * src/scim_anthy_prefs.{cpp,h}: Minor fix. + +2005-12-27 Takuro Ashie + + * src/scim_anthy_key2kana_table.h, src/scim_anthy_style_file.h: + Remove needless #include. + +2005-12-26 Takuro Ashie + + * data/wnn.sty: Fix typo (shrink segment). + +2005-12-20 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Remove needless code. + +2005-12-16 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Avoid double deleting both former and + later mathced text when start reconversion. + +2005-12-15 Takuro Ashie + + * src/scim_anthy_default_tables.cpp: NULL terminate for voiced + contonant table. + +2005-12-14 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Half space character was never outputed + by space key when the typing method is NICOLA mode. + +2005-12-08 Takuro Ashie + + * src/scim_anthy_factory.cpp, po/ja.po: Fix typo. + +2005-12-07 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Through space key event on + action_insert_space() family to activate application's specific + features. + +2005-12-06 Takuro Ashie + + * src/scim_anthy_nicola.cpp: Timer didn't work correctly when both + a normal key and a thumb shift key was pressed. + +2005-11-29 Takuro Ashie + + * data/atok.sty: Add predict keys. + +2005-11-29 Takuro Ashie + + * Version-0.8.0. + +2005-11-25 Takuro Ashie + + * src/scim_anthy_reading.cpp: Don't set NICOLA engine as case + sensitive by default. + +2005-11-22 Takuro Ashie + + * src/tron-dvorak.sty, src/tron-qwerty-jp.sty: + Add TRON layout. Thanks Okano, Shinchi . + +2005-11-19 Takuro Ashie + + * src/scim_anthy_prefs.cpp: Add mnemonic. + * po/ja.po: Update. + +2005-11-19 Takuro Ashie + + * src/scim_anthy_key2kana_table.cpp: Remove needless comment. + +2005-11-19 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_preedit.h: Rename SCIM_ANTHY_CANDIDATE_NORMAL to + SCIM_ANTHY_CANDIDATE_DEFAULT. + +2005-11-19 Takuro Ashie + + * src/scim_anthy_reading.{cpp,h}, src/scim_anthy_conversion.cpp, + src/scim_anthy_preedit.cpp: Remove needless code in Reading class. + +2005-11-19 Takuro Ashie + + * src/scim_anthy_reading.cpp: Remove debug print. + +2005-11-19 Takuro Ashie + + * src/scim_anthy_nicola.cpp: Don't eat unknown key release event. + * src/scim_anthy_imengine.cpp: Add a comment. + +2005-11-19 Takuro Ashie + + * src/scim_anthy_key2kana_base.h, src/scim_anthy_kana.{cpp,h}, + src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_nicola.{cpp,h}: + Move implementation of set_case_sensitive() and get_case_sensitive() to + Key2KanaConvertorBase. + +2005-11-19 Takuro Ashie + + * src/scim_anthy_key2kana_base.h, src/scim_anthy_kana.{cpp,h}, + src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_nicola.{cpp,h}, + src/scim_anthy_reading.cpp: + Add reset_pending () to Key2KanaConvertorBase class. + +2005-11-16 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Remove needless code. + +2005-11-16 Takuro Ashie + + * src/scim_anthy_nicola.cpp: Sorry, forgot to set alarm at some place. + +2005-11-16 Takuro Ashie + + * src/scim_anthy_default_tables.cpp: Add voiced consonants as shift + modifired keys into default NICOLA table. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_conversion.cpp: Add remaining HAS_ANTHY_PREDICTION + condition. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp: + Add UI for preferences of prediction. + * po/ja.po: Update. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.h: Enable to choose whether use direct select key + while predicting or not. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_helper.h: Fix typo. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Enable to select a candidte by direct + select key on prediction. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Enable to select a candidte on + prediction. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_reading.cpp: NICOLA engine should be case sensitive. + * src/scim_anthy_default_tables.cpp: Add some shift modifired keys into + NICOLA table. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_setup_kana.cpp: Fix some messages. + * po/ja.po: Update. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Don't to use m_lookup_table for\ + prediction to avoid conflict. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.h: Add a preference to select whether predict + while inputting or not. + +2005-11-15 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_factory.cpp, + src/scim_anthy_prefs.{cpp,h}: Add key bindings for prediction, and + comment out realtime prediction. + * src/scim_anthy_preedit.{cpp,h}: Add is_predicting (). + * src/scim_anthy_conversion.{cpp,h}: Add a feature for getting predicted + candidates. + * po/ja.po: Update. + +2005-11-14 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_preedit.cpp: + Cleanup. + +2005-11-14 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}: Add test code for prediction. + +2005-11-14 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}: Cleanup. + +2005-11-14 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_preedit.{cpp,h}: + Add prediction. Other minor fix. + +2005-11-14 Takuro Ashie + + * src/scim_anthy_conversion.h: Fix typo. + * src/scim_anthy_conversion.cpp: Fix indent. + +2005-11-13 Takuro Ashie + + * configure.ac: Requires scim-1.2.0. + +2005-11-13 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Add a comment. + +2005-11-13 Takuro Ashie + + * src/scim_anthy_nicola.cpp, src/scim_anthy_prefs.cpp, + src/scim_anthy_setup_kana.cpp: + Add a preference for simultaneous key pressing time. + +2005-11-12 Takuro Ashie + + * src/scim_anthy_helper.h: Add new commands for creating and deleting + input context. + +2005-11-12 Takuro Ashie + + * src/scim_anthy_nicola.cpp: Set limit of timer to 5ms < time < 1000ms. + +2005-11-12 Takuro Ashie + + * src/scim_anthy_nicola.{cpp,h}: Process single pressing more strictly + using timer. + +2005-11-12 Takuro Ashie + + * src/scim_anthy_helper.cpp, src/scim_anthy_imengine.cpp: + The timer feature has been tested and minor fix. + +2005-11-12 Takuro Ashie + + * src/scim_anthy_helper.cpp, src/scim_anthy_imengine.cpp: + Add timer, but it isn't tested yet. + +2005-11-12 Takuro Ashie + + * src/scim_anthy_prefs.cpp, data/atok.sty, data/msime.sty: + Add reconversion key. + * po/ja.po: Update. + +2005-11-12 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h}: + Fix some bit problems in reconversion feature. + +2005-11-12 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_imengine.cpp: Add reconversion feature, but it has some + bit problems yet. + +2005-11-12 Takuro Ashie + + * Makefile.am, src/scim_anthy_helper.cpp, + src/scim_anthy_imengine.{cpp,h}: Add test code getting selection text. + +2005-11-10 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_factory.{cpp,h}, + src/scim_anthy_prefs.h: Add reconvert key, but not implemented yet. + +2005-11-10 Takuro Ashie + + * configure.ac, src/scim_anthy_helper.cpp, src/Makefile.am: + Add anthy-imengine-helper. But it does nothing yet. + +2005-11-09 Takuro Ashie + + * src/scim_anthy_factory.cpp: + Add package name and version into authors text. + Thank you for your notifying > Masatake YAMATO + +2005-11-07 Takuro Ashie + + *po/ja.po: Update. + +2005-11-07 Takuro Ashie + + * src/scim_anthy_factory.cpp: Add help text. + +2005-11-06 Takuro Ashie + + *po/ja.po: Update. + +2005-11-06 Takuro Ashie + + * src/scim_anthy_prefs.h: Modify some default key bindings. + +2005-11-06 Takuro Ashie + + * src/scim_anthy_nicola.cpp: + Handle keypad correctly on thumb shift typing method. + +2005-11-06 Takuro Ashie + + * src/scim_anthy_key2kana.cpp: + Handle keypad correctly on kana typing method. + +2005-11-06 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_key2kana.cpp, + src/scim_anthy_utils.{cpp,h}: + Apply ten key setting exactly. But it's not enough yet for kana and + thumb shift typing method. + +2005-11-05 Takuro Ashie + + * src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_imengine.{cpp,h}, + src/scim_anthy_factgory.cpp: Change & add some key bindings. + Now previous "LatinModeKey" is renamed to "OnOffKey". Please reset your + configuration if you use non-default key bindings. + * data/atok.sty, data/canna.sty, data/msime.sty, data/vje-delta.sty, + data/wnn.sty: + Sync with new key bindings. + +2005-11-01 Takuro Ashie + + * data/nicola-a.sty, data/nicola-j.sty, data/oasys100j.sty: + Use wide character for numbers. + +2005-11-01 Takuro Ashie + + * src/scim_anthy_default_tables.cpp: Fix NICOLA table. + +2005-10-23 Takuro Ashie + + * src/scim_anthy_factory.cpp: Change uuid to increase priority. + +2005-10-21 Takuro Ashie + + * data/atok.sty: Fix typo in romaji table. + +2005-10-20 Takuro Ashie + + * src/scim_anthy_prefs.h: Remove needless entry. + +2005-10-16 Takuro Ashie + + * src/scim_anthy_prefs.cpp: Fix typo. + * po/ja.po: Update. + +2005-10-16 Takuro Ashie + + * src/scim_anthy_prefs.h: Add Henkan key to "Convert key" and "Next + candidate" key. + +2005-10-15 Takuro Ashie + + * data/Makefile.am: Add wnn.sty. + * data/wnn.sty: Add "Shift+space" to "Latin mode". + +2005-10-14 Takuro Ashie + + * Version-0.7.1 (BRANCH-0.7.0). + +2005-10-14 Takuro Ashie + + * src/scim_anthy_factory.cpp, src/scim_anthy_prefs.cpp: Fix typo. + * po/ja.po: Translate some untranslated messages. + +2005-10-11 Takuro Ashie + + * src/scim_anthy_factory.cpp: Fix typo. + +2005-10-04 Takuro Ashie + + * src/scim_anthy_table_editor.cpp: Fix a crash bug. + Thanks reporting! > Yukiko Bando & AWASHIRO Ikuya + +2005-09-29 Takuro Ashie + + * configure.ac: Version-0.7.0. + +2005-09-28 Takuro Ashie + + * data/canna.sty: Comment out non-implemented key bind. + +2005-09-26 Takuro Ashie + + * AUTHORS, src/scim_anthy_factory.cpp: Change order of authors list. + +2005-09-26 Takuro Ashie + + * data/wnn.sty: Add Wnn like romaji table and key map. + +2005-09-16 Takuro Ashie + + * data/canna.sty: Fix typo. + * src/scim_anthy_factory.cpp, src/scim_anthy_imengine.{cpp,h}, + src/scim_anthy_prefs.{cpp,h}: Add some key bindings. + (CancelAllKey, ConvertCharTypeForwardKey, ConvertCharTypeBackwardKey) + +2005-08-30 Takuro Ashie + + * data/canna.sty, data/msime.sty, data/vje-delta.sty: Fix typo. + +2005-08-30 Takuro Ashie + + * src/scim_anthy_prefs.h: Show dictionary menu on the panel by default. + +2005-08-30 Takuro Ashie + + * data/scim-anthy.png: Replace with new icon. + +2005-08-30 Takuro Ashie + + * src/scim_anthy_setup.cpp: Sorry, wrong key was set on startup. + +2005-08-30 Takuro Ashie + + * data/vje-delta.sty: Add. + * data/atok.sty, data/canna.sty, data/msime.sty: Minor fix. + +2005-08-29 Takuro Ashie + + * data/Makefile.am, data/canna.sty: Add Canna like style. + +2005-08-23 Takuro Ashie + + * src/scim_anthy_setup_romaji.cpp, src/scim_anthy_setup_kana.cpp: + Minor fix. + +2005-08-23 Takuro Ashie + + * src/scim_anthy_setup.cpp: Minor fix. + +2005-08-23 Takuro Ashie + + * src/scim_anthy_setup.cpp: Show all key bindings by default. + +2005-08-23 Takuro Ashie + + * src/scim_anthy_factory.cpp: Add authors. + +2005-08-14 Takuro Ashie + + * configfure.ac: Version-0.6.1 (Branch 0.6.0). + +2005-08-10 Takuro Ashie + + * src/scim_anthy_table_editor.cpp: Fix a stupid bug. + Thank you very much :D > Yukiko Bando + +2005-08-10 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Revive multi/dead key related code. + Thanks Yukiko Bando. + +2005-08-10 Takuro Ashie + + * src/scim_anthy_table_editor.cpp: NULL check before strcmp(). + +2005-08-09 Takuro Ashie + + * src/scim_anthy_factory.cpp: Set correct default value. + +2005-08-08 Takuro Ashie + + * src/scim_anthy_factory.cpp: Plug memory leak. Check file name length + of style file before load it. + * src/scim_anthy_imengine.cpp: Set custom typing table correctly even if + typing method label on toolbar is shown. + * src/scim_anthy_table_editor.cpp: Compare all columns on sorting. + +2005-08-05 Takuro Ashie + + * src/scim_anthy_setup_kana.cpp: Fix initial window size. + +2005-08-05 Takuro Ashie + + * src/scim_anthy_prefs.cpp: Minor fix. + * po/ja.po, src/scim_anthy_setup_kana.cpp, + src/scim_anthy_setup_romaji.cpp, src/scim_anthy_table_editor.{cpp,h}: + Add NICOLA customize window. + +2005-08-05 Takuro Ashie + + * src/scim_anthy_setup_kana.cpp: Enable to switch NICOLA layout by + option menu. + +2005-08-04 Takuro Ashie + + * src/scim_anthy_key2kana_table.cpp, src/scim_anthy_reading.cpp, + src/scim_anthy_style_file.cpp: Bug fix. Now loading custom NICOLA + layout is available. + +2005-08-04 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.{cpp,h}, + src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_reading.{cpp,h}: + Load custom NICOLA layout. Some minor fix. + +2005-08-04 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_reading.{cpp,h}: Clean up. + +2005-08-03 Takuro Ashie + + * src/scim_anthy_key2kana_table.{cpp,h}, src/scim_anthy_nicola.{cpp,h}, + src/scim_anthy_reading.{cpp,h}: Ready for customizable NICOLA layout. + +2005-08-03 Takuro Ashie + + * src/scim_anthy_key2kana.cpp, scim_anthy_key2kana_table.{cpp,h}, + scim_anthy_style_file.cpp: Ready for customizable NICOLA layout. + +2005-08-02 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}: Add get_typing_method() and + get_input_mode (). + +2005-08-02 Takuro Ashie + + * src/scim_anhthy_conversion.h: Remove needless code. + * src/scim_anhthy_conversion.h, src/scim_anthy_reading.h: Minor fix. + +2005-08-02 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_kana.{cpp,h}, + src/scim_anthy_key2kana.{cpp,h}, src/scim_anthy_key2kana_base.h, + src/scim_anthy_nicola.{cpp,h}, src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_reading.{cpp,h}: + Make each object to read static configurations directly from + AnthyFactory. + +2005-08-02 Takuro Ashie + + * src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.{cpp,h}, + src/scim_anthy_setup_kana.cpp: Clean up. + +2005-08-02 Takuro Ashie + + * src/scim_anthy_key2kana_table.cpp: Remove needless code. + +2005-08-02 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Always set file name of style file + object on loading even if it fails. + +2005-08-02 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Process user defined key bindings before + input key event for [Scim-imengine-dev 573] issue. + Only thumb shift keys should be processed before user defined key + bindings. + Thanks Ryo Dairiki. + +2005-08-01 Takuro Ashie + + * src/scim_anthy_preedit.cpp, src/scim_anthy_conversion.cpp: + Remove needless code. + +2005-07-29 Takuro Ashie + + * configure.ac: Version-0.6.0. + +2005-07-29 Takuro Ashie + + * configure.ac: Version-0.5.3 (BRNACH_0_5_0). + +2005-07-28 Takuro Ashie + + * data/nicola-a.sty, data/nicola-j.sty, data/oasys100j.sty: + Add copyright notice. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_setup_kana.cpp: Comment out NICOLA time setting. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_prefs.cpp: Sorry, wrong step size for NICOLA time was + set. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_default_tables.{cpp,h}, src/scim_anthy_kana.cpp, + src/scim_anthy_reading.cpp: + Add keypad table to KanaConvertor, but it's not used yet. + Class name should be renamed. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.cpp: + Don't flush pending string on realtime conversion. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_prefs.h, src/scim_anthy_setup_romaji.cpp, + src/scim_anthy_setup_kana.cpp: + Don't save romaji theme & kana layout name. + * src/scim_anthy_setup.cpp: The bug that user defined key bindings + aren't loaded has been fixed. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_reading.cpp: Don't create new segment if empty string + is returned from Key2KanaConvertor. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_conversion.cpp, src/scim_anthy_factory.{cpp,h}, + src/scim_anthy_preedit.cpp, src/scim_anthy_prefs.h, + src/scim_anthy_utils.{cpp,h}: + Apply preedit style preference. Fixed default settings of preedit style. + +2005-07-26 Takuro Ashie + + * po/ja.po: Update. + * src/scim_anthy_setup.cpp: Bug fix. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.h, + src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_reading.{cpp,h}, src/scim_anthy_setup.cpp: + Each object should read its configuration directly. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_preedit.cpp: Flush pending string in reading before + start conversion. Thanks 428 of SCIM thread in 2ch Linux borad. + +2005-07-26 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.{cpp,h}, + src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_prefs.{cpp,h}, + src/scim_anthy_setup.{cpp,h}: + Add preferences for color of conversion string. + Add UI for preference of preedit style, but it's not applied yet. + +2005-07-25 Takuro Ashie + + * src/scim_anthy_nicola.h: Don't use operator "!=" for KeyEvent class. + +2005-07-25 Takuro Ashie + + * data/msime.sty: Fix a wrong key binding. + +2005-07-23 Takuro Ashie + + * data/Makefile.am, data/nicola-a.sty, data/nicola-j.sty,oasys100j.sty: + Add NICOLA layouts. Thanks Hatuka*nezumi. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}: Always load mode settings on + initializing. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_action.cpp, src/scim_anthy_imengine.cpp, + src/scim_anthy_nicola.cpp, src/scim_anthy_utils.{cpp,h}: + Specify ignore mask when matching key event. + +2005-07-22 Takuro Ashie + + * po/ja.po, src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp, + Show units for integer type configurations. + +2005-07-22 Takuro Ashie + + * po/ja.po, src/scim_anthy_factory.h, src/scim_anthy_imengine.h, + src/scim_anthy_nicola.{cpp,h}, src/scim_anthy_setup.{cpp,h}, + src/scim_anthy_setup_kana.cpp: + Apply preferences for NICOLA except layout setting. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_setup.cpp, src/scim_anthy_utils.{cpp,h}: + Load preferenes for NICOLA. + +2005-07-22 Takuro Ashie + + * po/ja.po, src/scim_anthy_factory.cpp, src/scim_anthy_prefs.{cpp,h}, + src/scim_anthy_setup.{cpp,h}, src/scim_anthy_setup_kana.cpp: + Add preferences for NICOLA. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_nicola.cpp: Ignore Control and Alt modifiered keys. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_imenginne.cpp, src/scim_anthy_setup.cpp: + Remove #define ENABLE_NICOLA. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_nicola.cpp: + Temporary solution for handling single thumb shift key pressing. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_nicola.{cpp,h}, + src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_reading.{cpp,h}: + Handle single thumb shift key pressing. Still has some bugs. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_nicola.cpp: Fix indent and other minor fix. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_nicola.{cpp,h}: Refactoring. + +2005-07-22 Takuro Ashie + + * src/scim_anthy_nicola.cpp: Bug fix of handling key repeat. + +2005-07-21 Takuro Ashie + + * src/scim_anthy_nicola.{cpp,h}: Minor fixes. + +2005-07-21 Takuro Ashie + + * src/scim_anthy_nicola.{cpp,h}: Rewrite. But still has some bugs. + +2005-07-21 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp, po/ja.po: + Add a preferenece to show/hide the "Candidates" label. + +2005-07-21 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Show the "Candidates" label for lookup + window using aux string like honoka-tan. + +2005-07-20 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Don't apply some setting which can be + changed from toolabr. + +2005-07-20 Takuro Ashie + + * src/scim_anthy_reding.{cpp,h}: Support voiced sound on X's kana + typing. + +2005-07-20 Takuro Ashie + + * src/scim_anthy_reding.{cpp,h}: Test for supporting kana symbol of X. + +2005-07-20 Takuro Ashie + + * src/scim_anthy_kana.{cpp,h}: Added to support kana symbol of X. + +2005-07-20 Takuro Ashie + + * src/scim_anthy_key2kana_table.{cpp,h}, + src/scim_anthy_default_tables.{cpp,h}: + Create voiced consonant table automatically. + +2005-07-19 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Don't use convert as you type on Latin + or Wide Latin mode. + +2005-07-19 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_setup.cpp: + Disable NICOLA by default because some required features aren't + implemented yet. To enable it, please define ENABLE_NICOLA macro. + +2005-07-19 Takuro Ashie + + * src/scim_anthy_default_tables.{cpp,h}: Add KanaRule. + +2005-07-19 Takuro Ashie + + * data/atok.sty, data/msime.sty: Add "Zenkaku_Hankaku" to LatinModeKey. + * src/scim_anthy_factory.cpp, src/scim_anthy_setup.cpp: + Load key bindings from system wide style file. + +2005-07-17 Takuro Ashie + + * po/ja.po, src/scim_anthy_prefs.cpp, src/scim_anthy_setup.cpp: + Set mnemonic for spin button and fix typo. + +2005-07-17 Takuro Ashie + + * src/src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp: + Added preference to set the page size of the lookup table. + * po/ja.po: Update. + +2005-07-17 Takuro Ashie + + * data/Makefile.am, data/101kana.sty: Added a kana table for 101 + keyboard. Voiced consonants aren't handled yet by this table. + +2005-07-17 Takuro Ashie + + * src/scim_anthy_default_tables.cpp: Sort Kana and NICOLA table by + QWERTY order. + +2005-07-16 Takuro Ashie + + * src/scim_anthy_key2kana_table.cpp: Minor bug fix. + +2005-07-16 Takuro Ashie + + * src/scim_anthy_default_tables.cpp: Modified Kana table. + +2005-07-16 Takuro Ashie + + * src/scim_anthy_default_tables.cpp: Modified NICOLA table. + +2005-07-16 Takuro Ashie + + * src/scim_anthy_default_tables.{cpp,h}, + src/scim_anthy_key2kana_table.cpp: + Use half/wide setting of symbols and numbers also on kana mode. + +2005-07-16 Takuro Ashie + + * configure.ac: Version-0.5.2 (BRANCH_0_5_0 branch). + +2005-07-16 Takuro Ashie + + * src/scim_anthy_default_tables.cpp, src/scim_anthy_key2kana_table.cpp: + The bug that preferences for period, comma and width of numbers aren't + applied correctly has been fixed. + +2005-07-16 Takuro Ashie + + * src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp: + Added a widget to set the previous added preference. + +2005-07-16 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp: + src/scim_anthy_prefs.h: + Add a preference to set number of triggers to show lookup table. + +2005-07-16 Takuro Ashie + + * src/scim_anthy_conversion.cpp: Set initial cursor position of lookup + table. + * src/scim_anthy_factory.cpp, src/scim_anthy_imengine.{cpp,h}: + Count the number of times on which the convertion key was pressed. + +2005-07-16 Takuro Ashie + + * data/Makefile.am, data/azik.sty: Add AZIK extended romaji table. + +2005-07-16 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Minor fix. + +2005-07-15 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_prefs.h, + src/scim_anthy_setup_kana.cpp, src/scim_anthy_setup_romaji.cpp, + src/scim_anthy_style_file.{cpp,h}: + Load romaji or kana table directly from system wide theme file instead + of user's config file when the file name is specified at ~/.scim/config. + +2005-07-10 Takuro Ashie + + * po/ja.po, po/POTFILES.in: Update. + * src/Makefile.am, src/scim_anthy_prefs.h, src/scim_anthy_setup.cpp, + src/scim_anthy_setup_kana.{cpp,h}: Enable to customize kana table. + * src/scim_anthy_setup_romaji.cpp: Minor bugfix. + +2005-07-10 Takuro Ashie + + * src/scim_anthy_setup_romaji.cpp, src/scim_anthy_table_editor.{cpp,h}: + Use ScimAnthyTableEditor class. + +2005-07-10 Takuro Ashie + + * src/scim_anthy_setup_romaji.cpp: Minor fix. + * src/scim_anthy_table_editor.{cpp,h}: Add. + * src/Makefile.am: Add above file. + +2005-07-10 Takuro Ashie + + * po/ja.po: Update. + +2005-07-08 Takuro Ashie + + * src/scim_anthy_style_file.{cpp,h}, src/scim_anthy_setup_romaji.cpp: + Use UTF-8 as internal encoding. Add some functions for setting array. + +2005-07-08 Takuro Ashie + + * configure.ac: Version-0.5.1 (BRANCH_0_5_0 branch). + +2005-07-08 Takuro Ashie + + * src/scim_anthy_setup_romaji.cpp: Use new functions to getting array. + +2005-07-08 Takuro Ashie + + * src/scim_anthy_style_file.{cpp,h}: Refactoring. + +2005-07-08 Takuro Ashie + + * src/scim_anthy_style_file.{cpp,h}: Add functions for getting array. + +2005-07-07 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp: + Load kana typing table from "KanaTable/FundamentalTable" section in + ~/.scim/Anthy/config.sty. + +2005-07-07 Takuro Ashie + + * src/scim_anthy_reading.cpp: Set Key2KanaConvertor as case sensitive + when switch typing method to kana typing mode. + * src/scim_anthy_style_file.cpp: Enable to treate "continue" field of + key2kana conversion rule. + +2005-07-07 Takuro Ashie + + * src/scim_anthy_conversion.cpp, src/scim_anthy_imengine.cpp, + src/scim_anthy_preedit.cpp, src/scim_anthy_setup.cpp, + src/scim_anthy_utils.{cpp,h}: + Changed naming rule of global functions. + +2005-07-07 Takuro Ashie + + * src/scim_anthy_key2kana.cpp: + It's the ashie's refactoring ;-P + It's ashie quality ;-P + - for (unsigned int i = 0; i < seq.length (); i++) + - seq[i] = tolower (seq[i]); + + for (unsigned int j = 0; j < seq.length (); i++) + + seq[i] = tolower (seq[j]); + +2005-07-07 Takuro Ashie + + * src/scim_anthy_factory.cpp, src/scim_anthy_key2kana.cpp, + src/scim_anthy_key2kana_table.{cpp,h}, src/scim_anthy_setup.cpp, + src/scim_anthy_setup_romaji.cpp, src/scim_anthy_style_file.{cpp,h}: + Refactoring. + +2005-07-07 Takuro Ashie + + * src/scim_anthy_default_table.{cpp,h}, scim_anthy_key2kana_table.cpp: + Split voiced consonant rule from kana typing table. + +2005-07-07 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.{cpp,h}: + Revive set_typing_method() and get_typing_method() of Preedit class. + +2005-07-07 Takuro Ashie + + * src/scim_color_button.cpp: Remove compile time & run time warnings. + +2005-07-07 Takuro Ashie + + * src/scim_anthy_prefs.cpp, src/scim_anthy_setup.cpp: Fix typo. + * po/POTFILES.in, po/ja.po: Update. + +2005-07-07 Takuro Ashie + + * src/scim_anthy_setup.cpp: Set border width of color choice button. + * po/ja.po: Update. + +2005-07-06 Takuro Ashie + + * src/scim_anthy_factory.cpp, src/scim_anthy_imengine.{cpp,h}, + src/scim_anthy_prefs.{cpp,h}: + Add "Do nothing" action to disable a certain key event such as the space + key. It may be needed to use the space key as thumb shift key, or to + insert a space at a release event of space key, not a press event. + +2005-07-06 Takuro Ashie + + * src/scim_anthy_setup.cpp: Fixed order of buttons for showing/hiding + toolbar items. + +2005-07-06 Takuro Ashie + + * src/scim_anthy_nicola.{cpp,h}: Fix a problem that NicolaConvertor + ignores a shift modifiered key event. + +2005-07-06 Takuro Ashie + + * src/Makefile.am, src/scim_anthy_default_tables.{cpp,h}, + src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_key2kana.{cpp,h}, + src/scim_anthy_key2kana_base.h, src/scim_anthy_key2kana_table.h, + src/scim_anthy_nicola.{cpp,h}, src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_reading.{cpp,h}, src/scim_anthy_setup.cpp: + Started to implement NICOLA support. + +2005-07-04 Hiroyuki Ikezoe + + * src/scim_anthy_conversion.cpp: + Removed foreground attribute from selected segment text + since Gecko handles text as reversed text if foreground color is set. + +2005-07-04 Hiroyuki Ikezoe + + * src/scim_color_button.{cpp,h}, + src/scim_anthy_setup.cpp: + Use String class for color value. + +2005-07-03 Takuro Ashie + + * data/atok.sty: Fixed typo. + src/scim_anthy_factory: Raise priority of PageUp and PageDown. + Thanks AWASHIRO ikuya. + +2005-07-01 Hiroyuki Ikezoe + + * data/scim-anthy-swap-colors.png, + src/scim_color_button.{cpp,h}, + src/scim_anthy_conversion.{cpp,h}, + src/scim_anthy_factory.{cpp,h}, + src/scim_anthy_imengine.cpp, + src/scim_anthy_preedit.{cpp,h}, + src/scim_anthy_prefs.{cpp,h}, + src/scim_anthy_setup.cpp: + Preference of preedit and segment text color. + +2005-06-29 Takuro Ashie + + * configure.ac: Version-0.5.0. + +2005-06-28 Takuro Ashie + + * src/Makefile.am: Add header files. + +2005-06-27 Takuro Ashie + + * src/scim_anthy_setup_romaji.cpp: Changed widget order. + +2005-06-27 Takuro Ashie + + * src/scim_anthy_setup.cpp: Minor bug fix. + +2005-06-26 Takuro Ashie + + * src/scim_anthy_prefs.{cpp,h}: Fixed order of configurations. + +2005-06-26 Takuro Ashie + + * src/scim_anthy_prefs.h: Remove needless code. + +2005-06-25 Takuro Ashie + + * src/scim_anthy_imnegine.cpp: Reconvert before auto commit on + "Convert as you type". + +2005-06-24 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_prefs.{cpp,h}, + src/scim_anthy_setup.cpp: + Add preference to commit on inputting period or comma. + * po/ja.po: Update. + +2005-06-24 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_utils.{h,cpp}: + Move launch_program () into scim_anthy_utils.cpp + * src/scim_anthy_setup.cpp: Add "Launch" button for dictionary relates + commands. + * po/ja.po: Update. + +2005-06-24 Takuro Ashie + + * src/scim_anthy_imengine.cpp: + Enable F6-F10 keys while "Convert as you type". + +2005-06-24 Takuro Ashie + + * src/scim_anthy_prefs.h: Make "Allow split romaji" setting as ture by + default. + +2005-06-24 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp: + Add "Input mode" and "Conversion mode" preference. + * po/ja.po: Update. + +2005-06-23 Takuro Ashie + + * src/scim_anthy_factory.{cpp,h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_prefs.{cpp,h}, src/scim_anthy_setup.cpp: + Add preference to show/hide conversion mode label on toolbar. + * po/ja.po: Update. + +2005-06-23 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Enable to delete letters on "Convert as + you type". + +2005-06-23 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Select last segment when start selecting + candidates on "Convert as you type". + +2005-06-23 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_imengine.{cpp,h}: + Started to implement "Convert as you type" feature. + * po/ja.po: Update. + +2005-06-23 Takuro Ashie + + * src/scim_anthy_key2kana.cpp: Make Key2KanaConvertor as case + insensitive by default. + +2005-06-23 Takuro Ashie + + * src/scim_anthy_action.cpp: Ignore CapsLock on matching key bindings. + +2005-06-23 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_utils.{cpp,h}: + Rotate case of alphabet letters on pressing F8, F9 and F10 key like ATOK + or Microsoft IME. + * TODO: update. + +2005-06-22 Takuro Ashie + + * src/scim_anthy_conversion.cpp: Set reading length to ConversionSegment + class correctly. + +2005-06-22 Takuro Ashie + + * src/scim_anthy_conversion.{cpp.h}: implement get_segment_length () + of Conversion class correctly. + +2005-06-22 Takuro Ashie + + * src/scim_anthy_conversion.{cpp.h}, src/scim_anthy_imengine.cpp, + src/scim_anthy_preedit.{cpp,h}: + Unify some functions. + +2005-06-22 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}: Refactoring. + +2005-06-22 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}: Added some members into + ConversionSegment class. + +2005-06-22 Takuro Ashie + + * src/scim_anthy_prefs.h: Swap F9 and F10. + +2005-06-22 Takuro Ashie + + * TODO, data/atok.sty, data/msime.sty, po/ja.po, + src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_factory.cpp, + src/scim_anthy_imengine.{cpp,h}, src/scim_anthy_preedit.h, + src/scim_anthy_prefs.{cpp,h}: + Add half width conversion feature. + (The function binded to F8 key) + +2005-06-22 Takuro Ashie + + * src/scim_anthy_setup.cpp: Add "User defined" label for key theme. + +2005-06-21 Takuro Ashie + + * src/scim_anthy_setup_romaji.cpp: Add "User defined" label. + +2005-06-21 Takuro Ashie + + * po/ja.po: Update. + +2005-06-20 Takuro Ashie + + * po/POTFILES.in, po/ja.po: Update. + +2005-06-19 Takuro Ashie + + * data/atok.sty, data/msime.sty, src/scim_anthy_default_tables.cpp: + Add some symbols. + +2005-06-19 Takuro Ashie + + * src/scim_anthy_key2kana_table.cpp: Changed priority of tables. + +2005-06-15 Takuro Ashie + + * src/scim_anthy_setup.cpp: Changed page order. + +2005-06-10 Takuro Ashie + + * data/atok.sty: Remove needless entry in romaji table. + * data/msime.sty: Fix order of romaji table. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_key2kana_table.cpp: Disable auto convert when + preedition is started with comma or period. + Thanks reporting > UTUMI-san. + +2005-06-10 Takuro Ashie + + * scim_anthy_key2kana_table.cpp: Sorry, wrong comma table is set. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Set compare func to sort correctly. + Thanks reporting > UTUMI-san. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Don't reduce trailing space. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Bug fix. + +2005-06-10 Takuro Ashie + + * data/msime.sty: Add "-" entry into romaji table. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Handle escaped "=" correctly. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Also "[" and "]" should be escaped. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Also "=" should be escaped. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_setup_romaji.cpp: Fix typo. + * src/scim_anthy_style_file.cpp: Escape string. + +2005-06-10 Takuro Ashie + + * src/scim_anthy_setup.cpp: Minor fix. + +2005-06-09 Takuro Ashie + + * src/scim_anthy_setup.h, scim_anthy_setup.{cpp,h}: + Split from scim_anthy_setup.cpp. + +2005-06-08 Takuro Ashie + + * src/scim_anthy_setup.cpp: Add romaji theme menu onto romaji window. + Thanks suggestion > UTUMI-san. + Also other minor bug fixes are made. + +2005-06-08 Takuro Ashie + + * src/scim_anthy_setup.cpp: Skip style files which contains no key bind + or romaji settings. + +2005-06-08 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Set fundamental key2kana table for kana + typing method as NULL. It's not support customizing yet. + * src/scim_anthy_setup.cpp: Code clean up. + +2005-06-08 Takuro Ashie + + * src/scim_anthy_setup.cpp: Make columns on romaji table as sortable. + Thank you for suggestion > UTUMI-san. + +2005-06-07 Takuro Ashie + + * src/scim_anthy_setup.cpp: + Don't allow inserting non-ascii character for romaji string. + Set sensitivity of add button on romaji window. + +2005-06-07 Takuro Ashie + + * src/scim_anthy_setup.cpp: Minor tunings for adding romaji. + +2005-06-07 Takuro Ashie + + * src/scim_anthy_setup.cpp: Implement add button on romaji table, but + it's not enough yet. Exception handling is too poor. + +2005-06-07 Takuro Ashie + + * src/scim_anthy_setup.cpp: Add entries to edit romaji, but it doesn't + work yet. + * po/ja.po, po/POTFILES.in: Update. + +2005-06-07 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Reset preedit string on changing input + mode. + +2005-06-07 Takuro Ashie + + * src/scim_anthy_setup.cpp: Set sensitivity of remove button on romaji + window. + +2005-06-07 Takuro Ashie + + * data/atok.sty: Add some key bindings. + +2005-06-07 Takuro Ashie + + * src/scim_anthy_default_tables.cpp: Changed romaji order. + * src/scim_anthy_setup.cpp: Implement remove button of romaji window. + +2005-06-06 Takuro Ashie + + * src/scim_anthy_setup.cpp: Rename from scim_anthy_imengine_setup.cpp. + +2005-06-06 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Bug fix. + * src/scim_anthy_imengine_setup.cpp: Add UI for cutomizing romaji table, + but it doesn't work yet. + +2005-06-04 Takuro Ashie + + * configure.ac: Version-0.4.3 (BRANCH_0_4_3 branch). + +2005-06-03 Takuro Ashie + + * src/scim_anthy_conversion.cpp, src/scim_anthy_imengine.{cpp,h}, + src/scim_anthy_preedit.{cpp,h}, src/scim_anthy_reading.{cpp,h}: + Reading::commit -> Reading::finish. + Preedit::flush_pending -> Preedit::finish. + +2005-06-02 Takuro Ashie + + * data/msime.sty: Fixed typo in romaji table. + +2005-06-02 Takuro Ashie + + * src/scim_anthy_action.{cpp,h}, src/scim_anthy_factory.cpp: + Fix for gcc-4.0. It's ad-hoc solution. + * src/scim_anthy_imengine.cpp: Fix indent. + +2005-06-02 Takuro Ashie + + * src/scim_anthy_prefs.{cpp,h}: Split from scim_anthy_imengine_setup.cpp + +2005-06-02 Takuro Ashie + + * src/scim_anthy_style_file.{cpp,h}: + Insert space before new section. + Remove "m_iconv" member from StyleLine. + +2005-06-01 Takuro Ashie + + * data/atok.sty, data/msime.sty: Add "Setting" section. + +2005-06-01 Takuro Ashie + + * Makefile.am, scim_anthy_imengine_setup.cpp, + scim_anthy_style_file.cpp, scim_anthy_style_file.h: + Add test code for switching romaji table. + +2005-06-01 Takuro Ashie + + * src/scim_anthy_style_file.cpp: Add functions deleting key/section & + adding new section. + +2005-06-01 Takuro Ashie + + * data/atok.sty, data/msime.sty: Add "n" entry for romaji table. + +2005-06-01 Takuro Ashie + + * src/scim_anthy_factory.cpp: Sorry, previous code had a clash bug. + +2005-06-01 Takuro Ashie + + * src/scim_anthy_factory.cpp, src/scim_anthy_factory.h, + src/scim_anthy_imengine.cpp, src/scim_anthy_key2kana.cpp, + src/scim_anthy_key2kana.h, src/scim_anthy_key2kana_table.cpp, + src/scim_anthy_key2kana_table.h, src/scim_anthy_style_file.cpp, + src/scim_anthy_style_file.h: + Add test code for loading a custom romaji table. + If you want to test it, please copy data/atok.sty or data/msime.sty to + ~/.scim/Anthy/config.sty, and edit it. Currently AdditionalTableList + isn't loaded yet. + +2005-05-31 Takuro Ashie + + * po/ja.po: Fix typo. + +2005-05-31 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Add UI for switching romaji table, + but it doesn't work yet. + +2005-05-31 Takuro Ashie + + * TODO: Update. + +2005-05-30 Takuro Ashie + + * data/atok.sty, data/msime.sty: Minor fix. + * data/scim_style_file.{cpp,h}: Add m_format_version and m_version. + +2005-05-30 Takuro Ashie + + * data/atok.sty, data/msime.sty: Remove ID entry. + +2005-05-30 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Set "Key bindings" column as + resizable. + +2005-05-30 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Add "Choose keys..." button for + key preference. + +2005-05-30 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Add a label for key theme. + +2005-05-30 Takuro Ashie + + * src/scim_anthy_prefs.h: Revert. + * src/scim_anthy_imengine_setup.cpp: Save current key theme name. + +2005-05-29 Takuro Ashie + + * src/scim_anthy_prefs.h: Use space character for empty key bind. + * src/scim_anthy_imengine_setup.cpp: Add test UI for changing key theme. + +2005-05-29 Takuro Ashie + + * data/atok.sty: Fix wrong key bindings + * src/scim_anthy_imengine.cpp: Bug fixes for committing first or + selected segment. + +2005-05-29 Takuro Ashie + + * data/msime.sty: Fix wrong key bindings. + +2005-05-28 Takuro Ashie + + * scim_anthy_imengine_setup.cpp, scim_anthy_style_file.h: + Load style files. + +2005-05-28 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_preedit.cpp: + get_current_segment_pos() -> get_segment_pos(). + +2005-05-28 Takuro Ashie + + * src/scim_anthy_conversion.{cpp,h}, src/scim_anthy_utils.{cpp,h}: + Split from scim_anthy_preedit.{cpp,h}. + +2005-05-27 Takuro Ashie + + * src/scim_anthy_key2kana.{cpp,h}: + Rename from scim_anthy_key2kana_convertor.{cpp,h}. + * src/scim_anthy_factory.{cpp,h}: + Rename from scim_anthy_imengine_factory.{cpp,h}. + +2005-05-26 Takuro Ashie + + * src/scim_anthy_preedit.cpp: Fix length of vocied consonant in half + width katakana letters. Thanks reporting! > Seiichi SATO + +2005-05-26 Takuro Ashie + + * src/scim_anthy_reading.cpp, src/scim_anthy_reading.h: + Split the segment when append a letter between letters in the segment. + +2005-05-26 Takuro Ashie + + * src/scim_anthy_reading.cpp: Reset values for caret position when + segment is splitted. + +2005-05-26 Takuro Ashie + + * src/scim_anthy_reading.cpp: Make enable to split a segment which + contains only alphabet letters. + +2005-05-26 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: + Add a check button for the preference to split ReadingSegment. + * po/ja.po: Update. + +2005-05-26 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_factory.h, src/scim_anthy_preedit.cpp, + src/scim_anthy_preedit.h, src/scim_anthy_prefs.h, + src/scim_anthy_reading.cpp, src/scim_anthy_reading.h: + Add a setting to choose whether allow splitting ReadingSegment or not. + +2005-05-26 Takuro Ashie + + * src/scim_anthy_reading.{cpp,h}: Make enable to choose whether allow + splitting ReadingSegment or not on Reading::erase(). + +2005-05-26 Takuro Ashie + + * src/scim_anthy_reading.cpp: Bug fixes for previous commited code. + +2005-05-25 Takuro Ashie + + * src/scim_anthy_reading.cpp: Make enable to split ReadingSegment. + +2005-05-25 Takuro Ashie + + * src/scim_anthy_dfault_table.{cpp,h}, + src/scim_anthy_key2kana_table.cpp: + Split consonant rule from fundamental table. + +2005-05-25 Takuro Ashie + + * src/scim_anthy_preedit.cpp: Sorry, new erase() implementation didn't + work correctly on certain condition. + +2005-05-25 Takuro Ashie + + * src/scim_anthy_default_table.cpp, src/scim_anthy_default_table.h: + Rename from src/scim_anthy_key2kana_table_default.{cpp,h}. + +2005-05-25 Takuro Ashie + + * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h: + Erase commited string in m_reading. + +2005-05-24 Takuro Ashie + + * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h + src/scim_anthy_reading.cpp. src/scim_anthy_reading.h: + Fixed arguments and implementation of Reading::erase(). + +2005-05-24 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h: + Minor fix. + * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h, + src/scim_anthy_reading.cpp, src/scim_anrhy_reading.h: + Divide. Currently partial commiting is broken. + +2005-05-18 Takuro Ashie + + * all files: Use "scim_anthy" name space. + +2005-05-17 Takuro Ashie + + * configure.ac: Sorry, AM_INIT_AUTOMAKE(1.9), not AM_PREREQ. + +2005-05-17 Takuro Ashie + + * configure.ac: Version-0.4.2 (BRANCH_0_4_0 branch). + +2005-05-17 Takuro Ashie + + * configure.ac: Add AM_PREREQ & AC_PREREQ. + +2005-05-17 Takuro Ashie + + * src/scim_anthy_imengine.src/scim_anthy_imengine.cpp: Clean up. + +2005-05-17 Takuro Ashie + + * po/ja.po: Fix typo. Thanks DAIRIKI-san. + +2005-05-16 Takuro Ashie + + * src/configure.ac: Version-0.4.1. + * NEWS: Uppdate. + +2005-05-16 Takuro Ashie + + * src/scim_anthy_preedit.cpp: Revive key mask checking to enable + apllication's short cut key on non-preedition state. + Thanks DAIRIKI-san. + +22005-05-16 Takuro Ashie + + * src/scim_anthy_imegnine_table.cpp: Priority of symbol and number + tables are lower than comma and period. + +2005-05-16 Takuro Ashie + + * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h: + Revive key mask checking to enable apllication's short cut key on + non-preedition state. Thanks DAIRIKI-san. + Rename AnthyPreeditChar to AnthyPreeditSegment, and remove "pending" + member. + +2005-05-16 Takuro Ashie + + * src/scim_anthy_intl.h, src/scim_anthy_key2kana_convertor.cpp, + src/scim_anthy_key2kana_convertor.cpp, + src/scim_anthy_key2kana_table.cpp, src/scim_anthy_key2kana_table.h, + src/scim_anthy_key2kana_table_default.cpp, + src/scim_anthy_key2kana_table_default.h: + Add. + * src/scim_anthy_conv_table.cpp, src/scim_anthy_conv_table.h, + src/scim_anthy_automaton.cpp, src/scim_anthy_automaton.h: + Remove. + +2005-05-15 Takuro Ashie + + * src/configure.ac: Version-0.4.0. + * NEWS: Uppdate. + +2005-05-14 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Set editable of key prefs entry to + FALSE. + +2005-05-13 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Remove mask checking to compile against + scim-1.3.0. Thanks UTUMI-san. + +2005-05-12 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Add "Group:" label. + * po/ja.po: Update. + +2005-05-12 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/src/scim_anthy_imengine.h: + Restore visibility of preedit string and lookup table window on focus + in. + +2005-05-12 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_factory.h, + src/scim_anthy_imengine_setup.cpp, src/scim_anthy_preedit.cpp, + src/scim_anthy_preedit.h, src/scim_anthy_prefs.h: + Added learning preferences. + +2005-05-11 Takuro Ashie + + * src/scim_anthy_imengine_factory.cpp: Don't reverse key list. + +2005-05-11 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Eat all key event while preediting. + * src/scim_anthy_preedit.cpp: Don't process space character. + +2005-05-11 Takuro Ashie + + * data/atok.sty, data/msime.sty: Fixed typo. + +2005-05-09 Takuro Ashie + + * configure.ac: Version-0.3.2 (BRANCH_0_3_0 branch). + +2005-05-09 Takuro Ashie + + * src/scim_anthy_prefs.h: Fixed typo. + Thanks to UTUMI-san & DAIRIKI-san. + * src/scim_anthy_preedit.cpp: Fixed some clash bugs. + This patch is contributed by Ryo Dairiki . + Thanks reporting. + +2005-05-03 Takuro Ashie + + * configure.ac, data/Makefile.am, src/Makefile.am: Install style file. + +2005-05-02 Takuro Ashie + + * src/Makefile.am, src/scim_anthy_imengine_setup.cpp, + src/scim_anthy_style_file.cpp, src/scim_anthy_style_file.h: + Added style file parser. + +2005-05-02 Takuro Ashie + + * data/atok.sty, data/msime.sty: Added missing keys. + +2005-05-02 Takuro Ashie + + * src/scim_anthy_prefs.h, data/msime.sty: Fixed typo. + +2005-05-02 Takuro Ashie + + * data/atok.sty, data/msime.sty: Fixed typo. + +2005-05-02 Takuro Ashie + + * data/atok.sty, data/msime.sty: Minor fix. + +2005-04-29 Takuro Ashie + + * src/scim_anhy_imengine_setup.cpp, src/scim_anthy_imengine.cpp, + po/ja.po: + Fixed typo. + +2005-04-27 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_setup.cpp, + src/scim_anthy_prefs.h: + Add hiragana mode, katakana mode, circle typing method keys. + * po/ja.po: Update. + +2005-04-27 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_setup.cpp, + src/scim_anthy_prefs.h: + Add key bindings to inserting half & wide space. + * po/ja.po: Update. + +2005-04-26 Takuro Ashie + + * src/scim_anthy_style_file.cpp, src/scim_anthy_style_file.h: Add. + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_setup.cpp, scim_anthy_prefs.h: + Add key binding for selecting first & last candidate. + +2005-04-26 Takuro Ashie + + * data/atok.sty: Add key bindings. + * data/msime.sty: Fix some entries. + +2005-04-26 Takuro Ashie + + * data/atok.sty: Added ATOK like style definition file. + +2005-04-26 Takuro Ashie + + * data/msime.sty: Add Version field. + +2005-04-25 Takuro Ashie + + * data/msime.sty: Added Microsoft IME like style definition file. + +2005-04-25 Takuro Ashie + + * src/scim_anthy_conv_table.cpp: Don't treat "-" as symbol. + Thanks to UTUMI-san. + +2005-04-25 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Minor fixes. + +2005-04-22 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Add description field to key list + view. + * po/ja.po: Update. + +2005-04-22 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_setup.cpp, src/scim_anthy_preedit.cpp, + src/scim_anthy_preedit.h, src/scim_anthy_prefs.h: + Add inserting space & alternative space action. + +2005-04-22 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Use new key list view. + * src/scim_anthy_prefs.h: Remove some wasted key settings. + * po/ja.po: Update. + +2005-04-21 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Now start to create a new key + preference widget. + +2005-04-21 Takuro Ashie + + * src/scim_anthy_imengine_factory.cpp: Fixed typo. + +2005-04-21 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_factory.h, src/scim_anthy_imengine_setup.cpp, + src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h, + src/scim_anthy_prefs.h: + Added preference for ten key. + +2005-04-21 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Remove debug code. + * src/scim_anthy_preedit.cpp: Always use half width character for + pressing keys on key pad. This feature should be customizable. + +2005-04-21 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.cpp, + src/scim_anthy_preedit.h: + Added key pad support. + +2005-04-21 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_factory.h: + Apply most preferences immediately. + +2005-04-20 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Added mnemonic. + * po/ja.po: Updated. + +2005-04-20 Takuro Ashie + + * src/scim_anthy_prefs.cpp: Don't show the typing method label by + default. + +2005-04-20 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_factory.h, src/scim_anthy_imengine_setup.cpp, + src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h, + src/scim_anthy_prefs.h: Added preferences for symbols & numbers width. + * po/ja.po: Updated. + +2005-04-20 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Refactoring. + * src/scim_anthy_prefs.h: Fixed typo. + * po/ja.po: Updated. + +2005-04-19 Takuro Ashie + + * src/scim_anthy_conv_table.cpp, src/scim_anthy_conv_table.h, + src/scim_anthy_preedit.cpp: + Fixed naming rule of conversion tables. + Divide symbol & number conversion rule from roma-kana table. + +2005-04-19 Takuro Ashie + + * src/conv_table.cpp: Remove. + * src/scim_anthy_conv_table.cpp: Renamed from src/conv_table.cpp + * src/scim_anthy_conv_table.h: Added. + * src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h, + src/scim_anthy_imengine.h: + Rename Preedit class to AnthyPreedit. + +2005-04-18 Takuro Ashie + + * src/conv_table.cpp: Added wide number rule. + * src/scim_anthy_prefs.h: Fixed some key name. + +2005-03-21 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Modified labels for input mode to make + easy to recognize. + +2005-03-15 Takuro Ashie + + * src/scim_anthy_imengine_factory.cpp, + src/scim_anthy_imengine_factory.h, intl.h: + Divided from scim_anthy_imengine.{cpp,h}. + * src/scim_anthy_action.cpp, src/scim_anthy_action.h, + src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + Introduced action manager. + * po/POTFILES.in, ja.po: Updated. + +2005-02-01 Hiroyuki Ikezoe + + * src/scim_anthy_imengine.cpp: + Removed comment lines about commiting the preediting string when + focusing out. It should not be so. + We need get the event(?) of switching off scim and clear the preedit + string at that time. + +2005-01-29 Takuro Ashie + + * Applied patches provided by David Oftedal and + Yukiko Bando to input some symbols. + Thank you! + +2005-01-29 Takuro Ashie + + * configure.ac: Version-0.3.1. + Updated automake (no changes in source code). + +2005-01-27 Takuro Ashie + + * configure.ac: Inclemented version number. + +2005-01-27 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_setup.cpp, src/scim_anthy_prefs.h, po/ja.po: + Added an option to close candidate window on direct selecting. + +2005-01-27 Takuro Ashie + + * src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_setup.cpp, src/scim_anthy_prefs.h, po/ja.po: + Enabled to select keys to select candidates directly. + +2005-01-27 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: + Added popup menu to switching notebook pages. + +2005-01-02 Hiroyuki Ikezoe + + * src/scim_anthy_imengine.cpp: + Applied the patch from james Su . + Do not disconnect a signal-slot with in the slot function. + +2004-12-24 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Clear preedit string on reset(). + See http://lists.freedesktop.org/pipermail/scim/2004-December/001298.html + for more detail. + +2004-12-17 Hiroyuki Ikezoe + + * src/scim_anthy_imengine.cpp: + Comment out action_commit() in foucs_out(). + +2004-12-15 Hiroyuki Ikezoe + + * src/scim_anthy_imengine.cpp, src/scim_anthy_preedit.cpp: + Fixed a bug that Up key indicates 'R' on LC_CTYPE=en_US.UTF-8 + environment. + +2004-12-15 Hiroyuki Ikezoe + + * src/scim_anthy_imengine.cpp: + Fixed a bug that dead key does not work. + +2004-12-15 Hiroyuki Ikezoe + + * src/scim_anthy_imengine.cpp: + Applied two patches from James Su. + It fixed + http://lists.sourceforge.jp/mailman/archives/scim-imengine-dev/2004-December/000041.html + +2004-12-02 Hiroyuki Ikezoe + + * src/scim_anthy_imengine_setup.cpp: + Fixed an issue that left arrow on the left of the tab label + is enabled on starup time. + +2004-12-02 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Remove dictionary label string. + +2004-12-02 Takuro Ashie + * po/ja.po, src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_setup.cpp, src/scim_anthy_prefs.h: + Added key bindings for dictionary related actions. + +2004-12-01 Takuro Ashie + + * po/ja.po, src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_imengine_setup.cpp, src/scim_anthy_prefs.h: + Add dictionary menu. + * src/scim_anthy_preedit.cpp: bug fix. + +2004-12-01 Takuro Ashie + + * src/scim_anthy_prefs.h: Added Zenkaku_Hankaku and Shift+space key + bind for toggling latin mode. Thanks suggestion > UTUMI-san + +2004-11-30 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Changed page order. + Thank your for your suggestion > UTUMI Hirosi + +2004-11-30 Takuro Ashie + + * src/conv_table.cpp, src/scim_anthy_imengine_setup.cpp, + src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h, + src/scim_anthy_prefs.h: + Added a comma and period type. Also other minor fixes are made. + +2004-11-30 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Declare some functions as static. + +2004-11-30 Takuro Ashie + + * src/scim_anthy_imengine_setup.cpp: Set tooltips. + +2004-11-29 Hiroyuki Ikezoe + + * version 0.2.0. + +2004-11-27 Hiroyuki Ikezoe + + * src/scim_anthy_imengine.cpp: pressing space key + at the tail of candidates returns the head of the candidates. + +2004-11-27 Hiroyuki Ikezoe + + * src/scim_anthy_imengine.cpp: select next/prev candidate is loop. + But there is a bug that pressing space key at the tail of the candidates + cannot be moved at the head of the candidates. Why? + +2004-11-26 Takuro Ashie + + * src/scim_anthy_imengine.cpp: Bug fix for selecting candidate by + SCIM_KEY_0. + +2004-11-26 Takuro Ashie + + * src/scim_anthy_prefs.h: Added some key bindings. + Thank you for your suggestion > Yukiko Bando + +2004-11-25 Takuro Ashie + + * po/ja.po, src/scim_anthy_imengine_setup.cpp, + src/scim_anthy_imengine.cpp, src/scim_anthy_imengine.h, + src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h, + src/scim_anthy_prefs.h: + Added partial commit feature, but this work is not completed yet. + The caret position isn't reset yet. + +2004-11-25 Takuro Ashie + + * po/ja.po, src/conv_table.cpp, src/scim_anthy_imengine.cpp, + src/scim_anthy_imengine.h, src/scim_anthy_imengine_setup.cpp, + src/scim_anthy_preedit.cpp, src/scim_anthy_preedit.h, + src/scim_anthy_prefs.h: + Added space type preference. + +2004-11-19 gettextize + + * Makefile.am (SUBDIRS): Add intl, + (ACLOCAL_AMFLAGS): New variable. + (EXTRA_DIST): New variable. + * configure.ac (AC_CONFIG_FILES): Add intl/Makefile, + +2004-11-19 Takuro Ashie + + * Implemented almost all basic features. diff --git a/INSTALL b/INSTALL new file mode 100755 index 0000000..54caf7c --- /dev/null +++ b/INSTALL @@ -0,0 +1,229 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 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 configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./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 machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--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'. + +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. + diff --git a/Makefile.am b/Makefile.am new file mode 100755 index 0000000..a8efc89 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,22 @@ +## Copyright (C) 2004 Hiroyuki Ikezoe +## Copyright (C) 2004-2005 Takuro Ashie +## +## 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. + +SUBDIRS = intl po m4 src data + +ACLOCAL_AMFLAGS = -I m4 + +EXTRA_DIST = config.rpath diff --git a/Makefile.in b/Makefile.in new file mode 100755 index 0000000..249d8db --- /dev/null +++ b/Makefile.in @@ -0,0 +1,706 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure $(top_srcdir)/intl/Makefile.in \ + ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS TODO \ + config.guess config.rpath config.sub depcomp install-sh \ + ltmain.sh missing mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longdouble.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = intl/Makefile +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +ANTHY_CFLAGS = @ANTHY_CFLAGS@ +ANTHY_LIBS = @ANTHY_LIBS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GENCAT = @GENCAT@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK2_CFLAGS = @GTK2_CFLAGS@ +GTK2_LIBS = @GTK2_LIBS@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIBTOOL_EXPORT_OPTIONS = @LIBTOOL_EXPORT_OPTIONS@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SCIM_ANTHY_DATADIR = @SCIM_ANTHY_DATADIR@ +SCIM_ANTHY_MAJOR_VERSION = @SCIM_ANTHY_MAJOR_VERSION@ +SCIM_ANTHY_MICRO_VERSION = @SCIM_ANTHY_MICRO_VERSION@ +SCIM_ANTHY_MINOR_VERSION = @SCIM_ANTHY_MINOR_VERSION@ +SCIM_ANTHY_VERSION = @SCIM_ANTHY_VERSION@ +SCIM_BUILD_HELPER = @SCIM_BUILD_HELPER@ +SCIM_BUILD_SETUP = @SCIM_BUILD_SETUP@ +SCIM_CFLAGS = @SCIM_CFLAGS@ +SCIM_DATADIR = @SCIM_DATADIR@ +SCIM_DEBUG_FLAGS = @SCIM_DEBUG_FLAGS@ +SCIM_GTKUTILS_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ +SCIM_GTKUTILS_LIBS = @SCIM_GTKUTILS_LIBS@ +SCIM_ICONDIR = @SCIM_ICONDIR@ +SCIM_LIBS = @SCIM_LIBS@ +SCIM_MODULEDIR = @SCIM_MODULEDIR@ +SCIM_VERSION = @SCIM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = intl po m4 src data +ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = config.rpath +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool + +# 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): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(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; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +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 tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + 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 $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + 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 | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + --with-included-gettext \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-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: diff --git a/NEWS b/NEWS new file mode 100755 index 0000000..ad7f153 --- /dev/null +++ b/NEWS @@ -0,0 +1,217 @@ +Overview of Changes from scim-anthy-1.2.6 to scim-anthy-1.2.7 +============================================================== +* Changed default encoding (for getting strings from Anthy) to UTF-8. +* Now NICOLA engine is case sensitive. + +Overview of Changes from scim-anthy-1.2.5 to scim-anthy-1.2.6 +============================================================== +* Fix packaging misstake. +* Fix typo (Thanks Malcolm Parsons and Ikuya Awashiro). + +Overview of Changes from scim-anthy-1.2.4 to scim-anthy-1.2.5 +============================================================== +* Fixed a build problem against gcc-4.3. +* Addd de.po (Thanks Gerrit Sangel). +* Added a style file for NICOLA-F layout (Thanks MORIYAMA Masayuki). +* Sort style list by name. + +Overview of Changes from scim-anthy-1.2.3 to scim-anthy-1.2.4 +============================================================== +* Fixed a bug that a character which is possible to become a voiced consonant + is gone after inputing "Ro" has been fixed. +* Fixed a name collision issue of ScimColorButton. Now you can use scim-anthy + with scim-chewing, maybe. + +Overview of Changes from scim-anthy-1.2.2 to scim-anthy-1.2.3 +============================================================== +* Fix install path of helper module. +* Distinguish two backslash key of jp106 keybord. It requires scim-1.4.6. + Please clear ~/.scim/config after install scim-1.4.6. +* Some minor fixes. + +Overview of Changes from scim-anthy-1.2.1 to scim-anthy-1.2.2 +============================================================== +* Fix a bug that a wrong partial string is converted on direct kana conversion + after commiting a piece of segments. + +Overview of Changes from scim-anthy-1.2.0 to scim-anthy-1.2.1 +============================================================== +* Fix a problem that the romaji pending state aren't restored on pressing a + backspace or moving the caret has been fixed. + (Thanks Ryo Dairiki and Akira TAGOH) +* Add a dictionary encoding preference into setup UI. +* Revert the default dictionary encoding preference to EUC-JP. +* Other minor fixes (Thanks Sutou). + +Overview of Changes from scim-anthy-1.0.0 to scim-anthy-1.2.0 +============================================================== +* Add pseudo ASCII input mode. It enables users to enter ASCII letters during + Japanese mode. Thanks Akira TAGOH for your patch. +* Enable reconversion feature on non-GTK+ application (It's a ad-hoc solition). + Thanks Takashi Nakamoto. +* Enable to choose behavior on focus out. +* Add predict key into some key bindings themes. Thanks Ikuya Awashiro. +* Try EUC-JP-MS first when convert characters from Anthy to Unicode. +* Add tsuki layout into the list of kana typing layouts. Thanks Sugi. +* The bug that direct select keys doesn't work during predicting has been fixed. + Thanks TAGOH, UTUMI, Bando for your report. +* Fix some wrong entries in Romaji tables. Thanks Jun Oizumi. +* Fix a bug that commited clauses aren't cleared when the learning preferenece + is disabled. Thanks Jun Oizumi. + +Overview of Changes from scim-anthy-0.9.0 to scim-anthy-1.0.0 +============================================================== +* Add symbol style preference (Thanks Akira TAGOH). +* Don't activate direct select key when the lookup window isn't shown + (Thanks Akira TAGOH). +* Fix credit. + +Overview of Changes from scim-anthy-0.8.0 to scim-anthy-0.9.0 +============================================================= +* Add SKIM support (Provide as external package). +* Add prediction key bindings to ATOK like key bindings theme. +* Ensure to through space key event to enable application's specific feature + like Mozilla's scrolling feature (Thanks reporting > Yukiko Bando). +* Fix double commiting bug on Wide Latin mode. + (Thanks Ryo Dairiki and UTUMI Hirosi) +* Other minor fixes. + +Overview of Changes from scim-anthy-0.7.1 to scim-anthy-0.8.0 +============================================================= +* Now scim-anthy requires scim-1.2.0 or later. +* Add prediction feature. +* Add reconversion feature. It can reconvert already commited string. + Currently this feature will be enabled only on Gtk+2. +* Default thumb shift layout has been improved. +* Add timer for thumb shift layout. +* Some key bindings are modified. Please select "Default" key bindings theme + in the setup window once to upgrade safely. +* Add Wnn like style file. +* Add TRON layout. Thanks Okano Shinchi. +* Apply ten key setting exactly on all input modes. +* Add help text. + +Overview of Changes from scim-anthy-0.7.0 to scim-anthy-0.7.1 +============================================================= +* Fix a bug that sicm-setup crashes when close romaji editor. + +Overview of Changes from scim-anthy-0.6.1 to scim-anthy-0.7.0 +============================================================= +* Show dictionary menu on the panel by default. + It uses kasumi (http://kasumi.sourceforge.jp/). + It's very important package for scim-anthy. + Distributors, please install also kasumi when install scim-anthy. +* Enable to customize NICOLA table. +* Replace the scim-anthy icon with new one. Thanks SHIMODA-san. +* Show all key bindings on key bindings view by default. +* Add some style files (Canna, VJE-Delta). +* Fix typo in some style files. + +Overview of Changes from scim-anthy-0.6.0 to scim-anthy-0.6.1 +============================================================= +* The bug that some key bindings is dead has been fixed. + Thanks Ryo Dairiki. +* The bug that custom typing tables aren't set correctly has been fixed. +* Pluged a memory leak. + +Overview of Changes from scim-anthy-0.5.3 to scim-anthy-0.6.0 +============================================================= +* Method of loading romaji table has been changed. + Old user settings will be cleared when you change it by scim-setup. +* Add preedit color preference. +* Add some prefereneces for lookup window. +* Add AZIK extended romaji table. +* Enable to customize kana typing table. +* Add a kana table for 101 keyborad. +* Support kana key symbols of X Window System. + But this feature has some limitations: + - You can't switch to X's kana typing mode from scim-anthy. + You should customize /etc/X11/xorg.conf to switch it. + See http://ikumi.revery.net/cmp/kanainputonx.htm for more details. + - Typing method indicator on the panel can't indicate X's kana lock state. +* Experimental NICOLA support. +* Other minor fixes. + +Overview of Changes from scim-anthy-0.5.2 to scim-anthy-0.5.3 +============================================================= +* Fix a wrong key binding in the Microsoft IME like key bindings. + +Overview of Changes from scim-anthy-0.5.1 to scim-anthy-0.5.2 +============================================================= +* The bug that preferences of period, comma and width of numbers aren't + applied correctly has been fixed. + +Overview of Changes from scim-anthy-0.5.0 to scim-anthy-0.5.1 +============================================================= +* The bug that some letters cannot be typed correctly on kana typing mode has + been fixed. +* The bug that some key bindings of ATOK style aren't set correctly has been + fixed. (Thanks AWASHIRO Ikuya) + +Overview of Changes from scim-anthy-0.4.3 to scim-anthy-0.5.0 +============================================================= +* Enable to customize romaji table. +* Add "Key bindings theme" and "Romaji table theme" features. + (Thank you for testing and many suggestions > UTUMI-san and Bando-san) +* Add "Convert as you type" feature. +* Enable to split a romaji sequence. (Thanks! DAIRIKI-san) +* Enable to rotate case of alphabet letters on pressing F8, F9 and F10 key like ATOK or Microsoft IME. +* Other minor bug fixes. (Thanks! UTUMI-san, SATO-san) + +Overview of Changes from scim-anthy-0.4.2 to scim-anthy-0.4.3 +============================================================= +* Fix for gcc-4.0. Thanks UTUMI-san. +* Fix a bug that selecting first & last candidate feature doesn't work. + Thanks BANDO-san. + +Overview of Changes from scim-anthy-0.4.1 to scim-anthy-0.4.2 +============================================================= +* Fix typo in Japanese message (Thanks! DAIRIKI-san). +* Update automake version because previous version reduce filename extension + of the module. + +Overview of Changes from scim-anthy-0.4.0 to scim-anthy-0.4.1 +============================================================= +* Fix a bug that scim-anthy eats all key events although it doesn't have + preedit string (Thanks! DAIRIKI-san). + +Overview of Changes from scim-anthy-0.3.2 to scim-anthy-0.4.0 +============================================================= +* Add preference for width of symbols and numbers. +* Add ten keys support. +* Enable to insert a alternative width space by "Shift + Space". + Now this key binding doesn't use as changing input mode by default anymore. +* Modify to apply most preferences immediately. +* Refine key bindings preference. +* Add some miscellaneous key bindings. +* Add preferences for learning. +* Modify label text on toolbar to make easy to recognize. +* Don't show typing method label on toolbar by default anymore. +* Add some symbols to romaji-table (Thanks! David Oftedal and Yukiko Bando). +* Other minor bug fixes (Thaks! UTUMI Hirosi). + +Overview of Changes from scim-anthy-0.3.1 to scim-anthy-0.3.2 +============================================================= +* Fixed a bug that the 10th candidate on the lookup window can't be selected by + direct selecting key. To enable this, please clear previous setting + ("/IMEngine/PRIME/SelectCandidates10Key" in ~/.scim/config). + Thanks to UTUMI-san and DAIRIKI-san. +* Fixed some clash bugs. Thanks to DAIRIKI-san. + +Overview of Changes from scim-anthy-0.3.0 to scim-anthy-0.3.1 +============================================================= +* Update automake version. + +Overview of Changes from scim-anthy-0.2.0 to scim-anthy-0.3.0 +============================================================= +* Enable to select short cut keys to choose candidate directly. +* Added an option to close candidate window on direct selecting. +* Added period and comma style preference. +* Launch dictionary administration tools from toolbar or short cut key. +* Fixed a bug which clashes the scim-setup when reload the config. + (Thanks! James Su) +* Other minor fixes (Thanks! UTUMI-san, Bando-san) + +scim-anthy-0.2.0 +============================================================= +* Initial release. diff --git a/README b/README new file mode 100755 index 0000000..32b5e97 --- /dev/null +++ b/README @@ -0,0 +1,120 @@ +1. What's this? +=============== + +scim-anthy is a SCIM IMEngine module for anthy. + +SCIM is Smart Common Input Method platform, it provides user friendly/full +featured user interface and development platform to make input method +developer's life easier. + +Anthy is a system for Japanese input method. +It converts Hiragana text to Kana Kanji mixed text. + +scim-anthy provides some usefull user interfaces for Anthy using SCIM. + + +2. Requirements +=============== + +2.1 Necessary + + * scim-1.2.0 or later. + - http://www.scim-im.org/ + + * Anthy-5100 or later. + - http://anthy.sourceforge.jp/ + - http://sourceforge.jp/projects/anthy/ + +3.2 Optional + + * kasumi-0.6 or later: + - Dictionary management tool. Invoked from scim-anthy. + - http://kasumi.sourceforge.jp/ + + +3. Install +========== + + You can build & install scim, anthy, and scim-anthy by following command: + + $ ./configure + $ make + # make install + + If you installed the SCIM into /usr/local or any other non-standard + diretories, you should specify the PKG_CONFIG_PATH environment variable like + this: + + $ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure + + You'll find distribution-specific installation method from following site: + + http://home.nyc.rr.com/computertaijutsu/jpninpt.html + + +4. Usage +======== + +Yukiko Bando wrote some efficient documents of scim-anthy. +These documents are written for Mandriva users, but also usefull for all users +using other distributions. + +Please see them to learn usage of the scim-anthy: + + * http://www.h4.dion.ne.jp/~apricots/scim-anthy/howto.html + * http://www.h4.dion.ne.jp/~apricots/scim-anthy/romakana.html + + +5. License +========== + +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. + + +6. Credit +========= + +Special thanks to all scim-anthy developers and users! + + * Hiroyuki Ikezoe + - Originator of this project. + + * Takuro Ashie + - Developer. + + * SHIMODA Hiroshi + - Art work. + + * James Su + - Anthor of scim + + * Yusuke Tabata + - Author of Anthy. + + * Yukiko Bando + - Wrote some efficient documents of scim-anthy. + + * UTUMI Hirosi + - Packager of RPM package for Mandriva. + + * Ryo DAIRIKI + - Packager of RPM package for Fedora Core. + + * Mike Fabian + - Packager of RPM package for SUSE. + + * Ikuya AWASHIRO + - Packager of deb package for Debian and Ubuntu. + + * Mamoru Komachi + - Packager of Gentoo package. diff --git a/TODO b/TODO new file mode 100755 index 0000000..e69de29 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100755 index 0000000..47a4beb --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,8137 @@ +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +_LT_REQUIRED_DARWIN_CHECKS + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# -------------------------- +# Check for some things on darwin +AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm -rf libconftest.dylib* + fi + rm conftest.c + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[0123]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil="~$DSYMUTIL \$lib || :" + else + _lt_dsymutil= + fi + ;; + esac +]) + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# --------------------------------------------------------------------- +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +m4_if($1,[],[ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`echo $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], +[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], +[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognize shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognize a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= +_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + if test "$GXX" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix[[3-9]]*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + # + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + if test "$solaris_use_stlport4" != yes; then + _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) +case " $_LT_AC_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac +])# AC_LIBTOOL_POSTDEP_PREDEP + +# AC_LIBTOOL_LANG_F77_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) +AC_DEFUN([_LT_AC_LANG_F77_CONFIG], +[AC_REQUIRE([AC_PROG_F77]) +AC_LANG_PUSH(Fortran 77) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="\ + subroutine t + return + end +" + +# Code to be used in simple link tests +lt_simple_link_test_code="\ + program t + end +" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +_LT_AC_TAGVAR(GCC, $1)="$G77" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_F77_CONFIG + + +# AC_LIBTOOL_LANG_GCJ_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) +AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], +[AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_RESTORE +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_GCJ_CONFIG + + +# AC_LIBTOOL_LANG_RC_CONFIG +# ------------------------- +# Ensure that the configuration vars for the Windows resource compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) +AC_DEFUN([_LT_AC_LANG_RC_CONFIG], +[AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_RESTORE +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_RC_CONFIG + + +# AC_LIBTOOL_CONFIG([TAGNAME]) +# ---------------------------- +# If TAGNAME is not passed, then create an initial libtool script +# with a default configuration from the untagged config vars. Otherwise +# add code to config.status for appending the configuration named by +# TAGNAME from the matching tagged config vars. +AC_DEFUN([AC_LIBTOOL_CONFIG], +[# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + _LT_AC_TAGVAR(compiler, $1) \ + _LT_AC_TAGVAR(CC, $1) \ + _LT_AC_TAGVAR(LD, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ + _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ + _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ + _LT_AC_TAGVAR(old_archive_cmds, $1) \ + _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ + _LT_AC_TAGVAR(predep_objects, $1) \ + _LT_AC_TAGVAR(postdep_objects, $1) \ + _LT_AC_TAGVAR(predeps, $1) \ + _LT_AC_TAGVAR(postdeps, $1) \ + _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ + _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ + _LT_AC_TAGVAR(archive_cmds, $1) \ + _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ + _LT_AC_TAGVAR(postinstall_cmds, $1) \ + _LT_AC_TAGVAR(postuninstall_cmds, $1) \ + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ + _LT_AC_TAGVAR(allow_undefined_flag, $1) \ + _LT_AC_TAGVAR(no_undefined_flag, $1) \ + _LT_AC_TAGVAR(export_symbols_cmds, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ + _LT_AC_TAGVAR(hardcode_automatic, $1) \ + _LT_AC_TAGVAR(module_cmds, $1) \ + _LT_AC_TAGVAR(module_expsym_cmds, $1) \ + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ + _LT_AC_TAGVAR(fix_srcfile_path, $1) \ + _LT_AC_TAGVAR(exclude_expsyms, $1) \ + _LT_AC_TAGVAR(include_expsyms, $1); do + + case $var in + _LT_AC_TAGVAR(old_archive_cmds, $1) | \ + _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ + _LT_AC_TAGVAR(archive_cmds, $1) | \ + _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ + _LT_AC_TAGVAR(module_cmds, $1) | \ + _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ + _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\[$]0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` + ;; + esac + +ifelse([$1], [], + [cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + AC_MSG_NOTICE([creating $ofile])], + [cfgfile="$ofile"]) + + cat <<__EOF__ >> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 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 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. +# +# 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. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The directories searched by this compiler when creating a shared +# library +compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([LT_AC_PROG_SED]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux* | k*bsd*-gnu) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + _LT_AC_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=no + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + + +# Cheap backport of AS_EXECUTABLE_P and required macros +# from Autoconf 2.59; we should not use $as_executable_p directly. + +# _AS_TEST_PREPARE +# ---------------- +m4_ifndef([_AS_TEST_PREPARE], +[m4_defun([_AS_TEST_PREPARE], +[if test -x / >/dev/null 2>&1; then + as_executable_p='test -x' +else + as_executable_p='test -f' +fi +])])# _AS_TEST_PREPARE + +# AS_EXECUTABLE_P +# --------------- +# Check whether a file is executable. +m4_ifndef([AS_EXECUTABLE_P], +[m4_defun([AS_EXECUTABLE_P], +[AS_REQUIRE([_AS_TEST_PREPARE])dnl +$as_executable_p $1[]dnl +])])# AS_EXECUTABLE_P + +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +]) + + +# serial 9 AC_LIB_LTDL + +# AC_WITH_LTDL +# ------------ +# Clients of libltdl can use this macro to allow the installer to +# choose between a shipped copy of the ltdl sources or a preinstalled +# version of the library. +AC_DEFUN([AC_WITH_LTDL], +[AC_REQUIRE([AC_LIB_LTDL]) +AC_SUBST([LIBLTDL]) +AC_SUBST([INCLTDL]) + +# Unless the user asks us to check, assume no installed ltdl exists. +use_installed_libltdl=no + +AC_ARG_WITH([included_ltdl], + [ --with-included-ltdl use the GNU ltdl sources included here]) + +if test "x$with_included_ltdl" != xyes; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_LIB([ltdl], [lt_dlcaller_register], + [with_included_ltdl=no], + [with_included_ltdl=yes]) + ]) +fi + +if test "x$enable_ltdl_install" != xyes; then + # If the user did not specify an installable libltdl, then default + # to a convenience lib. + AC_LIBLTDL_CONVENIENCE +fi + +if test "x$with_included_ltdl" = xno; then + # If the included ltdl is not to be used. then Use the + # preinstalled libltdl we found. + AC_DEFINE([HAVE_LTDL], [1], + [Define this if a modern libltdl is already installed]) + LIBLTDL=-lltdl +fi + +# Report our decision... +AC_MSG_CHECKING([whether to use included libltdl]) +AC_MSG_RESULT([$with_included_ltdl]) + +AC_CONFIG_SUBDIRS([libltdl]) +])# AC_WITH_LTDL + + +# AC_LIB_LTDL +# ----------- +# Perform all the checks necessary for compilation of the ltdl objects +# -- including compiler checks and header checks. +AC_DEFUN([AC_LIB_LTDL], +[AC_PREREQ(2.50) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_C_CONST]) +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_HEADER_DIRENT]) +AC_REQUIRE([_LT_AC_CHECK_DLFCN]) +AC_REQUIRE([AC_LTDL_ENABLE_INSTALL]) +AC_REQUIRE([AC_LTDL_SHLIBEXT]) +AC_REQUIRE([AC_LTDL_SHLIBPATH]) +AC_REQUIRE([AC_LTDL_SYSSEARCHPATH]) +AC_REQUIRE([AC_LTDL_OBJDIR]) +AC_REQUIRE([AC_LTDL_DLPREOPEN]) +AC_REQUIRE([AC_LTDL_DLLIB]) +AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) +AC_REQUIRE([AC_LTDL_DLSYM_USCORE]) +AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS]) +AC_REQUIRE([AC_LTDL_FUNC_ARGZ]) + +AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ + stdio.h unistd.h]) +AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h]) +AC_CHECK_HEADERS([string.h strings.h], [break]) + +AC_CHECK_FUNCS([strchr index], [break]) +AC_CHECK_FUNCS([strrchr rindex], [break]) +AC_CHECK_FUNCS([memcpy bcopy], [break]) +AC_CHECK_FUNCS([memmove strcmp]) +AC_CHECK_FUNCS([closedir opendir readdir]) +])# AC_LIB_LTDL + + +# AC_LTDL_ENABLE_INSTALL +# ---------------------- +AC_DEFUN([AC_LTDL_ENABLE_INSTALL], +[AC_ARG_ENABLE([ltdl-install], + [AC_HELP_STRING([--enable-ltdl-install], [install libltdl])]) + +AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) +AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno) +])# AC_LTDL_ENABLE_INSTALL + + +# AC_LTDL_SYS_DLOPEN_DEPLIBS +# -------------------------- +AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_CACHE_CHECK([whether deplibs are loaded by dlopen], + [libltdl_cv_sys_dlopen_deplibs], + [# PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + libltdl_cv_sys_dlopen_deplibs=unknown + case "$host_os" in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + aix[[4-9]]*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + libltdl_cv_sys_dlopen_deplibs=yes + ;; + freebsd* | dragonfly*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | k*bsd*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + interix*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + irix[[12345]]*|irix6.[[01]]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + netbsd* | netbsdelf*-gnu) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + osf[[1234]]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explictly say `no'. + libltdl_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + ]) +if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], + [Define if the OS needs help to load dependent libraries for dlopen().]) +fi +])# AC_LTDL_SYS_DLOPEN_DEPLIBS + + +# AC_LTDL_SHLIBEXT +# ---------------- +AC_DEFUN([AC_LTDL_SHLIBEXT], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +AC_CACHE_CHECK([which extension is used for loadable modules], + [libltdl_cv_shlibext], +[ +module=yes +eval libltdl_cv_shlibext=$shrext_cmds + ]) +if test -n "$libltdl_cv_shlibext"; then + AC_DEFINE_UNQUOTED([LTDL_SHLIB_EXT], ["$libltdl_cv_shlibext"], + [Define to the extension used for shared libraries, say, ".so".]) +fi +])# AC_LTDL_SHLIBEXT + + +# AC_LTDL_SHLIBPATH +# ----------------- +AC_DEFUN([AC_LTDL_SHLIBPATH], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +AC_CACHE_CHECK([which variable specifies run-time library path], + [libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"]) +if test -n "$libltdl_cv_shlibpath_var"; then + AC_DEFINE_UNQUOTED([LTDL_SHLIBPATH_VAR], ["$libltdl_cv_shlibpath_var"], + [Define to the name of the environment variable that determines the dynamic library search path.]) +fi +])# AC_LTDL_SHLIBPATH + + +# AC_LTDL_SYSSEARCHPATH +# --------------------- +AC_DEFUN([AC_LTDL_SYSSEARCHPATH], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +AC_CACHE_CHECK([for the default library search path], + [libltdl_cv_sys_search_path], + [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"]) +if test -n "$libltdl_cv_sys_search_path"; then + sys_search_path= + for dir in $libltdl_cv_sys_search_path; do + if test -z "$sys_search_path"; then + sys_search_path="$dir" + else + sys_search_path="$sys_search_path$PATH_SEPARATOR$dir" + fi + done + AC_DEFINE_UNQUOTED([LTDL_SYSSEARCHPATH], ["$sys_search_path"], + [Define to the system default library search path.]) +fi +])# AC_LTDL_SYSSEARCHPATH + + +# AC_LTDL_OBJDIR +# -------------- +AC_DEFUN([AC_LTDL_OBJDIR], +[AC_CACHE_CHECK([for objdir], + [libltdl_cv_objdir], + [libltdl_cv_objdir="$objdir" + if test -n "$objdir"; then + : + else + rm -f .libs 2>/dev/null + mkdir .libs 2>/dev/null + if test -d .libs; then + libltdl_cv_objdir=.libs + else + # MS-DOS does not allow filenames that begin with a dot. + libltdl_cv_objdir=_libs + fi + rmdir .libs 2>/dev/null + fi + ]) +AC_DEFINE_UNQUOTED([LTDL_OBJDIR], ["$libltdl_cv_objdir/"], + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# AC_LTDL_OBJDIR + + +# AC_LTDL_DLPREOPEN +# ----------------- +AC_DEFUN([AC_LTDL_DLPREOPEN], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) +AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], + [libltdl_cv_preloaded_symbols], + [if test -n "$lt_cv_sys_global_symbol_pipe"; then + libltdl_cv_preloaded_symbols=yes + else + libltdl_cv_preloaded_symbols=no + fi + ]) +if test x"$libltdl_cv_preloaded_symbols" = xyes; then + AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], + [Define if libtool can extract symbol lists from object files.]) +fi +])# AC_LTDL_DLPREOPEN + + +# AC_LTDL_DLLIB +# ------------- +AC_DEFUN([AC_LTDL_DLLIB], +[LIBADD_DL= +AC_SUBST(LIBADD_DL) +AC_LANG_PUSH([C]) + +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.])], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LIBADD_DL="$LIBADD_DL -ldld"], + [AC_CHECK_LIB([dl], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"], + [AC_TRY_LINK([#if HAVE_DLFCN_H +# include +#endif + ], + [dlopen(0, 0);], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"], + [AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LIBADD_DL="$LIBADD_DL -ldld"], + [AC_CHECK_FUNC([_dyld_func_lookup], + [AC_DEFINE([HAVE_DYLD], [1], + [Define if you have the _dyld_func_lookup function.])]) + ]) + ]) + ]) + ]) + ]) +]) + +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + AC_CHECK_FUNCS([dlerror]) + LIBS="$lt_save_LIBS" +fi +AC_LANG_POP +])# AC_LTDL_DLLIB + + +# AC_LTDL_SYMBOL_USCORE +# --------------------- +# does the compiler prefix global symbols with an underscore? +AC_DEFUN([AC_LTDL_SYMBOL_USCORE], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) +AC_CACHE_CHECK([for _ prefix in compiled symbols], + [ac_cv_sys_symbol_underscore], + [ac_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + ac_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC + fi + else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.c >&AC_FD_CC + fi + rm -rf conftest* + ]) +])# AC_LTDL_SYMBOL_USCORE + + +# AC_LTDL_DLSYM_USCORE +# -------------------- +AC_DEFUN([AC_LTDL_DLSYM_USCORE], +[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) +if test x"$ac_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + AC_CACHE_CHECK([whether we have to add an underscore for dlsym], + [libltdl_cv_need_uscore], + [libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + _LT_AC_TRY_DLOPEN_SELF( + [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], + [], [libltdl_cv_need_uscore=cross]) + LIBS="$save_LIBS" + ]) + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then + AC_DEFINE([NEED_USCORE], [1], + [Define if dlsym() requires a leading underscore in symbol names.]) +fi +])# AC_LTDL_DLSYM_USCORE + +# AC_LTDL_FUNC_ARGZ +# ----------------- +AC_DEFUN([AC_LTDL_FUNC_ARGZ], +[AC_CHECK_HEADERS([argz.h]) + +AC_CHECK_TYPES([error_t], + [], + [AC_DEFINE([error_t], [int], + [Define to a type to use for `error_t' if it is not otherwise available.])], + [#if HAVE_ARGZ_H +# include +#endif]) + +AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify]) +])# AC_LTDL_FUNC_ARGZ + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# 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. +# +# 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. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 13 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/codeset.m4]) +m4_include([m4/gettext.m4]) +m4_include([m4/glibc21.m4]) +m4_include([m4/iconv.m4]) +m4_include([m4/intdiv0.m4]) +m4_include([m4/intmax.m4]) +m4_include([m4/inttypes-pri.m4]) +m4_include([m4/inttypes.m4]) +m4_include([m4/inttypes_h.m4]) +m4_include([m4/isc-posix.m4]) +m4_include([m4/lcmessage.m4]) +m4_include([m4/lib-ld.m4]) +m4_include([m4/lib-link.m4]) +m4_include([m4/lib-prefix.m4]) +m4_include([m4/longdouble.m4]) +m4_include([m4/longlong.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/po.m4]) +m4_include([m4/printf-posix.m4]) +m4_include([m4/progtest.m4]) +m4_include([m4/signed.m4]) +m4_include([m4/size_max.m4]) +m4_include([m4/stdint_h.m4]) +m4_include([m4/uintmax_t.m4]) +m4_include([m4/ulonglong.m4]) +m4_include([m4/wchar_t.m4]) +m4_include([m4/wint_t.m4]) +m4_include([m4/xsize.m4]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..f38e3cc --- /dev/null +++ b/autogen.sh @@ -0,0 +1,2 @@ +#!/bin/sh +./bootstrap diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..f2c215f --- /dev/null +++ b/bootstrap @@ -0,0 +1,9 @@ +#! /bin/sh + +set -x +aclocal -I m4 +autoheader +libtoolize -c --automake +automake --add-missing --copy --include-deps +autoconf +## @end 1 diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..0f0fe71 --- /dev/null +++ b/config.guess @@ -0,0 +1,1516 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2007-03-06' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100755 index 0000000..da2d1c6 --- /dev/null +++ b/config.h.in @@ -0,0 +1,437 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* The gettext domain */ +#undef GETTEXT_PACKAGE + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the `argz_append' function. */ +#undef HAVE_ARGZ_APPEND + +/* Define to 1 if you have the `argz_create_sep' function. */ +#undef HAVE_ARGZ_CREATE_SEP + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARGZ_H + +/* Define to 1 if you have the `argz_insert' function. */ +#undef HAVE_ARGZ_INSERT + +/* Define to 1 if you have the `argz_next' function. */ +#undef HAVE_ARGZ_NEXT + +/* Define to 1 if you have the `argz_stringify' function. */ +#undef HAVE_ARGZ_STRINGIFY + +/* Define to 1 if you have the `asprintf' function. */ +#undef HAVE_ASPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define to 1 if you have the `closedir' function. */ +#undef HAVE_CLOSEDIR + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_FEOF_UNLOCKED + +/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FGETS_UNLOCKED + +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_GETC_UNLOCKED + +/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL__SNPRINTF + +/* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you + don't. */ +#undef HAVE_DECL__SNWPRINTF + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define if you have the GNU dld library. */ +#undef HAVE_DLD + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLD_H + +/* Define to 1 if you have the `dlerror' function. */ +#undef HAVE_DLERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DL_H + +/* Define if you have the _dyld_func_lookup function. */ +#undef HAVE_DYLD + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if the system has the type `error_t'. */ +#undef HAVE_ERROR_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the `fwprintf' function. */ +#undef HAVE_FWPRINTF + +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the `getegid' function. */ +#undef HAVE_GETEGID + +/* Define to 1 if you have the `geteuid' function. */ +#undef HAVE_GETEUID + +/* Define to 1 if you have the `getgid' function. */ +#undef HAVE_GETGID + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the `getuid' function. */ +#undef HAVE_GETUID + +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the `index' function. */ +#undef HAVE_INDEX + +/* Define if you have the 'intmax_t' type in or . */ +#undef HAVE_INTMAX_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +#undef HAVE_INTTYPES_H_WITH_UINTMAX + +/* Define if you have and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET + +/* Define to 1 if you have the header file. */ +#undef HAVE_LANGINFO_H + +/* Define if your file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define if you have the libdl library or equivalent. */ +#undef HAVE_LIBDL + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBINTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the 'long double' type. */ +#undef HAVE_LONG_DOUBLE + +/* Define if you have the 'long long' type. */ +#undef HAVE_LONG_LONG + +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_O_DYLD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define to 1 if you have the `opendir' function. */ +#undef HAVE_OPENDIR + +/* Define if your printf() function supports format strings with positions. */ +#undef HAVE_POSIX_PRINTF + +/* Define if libtool can extract symbol lists from object files. */ +#undef HAVE_PRELOADED_SYMBOLS + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the `readdir' function. */ +#undef HAVE_READDIR + +/* Define to 1 if you have the `rindex' function. */ +#undef HAVE_RINDEX + +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define if you have the shl_load function. */ +#undef HAVE_SHL_LOAD + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ +#undef HAVE_STDINT_H_WITH_UINTMAX + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_EXT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `stpcpy' function. */ +#undef HAVE_STPCPY + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strcmp' function. */ +#undef HAVE_STRCMP + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_DL_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the `tsearch' function. */ +#undef HAVE_TSEARCH + +/* Define if you have the 'uintmax_t' type in or . */ +#undef HAVE_UINTMAX_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the 'unsigned long long' type. */ +#undef HAVE_UNSIGNED_LONG_LONG + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define if you have the 'wchar_t' type. */ +#undef HAVE_WCHAR_T + +/* Define to 1 if you have the `wcslen' function. */ +#undef HAVE_WCSLEN + +/* Define if you have the 'wint_t' type. */ +#undef HAVE_WINT_T + +/* Define to 1 if you have the `__argz_count' function. */ +#undef HAVE___ARGZ_COUNT + +/* Define to 1 if you have the `__argz_next' function. */ +#undef HAVE___ARGZ_NEXT + +/* Define to 1 if you have the `__argz_stringify' function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* Define to 1 if you have the `__fsetlocking' function. */ +#undef HAVE___FSETLOCKING + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Define if integer division by zero raises signal SIGFPE. */ +#undef INTDIV0_RAISES_SIGFPE + +/* Define if the OS needs help to load dependent libraries for dlopen(). */ +#undef LTDL_DLOPEN_DEPLIBS + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LTDL_OBJDIR + +/* Define to the name of the environment variable that determines the dynamic + library search path. */ +#undef LTDL_SHLIBPATH_VAR + +/* Define to the extension used for shared libraries, say, ".so". */ +#undef LTDL_SHLIB_EXT + +/* Define to the system default library search path. */ +#undef LTDL_SYSSEARCHPATH + +/* Define if dlsym() requires a leading underscore in symbol names. */ +#undef NEED_USCORE + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if exists and defines unusable PRI* macros. */ +#undef PRI_MACROS_BROKEN + +/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +#undef SIZE_MAX + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to a type to use for `error_t' if it is not otherwise available. */ +#undef error_t + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define as the type of the result of subtracting two pointers, if the system + doesn't define it. */ +#undef ptrdiff_t + +/* Define to empty if the C compiler doesn't support this keyword. */ +#undef signed + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to unsigned long or unsigned long long if and + don't define. */ +#undef uintmax_t diff --git a/config.rpath b/config.rpath new file mode 100755 index 0000000..4db13e5 --- /dev/null +++ b/config.rpath @@ -0,0 +1,548 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2003 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 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 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux*) + case $CC in + icc|ecc) + wl='-Wl,' + ;; + ccc) + wl='-Wl,' + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + sco3.2v5*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = yes; then + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi4*) + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + hardcode_direct=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10* | hpux11*) + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + sco3.2v5*) + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4.2uw2*) + hardcode_direct=yes + hardcode_minus_L=no + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + ;; + sysv5*) + hardcode_libdir_flag_spec= + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +libname_spec='lib$name' +case "$host_os" in + aix3*) + ;; + aix4* | aix5*) + ;; + amigaos*) + ;; + beos*) + ;; + bsdi4*) + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + ;; + darwin* | rhapsody*) + shrext=.dylib + ;; + dgux*) + ;; + freebsd1*) + ;; + freebsd*) + ;; + gnu*) + ;; + hpux9* | hpux10* | hpux11*) + case "$host_cpu" in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux*) + ;; + netbsd*) + ;; + newsos6) + ;; + nto-qnx) + ;; + openbsd*) + ;; + os2*) + libname_spec='$name' + shrext=.dll + ;; + osf3* | osf4* | osf5*) + ;; + sco3.2v5*) + ;; + solaris*) + ;; + sunos4*) + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + ;; + sysv4*MP*) + ;; + uts4*) + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure.ac b/configure.ac new file mode 100755 index 0000000..a246d94 --- /dev/null +++ b/configure.ac @@ -0,0 +1,155 @@ +# Process this file with autoconf to produce a configure script. +AC_PREREQ(2.59) +# base on scim-anthy-1.2.7 +AC_INIT(ise-engine-anthy, 0.0.0125, ashie@homa.ne.jp) +AC_CONFIG_SRCDIR([configure.ac]) + +# Save this value here, since automake will set cflags and cxxflags later +cflags_set=${CFLAGS+set} +cppflags_set=${CPPFLAGS+set} + +SCIM_ANTHY_MAJOR_VERSION=0 +SCIM_ANTHY_MINOR_VERSION=0 +SCIM_ANTHY_MICRO_VERSION=0125 + +SCIM_ANTHY_VERSION=$SCIM_ANTHY_MAJOR_VERSION.$SCIM_ANTHY_MINOR_VERSION.$SCIM_ANTHY_MICRO_VERSION + +AC_SUBST(SCIM_ANTHY_MAJOR_VERSION) +AC_SUBST(SCIM_ANTHY_MINOR_VERSION) +AC_SUBST(SCIM_ANTHY_MICRO_VERSION) +AC_SUBST(SCIM_ANTHY_VERSION) + +# Init automake stuff +AM_INIT_AUTOMAKE(1.9) +AM_CONFIG_HEADER(config.h) + +# Init gettext +ALL_LINGUAS="de ja" +AM_GNU_GETTEXT + +GETTEXT_PACKAGE=ise-engine-anthy +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain]) + +# Init libtool +AC_LIBTOOL_DLOPEN +AC_PROG_LIBTOOL +AC_LIB_LTDL +AC_SUBST(LIBTOOL_DEPS) + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_LANG(C++) + +AC_C_CONST +AC_TYPE_SIZE_T + +# Checks for libraries. + +SCIM_VERSION=1.2.0 + +PKG_CHECK_MODULES(SCIM,[isf >= $SCIM_VERSION]) + + +AC_SUBST(SCIM_VERSION) + +# Check if we should build setup module +#PKG_CHECK_MODULES(SCIM_GTKUTILS,[scim-gtkutils >= $SCIM_VERSION], +# [SCIM_HAS_GTKUTILS=yes], +# [SCIM_HAS_GTKUTILS=no]) +SCIM_HAS_GTKUTILS="no" +AM_CONDITIONAL(SCIM_BUILD_SETUP, [test "$SCIM_HAS_GTKUTILS" = "yes"]) + +if test "$SCIM_HAS_GTKUTILS" = "yes"; then + SCIM_BUILD_SETUP=1 +else + SCIM_BUILD_SETUP=0 +fi + +# Checks for header files. +AC_HEADER_STDC +AC_FUNC_ALLOCA +AC_CHECK_HEADERS([argz.h fcntl.h float.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h unistd.h wchar.h]) + +# Checks for library functions. +AC_SUBST(ac_aux_dir) + +# Checks for anthy +AC_CHECK_HEADER(anthy/anthy.h, [], [AC_MSG_ERROR(anthy/anthy.h was not found.)]) +ANTHY_LIBS="-lanthy -lanthydic" +ANTHY_CFLAGS="" +AC_SUBST(ANTHY_LIBS) +AC_SUBST(ANTHY_CFLAGS) + + +# Check gtk2 +#PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0], +# [HAS_GTK=yes], +# [HAS_GTK=no]) +HAS_GTK="no" +AM_CONDITIONAL(SCIM_BUILD_HELPER, [test "$HAS_GTK" = "yes"]) + +if test "$HAS_GTK" = "yes"; then + SCIM_BUILD_HELPER=1 +else + SCIM_BUILD_HELPER=0 +fi +AC_SUBST(SCIM_BUILD_HELPER) + +# libtool option to control which symbols are exported +# right now, symbols starting with _ are not exported +LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"' +AC_SUBST(LIBTOOL_EXPORT_OPTIONS) + +# Extra args. +AC_ARG_ENABLE(debug, + [ --enable-debug Turn on debugging], + [case "${enableval}" in + yes) debug=yes ;; + no) debug=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; + esac],[debug=no]) + +if test "x$debug" = "xyes"; then + test "$cflags_set" = set || CFLAGS="$CFLAGS -g" + test "$cppflags_set" = set || CPPFLAGS="$CXXFLAGS -g" + SCIM_DEBUG_FLAGS="-DENABLE_DEBUG=1" +else + SCIM_DEBUG_FLAGS="" +fi +AC_SUBST(SCIM_DEBUG_FLAGS) + +SCIM_DATADIR=`$PKG_CONFIG --variable=scimdatadir scim` +SCIM_ICONDIR=`$PKG_CONFIG --variable=icondir scim` +SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim` + +if test "x$SCIM_DATADIR" = "x"; then + SCIM_DATADIR=${datadir}/scim +fi + +if test "x$SCIM_ICONDIR" = "x"; then + SCIM_ICONDIR=${datadir}/scim/icons +fi + +if test "x$SCIM_MODULEDIR" = "x"; then + SCIM_MODULEDIR=${libdir}/scim-1.0 +fi + +SCIM_ANTHY_DATADIR=${SCIM_DATADIR}/Anthy + +AC_SUBST(SCIM_DATADIR) +AC_SUBST(SCIM_ICONDIR) +AC_SUBST(SCIM_MODULEDIR) +AC_SUBST(SCIM_ANTHY_DATADIR) + +AC_CONFIG_FILES([ +Makefile +intl/Makefile +po/Makefile.in +m4/Makefile +src/Makefile +data/Makefile +]) + +AC_OUTPUT diff --git a/data/101kana.sty b/data/101kana.sty new file mode 100755 index 0000000..b64007a --- /dev/null +++ b/data/101kana.sty @@ -0,0 +1,126 @@ +# +# 101kana.sty - Kana typing table for 101 keyboard. +# Copyright (C) 2005 Takuro Ashie +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = 101±Ñ¸ì¥­¡¼¥Ü¡¼¥ÉÍѤ«¤ÊÇÛÎó +Version = 0.0.0 + +[KanaTable/FundamentalTable] +# non modifiered keys +~=¤í +1=¤Ì +2=,¤Õ +3=¤¢ +4=¤¦ +5=¤¨ +6=¤ª +7=¤ä +8=¤æ +9=¤è +0=¤ï +-=,¤Û +\==,¤Ø + +q=,¤¿ +w=,¤Æ +e=¤¤ +r=,¤¹ +t=,¤« +y=¤ó +u=¤Ê +i=¤Ë +o=¤é +p=,¤» +\[=¡« +\]=¡¬ +\\=¤à + +a=,¤Á +s=,¤È +d=,¤· +f=,¤Ï +g=,¤­ +h=,¤¯ +j=¤Þ +k=¤Î +l=¤ê +;=¤ì +'=,¤± + +z=,¤Ä +x=,¤µ +c=,¤½ +v=,¤Ò +b=,¤³ +n=¤ß +m=¤â +\,=¤Í +.=¤ë +/=¤á + +# shift modifiered keys +`=¤í +!=¤Ì +@=,¤Õ +\#=¤¡ +$=¤¥ +%=¤§ +^=¤© +&=¤ã +*=¤å +(=¤ç +)=¤ò +_=¡¼ ++=¤ñ + +Q=,¤¿ +W=,¤Æ +E=¤£ +R=,¤¹ +T=¥õ +Y=¤ó +U=¤Ê +I=¤Ë +O=¤é +P=,¤» +{=¡Ö +}=¡× +|=¤à + +A=,¤Á +S=,¤È +D=,¤· +F=,¤î +G=,¤­ +H=,¤¯ +J=¤Þ +K=¤Î +L=¤ê +:=¤ì +"=¥ö + +Z=¤Ã +X=,¤µ +C=,¤½ +V=,¤ð +B=,¤³ +N=¤ß +M=¤â +?=¡¦ diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100755 index 0000000..96d12e6 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,41 @@ +## Copyright (C) 2004 Hiroyuki Ikezoe +## Copyright (C) 2004-2005 Takuro Ashie +## +## 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. + +MAINTAINERCLEANFILES = Makefile.in + +icondir = $(SCIM_ICONDIR) +icon_DATA = scim-anthy.png \ + scim-anthy-dict.png \ + scim-anthy-swap-colors.png + +styledir = $(SCIM_ANTHY_DATADIR)/style +style_DATA = atok.sty \ + msime.sty \ + canna.sty \ + wnn.sty \ + vje-delta.sty \ + azik.sty \ + 101kana.sty \ + nicola-a.sty \ + nicola-f.sty \ + nicola-j.sty \ + oasys100j.sty \ + tron-dvorak.sty \ + tron-qwerty-jp.sty \ + tsuki-2-203-101.sty \ + tsuki-2-203-106.sty +EXTRA_DIST = $(icon_DATA) $(style_DATA) diff --git a/data/Makefile.in b/data/Makefile.in new file mode 100755 index 0000000..57b412e --- /dev/null +++ b/data/Makefile.in @@ -0,0 +1,464 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = data +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longdouble.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(icondir)" "$(DESTDIR)$(styledir)" +iconDATA_INSTALL = $(INSTALL_DATA) +styleDATA_INSTALL = $(INSTALL_DATA) +DATA = $(icon_DATA) $(style_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +ANTHY_CFLAGS = @ANTHY_CFLAGS@ +ANTHY_LIBS = @ANTHY_LIBS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GENCAT = @GENCAT@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK2_CFLAGS = @GTK2_CFLAGS@ +GTK2_LIBS = @GTK2_LIBS@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIBTOOL_EXPORT_OPTIONS = @LIBTOOL_EXPORT_OPTIONS@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SCIM_ANTHY_DATADIR = @SCIM_ANTHY_DATADIR@ +SCIM_ANTHY_MAJOR_VERSION = @SCIM_ANTHY_MAJOR_VERSION@ +SCIM_ANTHY_MICRO_VERSION = @SCIM_ANTHY_MICRO_VERSION@ +SCIM_ANTHY_MINOR_VERSION = @SCIM_ANTHY_MINOR_VERSION@ +SCIM_ANTHY_VERSION = @SCIM_ANTHY_VERSION@ +SCIM_BUILD_HELPER = @SCIM_BUILD_HELPER@ +SCIM_BUILD_SETUP = @SCIM_BUILD_SETUP@ +SCIM_CFLAGS = @SCIM_CFLAGS@ +SCIM_DATADIR = @SCIM_DATADIR@ +SCIM_DEBUG_FLAGS = @SCIM_DEBUG_FLAGS@ +SCIM_GTKUTILS_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ +SCIM_GTKUTILS_LIBS = @SCIM_GTKUTILS_LIBS@ +SCIM_ICONDIR = @SCIM_ICONDIR@ +SCIM_LIBS = @SCIM_LIBS@ +SCIM_MODULEDIR = @SCIM_MODULEDIR@ +SCIM_VERSION = @SCIM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +MAINTAINERCLEANFILES = Makefile.in +icondir = $(SCIM_ICONDIR) +icon_DATA = scim-anthy.png \ + scim-anthy-dict.png \ + scim-anthy-swap-colors.png + +styledir = $(SCIM_ANTHY_DATADIR)/style +style_DATA = atok.sty \ + msime.sty \ + canna.sty \ + wnn.sty \ + vje-delta.sty \ + azik.sty \ + 101kana.sty \ + nicola-a.sty \ + nicola-f.sty \ + nicola-j.sty \ + oasys100j.sty \ + tron-dvorak.sty \ + tron-qwerty-jp.sty \ + tsuki-2-203-101.sty \ + tsuki-2-203-106.sty + +EXTRA_DIST = $(icon_DATA) $(style_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu data/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-iconDATA: $(icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(icon_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(iconDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(icondir)/$$f'"; \ + $(iconDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(icondir)/$$f"; \ + done + +uninstall-iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(icon_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(icondir)/$$f'"; \ + rm -f "$(DESTDIR)$(icondir)/$$f"; \ + done +install-styleDATA: $(style_DATA) + @$(NORMAL_INSTALL) + test -z "$(styledir)" || $(MKDIR_P) "$(DESTDIR)$(styledir)" + @list='$(style_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(styleDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(styledir)/$$f'"; \ + $(styleDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(styledir)/$$f"; \ + done + +uninstall-styleDATA: + @$(NORMAL_UNINSTALL) + @list='$(style_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(styledir)/$$f'"; \ + rm -f "$(DESTDIR)$(styledir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || 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 $(DATA) +installdirs: + for dir in "$(DESTDIR)$(icondir)" "$(DESTDIR)$(styledir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-iconDATA install-styleDATA + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-iconDATA uninstall-styleDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-iconDATA install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip install-styleDATA installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-iconDATA \ + uninstall-styleDATA + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/data/atok.sty b/data/atok.sty new file mode 100755 index 0000000..1afbf58 --- /dev/null +++ b/data/atok.sty @@ -0,0 +1,326 @@ +# +# atok.sty - Justsytem ATOK like style definition file for scim-anthy. +# Copyright (C) 2005 Takuro Ashie +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = ATOK +Version = 0.0.0 + +[KeyBindings] +OnOffKey = Henkan,Eisu_toggle,Zenkaku_Hankaku +CircleInputModeKey = F10 +CircleKanaModeKey = +LatinModeKey = +HiraganaModeKey = Hiragana_Katakana +KatakanaModeKey = Shift+Hiragana_Katakana +HalfKatakanaModeKey = +CircleTypingMethodKey = Romaji,Alt+Romaji + +ConvertKey = space,Henkan,Shift+space,Shift+Henkan +PredictKey = Tab +CancelKey = Escape,BackSpace,Control+h,Control+bracketleft +CommitKey = Return,Control+m +ReconvertKey = Shift+Henkan + +InsertSpaceKey = space +InsertAltSpaceKey = Shift+space +BackSpaceKey = BackSpace,Control+h +DeleteKey = Delete,Control+g + +MoveCaretBackwardKey = Left,Control+k +MoveCaretForwardKey = Right,Control+l +MoveCaretFirstKey = Control+Left +MoveCaretLastKey = Control+Right + +SelectPrevSegmentKey = Shift+Left +SelectNextSegmentKey = Shift+Right +SelectFirstSegmentKey = Control+Left +SelectLastSegmentKey = Control+Right +ExpandSegmentKey = Right,Control+l +ShrinkSegmentKey = Left,Control+k +CommitSelectedSegmentKey = Down + +CandidatesPageUpKey = Shift+Henkan +CandidatesPageDownKey = Henkan +SelectNextCandidateKey = space,Tab,Henkan,Shift+space,Shift+Henkan +SelectPrevCandidateKey = Up + +SelectCandidates1Key = 1 +SelectCandidates2Key = 2 +SelectCandidates3Key = 3 +SelectCandidates4Key = 4 +SelectCandidates5Key = 5 +SelectCandidates6Key = 6 +SelectCandidates7Key = 7 +SelectCandidates8Key = 8 +SelectCandidates9Key = 9 +SelectCandidates10Key = 0 + +ConvertToHiraganaKey = F6,Control+u +ConvertToKatakanaKey = F7,Control+i +ConvertToHalfKey = F8,Control+o +ConvertToHalfKatakanaKey = Shift+F8 +ConvertToWideLatinKey = F9,Control+p +ConvertToLatinKey = F10,Control+at + +AddWordKey = Control+F7 + + +# Override fundamental table +[RomajiTable/FundamentalTable] +- = ¡¼ +#/ = ¡¦ +#[ = ¡Ö +#] = ¡× +a = ¤¢ +ba = ¤Ð +be = ¤Ù +bi = ¤Ó +bo = ¤Ü +bu = ¤Ö +bya = ¤Ó¤ã +bye = ¤Ó¤§ +byi = ¤Ó¤£ +byo = ¤Ó¤ç +byu = ¤Ó¤å +cha = ¤Á¤ã +che = ¤Á¤§ +chi = ¤Á +cho = ¤Á¤ç +chu = ¤Á¤å +cya = ¤Á¤ã +cye = ¤Á¤§ +cyi = ¤Á¤£ +cyo = ¤Á¤ç +cyu = ¤Á¤å +da = ¤À +de = ¤Ç +dha = ¤Ç¤ã +dhe = ¤Ç¤§ +dhi = ¤Ç¤£ +dho = ¤Ç¤ç +dhu = ¤Ç¤å +di = ¤Â +do = ¤É +du = ¤Å +dwu = ¤É¤¥ +dya = ¤Â¤ã +dye = ¤Â¤§ +dyi = ¤Â¤£ +dyo = ¤Â¤ç +dyu = ¤Â¤å +e = ¤¨ +fa = ¤Õ¤¡ +fe = ¤Õ¤§ +fi = ¤Õ¤£ +fo = ¤Õ¤© +fu = ¤Õ +fya = ¤Õ¤ã +fye = ¤Õ¤§ +fyi = ¤Õ¤£ +fyo = ¤Õ¤ç +fyu = ¤Õ¤å +ga = ¤¬ +ge = ¤² +gi = ¤® +go = ¤´ +gu = ¤° +gwa = ¤°¤¡ +gya = ¤®¤ã +gye = ¤®¤§ +gyi = ¤®¤£ +gyo = ¤®¤ç +gyu = ¤®¤å +ha = ¤Ï +he = ¤Ø +hi = ¤Ò +ho = ¤Û +hu = ¤Õ +hya = ¤Ò¤ã +hye = ¤Ò¤§ +hyi = ¤Ò¤£ +hyo = ¤Ò¤ç +hyu = ¤Ò¤å +i = ¤¤ +ja = ¤¸¤ã +je = ¤¸¤§ +ji = ¤¸ +jo = ¤¸¤ç +ju = ¤¸¤å +jya = ¤¸¤ã +jye = ¤¸¤§ +jyi = ¤¸¤£ +jyo = ¤¸¤ç +jyu = ¤¸¤å +ka = ¤« +ke = ¤± +ki = ¤­ +ko = ¤³ +ku = ¤¯ +kwa = ¤¯¤¡ +kya = ¤­¤ã +kye = ¤­¤§ +kyi = ¤­¤£ +kyo = ¤­¤ç +kyu = ¤­¤å +la = ¤¡ +le = ¤§ +li = ¤£ +lka = ¥õ +lke = ¥ö +lo = ¤© +ltsu = ¤Ã +ltu = ¤Ã +lu = ¤¥ +lwa = ¤î +lya = ¤ã +lye = ¤§ +lyi = ¤£ +lyo = ¤ç +lyu = ¤å +ma = ¤Þ +me = ¤á +mi = ¤ß +mo = ¤â +mu = ¤à +mya = ¤ß¤ã +mye = ¤ß¤§ +myi = ¤ß¤£ +myo = ¤ß¤ç +myu = ¤ß¤å +n' = ¤ó +na = ¤Ê +ne = ¤Í +ni = ¤Ë +n = ¤ó +nn = ¤ó +no = ¤Î +nu = ¤Ì +nya = ¤Ë¤ã +nye = ¤Ë¤§ +nyi = ¤Ë¤£ +nyo = ¤Ë¤ç +nyu = ¤Ë¤å +o = ¤ª +pa = ¤Ñ +pe = ¤Ú +pi = ¤Ô +po = ¤Ý +pu = ¤× +pya = ¤Ô¤ã +pye = ¤Ô¤§ +pyi = ¤Ô¤£ +pyo = ¤Ô¤ç +pyu = ¤Ô¤å +ra = ¤é +re = ¤ì +ri = ¤ê +ro = ¤í +ru = ¤ë +rya = ¤ê¤ã +rye = ¤ê¤§ +ryi = ¤ê¤£ +ryo = ¤ê¤ç +ryu = ¤ê¤å +sa = ¤µ +se = ¤» +sha = ¤·¤ã +she = ¤·¤§ +shi = ¤· +sho = ¤·¤ç +shu = ¤·¤å +si = ¤· +so = ¤½ +su = ¤¹ +sya = ¤·¤ã +sye = ¤·¤§ +syi = ¤·¤£ +syo = ¤·¤ç +syu = ¤·¤å +ta = ¤¿ +te = ¤Æ +tha = ¤Æ¤ã +the = ¤Æ¤§ +thi = ¤Æ¤£ +tho = ¤Æ¤ç +thu = ¤Æ¤å +ti = ¤Á +to = ¤È +tsa = ¤Ä¤¡ +tse = ¤Ä¤§ +tsi = ¤Ä¤£ +tso = ¤Ä¤© +tsu = ¤Ä +tu = ¤Ä +twu = ¤È¤¥ +tya = ¤Á¤ã +tye = ¤Á¤§ +tyi = ¤Á¤£ +tyo = ¤Á¤ç +tyu = ¤Á¤å +u = ¤¦ +va = ¤¦¡«¤¡ +ve = ¤¦¡«¤§ +vi = ¤¦¡«¤£ +vo = ¤¦¡«¤© +vu = ¤¦¡« +wa = ¤ï +we = ¤¦¤§ +wi = ¤¦¤£ +wo = ¤ò +wu = ¤¦ +wye = ¤ñ +wyi = ¤ð +xa = ¤¡ +xe = ¤§ +xi = ¤£ +xka = ¥õ +xke = ¥ö +xo = ¤© +xtsu = ¤Ã +xtu = ¤Ã +xu = ¤¥ +xwa = ¤î +xya = ¤ã +xye = ¤§ +xyi = ¤£ +xyo = ¤ç +xyu = ¤å +ya = ¤ä +ye = ¤¤¤§ +yi = ¤¤ +yo = ¤è +yu = ¤æ +za = ¤¶ +ze = ¤¼ +zi = ¤¸ +zo = ¤¾ +zu = ¤º +zya = ¤¸¤ã +zye = ¤¸¤§ +zyi = ¤¸¤£ +zyo = ¤¸¤ç +zyu = ¤¸¤å + + +[PreeditStyle] + + +[Setting] +RomajiAllowSplit = false diff --git a/data/azik.sty b/data/azik.sty new file mode 100755 index 0000000..4e02cd8 --- /dev/null +++ b/data/azik.sty @@ -0,0 +1,683 @@ +# +# azik.sty - AZIK extended romaji table definition file. +# Copyright (C) 2005 Takuro Ashie +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = AZIK +Version = 0.0.0 + +# Override fundamental table +[RomajiTable/FundamentalTable] +# À¶²» +a = ¤¢ +i = ¤¤ +u = ¤¦ +e = ¤¨ +o = ¤ª + +ka = ¤« +ki = ¤­ +ku = ¤¯ +ke = ¤± +ko = ¤³ + +sa = ¤µ +si = ¤· +su = ¤¹ +se = ¤» +so = ¤½ + +ta = ¤¿ +ti = ¤Á +tu = ¤Ä +te = ¤Æ +to = ¤È + +na = ¤Ê +ni = ¤Ë +nu = ¤Ì +ne = ¤Í +no = ¤Î + +ha = ¤Ï +hi = ¤Ò +hu = ¤Õ +he = ¤Ø +ho = ¤Û + +fu = ¤Õ + +ma = ¤Þ +mi = ¤ß +mu = ¤à +me = ¤á +mo = ¤â + +ya = ¤ä +yu = ¤æ +yo = ¤è + +ra = ¤é +ri = ¤ê +ru = ¤ë +re = ¤ì +ro = ¤í + +wa = ¤ï +wo = ¤ò + +# Ùû²»³ÈÄ¥ +kz = ¤«¤ó +kn = ¤«¤ó +kk = ¤­¤ó +kj = ¤¯¤ó +kd = ¤±¤ó +kl = ¤³¤ó + +sz = ¤µ¤ó +sn = ¤µ¤ó +sk = ¤·¤ó +sj = ¤¹¤ó +sd = ¤»¤ó +sl = ¤½¤ó + +tz = ¤¿¤ó +tn = ¤¿¤ó +tk = ¤Á¤ó +tj = ¤Ä¤ó +td = ¤Æ¤ó +tl = ¤È¤ó + +nz = ¤Ê¤ó +nn = ¤ó +nk = ¤Ë¤ó +nj = ¤Ì¤ó +nd = ¤Í¤ó +nl = ¤Î¤ó + +hz = ¤Ï¤ó +hn = ¤Ï¤ó +hk = ¤Ò¤ó +hj = ¤Õ¤ó +hd = ¤Ø¤ó +hl = ¤Û¤ó + +fz = ¤Õ¤¡¤ó +fn = ¤Õ¤¡¤ó +fk = ¤Õ¤£¤ó +fj = ¤Õ¤ó +fd = ¤Õ¤§¤ó +fl = ¤Õ¤©¤ó + +mz = ¤Þ¤ó +mk = ¤ß¤ó +mj = ¤à¤ó +md = ¤á¤ó +ml = ¤â¤ó + +yz = ¤ä¤ó +yn = ¤ä¤ó +yj = ¤æ¤ó +yl = ¤è¤ó + +rz = ¤é¤ó +rn = ¤é¤ó +rk = ¤ê¤ó +rj = ¤ë¤ó +rd = ¤ì¤ó +rl = ¤í¤ó + +wz = ¤ï¤ó +wn = ¤ï¤ó +wk = ¤¦¤£¤ó +wd = ¤¦¤§¤ó +wl = ¤¦¤©¤ó + +# Æó½ÅÊì²»³ÈÄ¥ +kq = ¤«¤¤ +kh = ¤¯¤¦ +kw = ¤±¤¤ +kp = ¤³¤¦ + +sq = ¤µ¤¤ +sh = ¤¹¤¦ +sw = ¤»¤¤ +sp = ¤½¤¦ + +tq = ¤¿¤¤ +th = ¤Ä¤¦ +tw = ¤Æ¤¤ +tp = ¤È¤¦ + +nq = ¤Ê¤¤ +nh = ¤Ì¤¦ +nw = ¤Í¤¤ +np = ¤Î¤¦ + +hq = ¤Ï¤¤ +hh = ¤Õ¤¦ +hw = ¤Ø¤¤ +hp = ¤Û¤¦ + +fq = ¤Õ¤¡¤¤ +fh = ¤Õ¤¦ +fw = ¤Õ¤§¤¤ +fp = ¤Õ¤©¡¼ + +mq = ¤Þ¤¤ +mh = ¤à¤¦ +mw = ¤á¤¤ +mp = ¤â¤¦ + +yq = ¤ä¤¤ +yh = ¤æ¤¦ +yp = ¤è¤¦ + +rq = ¤é¤¤ +rh = ¤ë¤¦ +rw = ¤ì¤¤ +rp = ¤í¤¦ + +wq = ¤ï¤¤ +wp = ¤¦¤©¡¼ + +# Ùû²»³ÈÄ¥¸ß´¹¥­¡¼ +kn = ¤«¤ó +sn = ¤µ¤ó +tn = ¤¿¤ó +nn = ¤ó +hn = ¤Ï¤ó +fn = ¤Õ¤¡¤ó +mn = ¤â¤Î +yn = ¤ä¤ó +rn = ¤é¤ó +wn = ¤ï¤ó + +# Âù²»¡¢È¾Âù²» Ùû²»³ÈÄ¥¡¢Æó½ÅÊì²»³ÈÄ¥ +ga = ¤¬ +gi = ¤® +gu = ¤° +ge = ¤² +go = ¤´ + +za = ¤¶ +zi = ¤¸ +zu = ¤º +ze = ¤¼ +zo = ¤¾ + +da = ¤À +di = ¤Â +du = ¤Å +de = ¤Ç +do = ¤É + +ba = ¤Ð +bi = ¤Ó +bu = ¤Ö +be = ¤Ù +bo = ¤Ü + +pa = ¤Ñ +pi = ¤Ô +pu = ¤× +pe = ¤Ú +po = ¤Ý + +gz = ¤¬¤ó +gn = ¤¬¤ó +gk = ¤®¤ó +gj = ¤°¤ó +gd = ¤²¤ó +gl = ¤´¤ó + +zz = ¤¶¤ó +zn = ¤¶¤ó +zk = ¤¸¤ó +zj = ¤º¤ó +zd = ¤¼¤ó +zl = ¤¾¤ó + +dz = ¤À¤ó +dn = ¤À¤ó +dk = ¤Â¤ó +dj = ¤Å¤ó +dd = ¤Ç¤ó +dl = ¤É¤ó + +bz = ¤Ð¤ó +bn = ¤Ð¤ó +bk = ¤Ó¤ó +bj = ¤Ö¤ó +bd = ¤Ù¤ó +bl = ¤Ü¤ó + +pz = ¤Ñ¤ó +pn = ¤Ñ¤ó +pk = ¤Ô¤ó +pj = ¤×¤ó +pd = ¤Ú¤ó +pl = ¤Ý¤ó + +gq = ¤¬¤¤ +gh = ¤°¤¦ +gw = ¤²¤¤ +gp = ¤´¤¦ + +zq = ¤¶¤¤ +zh = ¤º¤¦ +zw = ¤¼¤¤ +zp = ¤¾¤¦ + +dq = ¤À¤¤ +dh = ¤Å¤¦ +dw = ¤Ç¤¤ +dp = ¤É¤¦ + +bq = ¤Ð¤¤ +bh = ¤Ö¤¦ +bw = ¤Ù¤¤ +bp = ¤Ü¤¦ + +pq = ¤Ñ¤¤ +ph = ¤×¤¦ +pw = ¤Ú¤¤ +pp = ¤Ý¤¦ + +zc = ¤¶ +zv = ¤¶¤¤ +zx = ¤¼¤¤ + +# Ù¹²»¡¢Ù¹²»¸ß´¹ +kya = ¤­¤ã +kyu = ¤­¤å +kye = ¤­¤§ +kyo = ¤­¤ç + +kga = ¤­¤ã +kgu = ¤­¤å +kge = ¤­¤§ +kgo = ¤­¤ç + +sya = ¤·¤ã +syu = ¤·¤å +sye = ¤·¤§ +syo = ¤·¤ç + +xa = ¤·¤ã +xu = ¤·¤å +xe = ¤·¤§ +xo = ¤·¤ç + +tya = ¤Á¤ã +tyu = ¤Á¤å +tye = ¤Á¤§ +tyo = ¤Á¤ç + +ca = ¤Á¤ã +cu = ¤Á¤å +ce = ¤Á¤§ +co = ¤Á¤ç + +nya = ¤Ë¤ã +nyu = ¤Ë¤å +nye = ¤Ë¤§ +nyo = ¤Ë¤ç + +nga = ¤Ë¤ã +ngu = ¤Ë¤å +nge = ¤Ë¤§ +ngo = ¤Ë¤ç + +hya = ¤Ò¤ã +hyu = ¤Ò¤å +hye = ¤Ò¤§ +hyo = ¤Ò¤ç + +hga = ¤Ò¤ã +hgu = ¤Ò¤å +hge = ¤Ò¤§ +hgo = ¤Ò¤ç + +mya = ¤ß¤ã +myu = ¤ß¤å +mye = ¤ß¤§ +myo = ¤ß¤ç + +mga = ¤ß¤ã +mgu = ¤ß¤å +mge = ¤ß¤§ +mgo = ¤ß¤ç + +rya = ¤ê¤ã +ryu = ¤ê¤å +rye = ¤ê¤§ +ryo = ¤ê¤ç + +kyz = ¤­¤ã¤ó +kyn = ¤­¤ã¤ó +kyj = ¤­¤å¤ó +kyd = ¤­¤§¤ó +kyl = ¤­¤ç¤ó + +kgz = ¤­¤ã¤ó +kgn = ¤­¤ã¤ó +kgj = ¤­¤å¤ó +kgd = ¤­¤§¤ó +kgl = ¤­¤ç¤ó + +syz = ¤·¤ã¤ó +syn = ¤·¤ã¤ó +syj = ¤·¤å¤ó +syd = ¤·¤§¤ó +syl = ¤·¤ç¤ó + +xz = ¤·¤ã¤ó +xn = ¤·¤ã¤ó +xj = ¤·¤å¤ó +xd = ¤·¤§¤ó +xl = ¤·¤ç¤ó + +tyz = ¤Á¤ã¤ó +tyn = ¤Á¤ã¤ó +tyj = ¤Á¤å¤ó +tyd = ¤Á¤§¤ó +tyl = ¤Á¤ç¤ó + +cz = ¤Á¤ã¤ó +cn = ¤Á¤ã¤ó +cj = ¤Á¤å¤ó +cd = ¤Á¤§¤ó +cl = ¤Á¤ç¤ó + +nyz = ¤Ë¤ã¤ó +nyn = ¤Ë¤ã¤ó +nyj = ¤Ë¤å¤ó +nyd = ¤Ë¤§¤ó +nyl = ¤Ë¤ç¤ó + +ngz = ¤Ë¤ã¤ó +ngn = ¤Ë¤ã¤ó +ngj = ¤Ë¤å¤ó +ngd = ¤Ë¤§¤ó +ngl = ¤Ë¤ç¤ó + +hyz = ¤Ò¤ã¤ó +hyn = ¤Ò¤ã¤ó +hyj = ¤Ò¤å¤ó +hyd = ¤Ò¤§¤ó +hyl = ¤Ò¤ç¤ó + +hgz = ¤Ò¤ã¤ó +hgn = ¤Ò¤ã¤ó +hgj = ¤Ò¤å¤ó +hgd = ¤Ò¤§¤ó +hgl = ¤Ò¤ç¤ó + +myz = ¤ß¤ã¤ó +myn = ¤ß¤ã¤ó +myj = ¤ß¤å¤ó +myd = ¤ß¤§¤ó +myl = ¤ß¤ç¤ó + +mgz = ¤ß¤ã¤ó +mgn = ¤ß¤ã¤ó +mgj = ¤ß¤å¤ó +mgd = ¤ß¤§¤ó +mgl = ¤ß¤ç¤ó + +ryz = ¤ê¤ã¤ó +ryn = ¤ê¤ã¤ó +ryj = ¤ê¤å¤ó +ryd = ¤ê¤§¤ó +ryl = ¤ê¤ç¤ó + +kyq = ¤­¤ã¤¤ +kyh = ¤­¤å¤¦ +kyw = ¤­¤§¤¤ +kyp = ¤­¤ç¤¦ + +kgq = ¤­¤ã¤¤ +kgh = ¤­¤å¤¦ +kgw = ¤­¤§¤¤ +kgp = ¤­¤ç¤¦ + +syq = ¤·¤ã¤¤ +syh = ¤·¤å¤¦ +syw = ¤·¤§¤¤ +syp = ¤·¤ç¤¦ + +xq = ¤·¤ã¤¤ +xh = ¤·¤å¤¦ +xw = ¤·¤§¤¤ +xp = ¤·¤ç¤¦ + +tyq = ¤Á¤ã¤¤ +tyh = ¤Á¤å¤¦ +tyw = ¤Á¤§¤¤ +typ = ¤Á¤ç¤¦ + +cq = ¤Á¤ã¤¤ +ch = ¤Á¤å¤¦ +cw = ¤Á¤§¤¤ +cp = ¤Á¤ç¤¦ + +nyq = ¤Ë¤ã¤¤ +nyh = ¤Ë¤å¤¦ +nyw = ¤Ë¤§¤¤ +nyp = ¤Ë¤ç¤¦ + +ngq = ¤Ë¤ã¤¤ +ngh = ¤Ë¤å¤¦ +ngw = ¤Ë¤§¤¤ +ngp = ¤Ë¤ç¤¦ + +hyq = ¤Ò¤ã¤¤ +hyh = ¤Ò¤å¤¦ +hyw = ¤Ò¤§¤¤ +hyp = ¤Ò¤ç¤¦ + +hgq = ¤Ò¤ã¤¤ +hgh = ¤Ò¤å¤¦ +hgw = ¤Ò¤§¤¤ +hgp = ¤Ò¤ç¤¦ + +myq = ¤ß¤ã¤¤ +myh = ¤ß¤å¤¦ +myw = ¤ß¤§¤¤ +myp = ¤ß¤ç¤¦ + +mgq = ¤ß¤ã¤¤ +mgh = ¤ß¤å¤¦ +mgw = ¤ß¤§¤¤ +mgp = ¤ß¤ç¤¦ + +ryq = ¤ê¤ã¤¤ +ryh = ¤ê¤å¤¦ +ryw = ¤ê¤§¤¤ +ryp = ¤ê¤ç¤¦ + +# Ù¹²» (Âù²»¡¢È¾Âù²») +gya = ¤®¤ã +gyu = ¤®¤å +gye = ¤®¤§ +gyo = ¤®¤ç + +zya = ¤¸¤ã +zyu = ¤¸¤å +zye = ¤¸¤§ +zyo = ¤¸¤ç + +ja = ¤¸¤ã +ju = ¤¸¤å +je = ¤¸¤§ +jo = ¤¸¤ç + +bya = ¤Ó¤ã +byu = ¤Ó¤å +bye = ¤Ó¤§ +byo = ¤Ó¤ç + +pya = ¤Ô¤ã +pyu = ¤Ô¤å +pye = ¤Ô¤§ +pyo = ¤Ô¤ç + +pga = ¤Ô¤ã +pgu = ¤Ô¤å +pge = ¤Ô¤§ +pgo = ¤Ô¤ç + +gyz = ¤®¤ã¤ó +gyn = ¤®¤ã¤ó +gyj = ¤®¤å¤ó +gyd = ¤®¤§¤ó +gyl = ¤®¤ç¤ó + +zyz = ¤¸¤ã¤ó +zyn = ¤¸¤ã¤ó +zyj = ¤¸¤å¤ó +zyd = ¤¸¤§¤ó +zyl = ¤¸¤ç¤ó + +jz = ¤¸¤ã¤ó +jn = ¤¸¤ã¤ó +jj = ¤¸¤å¤ó +jd = ¤¸¤§¤ó +jl = ¤¸¤ç¤ó + +byz = ¤Ó¤ã¤ó +byn = ¤Ó¤ã¤ó +byj = ¤Ó¤å¤ó +byd = ¤Ó¤§¤ó +byl = ¤Ó¤ç¤ó + +pyz = ¤Ô¤ã¤ó +pyn = ¤Ô¤ã¤ó +pyj = ¤Ô¤å¤ó +pyd = ¤Ô¤§¤ó +pyl = ¤Ô¤ç¤ó + +pgz = ¤Ô¤ã¤ó +pgn = ¤Ô¤ã¤ó +pgj = ¤Ô¤å¤ó +pgd = ¤Ô¤§¤ó +pgl = ¤Ô¤ç¤ó + +gyq = ¤®¤ã¤¤ +gyh = ¤®¤å¤¦ +gyw = ¤®¤§¤¤ +gyp = ¤®¤ç¤¦ + +zyq = ¤¸¤ã¤¤ +zyh = ¤¸¤å¤¦ +zyw = ¤¸¤§¤¤ +zyp = ¤¸¤ç¤¦ + +jq = ¤¸¤ã¤¤ +jh = ¤¸¤å¤¦ +jw = ¤¸¤§¤¤ +jp = ¤¸¤ç¤¦ + +byq = ¤Ó¤ã¤¤ +byh = ¤Ó¤å¤¦ +byw = ¤Ó¤§¤¤ +byp = ¤Ó¤ç¤¦ + +pyq = ¤Ô¤ã¤¤ +pyh = ¤Ô¤å¤¦ +pyw = ¤Ô¤§¤¤ +pyp = ¤Ô¤ç¤¦ + +pgq = ¤Ô¤ã¤¤ +pgh = ¤Ô¤å¤¦ +pgw = ¤Ô¤§¤¤ +pgp = ¤Ô¤ç¤¦ + +# Ù¹²» (³°Íè¸ì¡¢Â¾) +fa = ¤Õ¤¡ +fi = ¤Õ¤£ +fu = ¤Õ +fe = ¤Õ¤§ +fo = ¤Õ¤© + +va = ¥ô¤¡ +vi = ¥ô¤£ +vu = ¥ô +ve = ¥ô¤§ +vo = ¥ô¤© + +tgi = ¤Æ¤£ +tgu = ¤È¤¥ + +dci = ¤Ç¤£ +dcu = ¤É¤¥ + +wi = ¤¦¤£ +we = ¤¦¤§ +wo = ¤ò + +wso = ¤¦¤© + +la = ¤¡ +li = ¤£ +lu = ¤¥ +le = ¤§ +lo = ¤© + +lya = ¤ã +lyu = ¤å +lyo = ¤ç + +# Â¥²»¡¢Ùû²»¡¢Ä¹²»Éä +; = ¤Ã +q = ¤ó +- = ¡¼ +: = ¡¼ +\[ = ¡Ö +\] = ¡× + +# Æüì³ÈÄ¥ +kt = ¤³¤È +wt = ¤ï¤¿ +km = ¤«¤â +sr = ¤¹¤ë +rr = ¤é¤ì +nb = ¤Í¤Ð +nt = ¤Ë¤Á +st = ¤·¤¿ +mn = ¤â¤Î +tm = ¤¿¤á +tr = ¤¿¤é +zr = ¤¶¤ë +bt = ¤Ó¤È +dt = ¤À¤Á +tt = ¤¿¤Á +ms = ¤Þ¤¹ +dm = ¤Ç¤â +nr = ¤Ê¤ë +mt = ¤Þ¤¿ +gr = ¤¬¤é +wr = ¤ï¤ì +ht = ¤Ò¤È +ds = ¤Ç¤¹ +kr = ¤«¤é +yr = ¤è¤ë +tb = ¤¿¤Ó +gt = ¤´¤È diff --git a/data/canna.sty b/data/canna.sty new file mode 100755 index 0000000..e77f48f --- /dev/null +++ b/data/canna.sty @@ -0,0 +1,330 @@ +# +# canna.sty - Canna like style definition file for scim-anthy. +# Copyright (C) 2005 Takuro Ashie +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = Canna +Version = 0.0.0 + +[KeyBindings] +OnOffKey = Zenkaku_Hankaku,Shift+space,Control+o,Control+backslash +CircleInputModeKey = +CircleKanaModeKey = +LatinModeKey = +WideLatinModeKey = +HiraganaModeKey = Hiragana_Katakana +KatakanaModeKey = Shift+Hiragana_Katakana +HalfKatakanaModeKey = +CircleTypingMethodKey = Romaji,Alt+Romaji + +ConvertKey = space +PredictKey = Control+q,Control+Q +CancelKey = Escape,Control+g,Control+G +CommitKey = Return,Control+m,Control+M + +InsertSpaceKey = space +InsertAltSpaceKey = +BackSpaceKey = BackSpace,Control+h,Control+H +DeleteKey = Delete,Control+d,Control+D + +MoveCaretBackwardKey = Left,Control+b,Control+B +MoveCaretForwardKey = Right,Control+f,Control+F +MoveCaretFirstKey = Control+a,Control+A +MoveCaretLastKey = Control+e,Control+E + +SelectPrevSegmentKey = Left,Control+b,Control+B +SelectNextSegmentKey = Right,Control+f,Control+F +SelectFirstSegmentKey = Control+a,Control+A +SelectLastSegmentKey = Control+e,Control+E +ExpandSegmentKey = Control+o,Control+O +ShrinkSegmentKey = Tab,Control+i,Control+I +CommitSelectedSegmentKey = Control+k,Control+K + +CandidatesPageUpKey = Up,Control+p,Control+P +CandidatesPageDownKey = Down,Control+n,Control+N +SelectNextCandidateKey = space,Control+q,Control+Q,Right,Control+f,Control+F +SelectPrevCandidateKey = Left,Control+b,Control+B + +SelectCandidates1Key = 1 +SelectCandidates2Key = 2 +SelectCandidates3Key = 3 +SelectCandidates4Key = 4 +SelectCandidates5Key = 5 +SelectCandidates6Key = 6 +SelectCandidates7Key = 7 +SelectCandidates8Key = 8 +SelectCandidates9Key = 9 +SelectCandidates10Key = 0 + +ConvertCharTypeForwardKey = Control+n,Control+N +ConvertCharTypeBackwardKey = Control+p,Control+P +ConvertToHiraganaKey = +ConvertToKatakanaKey = +ConvertToHalfKey = +ConvertToHalfKatakanaKey = +ConvertToWideLatinKey = +ConvertToLatinKey = +# FIXME! +#ConvertToUpperKey = Control+u,Control+U +#ConvertToLowerKey = Control+l,Control+L + +AddWordKey = + +# Override fundamental table +[RomajiTable/FundamentalTable] +a = ¤¢ +i = ¤¤ +u = ¤¦ +e = ¤¨ +o = ¤ª +ka = ¤« +ki = ¤­ +ku = ¤¯ +ke = ¤± +ko = ¤³ +sa = ¤µ +si = ¤· +su = ¤¹ +se = ¤» +so = ¤½ +ta = ¤¿ +ti = ¤Á +tu = ¤Ä +te = ¤Æ +to = ¤È +na = ¤Ê +ni = ¤Ë +nu = ¤Ì +ne = ¤Í +no = ¤Î +ha = ¤Ï +hi = ¤Ò +hu = ¤Õ +he = ¤Ø +ho = ¤Û +ma = ¤Þ +mi = ¤ß +mu = ¤à +me = ¤á +mo = ¤â +ya = ¤ä +yi = ¤¤ +yu = ¤æ +ye = ¤¤¤§ +yo = ¤è +ra = ¤é +ri = ¤ê +ru = ¤ë +re = ¤ì +ro = ¤í +wa = ¤ï +wi = ¥ð +wu = ¤¦ +we = ¥ñ +wo = ¤ò +ga = ¤¬ +gi = ¤® +gu = ¤° +ge = ¤² +go = ¤´ +za = ¤¶ +zi = ¤¸ +zu = ¤º +ze = ¤¼ +zo = ¤¾ +da = ¤À +di = ¤Â +du = ¤Å +de = ¤Ç +do = ¤É +ba = ¤Ð +bi = ¤Ó +bu = ¤Ö +be = ¤Ù +bo = ¤Ü +pa = ¤Ñ +pi = ¤Ô +pu = ¤× +pe = ¤Ú +po = ¤Ý +kya = ¤­¤ã +kyi = ¤­¤£ +kyu = ¤­¤å +kye = ¤­¤§ +kyo = ¤­¤ç +gya = ¤®¤ã +gyi = ¤®¤£ +gyu = ¤®¤å +gye = ¤®¤§ +gyo = ¤®¤ç +sya = ¤·¤ã +syi = ¤·¤£ +syu = ¤·¤å +sye = ¤·¤§ +syo = ¤·¤ç +zya = ¤¸¤ã +zyi = ¤¸¤£ +zyu = ¤¸¤å +zye = ¤¸¤§ +zyo = ¤¸¤ç +tya = ¤Á¤ã +tyi = ¤Á¤£ +tyu = ¤Á¤å +tye = ¤Á¤§ +tyo = ¤Á¤ç +nya = ¤Ë¤ã +nyi = ¤Ë¤£ +nyu = ¤Ë¤å +nye = ¤Ë¤§ +nyo = ¤Ë¤ç +hya = ¤Ò¤ã +hyi = ¤Ò¤£ +hyu = ¤Ò¤å +hye = ¤Ò¤§ +hyo = ¤Ò¤ç +bya = ¤Ó¤ã +byi = ¤Ó¤£ +byu = ¤Ó¤å +bye = ¤Ó¤§ +byo = ¤Ó¤ç +pya = ¤Ô¤ã +pyi = ¤Ô¤£ +pyu = ¤Ô¤å +pye = ¤Ô¤§ +pyo = ¤Ô¤ç +mya = ¤ß¤ã +myi = ¤ß¤£ +myu = ¤ß¤å +mye = ¤ß¤§ +myo = ¤ß¤ç +rya = ¤ê¤ã +ryi = ¤ê¤£ +ryu = ¤ê¤å +rye = ¤ê¤§ +ryo = ¤ê¤ç +tsa = ¤Ä¤¡ +tyi = ¤Ä¤£ +tyu = ¤Ä +tye = ¤Ä¤§ +tyo = ¤Ä¤© +sha = ¤·¤ã +shi = ¤· +shu = ¤·¤å +she = ¤·¤§ +sho = ¤·¤ç +tha = ¤Æ¤¡ +thi = ¤Æ¤£ +thu = ¤Æ¤å +the = ¤Æ¤§ +tho = ¤Æ¤ç +ja = ¤¸¤ã +ji = ¤¸ +ju = ¤¸¤å +je = ¤¸¤§ +jo = ¤¸¤ç +cha = ¤Á¤ã +chi = ¤Á +chu = ¤Á¤å +che = ¤Á¤§ +cho = ¤Á¤ç +fa = ¤Õ¤¡ +fi = ¤Õ¤£ +fu = ¤Õ +fe = ¤Õ¤§ +fo = ¤Õ¤© +va = ¤¦¡«¤¡ +vi = ¤¦¡«¤£ +vu = ¤¦¡« +ve = ¤¦¡«¤§ +vo = ¤¦¡«¤© +gwa = ¤°¤¡ +gwi = ¤°¤£ +gwu = ¤°¤¥ +gwe = ¤°¤§ +gwo = ¤°¤© +dya = ¤Â¤ã +dyi = ¤Â¤£ +dyu = ¤Â¤å +dye = ¤Â¤§ +dyo = ¤Â¤ç +dha = ¤Ç¤ã +dhi = ¤Ç¤£ +dhu = ¤Ç¤å +dhe = ¤Ç¤§ +dho = ¤Ç¤ç +ca = ¤« +cu = ¤¯ +co = ¤³ +cya = ¤Á¤ã +cyi = ¤Á¤£ +cyu = ¤Á¤¥ +cye = ¤Á¤§ +cyo = ¤Á¤© +jya = ¤¸¤ã +jyi = ¤¸¤£ +jyu = ¤¸¤å +jye = ¤¸¤§ +jyo = ¤¸¤ç +la = ¤é +li = ¤ê +lu = ¤ë +le = ¤ì +lo = ¤í +lya = ¤ê¤ã +lyi = ¤ê¤£ +lyu = ¤ê¤å +lye = ¤ê¤§ +lyo = ¤ê¤ç +xa = ¤¡ +xi = ¤£ +xu = ¤¥ +xe = ¤§ +xo = ¤© +xwa = ¤î +xtu = ¤Ã +xtsu = ¤Ã +xya = ¤ã +xyu = ¤å +xyo = ¤ç +n = ¤ó +nn = ¤ó +mn = ¤ó +n' = ¤ó +@@ = ¡¡ +- = ¡¼ +#[ = ¡Ö +#] = ¡× +#, = ¡¢ +#. = ¡£ +@( = ¡Ê +@) = ¡Ë +@{ = ¡Ð +@} = ¡Ñ +@[ = ¡Î +@] = ¡Ï +@, = , +@. = . +@~ = ¡Á +@\ = ¡À +@/ = ¡¦ +@- = ¡¾ +@2 = ¡Å +@3 = ¡Ä +@|| = ¡Â +@| = ¡Ã diff --git a/data/msime.sty b/data/msime.sty new file mode 100755 index 0000000..f00e55c --- /dev/null +++ b/data/msime.sty @@ -0,0 +1,377 @@ +# +# msime.sty - Microsoft IME like style definition file for scim-anthy. +# Copyright (C) 2005 Takuro Ashie +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = Microsoft IME +Version = 0.0.0 + +[KeyBindings] +OnOffKey = Eisu_toggle,Zenkaku_Hankaku +CircleKanaModeKey = Muhenkan +LatinModeKey = +WideLatinModeKey = +HiraganaModeKey = Hiragana_Katakana +KatakanaModeKey = Shift+Hiragana_Katakana +HalfKatakanaModeKey = +CircleTypingMethodKey = Alt+Romaji + +ConvertKey = space,Shift+space,Henkan +PredictKey = Tab +CancelKey = BackSpace,Control+BackSpace,Escape,Control+h,Control+z +CommitKey = Return,Control+Return,Control+m +ReconvertKey = Henkan,F13 + +InsertSpaceKey = space +InsertAltSpaceKey = Shift+space +BackSpaceKey = BackSpace,Control+h +DeleteKey = Delete,Control+g + +MoveCaretFirstKey = Home,Control+Left,Down,Control+a,Control+e +MoveCaretLastKey = End,Control+Right,Down,Control+f,Control+n,Control+x +MoveCaretForwardKey = Right,Shift+Right,Control+d,Control+l +MoveCaretBackwardKey = Left,Shift+Left,Control+s,Control+k + +SelectFirstSegmentKey = Home,Control+Left,Control+a +SelectLastSegmentKey = End,Control+Right,Control+f +SelectNextSegmentKey = Right,Control+d +SelectPrevSegmentKey = Left,Control+s +ShrinkSegmentKey = Shift+Left,Control+e,Control+k +ExpandSegmentKey = Shift+Right,Control+l,Control+x +CommitFirstSegmentKey = Shift+Down +CommitSelectedSegmentKey = Control+Down,Control+n + +CandidatesPageUpKey = Page_Up,Shift+Up +CandidatesPageDownKey = Page_Down,Shift+Down +SelectFirstCandidateKey = Home +SelectLastCandidateKey = End +SelectPrevCandidateKey = Up,Control+e,Shift+space,Shift+Henkan +SelectNextCandidateKey = space,Tab,Henkan,Down,Control+x + +SelectCandidates1Key = 1 +SelectCandidates2Key = 2 +SelectCandidates3Key = 3 +SelectCandidates4Key = 4 +SelectCandidates5Key = 5 +SelectCandidates6Key = 6 +SelectCandidates7Key = 7 +SelectCandidates8Key = 8 +SelectCandidates9Key = 9 +SelectCandidates10Key = 0 + +ConvertToHiraganaKey = Control+u,F6 +ConvertToKatakanaKey = Control+i,F7 +ConvertToHalfKey = Control+o,F8 +ConvertToHalfKatakanaKey = Shift+F8 +ConvertToWideLatinKey = Control+p,F9 +ConvertToLatinKey = Control+t,F10 + + +# Override fundamental table +[RomajiTable/FundamentalTable] +- = ¡¼ +#/ = ¡¦ +#[ = ¡Ö +#] = ¡× +la = ¤¡ +xa = ¤¡ +a = ¤¢ +li = ¤£ +lyi = ¤£ +xi = ¤£ +xyi = ¤£ +i = ¤¤ +yi = ¤¤ +ye = ¤¤¤§ +lu = ¤¥ +xu = ¤¥ +u = ¤¦ +whu = ¤¦ +wu = ¤¦ +wha = ¤¦¤¡ +whi = ¤¦¤£ +wi = ¤¦¤£ +we = ¤¦¤§ +whe = ¤¦¤§ +who = ¤¦¤© +le = ¤§ +lye = ¤§ +xe = ¤§ +xye = ¤§ +e = ¤¨ +lo = ¤© +xo = ¤© +o = ¤ª +ca = ¤« +ka = ¤« +ga = ¤¬ +ki = ¤­ +kyi = ¤­¤£ +kye = ¤­¤§ +kya = ¤­¤ã +kyu = ¤­¤å +kyo = ¤­¤ç +gi = ¤® +gyi = ¤®¤£ +gye = ¤®¤§ +gya = ¤®¤ã +gyu = ¤®¤å +gyo = ¤®¤ç +cu = ¤¯ +ku = ¤¯ +qu = ¤¯ +kwa = ¤¯¤¡ +qa = ¤¯¤¡ +qwa = ¤¯¤¡ +qi = ¤¯¤£ +qwi = ¤¯¤£ +qyi = ¤¯¤£ +qwu = ¤¯¤¥ +qe = ¤¯¤§ +qwe = ¤¯¤§ +qye = ¤¯¤§ +qo = ¤¯¤© +qwo = ¤¯¤© +qya = ¤¯¤ã +qyu = ¤¯¤å +qyo = ¤¯¤ç +gu = ¤° +gwa = ¤°¤¡ +gwi = ¤°¤£ +gwu = ¤°¤¥ +gwe = ¤°¤§ +gwo = ¤°¤© +ke = ¤± +ge = ¤² +co = ¤³ +ko = ¤³ +go = ¤´ +sa = ¤µ +za = ¤¶ +ci = ¤· +shi = ¤· +si = ¤· +syi = ¤·¤£ +she = ¤·¤§ +sye = ¤·¤§ +sha = ¤·¤ã +sya = ¤·¤ã +shu = ¤·¤å +syu = ¤·¤å +sho = ¤·¤ç +syo = ¤·¤ç +ji = ¤¸ +zi = ¤¸ +jyi = ¤¸¤£ +zyi = ¤¸¤£ +je = ¤¸¤§ +jye = ¤¸¤§ +zye = ¤¸¤§ +ja = ¤¸¤ã +jya = ¤¸¤ã +zya = ¤¸¤ã +ju = ¤¸¤å +jyu = ¤¸¤å +zyu = ¤¸¤å +jo = ¤¸¤ç +jyo = ¤¸¤ç +zyo = ¤¸¤ç +su = ¤¹ +swa = ¤¹¤¡ +swi = ¤¹¤£ +swu = ¤¹¤¥ +swe = ¤¹¤§ +swo = ¤¹¤© +zu = ¤º +ce = ¤» +se = ¤» +ze = ¤¼ +so = ¤½ +zo = ¤¾ +ta = ¤¿ +da = ¤À +chi = ¤Á +ti = ¤Á +cyi = ¤Á¤£ +tyi = ¤Á¤£ +che = ¤Á¤§ +cye = ¤Á¤§ +tye = ¤Á¤§ +cha = ¤Á¤ã +cya = ¤Á¤ã +tya = ¤Á¤ã +chu = ¤Á¤å +cyu = ¤Á¤å +tyu = ¤Á¤å +cho = ¤Á¤ç +cyo = ¤Á¤ç +tyo = ¤Á¤ç +di = ¤Â +dyi = ¤Â¤£ +dye = ¤Â¤§ +dya = ¤Â¤ã +dyu = ¤Â¤å +dyo = ¤Â¤ç +ltsu = ¤Ã +ltu = ¤Ã +xtsu = ¤Ã +xtu = ¤Ã +tsu = ¤Ä +tu = ¤Ä +tsa = ¤Ä¤¡ +tsi = ¤Ä¤£ +tse = ¤Ä¤§ +tso = ¤Ä¤© +du = ¤Å +te = ¤Æ +thi = ¤Æ¤£ +the = ¤Æ¤§ +tha = ¤Æ¤ã +thu = ¤Æ¤å +tho = ¤Æ¤ç +de = ¤Ç +dhi = ¤Ç¤£ +dhe = ¤Ç¤§ +dha = ¤Ç¤ã +dhu = ¤Ç¤å +dho = ¤Ç¤ç +to = ¤È +twa = ¤È¤¡ +twi = ¤È¤£ +twu = ¤È¤¥ +twe = ¤È¤§ +two = ¤È¤© +do = ¤É +dwa = ¤É¤¡ +dwi = ¤É¤£ +dwu = ¤É¤¥ +dwe = ¤É¤§ +dwo = ¤É¤© +na = ¤Ê +ni = ¤Ë +nyi = ¤Ë¤£ +nye = ¤Ë¤§ +nya = ¤Ë¤ã +nyu = ¤Ë¤å +nyo = ¤Ë¤ç +nu = ¤Ì +ne = ¤Í +no = ¤Î +ha = ¤Ï +ba = ¤Ð +pa = ¤Ñ +hi = ¤Ò +hyi = ¤Ò¤£ +hye = ¤Ò¤§ +hya = ¤Ò¤ã +hyu = ¤Ò¤å +hyo = ¤Ò¤ç +bi = ¤Ó +byi = ¤Ó¤£ +bye = ¤Ó¤§ +bya = ¤Ó¤ã +byu = ¤Ó¤å +byo = ¤Ó¤ç +pi = ¤Ô +pyi = ¤Ô¤£ +pye = ¤Ô¤§ +pya = ¤Ô¤ã +pyu = ¤Ô¤å +pyo = ¤Ô¤ç +fu = ¤Õ +hu = ¤Õ +fa = ¤Õ¤¡ +fwa = ¤Õ¤¡ +fi = ¤Õ¤£ +fwi = ¤Õ¤£ +fyi = ¤Õ¤£ +fwu = ¤Õ¤¥ +fe = ¤Õ¤§ +fwe = ¤Õ¤§ +fye = ¤Õ¤§ +fo = ¤Õ¤© +fwo = ¤Õ¤© +fya = ¤Õ¤ã +fyu = ¤Õ¤å +fyo = ¤Õ¤ç +bu = ¤Ö +pu = ¤× +he = ¤Ø +be = ¤Ù +pe = ¤Ú +ho = ¤Û +bo = ¤Ü +po = ¤Ý +ma = ¤Þ +mi = ¤ß +myi = ¤ß¤£ +mye = ¤ß¤§ +mya = ¤ß¤ã +myu = ¤ß¤å +myo = ¤ß¤ç +mu = ¤à +me = ¤á +mo = ¤â +lya = ¤ã +xya = ¤ã +ya = ¤ä +lyu = ¤å +xyu = ¤å +yu = ¤æ +lyo = ¤ç +xyo = ¤ç +yo = ¤è +ra = ¤é +ri = ¤ê +ryi = ¤ê¤£ +rye = ¤ê¤§ +rya = ¤ê¤ã +ryu = ¤ê¤å +ryo = ¤ê¤ç +ru = ¤ë +re = ¤ì +ro = ¤í +lwa = ¤î +xwa = ¤î +wa = ¤ï +wo = ¤ò +n = ¤ó +nn = ¤ó +xn = ¤ó +vu = ¥ô +va = ¥ô¤¡ +vi = ¥ô¤£ +vyi = ¥ô¤£ +ve = ¥ô¤§ +vye = ¥ô¤§ +vo = ¥ô¤© +vya = ¥ô¤ã +vyu = ¥ô¤å +vyo = ¥ô¤ç +lka = ¥õ +xka = ¥õ +lke = ¥ö +xke = ¥ö + + +[PreeditStyle] + + +[Setting] +RomajiAllowSplit = true diff --git a/data/nicola-a.sty b/data/nicola-a.sty new file mode 100755 index 0000000..8ee723b --- /dev/null +++ b/data/nicola-a.sty @@ -0,0 +1,97 @@ +# +# nicola-a.sty - NICOLA A type layout definition file +# Copyright (C) 2005 Hatuka*nezumi +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = NICOLA A·¿ÇÛÎó +Version = 0.0.0 + +[NICOLATable/FundamentalTable] +# non modifiered keys +'=',, +1=£±,¡©,¡© +2=£²,¡¿,¡¿ +3=£³,, +4=£´,¡Ö,¡Ö +5=£µ,¡×,¡× +6=£¶,¡Î,¡Î +7=£·,¡Ï,¡Ï +8=£¸,, +9=£¹,¡Ê,¡Ê +0=£°,¡Ë,¡Ë +-=¡Ý,, +\==¡á,, + +q=¡£,¤¡,¤ð +w=¤«,¤¨,¤¬ +e=¤¿,¤ê,¤À +r=¤³,¤ã,¤´ +t=¤µ,¤ì,¤¶ +y=¤é,¤Ñ,¤è +u=¤Á,¤Â,¤Ë +i=¤¯,¤°,¤ë +o=¤Ä,¤Å,¤Þ +p=¡¤,¤Ô,¤§ +\[=¡¢,, +\]=¡«,,¡¬ +\\= + +a=¤¦,¤ò,¥ô +s=¤·,¤¢,¤¸ +d=¤Æ,¤Ê,¤Ç +f=¤±,¤å,¤² +g=¤»,¤â,¤¼ +h=¤Ï,¤Ð,¤ß +j=¤È,¤É,¤ª +k=¤­,¤®,¤Î +l=¤¤,¤Ý,¤ç +;=¤ó,,¤Ã +'= + +z=¡¥,¤¥,¤ñ +x=¤Ò,¡¼,¤Ó +c=¤¹,¤í,¤º +v=¤Õ,¤ä,¤Ö +b=¤Ø,¤£,¤Ù +n=¤á,¤×,¤Ì +m=¤½,¤¾,¤æ +\,=¤Í,¤Ú,¤à +.=¤Û,¤Ü,¤ï +/=¡¦,¤î,¤© + +# shift modifiered keys +~=¡Á +!=¡ª +@=¡÷ +\#=¡ô +$=¡ð +%=¡ó +^=¡° +&=¡õ +*=¡ö +(=¡Ê +)=¡Ë +_=¡² ++=¡Ü + +H=¤Ñ +X=¤Ô +V=¤× +B=¤Ú +>=¤Ý diff --git a/data/nicola-f.sty b/data/nicola-f.sty new file mode 100755 index 0000000..3485db0 --- /dev/null +++ b/data/nicola-f.sty @@ -0,0 +1,98 @@ +# +# nicola-f.sty - NICOLA F type layout definition file +# Copyright (C) 2005 Hatuka*nezumi +# Copyright (C) 2005 MORIYAMA Masayuki +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = NICOLA F·¿ÇÛÎó +Version = 0.0.0 + +[NICOLATable/FundamentalTable] +# non modifiered keys +1=1,¡©,¡© +2=2,¡¿,¡¿ +3=3,¡Á,¡Á +4=4,¡Ö,¡Ö +5=5,¡×,¡× +6=6,¡Î,¡Î +7=7,¡Ï,¡Ï +8=8,¡Ê,¡Ê +9=9,¡Ë,¡Ë +0=0,¡Ø,¡Ø +-=¡Ý,¡Ù,¡Ù +^=¡°,, +\\=¡ï,, + +q=¡£,¤¡,¤ð +w=¤«,¤¨,¤¬ +e=¤¿,¤ê,¤À +r=¤³,¤ã,¤´ +t=¤µ,¤ì,¤¶ +y=¤é,¤Ñ,¤è +u=¤Á,¤Â,¤Ë +i=¤¯,¤°,¤ë +o=¤Ä,¤Å,¤Þ +p=¡¤,¤Ô,¤§ +@= +\[=¡«,,¡¬ + +a=¤¦,¤ò,¥ô +s=¤·,¤¢,¤¸ +d=¤Æ,¤Ê,¤Ç +f=¤±,¤å,¤² +g=¤»,¤â,¤¼ +h=¤Ï,¤Ð,¤ß +j=¤È,¤É,¤ª +k=¤­,¤®,¤Î +l=¤¤,¤Ý,¤ç +;=¤ó,,¤Ã +:=¡¢,, +\]= + +z=¡¥,¤¥,¤ñ +x=¤Ò,¡¼,¤Ó +c=¤¹,¤í,¤º +v=¤Õ,¤ä,¤Ö +b=¤Ø,¤£,¤Ù +n=¤á,¤×,¤Ì +m=¤½,¤¾,¤æ +,=¤Í,¤Ú,¤à +.=¤Û,¤Ü,¤ï +/=¡¦,¤î,¤© + +# shift modifiered keys +!=¡ª +"=¡É +\#=¡ô +$=¡ð +%=¡ó +&=¡õ +'=¡Ç +(=¡Ê +)=¡Ë + +\==¡á +~=¡± +|=¡Ã + +H=¤Ñ +X=¤Ô +V=¤× +B=¤Ú +>=¤Ý diff --git a/data/nicola-j.sty b/data/nicola-j.sty new file mode 100755 index 0000000..05e2b1c --- /dev/null +++ b/data/nicola-j.sty @@ -0,0 +1,97 @@ +# +# nicola-j.sty - NICOLA J type layout definition file +# Copyright (C) 2005 Hatuka*nezumi +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = NICOLA J·¿ÇÛÎó +Version = 0.0.0 + +[NICOLATable/FundamentalTable] +# non modifiered keys +1=£±,¡©,¡© +2=£²,¡¿,¡¿ +3=£³,¡Á,¡Á +4=£´,¡Ö,¡Ö +5=£µ,¡×,¡× +6=£¶,¡Î,¡Î +7=£·,¡Ï,¡Ï +8=£¸,¡Ê,¡Ê +9=£¹,¡Ë,¡Ë +0=£°,¡Ø,¡Ø +-=¡Ý,¡Ù,¡Ù +^=¡°,, +\\=¡ï,, + +q=¡£,¤¡,¤ð +w=¤«,¤¨,¤¬ +e=¤¿,¤ê,¤À +r=¤³,¤ã,¤´ +t=¤µ,¤ì,¤¶ +y=¤é,¤Ñ,¤è +u=¤Á,¤Â,¤Ë +i=¤¯,¤°,¤ë +o=¤Ä,¤Å,¤Þ +p=¡¤,¤Ô,¤§ +@=¡¢,, +\[=¡«,,¡¬ + +a=¤¦,¤ò,¥ô +s=¤·,¤¢,¤¸ +d=¤Æ,¤Ê,¤Ç +f=¤±,¤å,¤² +g=¤»,¤â,¤¼ +h=¤Ï,¤Ð,¤ß +j=¤È,¤É,¤ª +k=¤­,¤®,¤Î +l=¤¤,¤Ý,¤ç +;=¤ó,,¤Ã +:= +\]= + +z=¡¥,¤¥,¤ñ +x=¤Ò,¡¼,¤Ó +c=¤¹,¤í,¤º +v=¤Õ,¤ä,¤Ö +b=¤Ø,¤£,¤Ù +n=¤á,¤×,¤Ì +m=¤½,¤¾,¤æ +,=¤Í,¤Ú,¤à +.=¤Û,¤Ü,¤ï +/=¡¦,¤î,¤© + +# shift modifiered keys +!=¡ª +"=¡É +\#=¡ô +$=¡ð +%=¡ó +&=¡õ +'=¡Ç +(=¡Ê +)=¡Ë + +\==¡á +~=¡± +|=¡Ã + +H=¤Ñ +X=¤Ô +V=¤× +B=¤Ú +>=¤Ý diff --git a/data/oasys100j.sty b/data/oasys100j.sty new file mode 100755 index 0000000..061ab14 --- /dev/null +++ b/data/oasys100j.sty @@ -0,0 +1,97 @@ +# +# oasys100j.sty - OASYS 100J like layout definition file +# Copyright (C) 2005 Hatuka*nezumi +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = OASYS 100J¸ß´¹ÇÛÎó +Version = 0.0.0 + +[NICOLATable/FundamentalTable] +# non modifiered keys +1=£±,¡©,¡© +2=£²,¡¿,¡¿ +3=£³,¡Á,¡Á +4=£´,¡Ö,¡Ö +5=£µ,¡×,¡× +6=£¶,¡Î,¡Î +7=£·,¡Ï,¡Ï +8=£¸,¡Ê,¡Ê +9=£¹,¡Ë,¡Ë +0=£°,¡Ø,¡Ø +-=¡½,¡Ù,¡Ù +^=¡Ã,¡ï,¡ï +\\= + +q=¡£,¤¡,¤ð +w=¤«,¤¨,¤¬ +e=¤¿,¤ê,¤À +r=¤³,¤ã,¤´ +t=¤µ,¤ì,¤¶ +y=¤é,¤Ñ,¤è +u=¤Á,¤Â,¤Ë +i=¤¯,¤°,¤ë +o=¤Ä,¤Å,¤Þ +p=¡¤,¤Ô,¤§ +@=¡¢,¡Ý,¡Ý +\[=¡«,,¡¬ + +a=¤¦,¤ò,¥ô +s=¤·,¤¢,¤¸ +d=¤Æ,¤Ê,¤Ç +f=¤±,¤å,¤² +g=¤»,¤â,¤¼ +h=¤Ï,¤Ð,¤ß +j=¤È,¤É,¤ª +k=¤­,¤®,¤Î +l=¤¤,¤Ý,¤ç +;=¤ó,,¤Ã +:= +\]= + +z=¡¥,¤¥,¤ñ +x=¤Ò,¡¼,¤Ó +c=¤¹,¤í,¤º +v=¤Õ,¤ä,¤Ö +b=¤Ø,¤£,¤Ù +n=¤á,¤×,¤Ì +m=¤½,¤¾,¤æ +,=¤Í,¤Ú,¤à +.=¤Û,¤Ü,¤ï +/=¡¦,¤î,¤© + +# shift modifiered keys +!=¡ª +"=¡É +\#=¡ô +$=¡ð +%=¡ó +&=¡õ +'=¡Ç +(=¡Ê +)=¡Ë + +\==¡á +~=¡È +|= + +H=¤Ñ +X=¤Ô +V=¤× +B=¤Ú +>=¤Ý diff --git a/data/scim-anthy-dict.png b/data/scim-anthy-dict.png new file mode 100755 index 0000000000000000000000000000000000000000..335106bf85641b5cb6b752adb83d1da70aca9f2f GIT binary patch literal 1924 zcmV-~2YdL5P)UyEFe6i_iz9J2N6j` zK~#90?Uu`r99I>_fA`+1>UZ^Hrl;p=kH?|hg?Ss@|8UxCDe zC4T^dO(X?ZokTJTvz6O!xH6^rO1!K3H^5Vv;e5iCDoW9d(sd zea=_kId$#_|HuD2)I&Tgh9QT)Ilu$l=OG{-aKBTCT?)k1#AE@U>=r$ z1kykj$S5Jg`RZ7$Z{3vVd84^>x;9=ajd|A01(LlbP0iDbWq(Bj+V=cO1`7>NxY>pLB`L>t) z`t=SvO6Vi7(FWRRj81TUgEj^mYkIBSHGaQecHdIuOo*lyX9f zuwpsTa%Ru=U?w_1G*n_&66(?E>Ep*oCcagQHlZ`lCBfsVG`vT8O zjPwDAZxLmsQhSttu;a{$E$0$9P@n_o9W~VYW=k5U_aB`+z>DKj_(){_HOr9@hbau%5w zoQSbFvgs6a#bRbAUw$MKJh>6~1#l1Osi72W%dMumy;dLp`ksBYY~Ue<#ae~gTt!Y) zan%Yzlpx!EA|nu1VTHvAhjb396NJ&oB*EGQJV$!0LasK&$mA@UT8-P?cCy@Qn^qim zfqww49RiVcZeg+6xOZb^W%lrBWu#aeQNpuWl_6=YkxG|H&5RSoii~r#qb}M+xLyZz zjPpEFN)eRu;Diz|H z8LCGP@ud^bWRHCD@$#k1m&MhqSAPdw02YDm`%gm+^sIA>cUrBLHy3V}=W3(X$=p;R zlmw>`TOIU96MwdfpYrHgkIP$IoL*hym4)}XDh0KtpQ85I5yt1{7@L}+Ix#M@xtu7M z%XB&&bMD-^4}iY|%R4i0KP=D(>W%hx@7l_0<;&B1XU5WbDWyOOMQpqD>J1`4&9C0Q z#JNVDelgF)+#FLgGvxDm!Z4&%Dv{6UsaC5Li$${8EVHw-{`t4g2aRT9iNPrv?dAsz zgT=A5-rin(d-3M@o^rM}F*Y68w8Z)$Qun#N)#Acx9demLv0?!)8!$UFOKoiI!@{{- zjzXb;+1_UR$`x`8w^Hxc>)FWK*MN?<3jsIWSR25F>#M83_|YFv@#9SO*+Ww!p72V< z**wYeJ&e?? z-fjeT&}VS0{`uzmTH}Ym{CWQe&pvDH;j=;`fZUE<(nvL{N{_=-j=w(lS<>*ss zPozm_(qyw)3WWm2Vv+TFoinFT!FGcy=dV#oDVlJ;?|9qct^jplm4Rtl1LBWcvIoHf zO2E;neBpcFfA;z3X0u`CPi7lg2wA*yhqI?o<0)aQDX)>~_Lr`E;$;$d5yxTR8iUQ( z8b-v>zI|2#06q``Uz-TS7r%4p(8)9RRx;P_uF{X=7`Rc8;`Ow3Yg>XFeMc840Jj)? za*g{6yJ397lztl2P>CZFUIO-8xDH$fx(Hf0>cGk{^st~ey#9n?eOLnUkrMO3$S_9_ z&`36sVioNg!@>Z;kid>J`rHIyphT9zrz8N4C;CkLUAh+P8a^@|au|BIME@y)o&U=F zuK&g9JWP`R1{8xGJuLe}rs^T(Ri!5AOMbZubRmFqia2_dB>b9X4IC@7ASdtBja6uUy^FZ<)iS Y@1r8%C(h_40yLY!)78&qol`;+05-Hsh5!Hn literal 0 HcmV?d00001 diff --git a/data/scim-anthy.png b/data/scim-anthy.png new file mode 100755 index 0000000000000000000000000000000000000000..8d901880e0a9f01cf5ff2e14eedbc69efa78593d GIT binary patch literal 1722 zcmV;r21WUaP)|wrp8BkOJ~@<>hj@_nzPWI6x7( ztS_0#l0C^U=bn3>^L)R*@Ar8*Klp$998E-$L}Y=8s9O!ZK}Ndww;ujr^vFwR?e6A* z8WCA`tH9UGxj#i@PoBswpIrXIYS~ftTj}^$U!#cVpLRU$Q!^MJ`WDB3>>?fkpfEQ` z+2RwNeB;7xz@7hn0u!NhV&gabm28EHj>iDppNW8oY?blQUnMg9iikWZBCdpQq~`yf zB@a&DMxrk2no3!{b!jh9o4_`o*s+~5@==A@_KPC&3lUlFJhbg^$nl@pvL{dM7Z%Fp z7oU}ZuHi}%F%k@>Npx(ty!TD%cDyT< zyEpHW5BFUNi^#ni!J|7k{ToF*g0jb19Qh-s_8!;>JT%vUN+}z|s%Bys(-mVl7GU{3 zU)ZUXs!E{QW7Phv8!#2^oKXhW3!*wM_`#?8DJS?EEvI#*>p8tE78bXUxk%9-Ft92jS=@sfc6BE zy68Ig6|^x_l1}lG7A~LazE?!d1OzHs`Zd8aAju(7*R&FVj683V>sD7~|V3&%S$fkY|<3EVYEx}TPz2Y6-QS23p%br$WtUH4?>{Rd_P0f3cJ|2V)%WGiVv&kMk$)74eejF& z{FYx!WGuRO4z)65^isW?ESK&BPsuYY_Db#krjctM*WVG5hegC$hDxb+%jys9JFC!# zID8-(J1*S5v7o}YD0Q<^>MfjBH8`FtMvCE0kquA?&{jhiOS zqPwA|-nnZ(1PAILWaZblkmQTe`g;>23T^{jI=D12b(Ep8`Oyl-+TGvt29`cexYony z5isJQd*}@&G1!;Fy2oc!^EvSnY;B#0+V5wxO5LL z^^RiDWB~#aqq!jfKz^w|2(%_7pp>#@eCP;<=W*18LtrXg+Kr%Y-BH4@Kuehn z3zQ2mK`9U$h|zQ=7t>=vH5$(>=IrSrni}#L9K8WcKQMkI7m75AF-L`_1Ob^W` z`vE8@^>+d-pO}DB3K9Eo?Zs_nZ@-#LD3mJ*@OEd8LEK! +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = TRONÇÛÎó +Version = 0.0.0 + +[NICOLATable/FundamentalTable] +# non modifiered keys +1=1,¡Ä,¡Á +2=2,¡®,¡Ç +3=3,¡È,¡É +4=4,¡Ö,¡× +5=5,¡Ø,¡Ù +6=6,¡ã,¡ä +7=7,¡Ê,¡Ë +8=8,¡Ð,¡Ñ +9=9,¡Î,¡Ï +0=0,¡À,¡Ã +!=1,¡Ä,¡Á +@=2,¡®,¡Ç +\#=3,¡È,¡É +$=4,¡Ö,¡× +%=5,¡Ø,¡Ù +^=6,¡ã,¡ä +&=7,¡Ê,¡Ë +*=8,¡Ð,¡Ñ +(=9,¡Î,¡Ï +)=0,¡À,¡Ã +"=¤é,¤Ò,¤Ó +'=¤é,¤Ò,¤Ó +<=¤ë,¤½,¤¾ +\,=¤ë,¤½,¤¾ +>=¤³,¡¦,¤´ +.=¤³,¡¦,¤´ +p=¤Ï,¤ã,¤Ð +y=¤ç,¤Û,¤Ü +f=¤­,¤®,¤¨ +g=¤Î,¤²,¤± +c=¤¯,¤°,¤á +r=¤¢, ,¤à +l=¤ì,¤ð,¤í +a=¤¿,¤Ì,¤À +o=¤È,¤Í,¤É +e=¤«,¤å,¤¬ +u=¤Æ,¤è,¤Ç +i=¤â,¤Õ,¤Ö +d=¤ò,¡«,¤ª +h=¤¤,¤Â,¤Á +t=¤¦,¥ô,¡¼ +n=¤·,¤¸,¤ß +s=¤ó,¤ñ,¤ä +;=¤Þ,¤§,¥õ +:=¤Þ,¤§,¥õ +q=¤ê,¤©,¥ö +j=¤Ë,¤»,¤¼ +k=¤µ,¤æ,¤¶ +x=¤Ê,¤Ø,¤Ù +b=¤¹,¤º,¤ï +m=¤Ä,¤Å,¤£ +w=¡¢,\,,¤¡ +v=¡£,.,¡¬ +z=¤Ã,¤î,¤¥ + ++=¡Ý,¡Ü,¡à +\==¡Ý,¡Ü,¡à +\[=¡á,¡ô,¡ó +{=¡á,¡ô,¡ó +/=¡¿,¡ö,¡ß +?=¡¿,¡ö,¡ß + +\\=¡÷,¡ð,¡ï +|=¡÷,¡ð,¡ï +\]=¡²,¡ª,¡ª +}=¡²,¡ª,¡ª +-=_,¡©,¡© +_=_,¡©,¡© diff --git a/data/tron-qwerty-jp.sty b/data/tron-qwerty-jp.sty new file mode 100755 index 0000000..48391e6 --- /dev/null +++ b/data/tron-qwerty-jp.sty @@ -0,0 +1,99 @@ +# +# tron-qwerty-jp.sty - TRON type layout definition file +# Copyright (C) 2005 Okano, Shinchi +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = TRON-QWERTY-JPÇÛÎó +Version = 0.0.0 + +[NICOLATable/FundamentalTable] +# non modifiered keys +1=1,¡Ä,¡Á +2=2,¡®,¡Ç +3=3,¡È,¡É +4=4,¡Ö,¡× +5=5,¡Ø,¡Ù +6=6,¡ã,¡ä +7=7,¡Ê,¡Ë +8=8,¡Ð,¡Ñ +9=9,¡Î,¡Ï +0=0,¡À,¡Ã +!=1,¡Ä,¡Á +"=2,¡®,¡Ç +\#=3,¡È,¡É +$=4,¡Ö,¡× +%=5,¡Ø,¡Ù +&=6,¡ã,¡ä +'=7,¡Ê,¡Ë +(=8,¡Ð,¡Ñ +)=9,¡Î,¡Ï +~=0,¡À,¡Ã +q=¤é,¤Ò,¤Ó +w=¤ë,¤½,¤¾ +e=¤³,¡¦,¤´ +r=¤Ï,¤ã,¤Ð +t=¤ç,¤Û,¤Ü +y=¤­,¤®,¤¨ +u=¤Î,¤²,¤± +i=¤¯,¤°,¤á +o=¤¢, ,¤à +#o=¤¢,¤×,¤à +p=¤ì,¤ð,¤í +#p=¤ì,¤Ý,¤í +a=¤¿,¤Ì,¤À +s=¤È,¤Í,¤É +d=¤«,¤å,¤¬ +f=¤Æ,¤è,¤Ç +g=¤â,¤Õ,¤Ö +h=¤ò,¡«,¤ª +j=¤¤,¤Â,¤Á +k=¤¦,¥ô,¡¼ +l=¤·,¤¸,¤ß +;=¤ó,¤ñ,¤ä +:=¤ó,¤ñ,¤ä +#;=¤ó,¤Ñ,¤ä +#:=¤ó,¤Ñ,¤ä +z=¤Þ,¤§,¥õ +#z=¤Þ,¤§,¤Ô +x=¤ê,¤©,¥ö +#x=¤ê,¤©,¤Ú +c=¤Ë,¤»,¤¼ +v=¤µ,¤æ,¤¶ +b=¤Ê,¤Ø,¤Ù +n=¤¹,¤º,¤ï +m=¤Ä,¤Å,¤£ +,=¡¢,\,,¤¡ +<=¡¢,\,,¤¡ +.=¡£,.,¡¬ +>=¡£,.,¡¬ +/=¤Ã,¤î,¤¥ + +-=¡Ý,¡Ü,¡à +\==¡Ý,¡Ü,¡à +\[=¡á,¡ô,¡ó +{=¡á,¡ô,¡ó +\]=¡¿,¡ö,¡ß +}=¡¿,¡ö,¡ß + +@=¡÷,¡ð,¡ï +`=¡÷,¡ð,¡ï +^=¡²,¡ª,¡ª +~=¡²,¡ª,¡ª +\\=_,¡©,¡© +_=_,¡©,¡© diff --git a/data/tsuki-2-203-101.sty b/data/tsuki-2-203-101.sty new file mode 100755 index 0000000..e510865 --- /dev/null +++ b/data/tsuki-2-203-101.sty @@ -0,0 +1,90 @@ +# +# tsuki-2-203_106.sty - Tsuki 2-236 style for 101 US keybord +# Copyright (C) 2006 Tatsuki Sugiura +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = ·î (2-263) 101US +Version = 0.0.2 + +# Override fundamental table +[KanaTable/FundamentalTable] +q=,¤½ +w=,¤³ +e=,¤· +r=,¤Æ +t=¤ç +y=,¤Ä +u=¤ó +i=¤¤ +o=¤Î +p=¤ê +\[=,¤Á +a=,¤Ï +s=,¤« +f=,¤È +g=,¤¿ +h=,¤¯ +j=¤¦ +l=¡« +;=,¤­ +'=¤ì +z=,¤¹ +x=,¤± +c=¤Ë +v=¤Ê +b=,¤µ +n=¤Ã +m=¤ë +,=¡¢ +.=¡£ +/=¡¬ +\\=¡¦ +d\\=¡© +kq=¤¡ +kw=,¤Ò +ke=,¤Û +kr=,¤Õ +kt=¤á +ka=¤£ +ks=¤ò +kd=¤é +kf=¤¢ +kg=¤è +kz=¤¥ +kx=,¤Ø +kc=,¤» +kv=¤å +kb=¤ã +dy=¤Ì +du=¤¨ +di=¤ß +do=¤ä +dp=¤§ +d\[=¡Ö +dh=¤Þ +dj=¤ª +dk=¤â +dl=¤ï +d;=¤æ +d'=¡× +dn=¤à +dm=¤í +d,=¤Í +d.=¡¼ +d/=¤© diff --git a/data/tsuki-2-203-106.sty b/data/tsuki-2-203-106.sty new file mode 100755 index 0000000..513f084 --- /dev/null +++ b/data/tsuki-2-203-106.sty @@ -0,0 +1,91 @@ +# +# tsuki-2-203_106.sty - Tsuki 2-236 style for 106/109 JP keybord +# Copyright (C) 2006 Tatsuki Sugiura +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = ·î (2-263) 106JP +Version = 0.0.2 + +# Override fundamental table +[KanaTable/FundamentalTable] +q=,¤½ +w=,¤³ +e=,¤· +r=,¤Æ +t=¤ç +y=,¤Ä +u=¤ó +i=¤¤ +o=¤Î +p=¤ê +@=,¤Á +a=,¤Ï +s=,¤« +f=,¤È +g=,¤¿ +h=,¤¯ +j=¤¦ +l=¡« +;=,¤­ +:=¤ì +z=,¤¹ +x=,¤± +c=¤Ë +v=¤Ê +b=,¤µ +n=¤Ã +m=¤ë +,=¡¢ +.=¡£ +/=¡¬ +\\=¡¦ +d\\=¡© +kq=¤¡ +kw=,¤Ò +ke=,¤Û +kr=,¤Õ +kt=¤á +ka=¤£ +ks=¤ò +kd=¤é +kf=¤¢ +kg=¤è +kz=¤¥ +kx=,¤Ø +kc=,¤» +kv=¤å +kb=¤ã +dy=¤Ì +du=¤¨ +di=¤ß +do=¤ä +dp=¤§ +d@=¡Ö +dh=¤Þ +dj=¤ª +dk=¤â +dl=¤ï +d;=¤æ +d:=¡× +dn=¤à +dm=¤í +d,=¤Í +d.=¡¼ +d/=¤© + diff --git a/data/vje-delta.sty b/data/vje-delta.sty new file mode 100755 index 0000000..0d61fac --- /dev/null +++ b/data/vje-delta.sty @@ -0,0 +1,339 @@ +# +# vje-delta.sty - VACS VJE-Delta like style definition file for scim-anthy. +# Copyright (C) 2005 Takuro Ashie +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = VJE-Delta +Version = 0.0.0 + +[KeyBindings] +OnOffKey = Zenkaku_Hankaku,Henkan,Control+F8,Control+Shift+l,Control+Shift+L +CircleInputModeKey = +CircleKanaModeKey = +LatinModeKey = +WideLatinModeKey = +HiraganaModeKey = Control+F6,Control+Shift+j,Control+Shift+J +KatakanaModeKey = Control+F7,Control+Shift+k,Control+Shift+K +HalfKatakanaModeKey = +CircleTypingMethodKey = Control+F3,Control+Shift+r,Control+Shift+R + +ConvertKey = space,Henkan,Down +CancelKey = Escape +CancelAllKey = Shift+BackSpace,Control+y,Control+Y +CommitKey = Return,Muhenkan + +InsertSpaceKey = space +InsertAltSpaceKey = Shift+space +BackSpaceKey = BackSpace,Control+h,Control+H +DeleteKey = Delete,Control+g,Control+G + +MoveCaretBackwardKey = Left,Control+s,Control+S +MoveCaretForwardKey = Right,Control+d,Control+D +MoveCaretFirstKey = +MoveCaretLastKey = + +SelectPrevSegmentKey = Left,Control+s,Control+S +SelectNextSegmentKey = Right,Control+d,Control+D +SelectFirstSegmentKey = Page_Up,Control+a,Control+A +SelectLastSegmentKey = Page_Down,Control+f,Control+F +ExpandSegmentKey = Shift+Right,Control+w,Control+W +ShrinkSegmentKey = Shift+Left,Control+q,Control+Q +CommitSelectedSegmentKey = + +CandidatesPageUpKey = Shift+Up,Control+e,Control+E +CandidatesPageDownKey = Shift+Down,Control+x,Control+X +SelectNextCandidateKey = space,Henkan,Down +SelectPrevCandidateKey = Up + +SelectCandidates1Key = 1 +SelectCandidates2Key = 2 +SelectCandidates3Key = 3 +SelectCandidates4Key = 4 +SelectCandidates5Key = 5 +SelectCandidates6Key = 6 +SelectCandidates7Key = 7 +SelectCandidates8Key = 8 +SelectCandidates9Key = 9 +SelectCandidates10Key = 0 + +ConvertToHiraganaKey = F6,Control+j +ConvertToKatakanaKey = F7,Control+k +ConvertToHalfKey = F9,Control+o +ConvertToHalfKatakanaKey = +ConvertToWideLatinKey = F8,Control+l +ConvertToLatinKey = + +AddWordKey = + + +# Override fundamental table +[RomajiTable/FundamentalTable] +- = ¡¼ +#[ = ¡Ö +#] = ¡× +a = ¤¢ +i = ¤¤ +u = ¤¦ +e = ¤¨ +o = ¤ª +xa = ¤¡ +xi = ¤£ +xu = ¤¥ +xe = ¤§ +xo = ¤© +ka = ¤« +ki = ¤­ +ku = ¤¯ +ke = ¤± +ko = ¤³ +xka = ¥õ +xke = ¥ö +kya = ¤­¤ã +kyi = ¤­¤£ +kyu = ¤­¤å +cu = ¤­¤å +kye = ¤­¤§ +kyo = ¤­¤ç +kwa = ¤¯¤¡ +qa = ¤¯¤¡ +kwi = ¤¯¤£ +qi = ¤¯¤£ +kwe = ¤¯¤§ +qe = ¤¯¤§ +kwo = ¤¯¤© +qo = ¤¯¤© +qya = ¤¯¤ã +qyi = ¤¯¤£ +qyu = ¤¯¤å +qye = ¤¯¤§ +quo = ¤¯¤ç +sa = ¤µ +si = ¤· +shi = ¤· +ci = ¤· +su = ¤¹ +se = ¤» +ce = ¤» +so = ¤½ +sya = ¤·¤ã +sha = ¤·¤ã +syi = ¤·¤£ +syu = ¤·¤å +shu = ¤·¤å +sye = ¤·¤§ +she = ¤·¤§ +syo = ¤·¤ç +sho = ¤·¤ç +ta = ¤¿ +ti = ¤Á +chi = ¤Á +tu = ¤Ä +tsu = ¤Ä +te = ¤Æ +to = ¤È +tya = ¤Á¤ã +cya = ¤Á¤ã +cha = ¤Á¤ã +tyi = ¤Á¤£ +cyi = ¤Á¤£ +tyu = ¤Á¤å +cyu = ¤Á¤å +chu = ¤Á¤å +tye = ¤Á¤§ +cye = ¤Á¤§ +che = ¤Á¤§ +tyo = ¤Á¤ç +cyo = ¤Á¤ç +cho = ¤Á¤ç +xtu = ¤Ã +tsa = ¤Ä¤¡ +tsi = ¤Ä¤£ +tse = ¤Ä¤§ +tso = ¤Ä¤© +tha = ¤Æ¤ã +thi = ¤Æ¤£ +thu = ¤Æ¤å +the = ¤Æ¤§ +tho = ¤Æ¤ç +twu = ¤È¤¥ +na = ¤Ê +ni = ¤Ë +nu = ¤Ì +ne = ¤Í +no = ¤Î +nya = ¤Ë¤ã +nyi = ¤Ë¤£ +nyu = ¤Ë¤å +nye = ¤Ë¤§ +nyo = ¤Ë¤ç +ha = ¤Ï +hi = ¤Ò +hu = ¤Õ +fu = ¤Õ +he = ¤Ø +ho = ¤Û +hya = ¤Ò¤ã +hyi = ¤Ò¤£ +hyu = ¤Ò¤å +hye = ¤Ò¤§ +hyo = ¤Ò¤ç +fa = ¤Õ¤¡ +fi = ¤Õ¤£ +fe = ¤Õ¤§ +fo = ¤Õ¤© +fya = ¤Õ¤ã +fyi = ¤Õ¤£ +fyu = ¤Õ¤å +fye = ¤Õ¤§ +fyo = ¤Õ¤ç +ma = ¤Þ +mi = ¤ß +mu = ¤à +me = ¤á +mo = ¤â +mya = ¤ß¤ã +myi = ¤ß¤£ +myu = ¤ß¤å +mye = ¤ß¤§ +myo = ¤ß¤ç +ya = ¤ä +yi = ¤¤ +yu = ¤æ +ye = ¤¤¤§ +yo = ¤è +xya = ¤ã +xyi = ¤£ +xyu = ¤å +xye = ¤§ +xyo = ¤ç +la = ¤é +ra = ¤é +li = ¤ê +ri = ¤ê +lu = ¤ë +ru = ¤ë +le = ¤ì +re = ¤ì +lo = ¤í +ro = ¤í +lya = ¤ê¤ã +rya = ¤ê¤ã +lyi = ¤ê¤£ +ryi = ¤ê¤£ +lyu = ¤ê¤å +ryu = ¤ê¤å +lye = ¤ê¤§ +rye = ¤ê¤§ +lyo = ¤ê¤ç +ryo = ¤ê¤ç +wa = ¤ï +wi = ¤¦¤£ +wu = ¤¦ +we = ¤¦¤§ +wo = ¤ò +xwa = ¤î +wha = ¤¦¤¡ +whi = ¤¦¤£ +whu = ¤¦ +whe = ¤¦¤§ +who = ¤¦¤© +nn = ¤ó +n' = ¤ó +ga = ¤¬ +gi = ¤® +gu = ¤° +ge = ¤² +go = ¤´ +gwa = ¤°¤¡ +gwi = ¤°¤£ +gwu = ¤°¤å +gwe = ¤°¤§ +gwo = ¤°¤© +gya = ¤®¤ã +gyi = ¤®¤£ +gyu = ¤®¤å +gye = ¤®¤§ +gyo = ¤®¤ç +za = ¤¶ +zi = ¤¸ +ji = ¤¸ +zu = ¤º +ze = ¤¼ +zo = ¤¾ +zya = ¤¸¤ã +ja = ¤¸¤ã +jya = ¤¸¤ã +zyi = ¤¸¤£ +ji = ¤¸¤£ +jyi = ¤¸¤£ +zyu = ¤¸¤å +ju = ¤¸¤å +jyu = ¤¸¤å +zye = ¤¸¤§ +je = ¤¸¤§ +jye = ¤¸¤§ +zyo = ¤¸¤ç +jo = ¤¸¤ç +jyo = ¤¸¤ç +da = ¤À +di = ¤Â +du = ¤Å +de = ¤Ç +do = ¤É +dya = ¤Â¤ã +dyi = ¤Ç¤£ +dyu = ¤Â¤å +dye = ¤Â¤§ +dyo = ¤Â¤ç +dha = ¤Ç¤ã +dhi = ¤Ç¤£ +dhu = ¤Ç¤å +dhe = ¤Ç¤§ +dho = ¤Ç¤ç +dwu = ¤É¤¥ +ba = ¤Ð +bi = ¤Ó +bu = ¤Ö +be = ¤Ù +bo = ¤Ü +bya = ¤Ó¤ã +byi = ¤Ó¤£ +byu = ¤Ó¤å +bye = ¤Ó¤§ +byo = ¤Ó¤ç +pa = ¤Ñ +pi = ¤Ô +pu = ¤× +pe = ¤Ú +po = ¤Ý +pya = ¤Ô¤ã +pyi = ¤Ô¤£ +pyu = ¤Ô¤å +pye = ¤Ô¤§ +pyo = ¤Ô¤ç +va = ¥ô¤¡ +vi = ¥ô¤£ +vu = ¥ô¤¥ +ve = ¥ô¤§ +vo = ¥ô¤© +vya = ¥ô¤ã +vyi = ¥ô¤£ +vyu = ¥ô¤å +vye = ¥ô¤§ +vyo = ¥ô¤ç diff --git a/data/wnn.sty b/data/wnn.sty new file mode 100755 index 0000000..b4fac39 --- /dev/null +++ b/data/wnn.sty @@ -0,0 +1,311 @@ +# +# wnn.sty - Wnn like style definition file for scim-anthy. +# Copyright (C) 2005 Takuro Ashie +# +# 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. +# + +FormatVersion = 0.0.0 +Encoding = EUC-JP +Title = Wnn +Version = 0.0.0 + +[KeyBindings] +OnOffKey = Shift+space +CircleInputModeKey = +CircleKanaModeKey = +LatinModeKey = +WideLatinModeKey = +HiraganaModeKey = +KatakanaModeKey = +HalfKatakanaModeKey = +CircleTypingMethodKey = + +ConvertKey = space +PredictKey = Control+q,Control+Q +CancelKey = Escape,Control+g,Control+G,Alt+Down,Muhenkan +CommitKey = Control+l,Control+L,Control+m,Control+M,Control+j,Control+J,Return + +InsertSpaceKey = space +InsertAltSpaceKey = +BackSpaceKey = Control+h,Backspace +DeleteKey = Control+d,Delete + +MoveCaretBackwardKey = Control+b,Control+B,Left +MoveCaretForwardKey = Control+f,Control+F,Right +MoveCaretFirstKey = Control+a,Control+A,Alt+Left +MoveCaretLastKey = Control+e,Control+E,Alt+Right + +SelectPrevSegmentKey = Control+b,Control+B,Left +SelectNextSegmentKey = Control+f,Control+F,Right +SelectFirstSegmentKey = Control+a,Control+A,Alt+Left +SelectLastSegmentKey = Control+e,Control+E,Alt+Right +ExpandSegmentKey = Control+o,Control+O,F14 +ShrinkSegmentKey = Control+i,Control+I,F13 +CommitSelectedSegmentKey = + +CandidatesPageUpKey = Tab +CandidatesPageDownKey = Shift+Tab +SelectNextCandidateKey = space,Control+q,Control+Q,Control+p,Control+P,Up +SelectPrevCandidateKey = Control+n,Control+N,Down + +SelectCandidates1Key = 1 +SelectCandidates2Key = 2 +SelectCandidates3Key = 3 +SelectCandidates4Key = 4 +SelectCandidates5Key = 5 +SelectCandidates6Key = 6 +SelectCandidates7Key = 7 +SelectCandidates8Key = 8 +SelectCandidates9Key = 9 +SelectCandidates10Key = 0 + +ConvertToHiraganaKey = F6 +ConvertToKatakanaKey = F7 +ConvertToHalfKey = F8 +ConvertToHalfKatakanaKey = +ConvertToWideLatinKey = F9 +ConvertToLatinKey = F10 + +AddWordKey = + +# Override fundamental table +[RomajiTable/FundamentalTable] +- = ¡¼ +#/ = ¡¦ +#[ = ¡Ö +#] = ¡× +z. = ¡Ä +z- = ¡Á +a = ¤¢ +i = ¤¤ +u = ¤¦ +e = ¤¨ +o = ¤ª +ka = ¤« +ki = ¤­ +ku = ¤¯ +ke = ¤± +ko = ¤³ +kya = ¤­¤ã +kyi = ¤­¤£ +kyu = ¤­¤å +kye = ¤­¤§ +kyo = ¤­¤ç +sa = ¤µ +si = ¤· +su = ¤¹ +se = ¤» +so = ¤½ +sya = ¤·¤ã +syi = ¤·¤£ +syu = ¤·¤å +sye = ¤·¤§ +syo = ¤·¤ç +sha = ¤·¤ã +shi = ¤· +shu = ¤·¤å +she = ¤·¤§ +sho = ¤·¤ç +ta = ¤¿ +ti = ¤Á +tu = ¤Ä +te = ¤Æ +to = ¤È +tya = ¤Á¤ã +tyi = ¤Æ¤£ +tyu = ¤Á¤å +tye = ¤Á¤§ +tyo = ¤Á¤ç +tha = ¤Æ¤ã +thi = ¤Æ¤£ +thu = ¤Æ¤å +the = ¤Æ¤§ +tho = ¤Æ¤ç +tsu = ¤Ä +cha = ¤Á¤ã +chi = ¤Á +chu = ¤Á¤å +che = ¤Á¤§ +cho = ¤Á¤ç +na = ¤Ê +ni = ¤Ë +nu = ¤Ì +ne = ¤Í +no = ¤Î +nya = ¤Ë¤ã +nyi = ¤Ë¤£ +nyu = ¤Ë¤å +nye = ¤Ë¤§ +nyo = ¤Ë¤ç +ha = ¤Ï +hi = ¤Ò +hu = ¤Õ +he = ¤Ø +ho = ¤Û +hya = ¤Ò¤ã +hyi = ¤Ò¤£ +hyu = ¤Ò¤å +hye = ¤Ò¤§ +hyo = ¤Ò¤ç +fa = ¤Õ¤¡ +fi = ¤Õ¤£ +fu = ¤Õ +fe = ¤Õ¤§ +fo = ¤Õ¤© +fya = ¤Õ¤ã +fyi = ¤Õ¤£ +fyu = ¤Õ¤å +fye = ¤Õ¤§ +fyo = ¤Õ¤ç +ma = ¤Þ +mi = ¤ß +mu = ¤à +me = ¤á +mo = ¤â +mya = ¤ß¤ã +myu = ¤ß¤å +mye = ¤ß¤§ +myo = ¤ß¤ç +ya = ¤ä +yi = ¤¤ +yu = ¤æ +ye = ¤¤¤§ +yo = ¤è +ra = ¤é +ri = ¤ê +ru = ¤ë +re = ¤ì +ro = ¤í +la = ¤é +li = ¤ê +lu = ¤ë +le = ¤ì +lo = ¤í +rya = ¤ê¤ã +ryi = ¤ê¤£ +ryu = ¤ê¤å +rye = ¤ê¤§ +ryo = ¤ê¤ç +lya = ¤ê¤ã +lyi = ¤ê¤£ +lyu = ¤ê¤å +lye = ¤ê¤§ +lyo = ¤ê¤ç +wa = ¤ï +wi = ¤ð +wu = ¤¦ +we = ¤ñ +wo = ¤ò +ga = ¤¬ +gi = ¤® +gu = ¤° +ge = ¤² +go = ¤´ +gya = ¤®¤ã +gyi = ¤®¤£ +gyu = ¤®¤å +gye = ¤®¤§ +gyo = ¤®¤ç +za = ¤¶ +zi = ¤¸ +zu = ¤º +ze = ¤¼ +zo = ¤¾ +zya = ¤¸¤ã +zyi = ¤¸¤£ +zyu = ¤¸¤å +zye = ¤¸¤§ +zyo = ¤¸¤ç +ja = ¤¸¤ã +ji = ¤¸ +ju = ¤¸¤å +je = ¤¸¤§ +jo = ¤¸¤ç +da = ¤À +di = ¤Â +du = ¤Å +de = ¤Ç +do = ¤É +dya = ¤Â¤ã +dyi = ¤Ç¤£ +dyu = ¤Â¤å +dye = ¤Â¤§ +dyo = ¤Â¤ç +dha = ¤Ç¤ã +dhi = ¤Ç¤£ +dhu = ¤Ç¤å +dhe = ¤Ç¤§ +dho = ¤Ç¤ç +ba = ¤Ð +bi = ¤Ó +bu = ¤Ö +be = ¤Ù +bo = ¤Ü +bya = ¤Ó¤ã +byi = ¤Ó¤å +byu = ¤Ó¤å +bye = ¤Ó¤§ +byo = ¤Ó¤ç +pa = ¤Ñ +pi = ¤Ô +pu = ¤× +pe = ¤Ú +po = ¤Ý +pya = ¤Ô¤ã +pyi = ¤Ô¤£ +pyu = ¤Ô¤å +pye = ¤Ô¤§ +pyo = ¤Ô¤ç +va = ¥ô¤¡ +vi = ¥ô¤£ +vu = ¥ô +ve = ¥ô¤§ +vo = ¥ô¤© +kwa = ¤¯¤î +kwi = ¤¯¤£ +kwu = ¤¯ +kwe = ¤¯¤§ +kwo = ¤¯¤© +gwa = ¤°¤î +gwi = ¤°¤£ +gwu = ¤° +gwe = ¤°¤§ +gwo = ¤°¤© +tsa = ¤Ä¤¡ +tsi = ¤Ä¤£ +tse = ¤Ä¤§ +tso = ¤Ä¤© +n = ¤ó +n' = ¤ó +nn = ¤ó +xa = ¤¡ +xi = ¤£ +xu = ¤¥ +xe = ¤§ +xo = ¤© +xya = ¤ã +xyu = ¤å +xyo = ¤ç +xtu = ¤Ã +xwa = ¤î +xti = ¤Æ¤£ +xdi = ¤Ç¤£ +xdu = ¤É¤¥ +xde = ¤Ç¤§ +xdo = ¤É¤© +xwi = ¤¦¤£ +xwe = ¤¦¤§ +xwo = ¤¦¤© diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..ca5ea4e --- /dev/null +++ b/depcomp @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# 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. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -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. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # 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" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space 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 preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + 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) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # 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 ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$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 preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + 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 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..4fbbae7 --- /dev/null +++ b/install-sh @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/intl/ChangeLog b/intl/ChangeLog new file mode 100755 index 0000000..7512919 --- /dev/null +++ b/intl/ChangeLog @@ -0,0 +1,4 @@ +2004-01-29 GNU + + * Version 0.14.1 released. + diff --git a/intl/Makefile.in b/intl/Makefile.in new file mode 100755 index 0000000..05f1532 --- /dev/null +++ b/intl/Makefile.in @@ -0,0 +1,493 @@ +# Makefile for directory with message catalog handling library of GNU gettext +# Copyright (C) 1995-1998, 2000-2003 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) $(MKINSTALLDIRS) + +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)\" -DIN_LIBINTL \ +-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ +-Dset_relocation_prefix=libintl_set_relocation_prefix \ +-Drelocate=libintl_relocate \ +-DDEPENDS_ON_LIBICONV=1 @DEFS@ +CPPFLAGS = @CPPFLAGS@ +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +HEADERS = \ + gmo.h \ + gettextP.h \ + hash-string.h \ + loadinfo.h \ + plural-exp.h \ + eval-plural.h \ + localcharset.h \ + relocatable.h \ + xsize.h \ + printf-args.h printf-args.c \ + printf-parse.h wprintf-parse.h printf-parse.c \ + vasnprintf.h vasnwprintf.h vasnprintf.c \ + os2compat.h \ + libgnuintl.h.in +SOURCES = \ + 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 \ + plural-exp.c \ + localcharset.c \ + relocatable.c \ + localename.c \ + log.c \ + printf.c \ + osdep.c \ + os2compat.c \ + intl-compat.c +OBJECTS = \ + 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 \ + plural-exp.$lo \ + localcharset.$lo \ + relocatable.$lo \ + localename.$lo \ + log.$lo \ + printf.$lo \ + osdep.$lo \ + 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.0 COPYING.LIB-2.1 libintl.glibc \ +libgnuintl.h_vms Makefile.vms \ +libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc +DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ +COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h + +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) @LTLIBICONV@ $(LIBS) -lc \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) \ + -no-undefined + +# 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=7 +LTV_REVISION=0 +LTV_AGE=4 + +.SUFFIXES: +.SUFFIXES: .c .y .o .lo .sin .sed + +.c.o: + $(COMPILE) $< + +.y.c: + $(YACC) $(YFLAGS) --output $@ $< + rm -f $*.h + +bindtextdom.lo: $(srcdir)/bindtextdom.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c +dcgettext.lo: $(srcdir)/dcgettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c +dgettext.lo: $(srcdir)/dgettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c +gettext.lo: $(srcdir)/gettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c +finddomain.lo: $(srcdir)/finddomain.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c +loadmsgcat.lo: $(srcdir)/loadmsgcat.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c +localealias.lo: $(srcdir)/localealias.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c +textdomain.lo: $(srcdir)/textdomain.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c +l10nflist.lo: $(srcdir)/l10nflist.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c +explodename.lo: $(srcdir)/explodename.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c +dcigettext.lo: $(srcdir)/dcigettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c +dcngettext.lo: $(srcdir)/dcngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c +dngettext.lo: $(srcdir)/dngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c +ngettext.lo: $(srcdir)/ngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c +plural.lo: $(srcdir)/plural.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c +plural-exp.lo: $(srcdir)/plural-exp.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c +localcharset.lo: $(srcdir)/localcharset.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c +relocatable.lo: $(srcdir)/relocatable.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c +localename.lo: $(srcdir)/localename.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c +log.lo: $(srcdir)/log.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c +printf.lo: $(srcdir)/printf.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c +osdep.lo: $(srcdir)/osdep.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c +intl-compat.lo: $(srcdir)/intl-compat.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c + +ref-add.sed: $(srcdir)/ref-add.sin + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed + mv t-ref-add.sed ref-add.sed +ref-del.sed: $(srcdir)/ref-del.sin + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed + mv t-ref-del.sed ref-del.sed + +INCLUDES = -I. -I$(srcdir) -I.. + +libgnuintl.h: $(srcdir)/libgnuintl.h.in + sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ + -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ + -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ + -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ + < $(srcdir)/libgnuintl.h.in > libgnuintl.h + +libintl.h: libgnuintl.h + cp libgnuintl.h libintl.h + +charset.alias: $(srcdir)/config.charset + $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ + mv t-$@ $@ + +check: all + +# 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-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; 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; \ + if test "@RELOCATABLE@" = yes; then \ + dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \ + if test -n "$$dependencies"; then \ + rm -f $(DESTDIR)$(libdir)/libintl.la; \ + fi; \ + fi; \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir); \ + $(LIBTOOL) --mode=install \ + $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \ + rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + $(LIBTOOL) --mode=uninstall \ + rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \ + else \ + : ; \ + fi + if test '@USE_INCLUDED_LIBINTL@' = yes; then \ + test @GLIBC21@ != no || $(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-tools"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ + $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ + dists="COPYING.LIB-2.0 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 + +install-strip: install + +installdirs: + if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir); \ + else \ + : ; \ + fi + if test '@USE_INCLUDED_LIBINTL@' = yes; then \ + test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ + $(mkinstalldirs) $(DESTDIR)$(localedir); \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; then \ + rm -f $(DESTDIR)$(includedir)/libintl.h; \ + $(LIBTOOL) --mode=uninstall \ + rm -f $(DESTDIR)$(libdir)/libintl.$la; \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + 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-tools"; then \ + for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + +info dvi ps pdf html: + +$(OBJECTS): ../config.h libgnuintl.h +bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h +dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h +explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h +dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h +dcigettext.$lo: $(srcdir)/eval-plural.h +localcharset.$lo: $(srcdir)/localcharset.h +localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h +printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) + +ctags: CTAGS + +CTAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES) + +id: ID + +ID: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) + + +mostlyclean: + rm -f *.a *.la *.o *.obj *.lo core core.* + rm -f libgnuintl.h 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-runtime" || test "$(PACKAGE)" = "gettext-tools"; 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-tools"; then \ + : ; \ + else \ + if test "$(PACKAGE)" = "gettext-runtime"; 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; \ + cp -p $$dir/$$file $(distdir); \ + done; \ + fi + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status +# This would be more efficient, but doesn't work any more with autoconf-2.57, +# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used. +# cd $(top_builddir) && 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: diff --git a/intl/VERSION b/intl/VERSION new file mode 100755 index 0000000..b4b846c --- /dev/null +++ b/intl/VERSION @@ -0,0 +1 @@ +GNU gettext library from gettext-0.14.1 diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c new file mode 100755 index 0000000..dcdc400 --- /dev/null +++ b/intl/bindtextdom.c @@ -0,0 +1,363 @@ +/* Implementation of the bindtextdomain(3) function + Copyright (C) 1995-1998, 2000-2003 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 +#endif + +#include +#include +#include + +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "gettextP.h" + +#ifdef _LIBC +/* We have to handle multi-threaded applications. */ +# include +#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 libintl_nl_default_dirname +# define _nl_domain_bindings libintl_nl_domain_bindings +#endif + +/* Some compilers, like SunOS4 cc, don't have offsetof in . */ +#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[]; +#ifdef _LIBC +extern const char _nl_default_dirname_internal[] attribute_hidden; +#else +# define INTUSE(name) name +#endif + +/* 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 attribute_hidden) + + +/* 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 libintl_bindtextdomain +# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset +#endif + +/* 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 (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, INTUSE(_nl_default_dirname)) == 0) + result = (char *) INTUSE(_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 != INTUSE(_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 = INTUSE(_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 = INTUSE(_nl_default_dirname); + else + { + if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) + dirname = INTUSE(_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 *) INTUSE(_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 != INTUSE(_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 (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 (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 diff --git a/intl/config.charset b/intl/config.charset new file mode 100755 index 0000000..43d45fb --- /dev/null +++ b/intl/config.charset @@ -0,0 +1,608 @@ +#! /bin/sh +# Output a system dependent table of character encoding aliases. +# +# Copyright (C) 2000-2004 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 MIME? used by which systems +# ASCII, ANSI_X3.4-1968 glibc solaris freebsd darwin +# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd darwin +# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd darwin +# ISO-8859-3 Y glibc solaris +# ISO-8859-4 Y osf solaris freebsd darwin +# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd darwin +# ISO-8859-6 Y glibc aix hpux solaris +# ISO-8859-7 Y glibc aix hpux irix osf solaris +# ISO-8859-8 Y glibc aix hpux osf solaris +# ISO-8859-9 Y glibc aix hpux irix osf solaris +# ISO-8859-13 glibc +# ISO-8859-14 glibc +# ISO-8859-15 glibc aix osf solaris freebsd +# KOI8-R Y glibc solaris freebsd darwin +# KOI8-U Y glibc freebsd darwin +# KOI8-T glibc +# 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 darwin dos +# CP869 dos +# CP874 woe32 dos +# CP922 aix +# CP932 aix woe32 dos +# CP943 aix +# CP949 osf woe32 dos +# CP950 woe32 dos +# CP1046 aix +# CP1124 aix +# CP1125 dos +# CP1129 aix +# CP1250 woe32 +# CP1251 glibc solaris darwin woe32 +# CP1252 aix woe32 +# CP1253 woe32 +# CP1254 woe32 +# CP1255 glibc woe32 +# CP1256 woe32 +# CP1257 woe32 +# GB2312 Y glibc aix hpux irix solaris freebsd darwin +# EUC-JP Y glibc aix hpux irix osf solaris freebsd darwin +# EUC-KR Y glibc aix hpux irix osf solaris freebsd darwin +# EUC-TW glibc aix hpux irix osf solaris +# BIG5 Y glibc aix hpux osf solaris freebsd darwin +# BIG5-HKSCS glibc solaris +# GBK glibc aix osf solaris woe32 dos +# GB18030 glibc solaris +# SHIFT_JIS Y hpux osf solaris freebsd darwin +# JOHAB glibc solaris woe32 +# TIS-620 glibc aix hpux osf solaris +# VISCII Y glibc +# TCVN5712-1 glibc +# GEORGIAN-PS glibc +# 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 Y glibc aix hpux osf solaris +# +# 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-gnulibc1*) + # Linux libc5 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 "POSIX ASCII" + for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \ + en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \ + en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \ + es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \ + et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \ + fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \ + it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \ + sv_FI sv_SE; do + echo "$l ISO-8859-1" + echo "$l.iso-8859-1 ISO-8859-1" + echo "$l.iso-8859-15 ISO-8859-15" + echo "$l.iso-8859-15@euro ISO-8859-15" + echo "$l@euro ISO-8859-15" + echo "$l.cp-437 CP437" + echo "$l.cp-850 CP850" + echo "$l.cp-1252 CP1252" + echo "$l.cp-1252@euro CP1252" + #echo "$l.atari-st ATARI-ST" # not a commonly used encoding + echo "$l.utf-8 UTF-8" + echo "$l.utf-8@euro UTF-8" + done + for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \ + sl_SI sr sr_CS sr_YU; do + echo "$l ISO-8859-2" + echo "$l.iso-8859-2 ISO-8859-2" + echo "$l.cp-852 CP852" + echo "$l.cp-1250 CP1250" + echo "$l.utf-8 UTF-8" + done + for l in mk mk_MK ru ru_RU; do + echo "$l ISO-8859-5" + echo "$l.iso-8859-5 ISO-8859-5" + echo "$l.koi8-r KOI8-R" + echo "$l.cp-866 CP866" + echo "$l.cp-1251 CP1251" + echo "$l.utf-8 UTF-8" + done + for l in ar ar_SA; do + echo "$l ISO-8859-6" + echo "$l.iso-8859-6 ISO-8859-6" + echo "$l.cp-864 CP864" + #echo "$l.cp-868 CP868" # not a commonly used encoding + echo "$l.cp-1256 CP1256" + echo "$l.utf-8 UTF-8" + done + for l in el el_GR gr gr_GR; do + echo "$l ISO-8859-7" + echo "$l.iso-8859-7 ISO-8859-7" + echo "$l.cp-869 CP869" + echo "$l.cp-1253 CP1253" + echo "$l.cp-1253@euro CP1253" + echo "$l.utf-8 UTF-8" + echo "$l.utf-8@euro UTF-8" + done + for l in he he_IL iw iw_IL; do + echo "$l ISO-8859-8" + echo "$l.iso-8859-8 ISO-8859-8" + echo "$l.cp-862 CP862" + echo "$l.cp-1255 CP1255" + echo "$l.utf-8 UTF-8" + done + for l in tr tr_TR; do + echo "$l ISO-8859-9" + echo "$l.iso-8859-9 ISO-8859-9" + echo "$l.cp-857 CP857" + echo "$l.cp-1254 CP1254" + echo "$l.utf-8 UTF-8" + done + for l in lt lt_LT lv lv_LV; do + #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name + echo "$l ISO-8859-13" + done + for l in ru_UA uk uk_UA; do + echo "$l KOI8-U" + done + for l in zh zh_CN; do + #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name + echo "$l GB2312" + done + for l in ja ja_JP ja_JP.EUC; do + echo "$l EUC-JP" + done + for l in ko ko_KR; do + echo "$l EUC-KR" + done + for l in th th_TH; do + echo "$l TIS-620" + done + for l in fa fa_IR; do + #echo "$l ISIRI-3342" # a broken encoding + echo "$l.utf-8 UTF-8" + done + ;; + 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-3 ISO-8859-3" + 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 "ansi-1251 CP1251" + echo "BIG5 BIG5" + echo "Big5-HKSCS BIG5-HKSCS" + echo "gb2312 GB2312" + echo "GBK GBK" + echo "GB18030 GB18030" + echo "cns11643 EUC-TW" + echo "5601 EUC-KR" + echo "ko_KR.johap92 JOHAB" + 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* | os2*) + # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just + # reuse FreeBSD's locale data for OS/2. + 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" + ;; + netbsd*) + 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-15 ISO-8859-15" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "BIG5 BIG5" + echo "SJIS SHIFT_JIS" + ;; + darwin*) + # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "C ASCII" + for l in en_AU en_CA en_GB en_US la_LN; do + echo "$l.US-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 nl_BE \ + nl_NL no_NO pt_PT sv_SE; do + echo "$l ISO-8859-1" + echo "$l.ISO8859-1 ISO-8859-1" + echo "$l.ISO8859-15 ISO-8859-15" + done + for l in la_LN; do + echo "$l.ISO8859-1 ISO-8859-1" + echo "$l.ISO8859-15 ISO-8859-15" + done + for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do + echo "$l.ISO8859-2 ISO-8859-2" + done + for l in la_LN lt_LT; do + echo "$l.ISO8859-4 ISO-8859-4" + done + for l in ru_RU; do + echo "$l.KOI8-R KOI8-R" + echo "$l.ISO8859-5 ISO-8859-5" + echo "$l.CP866 CP866" + done + for l in bg_BG; do + echo "$l.CP1251 CP1251" + 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 "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 " + echo "# and Bruno Haible ." + 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_CS 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 CP866" + echo "ru_RU CP866" + echo "uk CP1125" + echo "uk_UA CP1125" + # 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 diff --git a/intl/dcgettext.c b/intl/dcgettext.c new file mode 100755 index 0000000..850acde --- /dev/null +++ b/intl/dcgettext.c @@ -0,0 +1,56 @@ +/* Implementation of the dcgettext(3) function. + Copyright (C) 1995-1999, 2000-2003 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 +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#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 libintl_dcgettext +# define DCIGETTEXT libintl_dcigettext +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +char * +DCGETTEXT (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. */ +INTDEF(__dcgettext) +weak_alias (__dcgettext, dcgettext); +#endif diff --git a/intl/dcigettext.c b/intl/dcigettext.c new file mode 100755 index 0000000..35238e2 --- /dev/null +++ b/intl/dcigettext.c @@ -0,0 +1,1219 @@ +/* Implementation of the internal dcigettext function. + Copyright (C) 1995-1999, 2000-2003 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 to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#ifdef __GNUC__ +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#include +#ifndef errno +extern int errno; +#endif +#ifndef __set_errno +# define __set_errno(val) errno = (val) +#endif + +#include +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include + +#ifdef _LIBC + /* Guess whether integer division by zero raises signal SIGFPE. + Set to 1 only if you know for sure. In case of doubt, set to 0. */ +# if defined __alpha__ || defined __arm__ || defined __i386__ \ + || defined __m68k__ || defined __s390__ +# define INTDIV0_RAISES_SIGFPE 1 +# else +# define INTDIV0_RAISES_SIGFPE 0 +# endif +#endif +#if !INTDIV0_RAISES_SIGFPE +# include +#endif + +#if defined HAVE_SYS_PARAM_H || defined _LIBC +# include +#endif + +#include "gettextP.h" +#include "plural-exp.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "hash-string.h" + +/* Thread safetyness. */ +#ifdef _LIBC +# include +#else +/* Provide dummy implementation if this is outside glibc. */ +# define __libc_lock_define_initialized(CLASS, NAME) +# define __libc_lock_lock(NAME) +# define __libc_lock_unlock(NAME) +# define __libc_rwlock_define_initialized(CLASS, NAME) +# define __libc_rwlock_rdlock(NAME) +# define __libc_rwlock_unlock(NAME) +#endif + +/* Alignment of types. */ +#if defined __GNUC__ && __GNUC__ >= 2 +# define alignof(TYPE) __alignof__ (TYPE) +#else +# define alignof(TYPE) \ + ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) +#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_default_domain libintl_nl_default_default_domain +# define _nl_current_default_domain libintl_nl_current_default_domain +# define _nl_default_dirname libintl_nl_default_dirname +# define _nl_domain_bindings libintl_nl_domain_bindings +#endif + +/* Some compilers, like SunOS4 cc, don't have offsetof in . */ +#ifndef offsetof +# define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) +#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. */ +# define getcwd __getcwd +# ifndef stpcpy +# define stpcpy __stpcpy +# endif +# define tfind __tfind +#else +# if !defined HAVE_GETCWD +char *getwd (); +# define getcwd(buf, max) getwd (buf) +# else +# if VMS +# define getcwd(buf, max) (getcwd) (buf, max, 0) +# else +char *getcwd (); +# endif +# endif +# ifndef HAVE_STPCPY +static char *stpcpy (char *dest, const char *src); +# endif +# ifndef HAVE_MEMPCPY +static void *mempcpy (void *dest, const void *src, size_t n); +# endif +#endif + +/* Amount to increase buffer size by in each try. */ +#define PATH_INCR 32 + +/* The following is from pathmax.h. */ +/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define + PATH_MAX but might cause redefinition warnings when sys/param.h is + later included (as on MORE/BSD 4.3). */ +#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__) +# include +#endif + +#ifndef _POSIX_PATH_MAX +# define _POSIX_PATH_MAX 255 +#endif + +#if !defined PATH_MAX && defined _PC_PATH_MAX +# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) +#endif + +/* Don't include sys/param.h if it already has been. */ +#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include +#endif + +#if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +#endif + +#ifndef PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +#endif + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, + it may be concatenated to a directory pathname. + IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. + */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) +# define IS_PATH_WITH_DIR(P) \ + (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) +# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) +#endif + +/* This is the type used for the search tree where known translations + are stored. */ +struct known_translation_t +{ + /* Domain in which to search. */ + char *domainname; + + /* The category. */ + int category; + + /* State of the catalog counter at the point the string was found. */ + int counter; + + /* Catalog where the string was found. */ + struct loaded_l10nfile *domain; + + /* And finally the translation. */ + const char *translation; + size_t translation_length; + + /* Pointer to the string in question. */ + char msgid[ZERO]; +}; + +/* Root of the search tree with known translations. We can use this + only if the system provides the `tsearch' function family. */ +#if defined HAVE_TSEARCH || defined _LIBC +# include + +static void *root; + +# ifdef _LIBC +# define tsearch __tsearch +# endif + +/* Function to compare two entries in the table of known translations. */ +static int +transcmp (const void *p1, const void *p2) +{ + const struct known_translation_t *s1; + const struct known_translation_t *s2; + int result; + + s1 = (const struct known_translation_t *) p1; + s2 = (const struct known_translation_t *) p2; + + result = strcmp (s1->msgid, s2->msgid); + if (result == 0) + { + result = strcmp (s1->domainname, s2->domainname); + if (result == 0) + /* We compare the category last (though this is the cheapest + operation) since it is hopefully always the same (namely + LC_MESSAGES). */ + result = s1->category - s2->category; + } + + return result; +} +#endif + +#ifndef INTVARDEF +# define INTVARDEF(name) +#endif +#ifndef INTUSE +# define INTUSE(name) name +#endif + +/* Name of the default domain used for gettext(3) prior any call to + textdomain(3). The default value for this is "messages". */ +const char _nl_default_default_domain[] attribute_hidden = "messages"; + +/* Value used as the default domain for gettext(3). */ +const char *_nl_current_default_domain attribute_hidden + = _nl_default_default_domain; + +/* Contains the default location of the message catalogs. */ +#if defined __EMX__ +extern const char _nl_default_dirname[]; +#else +const char _nl_default_dirname[] = LOCALEDIR; +INTVARDEF (_nl_default_dirname) +#endif + +/* List with bindings of specific domains created by bindtextdomain() + calls. */ +struct binding *_nl_domain_bindings; + +/* Prototypes for local functions. */ +static char *plural_lookup (struct loaded_l10nfile *domain, + unsigned long int n, + const char *translation, size_t translation_len) + internal_function; +static const char *guess_category_value (int category, + const char *categoryname) + internal_function; +#ifdef _LIBC +# include "../locale/localeinfo.h" +# define category_to_name(category) _nl_category_names[category] +#else +static const char *category_to_name (int category) internal_function; +#endif + + +/* For those loosing systems which don't have `alloca' we have to add + some additional code emulating it. */ +#ifdef HAVE_ALLOCA +/* Nothing has to be done. */ +# define freea(p) /* nothing */ +# define ADD_BLOCK(list, address) /* nothing */ +# define FREE_BLOCKS(list) /* nothing */ +#else +struct block_list +{ + void *address; + struct block_list *next; +}; +# define ADD_BLOCK(list, addr) \ + do { \ + struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ + /* If we cannot get a free block we cannot add the new element to \ + the list. */ \ + if (newp != NULL) { \ + newp->address = (addr); \ + newp->next = (list); \ + (list) = newp; \ + } \ + } while (0) +# define FREE_BLOCKS(list) \ + do { \ + while (list != NULL) { \ + struct block_list *old = list; \ + list = list->next; \ + free (old->address); \ + free (old); \ + } \ + } while (0) +# undef alloca +# define alloca(size) (malloc (size)) +# define freea(p) free (p) +#endif /* have alloca */ + + +#ifdef _LIBC +/* List of blocks allocated for translations. */ +typedef struct transmem_list +{ + struct transmem_list *next; + char data[ZERO]; +} transmem_block_t; +static struct transmem_list *transmem_list; +#else +typedef unsigned char transmem_block_t; +#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 DCIGETTEXT __dcigettext +#else +# define DCIGETTEXT libintl_dcigettext +#endif + +/* Lock variable to protect the global data in the gettext implementation. */ +#ifdef _LIBC +__libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden) +#endif + +/* Checking whether the binaries runs SUID must be done and glibc provides + easier methods therefore we make a difference here. */ +#ifdef _LIBC +# define ENABLE_SECURE __libc_enable_secure +# define DETERMINE_SECURE +#else +# ifndef HAVE_GETUID +# define getuid() 0 +# endif +# ifndef HAVE_GETGID +# define getgid() 0 +# endif +# ifndef HAVE_GETEUID +# define geteuid() getuid() +# endif +# ifndef HAVE_GETEGID +# define getegid() getgid() +# endif +static int enable_secure; +# define ENABLE_SECURE (enable_secure == 1) +# define DETERMINE_SECURE \ + if (enable_secure == 0) \ + { \ + if (getuid () != geteuid () || getgid () != getegid ()) \ + enable_secure = 1; \ + else \ + enable_secure = -1; \ + } +#endif + +/* Get the function to evaluate the plural expression. */ +#include "eval-plural.h" + +/* Look up MSGID in the DOMAINNAME message catalog for the current + CATEGORY locale and, if PLURAL is nonzero, search over string + depending on the plural form determined by N. */ +char * +DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, + int plural, unsigned long int n, int category) +{ +#ifndef HAVE_ALLOCA + struct block_list *block_list = NULL; +#endif + struct loaded_l10nfile *domain; + struct binding *binding; + const char *categoryname; + const char *categoryvalue; + char *dirname, *xdomainname; + char *single_locale; + char *retval; + size_t retlen; + int saved_errno; +#if defined HAVE_TSEARCH || defined _LIBC + struct known_translation_t *search; + struct known_translation_t **foundp = NULL; + size_t msgid_len; +#endif + size_t domainname_len; + + /* If no real MSGID is given return NULL. */ + if (msgid1 == NULL) + return NULL; + +#ifdef _LIBC + if (category < 0 || category >= __LC_LAST || category == LC_ALL) + /* Bogus. */ + return (plural == 0 + ? (char *) msgid1 + /* Use the Germanic plural rule. */ + : n == 1 ? (char *) msgid1 : (char *) msgid2); +#endif + + __libc_rwlock_rdlock (_nl_state_lock); + + /* If DOMAINNAME is NULL, we are interested in the default domain. If + CATEGORY is not LC_MESSAGES this might not make much sense but the + definition left this undefined. */ + if (domainname == NULL) + domainname = _nl_current_default_domain; + + /* OS/2 specific: backward compatibility with older libintl versions */ +#ifdef LC_MESSAGES_COMPAT + if (category == LC_MESSAGES_COMPAT) + category = LC_MESSAGES; +#endif + +#if defined HAVE_TSEARCH || defined _LIBC + msgid_len = strlen (msgid1) + 1; + + /* Try to find the translation among those which we found at + some time. */ + search = (struct known_translation_t *) + alloca (offsetof (struct known_translation_t, msgid) + msgid_len); + memcpy (search->msgid, msgid1, msgid_len); + search->domainname = (char *) domainname; + search->category = category; + + foundp = (struct known_translation_t **) tfind (search, &root, transcmp); + freea (search); + if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr) + { + /* Now deal with plural. */ + if (plural) + retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation, + (*foundp)->translation_length); + else + retval = (char *) (*foundp)->translation; + + __libc_rwlock_unlock (_nl_state_lock); + return retval; + } +#endif + + /* Preserve the `errno' value. */ + saved_errno = errno; + + /* See whether this is a SUID binary or not. */ + DETERMINE_SECURE; + + /* First find matching binding. */ + 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) + dirname = (char *) INTUSE(_nl_default_dirname); + else if (IS_ABSOLUTE_PATH (binding->dirname)) + dirname = binding->dirname; + else + { + /* We have a relative path. Make it absolute now. */ + size_t dirname_len = strlen (binding->dirname) + 1; + size_t path_max; + char *ret; + + path_max = (unsigned int) PATH_MAX; + path_max += 2; /* The getcwd docs say to do this. */ + + for (;;) + { + dirname = (char *) alloca (path_max + dirname_len); + ADD_BLOCK (block_list, dirname); + + __set_errno (0); + ret = getcwd (dirname, path_max); + if (ret != NULL || errno != ERANGE) + break; + + path_max += path_max / 2; + path_max += PATH_INCR; + } + + if (ret == NULL) + /* We cannot get the current working directory. Don't signal an + error but simply return the default string. */ + goto return_untranslated; + + stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); + } + + /* Now determine the symbolic name of CATEGORY and its value. */ + categoryname = category_to_name (category); + categoryvalue = guess_category_value (category, categoryname); + + domainname_len = strlen (domainname); + xdomainname = (char *) alloca (strlen (categoryname) + + domainname_len + 5); + ADD_BLOCK (block_list, xdomainname); + + stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), + domainname, domainname_len), + ".mo"); + + /* Creating working area. */ + single_locale = (char *) alloca (strlen (categoryvalue) + 1); + ADD_BLOCK (block_list, single_locale); + + + /* Search for the given string. This is a loop because we perhaps + got an ordered list of languages to consider for the translation. */ + while (1) + { + /* Make CATEGORYVALUE point to the next element of the list. */ + while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') + ++categoryvalue; + if (categoryvalue[0] == '\0') + { + /* The whole contents of CATEGORYVALUE has been searched but + no valid entry has been found. We solve this situation + by implicitly appending a "C" entry, i.e. no translation + will take place. */ + single_locale[0] = 'C'; + single_locale[1] = '\0'; + } + else + { + char *cp = single_locale; + while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') + *cp++ = *categoryvalue++; + *cp = '\0'; + + /* When this is a SUID binary we must not allow accessing files + outside the dedicated directories. */ + if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale)) + /* Ingore this entry. */ + continue; + } + + /* If the current locale value is C (or POSIX) we don't load a + domain. Return the MSGID. */ + if (strcmp (single_locale, "C") == 0 + || strcmp (single_locale, "POSIX") == 0) + break; + + /* Find structure describing the message catalog matching the + DOMAINNAME and CATEGORY. */ + domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); + + if (domain != NULL) + { + retval = _nl_find_msg (domain, binding, msgid1, &retlen); + + if (retval == NULL) + { + int cnt; + + for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) + { + retval = _nl_find_msg (domain->successor[cnt], binding, + msgid1, &retlen); + + if (retval != NULL) + { + domain = domain->successor[cnt]; + break; + } + } + } + + if (retval != NULL) + { + /* Found the translation of MSGID1 in domain DOMAIN: + starting at RETVAL, RETLEN bytes. */ + FREE_BLOCKS (block_list); +#if defined HAVE_TSEARCH || defined _LIBC + if (foundp == NULL) + { + /* Create a new entry and add it to the search tree. */ + struct known_translation_t *newp; + + newp = (struct known_translation_t *) + malloc (offsetof (struct known_translation_t, msgid) + + msgid_len + domainname_len + 1); + if (newp != NULL) + { + newp->domainname = + mempcpy (newp->msgid, msgid1, msgid_len); + memcpy (newp->domainname, domainname, domainname_len + 1); + newp->category = category; + newp->counter = _nl_msg_cat_cntr; + newp->domain = domain; + newp->translation = retval; + newp->translation_length = retlen; + + /* Insert the entry in the search tree. */ + foundp = (struct known_translation_t **) + tsearch (newp, &root, transcmp); + if (foundp == NULL + || __builtin_expect (*foundp != newp, 0)) + /* The insert failed. */ + free (newp); + } + } + else + { + /* We can update the existing entry. */ + (*foundp)->counter = _nl_msg_cat_cntr; + (*foundp)->domain = domain; + (*foundp)->translation = retval; + (*foundp)->translation_length = retlen; + } +#endif + __set_errno (saved_errno); + + /* Now deal with plural. */ + if (plural) + retval = plural_lookup (domain, n, retval, retlen); + + __libc_rwlock_unlock (_nl_state_lock); + return retval; + } + } + } + + return_untranslated: + /* Return the untranslated MSGID. */ + FREE_BLOCKS (block_list); + __libc_rwlock_unlock (_nl_state_lock); +#ifndef _LIBC + if (!ENABLE_SECURE) + { + extern void _nl_log_untranslated (const char *logfilename, + const char *domainname, + const char *msgid1, const char *msgid2, + int plural); + const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED"); + + if (logfilename != NULL && logfilename[0] != '\0') + _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural); + } +#endif + __set_errno (saved_errno); + return (plural == 0 + ? (char *) msgid1 + /* Use the Germanic plural rule. */ + : n == 1 ? (char *) msgid1 : (char *) msgid2); +} + + +char * +internal_function +_nl_find_msg (struct loaded_l10nfile *domain_file, + struct binding *domainbinding, const char *msgid, + size_t *lengthp) +{ + struct loaded_domain *domain; + nls_uint32 nstrings; + size_t act; + char *result; + size_t resultlen; + + if (domain_file->decided == 0) + _nl_load_domain (domain_file, domainbinding); + + if (domain_file->data == NULL) + return NULL; + + domain = (struct loaded_domain *) domain_file->data; + + nstrings = domain->nstrings; + + /* Locate the MSGID and its translation. */ + if (domain->hash_tab != NULL) + { + /* Use the hashing table. */ + nls_uint32 len = strlen (msgid); + nls_uint32 hash_val = hash_string (msgid); + nls_uint32 idx = hash_val % domain->hash_size; + nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); + + while (1) + { + nls_uint32 nstr = + W (domain->must_swap_hash_tab, domain->hash_tab[idx]); + + if (nstr == 0) + /* Hash table entry is empty. */ + return NULL; + + nstr--; + + /* Compare msgid with the original string at index nstr. + We compare the lengths with >=, not ==, because plural entries + are represented by strings with an embedded NUL. */ + if (nstr < nstrings + ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len + && (strcmp (msgid, + domain->data + W (domain->must_swap, + domain->orig_tab[nstr].offset)) + == 0) + : domain->orig_sysdep_tab[nstr - nstrings].length > len + && (strcmp (msgid, + domain->orig_sysdep_tab[nstr - nstrings].pointer) + == 0)) + { + act = nstr; + goto found; + } + + if (idx >= domain->hash_size - incr) + idx -= domain->hash_size - incr; + else + idx += incr; + } + /* NOTREACHED */ + } + else + { + /* Try the default method: binary search in the sorted array of + messages. */ + size_t top, bottom; + + bottom = 0; + top = nstrings; + while (bottom < top) + { + int cmp_val; + + act = (bottom + top) / 2; + cmp_val = strcmp (msgid, (domain->data + + W (domain->must_swap, + domain->orig_tab[act].offset))); + if (cmp_val < 0) + top = act; + else if (cmp_val > 0) + bottom = act + 1; + else + goto found; + } + /* No translation was found. */ + return NULL; + } + + found: + /* The translation was found at index ACT. If we have to convert the + string to use a different character set, this is the time. */ + if (act < nstrings) + { + result = (char *) + (domain->data + W (domain->must_swap, domain->trans_tab[act].offset)); + resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1; + } + else + { + result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer; + resultlen = domain->trans_sysdep_tab[act - nstrings].length; + } + +#if defined _LIBC || HAVE_ICONV + if (domain->codeset_cntr + != (domainbinding != NULL ? domainbinding->codeset_cntr : 0)) + { + /* The domain's codeset has changed through bind_textdomain_codeset() + since the message catalog was initialized or last accessed. We + have to reinitialize the converter. */ + _nl_free_domain_conv (domain); + _nl_init_domain_conv (domain_file, domain, domainbinding); + } + + if ( +# ifdef _LIBC + domain->conv != (__gconv_t) -1 +# else +# if HAVE_ICONV + domain->conv != (iconv_t) -1 +# endif +# endif + ) + { + /* We are supposed to do a conversion. First allocate an + appropriate table with the same structure as the table + of translations in the file, where we can put the pointers + to the converted strings in. + There is a slight complication with plural entries. They + are represented by consecutive NUL terminated strings. We + handle this case by converting RESULTLEN bytes, including + NULs. */ + + if (domain->conv_tab == NULL + && ((domain->conv_tab = + (char **) calloc (nstrings + domain->n_sysdep_strings, + sizeof (char *))) + == NULL)) + /* Mark that we didn't succeed allocating a table. */ + domain->conv_tab = (char **) -1; + + if (__builtin_expect (domain->conv_tab == (char **) -1, 0)) + /* Nothing we can do, no more memory. */ + goto converted; + + if (domain->conv_tab[act] == NULL) + { + /* We haven't used this string so far, so it is not + translated yet. Do this now. */ + /* We use a bit more efficient memory handling. + We allocate always larger blocks which get used over + time. This is faster than many small allocations. */ + __libc_lock_define_initialized (static, lock) +# define INITIAL_BLOCK_SIZE 4080 + static unsigned char *freemem; + static size_t freemem_size; + + const unsigned char *inbuf; + unsigned char *outbuf; + int malloc_count; +# ifndef _LIBC + transmem_block_t *transmem_list = NULL; +# endif + + __libc_lock_lock (lock); + + inbuf = (const unsigned char *) result; + outbuf = freemem + sizeof (size_t); + + malloc_count = 0; + while (1) + { + transmem_block_t *newmem; +# ifdef _LIBC + size_t non_reversible; + int res; + + if (freemem_size < sizeof (size_t)) + goto resize_freemem; + + res = __gconv (domain->conv, + &inbuf, inbuf + resultlen, + &outbuf, + outbuf + freemem_size - sizeof (size_t), + &non_reversible); + + if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT) + break; + + if (res != __GCONV_FULL_OUTPUT) + { + __libc_lock_unlock (lock); + goto converted; + } + + inbuf = result; +# else +# if HAVE_ICONV + const char *inptr = (const char *) inbuf; + size_t inleft = resultlen; + char *outptr = (char *) outbuf; + size_t outleft; + + if (freemem_size < sizeof (size_t)) + goto resize_freemem; + + outleft = freemem_size - sizeof (size_t); + if (iconv (domain->conv, + (ICONV_CONST char **) &inptr, &inleft, + &outptr, &outleft) + != (size_t) (-1)) + { + outbuf = (unsigned char *) outptr; + break; + } + if (errno != E2BIG) + { + __libc_lock_unlock (lock); + goto converted; + } +# endif +# endif + + resize_freemem: + /* We must allocate a new buffer or resize the old one. */ + if (malloc_count > 0) + { + ++malloc_count; + freemem_size = malloc_count * INITIAL_BLOCK_SIZE; + newmem = (transmem_block_t *) realloc (transmem_list, + freemem_size); +# ifdef _LIBC + if (newmem != NULL) + transmem_list = transmem_list->next; + else + { + struct transmem_list *old = transmem_list; + + transmem_list = transmem_list->next; + free (old); + } +# endif + } + else + { + malloc_count = 1; + freemem_size = INITIAL_BLOCK_SIZE; + newmem = (transmem_block_t *) malloc (freemem_size); + } + if (__builtin_expect (newmem == NULL, 0)) + { + freemem = NULL; + freemem_size = 0; + __libc_lock_unlock (lock); + goto converted; + } + +# ifdef _LIBC + /* Add the block to the list of blocks we have to free + at some point. */ + newmem->next = transmem_list; + transmem_list = newmem; + + freemem = newmem->data; + freemem_size -= offsetof (struct transmem_list, data); +# else + transmem_list = newmem; + freemem = newmem; +# endif + + outbuf = freemem + sizeof (size_t); + } + + /* We have now in our buffer a converted string. Put this + into the table of conversions. */ + *(size_t *) freemem = outbuf - freemem - sizeof (size_t); + domain->conv_tab[act] = (char *) freemem; + /* Shrink freemem, but keep it aligned. */ + freemem_size -= outbuf - freemem; + freemem = outbuf; + freemem += freemem_size & (alignof (size_t) - 1); + freemem_size = freemem_size & ~ (alignof (size_t) - 1); + + __libc_lock_unlock (lock); + } + + /* Now domain->conv_tab[act] contains the translation of all + the plural variants. */ + result = domain->conv_tab[act] + sizeof (size_t); + resultlen = *(size_t *) domain->conv_tab[act]; + } + + converted: + /* The result string is converted. */ + +#endif /* _LIBC || HAVE_ICONV */ + + *lengthp = resultlen; + return result; +} + + +/* Look up a plural variant. */ +static char * +internal_function +plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, + const char *translation, size_t translation_len) +{ + struct loaded_domain *domaindata = (struct loaded_domain *) domain->data; + unsigned long int index; + const char *p; + + index = plural_eval (domaindata->plural, n); + if (index >= domaindata->nplurals) + /* This should never happen. It means the plural expression and the + given maximum value do not match. */ + index = 0; + + /* Skip INDEX strings at TRANSLATION. */ + p = translation; + while (index-- > 0) + { +#ifdef _LIBC + p = __rawmemchr (p, '\0'); +#else + p = strchr (p, '\0'); +#endif + /* And skip over the NUL byte. */ + p++; + + if (p >= translation + translation_len) + /* This should never happen. It means the plural expression + evaluated to a value larger than the number of variants + available for MSGID1. */ + return (char *) translation; + } + return (char *) p; +} + +#ifndef _LIBC +/* Return string representation of locale CATEGORY. */ +static const char * +internal_function +category_to_name (int category) +{ + const char *retval; + + switch (category) + { +#ifdef LC_COLLATE + case LC_COLLATE: + retval = "LC_COLLATE"; + break; +#endif +#ifdef LC_CTYPE + case LC_CTYPE: + retval = "LC_CTYPE"; + break; +#endif +#ifdef LC_MONETARY + case LC_MONETARY: + retval = "LC_MONETARY"; + break; +#endif +#ifdef LC_NUMERIC + case LC_NUMERIC: + retval = "LC_NUMERIC"; + break; +#endif +#ifdef LC_TIME + case LC_TIME: + retval = "LC_TIME"; + break; +#endif +#ifdef LC_MESSAGES + case LC_MESSAGES: + retval = "LC_MESSAGES"; + break; +#endif +#ifdef LC_RESPONSE + case LC_RESPONSE: + retval = "LC_RESPONSE"; + break; +#endif +#ifdef LC_ALL + case LC_ALL: + /* This might not make sense but is perhaps better than any other + value. */ + retval = "LC_ALL"; + break; +#endif + default: + /* If you have a better idea for a default value let me know. */ + retval = "LC_XXX"; + } + + return retval; +} +#endif + +/* Guess value of current locale from value of the environment variables. */ +static const char * +internal_function +guess_category_value (int category, const char *categoryname) +{ + const char *language; + const char *retval; + + /* The highest priority value is the `LANGUAGE' environment + variable. But we don't use the value if the currently selected + locale is the C locale. This is a GNU extension. */ + language = getenv ("LANGUAGE"); + if (language != NULL && language[0] == '\0') + language = NULL; + + /* We have to proceed with the POSIX methods of looking to `LC_ALL', + `LC_xxx', and `LANG'. On some systems this can be done by the + `setlocale' function itself. */ +#ifdef _LIBC + retval = __current_locale_name (category); +#else + retval = _nl_locale_name (category, categoryname); +#endif + + /* Ignore LANGUAGE if the locale is set to "C" because + 1. "C" locale usually uses the ASCII encoding, and most international + messages use non-ASCII characters. These characters get displayed + as question marks (if using glibc's iconv()) or as invalid 8-bit + characters (because other iconv()s refuse to convert most non-ASCII + characters to ASCII). In any case, the output is ugly. + 2. The precise output of some programs in the "C" locale is specified + by POSIX and should not depend on environment variables like + "LANGUAGE". We allow such programs to use gettext(). */ + return language != NULL && strcmp (retval, "C") != 0 ? language : 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 (char *dest, const char *src) +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} +#endif + +#if !_LIBC && !HAVE_MEMPCPY +static void * +mempcpy (void *dest, const void *src, size_t n) +{ + return (void *) ((char *) memcpy (dest, src, n) + n); +} +#endif + + +#ifdef _LIBC +/* If we want to free all resources we have to do some work at + program's end. */ +libc_freeres_fn (free_mem) +{ + void *old; + + while (_nl_domain_bindings != NULL) + { + struct binding *oldp = _nl_domain_bindings; + _nl_domain_bindings = _nl_domain_bindings->next; + if (oldp->dirname != INTUSE(_nl_default_dirname)) + /* Yes, this is a pointer comparison. */ + free (oldp->dirname); + free (oldp->codeset); + free (oldp); + } + + if (_nl_current_default_domain != _nl_default_default_domain) + /* Yes, again a pointer comparison. */ + free ((char *) _nl_current_default_domain); + + /* Remove the search tree with the known translations. */ + __tdestroy (root, free); + root = NULL; + + while (transmem_list != NULL) + { + old = transmem_list; + transmem_list = transmem_list->next; + free (old); + } +} +#endif diff --git a/intl/dcngettext.c b/intl/dcngettext.c new file mode 100755 index 0000000..48a3e09 --- /dev/null +++ b/intl/dcngettext.c @@ -0,0 +1,57 @@ +/* Implementation of the dcngettext(3) function. + Copyright (C) 1995-1999, 2000-2003 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 +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#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 libintl_dcngettext +# define DCIGETTEXT libintl_dcigettext +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +char * +DCNGETTEXT (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 diff --git a/intl/dgettext.c b/intl/dgettext.c new file mode 100755 index 0000000..b64b0f5 --- /dev/null +++ b/intl/dgettext.c @@ -0,0 +1,58 @@ +/* Implementation of the dgettext(3) function. + Copyright (C) 1995-1997, 2000-2003 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 +#endif + +#include "gettextP.h" + +#include + +#ifdef _LIBC +# include +#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 INTUSE(__dcgettext) +#else +# define DGETTEXT libintl_dgettext +# define DCGETTEXT libintl_dcgettext +#endif + +/* Look up MSGID in the DOMAINNAME message catalog of the current + LC_MESSAGES locale. */ +char * +DGETTEXT (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 diff --git a/intl/dngettext.c b/intl/dngettext.c new file mode 100755 index 0000000..7815637 --- /dev/null +++ b/intl/dngettext.c @@ -0,0 +1,59 @@ +/* Implementation of the dngettext(3) function. + Copyright (C) 1995-1997, 2000-2003 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 +#endif + +#include "gettextP.h" + +#include + +#ifdef _LIBC +# include +#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 libintl_dngettext +# define DCNGETTEXT libintl_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 (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 diff --git a/intl/eval-plural.h b/intl/eval-plural.h new file mode 100755 index 0000000..01bd5af --- /dev/null +++ b/intl/eval-plural.h @@ -0,0 +1,108 @@ +/* Plural expression evaluation. + Copyright (C) 2000-2003 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 STATIC +#define STATIC static +#endif + +/* Evaluate the plural expression and return an index value. */ +STATIC +unsigned long int +internal_function +plural_eval (struct expression *pexp, unsigned long int n) +{ + switch (pexp->nargs) + { + case 0: + switch (pexp->operation) + { + case var: + return n; + case num: + return pexp->val.num; + default: + break; + } + /* NOTREACHED */ + break; + case 1: + { + /* pexp->operation must be lnot. */ + unsigned long int arg = plural_eval (pexp->val.args[0], n); + return ! arg; + } + case 2: + { + unsigned long int leftarg = plural_eval (pexp->val.args[0], n); + if (pexp->operation == lor) + return leftarg || plural_eval (pexp->val.args[1], n); + else if (pexp->operation == land) + return leftarg && plural_eval (pexp->val.args[1], n); + else + { + unsigned long int rightarg = plural_eval (pexp->val.args[1], n); + + switch (pexp->operation) + { + case mult: + return leftarg * rightarg; + case divide: +#if !INTDIV0_RAISES_SIGFPE + if (rightarg == 0) + raise (SIGFPE); +#endif + return leftarg / rightarg; + case module: +#if !INTDIV0_RAISES_SIGFPE + if (rightarg == 0) + raise (SIGFPE); +#endif + return leftarg % rightarg; + case plus: + return leftarg + rightarg; + case minus: + return leftarg - rightarg; + case less_than: + return leftarg < rightarg; + case greater_than: + return leftarg > rightarg; + case less_or_equal: + return leftarg <= rightarg; + case greater_or_equal: + return leftarg >= rightarg; + case equal: + return leftarg == rightarg; + case not_equal: + return leftarg != rightarg; + default: + break; + } + } + /* NOTREACHED */ + break; + } + case 3: + { + /* pexp->operation must be qmop. */ + unsigned long int boolarg = plural_eval (pexp->val.args[0], n); + return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); + } + } + /* NOTREACHED */ + return 0; +} diff --git a/intl/explodename.c b/intl/explodename.c new file mode 100755 index 0000000..52c25e7 --- /dev/null +++ b/intl/explodename.c @@ -0,0 +1,185 @@ +/* Copyright (C) 1995-1998, 2000-2001, 2003 Free Software Foundation, Inc. + Contributed by Ulrich Drepper , 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 +#endif + +#include +#include +#include + +#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 (const char *name) +{ + while (name[0] != '\0' && name[0] != '_' && name[0] != '@' + && name[0] != '+' && name[0] != ',') + ++name; + + return (char *) name; +} + + +int +_nl_explode_name (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; +} diff --git a/intl/finddomain.c b/intl/finddomain.c new file mode 100755 index 0000000..4992a8c --- /dev/null +++ b/intl/finddomain.c @@ -0,0 +1,192 @@ +/* Handle list of needed message catalogs + Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc. + Written by Ulrich Drepper , 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 +#endif + +#include +#include +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#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 (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 +libc_freeres_fn (free_mem) +{ + 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); + } +} +#endif diff --git a/intl/gettext.c b/intl/gettext.c new file mode 100755 index 0000000..92c42fa --- /dev/null +++ b/intl/gettext.c @@ -0,0 +1,63 @@ +/* Implementation of gettext(3) function. + Copyright (C) 1995, 1997, 2000-2003 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 +#endif + +#ifdef _LIBC +# define __need_NULL +# include +#else +# include /* Just for NULL. */ +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#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 INTUSE(__dcgettext) +#else +# define GETTEXT libintl_gettext +# define DCGETTEXT libintl_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 (const char *msgid) +{ + return DCGETTEXT (NULL, msgid, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__gettext, gettext); +#endif diff --git a/intl/gettextP.h b/intl/gettextP.h new file mode 100755 index 0000000..4d66c3d --- /dev/null +++ b/intl/gettextP.h @@ -0,0 +1,215 @@ +/* Header describing internals of libintl library. + Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. + Written by Ulrich Drepper , 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 /* Get size_t. */ + +#ifdef _LIBC +# include "../iconv/gconv_int.h" +#else +# if HAVE_ICONV +# include +# endif +#endif + +#include "loadinfo.h" + +#include "gmo.h" /* Get nls_uint32. */ + +/* @@ end of prolog @@ */ + +#ifndef internal_function +# define internal_function +#endif + +#ifndef attribute_hidden +# define attribute_hidden +#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 +# 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 + + +/* In-memory representation of system dependent string. */ +struct sysdep_string_desc +{ + /* Length of addressed string, including the trailing NUL. */ + size_t length; + /* Pointer to addressed string. */ + const char *pointer; +}; + +/* The representation of an opened message catalog. */ +struct loaded_domain +{ + /* Pointer to memory containing the .mo file. */ + const char *data; + /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */ + int use_mmap; + /* Size of mmap()ed memory. */ + size_t mmap_size; + /* 1 if the .mo file uses a different endianness than this machine. */ + int must_swap; + /* Pointer to additional malloc()ed memory. */ + void *malloced; + + /* Number of static strings pairs. */ + nls_uint32 nstrings; + /* Pointer to descriptors of original strings in the file. */ + const struct string_desc *orig_tab; + /* Pointer to descriptors of translated strings in the file. */ + const struct string_desc *trans_tab; + + /* Number of system dependent strings pairs. */ + nls_uint32 n_sysdep_strings; + /* Pointer to descriptors of original sysdep strings. */ + const struct sysdep_string_desc *orig_sysdep_tab; + /* Pointer to descriptors of translated sysdep strings. */ + const struct sysdep_string_desc *trans_sysdep_tab; + + /* Size of hash table. */ + nls_uint32 hash_size; + /* Pointer to hash table. */ + const nls_uint32 *hash_tab; + /* 1 if the hash table uses a different endianness than this machine. */ + int must_swap_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; + +#ifndef _LIBC +const char *_nl_locale_name (int category, const char *categoryname); +#endif + +struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale, + const char *__domainname, + struct binding *__domainbinding) + internal_function; +void _nl_load_domain (struct loaded_l10nfile *__domain, + struct binding *__domainbinding) + internal_function; +void _nl_unload_domain (struct loaded_domain *__domain) + internal_function; +const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file, + struct loaded_domain *__domain, + struct binding *__domainbinding) + internal_function; +void _nl_free_domain_conv (struct loaded_domain *__domain) + internal_function; + +char *_nl_find_msg (struct loaded_l10nfile *domain_file, + struct binding *domainbinding, const char *msgid, + size_t *lengthp) + internal_function; + +#ifdef _LIBC +extern char *__gettext (const char *__msgid); +extern char *__dgettext (const char *__domainname, const char *__msgid); +extern char *__dcgettext (const char *__domainname, const char *__msgid, + int __category); +extern char *__ngettext (const char *__msgid1, const char *__msgid2, + unsigned long int __n); +extern char *__dngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int n); +extern char *__dcngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category); +extern char *__dcigettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + int __plural, unsigned long int __n, + int __category); +extern char *__textdomain (const char *__domainname); +extern char *__bindtextdomain (const char *__domainname, + const char *__dirname); +extern char *__bind_textdomain_codeset (const char *__domainname, + const char *__codeset); +#else +/* Declare the exported libintl_* functions, in a way that allows us to + call them under their real name. */ +# undef _INTL_REDIRECT_INLINE +# undef _INTL_REDIRECT_MACROS +# define _INTL_REDIRECT_MACROS +# include "libgnuintl.h" +extern char *libintl_dcigettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + int __plural, unsigned long int __n, + int __category); +#endif + +/* @@ begin of epilog @@ */ + +#endif /* gettextP.h */ diff --git a/intl/gmo.h b/intl/gmo.h new file mode 100755 index 0000000..e7c9cc1 --- /dev/null +++ b/intl/gmo.h @@ -0,0 +1,149 @@ +/* Description of GNU message catalog format: general file layout. + Copyright (C) 1995, 1997, 2000-2002, 2004 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 + +#include + +/* @@ 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 +#define MO_REVISION_NUMBER_WITH_SYSDEP_I 1 + +/* 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 ) 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 following are only used in .mo files with major revision 0 or 1. */ + + /* 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 translated strings. */ + nls_uint32 trans_tab_offset; + /* Size of hash table. */ + nls_uint32 hash_tab_size; + /* Offset of first hash table entry. */ + nls_uint32 hash_tab_offset; + + /* The following are only used in .mo files with minor revision >= 1. */ + + /* The number of system dependent segments. */ + nls_uint32 n_sysdep_segments; + /* Offset of table describing system dependent segments. */ + nls_uint32 sysdep_segments_offset; + /* The number of system dependent strings pairs. */ + nls_uint32 n_sysdep_strings; + /* Offset of table with start offsets of original sysdep strings. */ + nls_uint32 orig_sysdep_tab_offset; + /* Offset of table with start offsets of translated sysdep strings. */ + nls_uint32 trans_sysdep_tab_offset; +}; + +/* Descriptor for static string contained in the binary .mo file. */ +struct string_desc +{ + /* Length of addressed string, not including the trailing NUL. */ + nls_uint32 length; + /* Offset of string in file. */ + nls_uint32 offset; +}; + +/* The following are only used in .mo files with minor revision >= 1. */ + +/* Descriptor for system dependent string segment. */ +struct sysdep_segment +{ + /* Length of addressed string, including the trailing NUL. */ + nls_uint32 length; + /* Offset of string in file. */ + nls_uint32 offset; +}; + +/* Descriptor for system dependent string. */ +struct sysdep_string +{ + /* Offset of static string segments in file. */ + nls_uint32 offset; + /* Alternating sequence of static and system dependent segments. + The last segment is a static segment, including the trailing NUL. */ + struct segment_pair + { + /* Size of static segment. */ + nls_uint32 segsize; + /* Reference to system dependent string segment, or ~0 at the end. */ + nls_uint32 sysdepref; + } segments[1]; +}; + +/* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF, + regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */ +#define SEGMENTS_END ((nls_uint32) ~0) + +/* @@ begin of epilog @@ */ + +#endif /* gettext.h */ diff --git a/intl/hash-string.h b/intl/hash-string.h new file mode 100755 index 0000000..093e3b1 --- /dev/null +++ b/intl/hash-string.h @@ -0,0 +1,48 @@ +/* Description of GNU message catalog format: string hashing function. + Copyright (C) 1995, 1997-1998, 2000-2003 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 @@ */ + +/* 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 inline unsigned long int +hash_string (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 char) *str++; + g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); + if (g != 0) + { + hval ^= g >> (HASHWORDBITS - 8); + hval ^= g; + } + } + return hval; +} diff --git a/intl/intl-compat.c b/intl/intl-compat.c new file mode 100755 index 0000000..96f9d95 --- /dev/null +++ b/intl/intl-compat.c @@ -0,0 +1,131 @@ +/* intl-compat.c - Stub functions to call gettext functions from GNU gettext + Library. + Copyright (C) 1995, 2000-2003 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 +#endif + +#include "gettextP.h" + +/* @@ end of prolog @@ */ + +/* This file redirects the gettext functions (without prefix) to those + defined in the included GNU libintl library (with "libintl_" prefix). + It is compiled into libintl in order to make the AM_GNU_GETTEXT test + of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which + has the redirections primarily in the include file. + It is also compiled into libgnuintl so that libgnuintl.so can be used + as LD_PRELOADable library on glibc systems, to provide the extra + features that the functions in the libc don't have (namely, logging). */ + + +#undef gettext +#undef dgettext +#undef dcgettext +#undef ngettext +#undef dngettext +#undef dcngettext +#undef textdomain +#undef bindtextdomain +#undef bind_textdomain_codeset + + +/* When building a DLL, we must export some functions. Note that because + the functions are only defined for binary backward compatibility, we + don't need to use __declspec(dllimport) in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define DLL_EXPORTED __declspec(dllexport) +#else +# define DLL_EXPORTED +#endif + + +DLL_EXPORTED +char * +gettext (const char *msgid) +{ + return libintl_gettext (msgid); +} + + +DLL_EXPORTED +char * +dgettext (const char *domainname, const char *msgid) +{ + return libintl_dgettext (domainname, msgid); +} + + +DLL_EXPORTED +char * +dcgettext (const char *domainname, const char *msgid, int category) +{ + return libintl_dcgettext (domainname, msgid, category); +} + + +DLL_EXPORTED +char * +ngettext (const char *msgid1, const char *msgid2, unsigned long int n) +{ + return libintl_ngettext (msgid1, msgid2, n); +} + + +DLL_EXPORTED +char * +dngettext (const char *domainname, + const char *msgid1, const char *msgid2, unsigned long int n) +{ + return libintl_dngettext (domainname, msgid1, msgid2, n); +} + + +DLL_EXPORTED +char * +dcngettext (const char *domainname, + const char *msgid1, const char *msgid2, unsigned long int n, + int category) +{ + return libintl_dcngettext (domainname, msgid1, msgid2, n, category); +} + + +DLL_EXPORTED +char * +textdomain (const char *domainname) +{ + return libintl_textdomain (domainname); +} + + +DLL_EXPORTED +char * +bindtextdomain (const char *domainname, const char *dirname) +{ + return libintl_bindtextdomain (domainname, dirname); +} + + +DLL_EXPORTED +char * +bind_textdomain_codeset (const char *domainname, const char *codeset) +{ + return libintl_bind_textdomain_codeset (domainname, codeset); +} diff --git a/intl/l10nflist.c b/intl/l10nflist.c new file mode 100755 index 0000000..eb995aa --- /dev/null +++ b/intl/l10nflist.c @@ -0,0 +1,421 @@ +/* Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. + Contributed by Ulrich Drepper , 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 to provide a prototype for stpcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#if defined _LIBC || defined HAVE_ARGZ_H +# include +#endif +#include +#include +#include + +#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 (char *dest, const char *src); +# endif +#endif + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, + it may be concatenated to a directory pathname. + */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) +#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__ (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) +#else +# ifdef _LIBC +# define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) +# endif +#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__ (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) +#else +# ifdef _LIBC +# define __argz_stringify(argz, len, sep) \ + INTUSE(__argz_stringify) (argz, len, sep) +# endif +#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ + +#if !defined _LIBC && !defined HAVE___ARGZ_NEXT +static char * +argz_next__ (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 inline int +pop (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 (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 **lastp; + struct loaded_l10nfile *retval; + char *cp; + size_t dirlist_count; + size_t entries; + int cnt; + + /* If LANGUAGE contains an absolute directory specification, we ignore + DIRLIST. */ + if (IS_ABSOLUTE_PATH (language)) + dirlist_len = 0; + + /* 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) : 0) + + ((mask & CEN_REVISION) != 0 + ? strlen (revision) + 1 : 0)) : 0) + + 1 + strlen (filename) + 1); + + if (abs_filename == NULL) + return NULL; + + /* Construct file name. */ + cp = abs_filename; + if (dirlist_len > 0) + { + memcpy (cp, dirlist, dirlist_len); + __argz_stringify (cp, dirlist_len, PATH_SEPARATOR); + cp += dirlist_len; + cp[-1] = '/'; + } + + 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. */ + lastp = l10nfile_list; + 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; + } + + lastp = &retval->next; + } + + if (retval != NULL || do_allocate == 0) + { + free (abs_filename); + return retval; + } + + dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1); + + /* Allocate a new loaded_l10nfile. */ + retval = + (struct loaded_l10nfile *) + malloc (sizeof (*retval) + + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0)) + * sizeof (struct loaded_l10nfile *))); + if (retval == NULL) + return NULL; + + retval->filename = abs_filename; + + /* We set retval->data to NULL here; it is filled in later. + Setting retval->decided to 1 here means that retval does not + correspond to a real file (dirlist_count > 1) or is not worth + looking up (if an unnormalized codeset was specified). */ + retval->decided = (dirlist_count > 1 + || ((mask & XPG_CODESET) != 0 + && (mask & XPG_NORM_CODESET) != 0)); + retval->data = NULL; + + retval->next = *lastp; + *lastp = retval; + + entries = 0; + /* Recurse to fill the inheritance list of RETVAL. + If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL + entry does not correspond to a real file; retval->filename contains + colons. In this case we loop across all elements of DIRLIST and + across all bit patterns dominated by MASK. + If the DIRLIST is a single directory or entirely redundant (i.e. + DIRLIST_COUNT == 1), we loop across all bit patterns dominated by + MASK, excluding MASK itself. + In either case, we loop down from MASK to 0. This has the effect + that the extra bits in the locale name are dropped in this order: + first the modifier, then the territory, then the codeset, then the + normalized_codeset. */ + for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt) + if ((cnt & ~mask) == 0 + && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0) + && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0)) + { + if (dirlist_count > 1) + { + /* 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); + } + else + retval->successor[entries++] + = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, + 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 (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 ((unsigned char) codeset[cnt])) + { + ++len; + + if (isalpha ((unsigned char) 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 ((unsigned char) codeset[cnt])) + *wp++ = tolower ((unsigned char) codeset[cnt]); + else if (isdigit ((unsigned char) 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 (char *dest, const char *src) +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} +#endif diff --git a/intl/libgnuintl.h.in b/intl/libgnuintl.h.in new file mode 100755 index 0000000..3be7eb9 --- /dev/null +++ b/intl/libgnuintl.h.in @@ -0,0 +1,383 @@ +/* Message catalogs for internationalization. + Copyright (C) 1995-1997, 2000-2003 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 + +/* 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, defines __LOCALE_H (or _LOCALE_H in Solaris 2.5) + then includes (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 || (defined _LOCALE_H && defined __sun)) +# 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 + +/* Provide information about the supported file formats. Returns the + maximum minor revision number supported for a given major revision. */ +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ + ((major) == 0 ? 1 : -1) + +/* Resolve a platform specific conflict on DJGPP. GNU gettext takes + precedence over _conio_gettext. */ +#ifdef __DJGPP__ +# undef gettext +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/* We redirect the functions to those prefixed with "libintl_". This is + necessary, because some systems define gettext/textdomain/... in the C + library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). + If we used the unprefixed names, there would be cases where the + definition in the C library would override the one in the libintl.so + shared library. Recall that on ELF systems, the symbols are looked + up in the following order: + 1. in the executable, + 2. in the shared libraries specified on the link command line, in order, + 3. in the dependencies of the shared libraries specified on the link + command line, + 4. in the dlopen()ed shared libraries, in the order in which they were + dlopen()ed. + The definition in the C library would override the one in libintl.so if + either + * -lc is given on the link command line and -lintl isn't, or + * -lc is given on the link command line before -lintl, or + * libintl.so is a dependency of a dlopen()ed shared library but not + linked to the executable at link time. + Since Solaris gettext() behaves differently than GNU gettext(), this + would be unacceptable. + + The redirection happens by default through macros in C, so that &gettext + is independent of the compilation unit, but through inline functions in + C++, in order not to interfere with the name mangling of class fields or + class methods called 'gettext'. */ + +/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. + If he doesn't, we choose the method. A third possible method is + _INTL_REDIRECT_ASM, supported only by GCC. */ +#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) +# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) +# define _INTL_REDIRECT_ASM +# else +# ifdef __cplusplus +# define _INTL_REDIRECT_INLINE +# else +# define _INTL_REDIRECT_MACROS +# endif +# endif +#endif +/* Auxiliary macros. */ +#ifdef _INTL_REDIRECT_ASM +# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) +# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring +# define _INTL_STRINGIFY(prefix) #prefix +#else +# define _INTL_ASM(cname) +#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). */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_gettext (const char *__msgid); +static inline char *gettext (const char *__msgid) +{ + return libintl_gettext (__msgid); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define gettext libintl_gettext +#endif +extern char *gettext (const char *__msgid) + _INTL_ASM (libintl_gettext); +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current + LC_MESSAGES locale. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_dgettext (const char *__domainname, const char *__msgid); +static inline char *dgettext (const char *__domainname, const char *__msgid) +{ + return libintl_dgettext (__domainname, __msgid); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define dgettext libintl_dgettext +#endif +extern char *dgettext (const char *__domainname, const char *__msgid) + _INTL_ASM (libintl_dgettext); +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, + int __category); +static inline char *dcgettext (const char *__domainname, const char *__msgid, + int __category) +{ + return libintl_dcgettext (__domainname, __msgid, __category); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define dcgettext libintl_dcgettext +#endif +extern char *dcgettext (const char *__domainname, const char *__msgid, + int __category) + _INTL_ASM (libintl_dcgettext); +#endif + + +/* Similar to `gettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, + unsigned long int __n); +static inline char *ngettext (const char *__msgid1, const char *__msgid2, + unsigned long int __n) +{ + return libintl_ngettext (__msgid1, __msgid2, __n); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define ngettext libintl_ngettext +#endif +extern char *ngettext (const char *__msgid1, const char *__msgid2, + unsigned long int __n) + _INTL_ASM (libintl_ngettext); +#endif + +/* Similar to `dgettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, + const char *__msgid2, unsigned long int __n); +static inline char *dngettext (const char *__domainname, const char *__msgid1, + const char *__msgid2, unsigned long int __n) +{ + return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define dngettext libintl_dngettext +#endif +extern char *dngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n) + _INTL_ASM (libintl_dngettext); +#endif + +/* Similar to `dcgettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_dcngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category); +static inline char *dcngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category) +{ + return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define dcngettext libintl_dcngettext +#endif +extern char *dcngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category) + _INTL_ASM (libintl_dcngettext); +#endif + + +/* 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". */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_textdomain (const char *__domainname); +static inline char *textdomain (const char *__domainname) +{ + return libintl_textdomain (__domainname); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define textdomain libintl_textdomain +#endif +extern char *textdomain (const char *__domainname) + _INTL_ASM (libintl_textdomain); +#endif + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_bindtextdomain (const char *__domainname, + const char *__dirname); +static inline char *bindtextdomain (const char *__domainname, + const char *__dirname) +{ + return libintl_bindtextdomain (__domainname, __dirname); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define bindtextdomain libintl_bindtextdomain +#endif +extern char *bindtextdomain (const char *__domainname, const char *__dirname) + _INTL_ASM (libintl_bindtextdomain); +#endif + +/* Specify the character encoding in which the messages from the + DOMAINNAME message catalog will be returned. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_bind_textdomain_codeset (const char *__domainname, + const char *__codeset); +static inline char *bind_textdomain_codeset (const char *__domainname, + const char *__codeset) +{ + return libintl_bind_textdomain_codeset (__domainname, __codeset); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define bind_textdomain_codeset libintl_bind_textdomain_codeset +#endif +extern char *bind_textdomain_codeset (const char *__domainname, + const char *__codeset) + _INTL_ASM (libintl_bind_textdomain_codeset); +#endif + + +/* Support for format strings with positions in *printf(), following the + POSIX/XSI specification. + Note: These replacements for the *printf() functions are visible only + in source files that #include or #include "gettext.h". + Packages that use *printf() in source files that don't refer to _() + or gettext() but for which the format string could be the return value + of _() or gettext() need to add this #include. Oh well. */ + +#if !@HAVE_POSIX_PRINTF@ + +#include +#include + +/* Get va_list. */ +#if __STDC__ || defined __cplusplus || defined _MSC_VER +# include +#else +# include +#endif + +#undef fprintf +#define fprintf libintl_fprintf +extern int fprintf (FILE *, const char *, ...); +#undef vfprintf +#define vfprintf libintl_vfprintf +extern int vfprintf (FILE *, const char *, va_list); + +#undef printf +#define printf libintl_printf +extern int printf (const char *, ...); +#undef vprintf +#define vprintf libintl_vprintf +extern int vprintf (const char *, va_list); + +#undef sprintf +#define sprintf libintl_sprintf +extern int sprintf (char *, const char *, ...); +#undef vsprintf +#define vsprintf libintl_vsprintf +extern int vsprintf (char *, const char *, va_list); + +#if @HAVE_SNPRINTF@ + +#undef snprintf +#define snprintf libintl_snprintf +extern int snprintf (char *, size_t, const char *, ...); +#undef vsnprintf +#define vsnprintf libintl_vsnprintf +extern int vsnprintf (char *, size_t, const char *, va_list); + +#endif + +#if @HAVE_ASPRINTF@ + +#undef asprintf +#define asprintf libintl_asprintf +extern int asprintf (char **, const char *, ...); +#undef vasprintf +#define vasprintf libintl_vasprintf +extern int vasprintf (char **, const char *, va_list); + +#endif + +#if @HAVE_WPRINTF@ + +#undef fwprintf +#define fwprintf libintl_fwprintf +extern int fwprintf (FILE *, const wchar_t *, ...); +#undef vfwprintf +#define vfwprintf libintl_vfwprintf +extern int vfwprintf (FILE *, const wchar_t *, va_list); + +#undef wprintf +#define wprintf libintl_wprintf +extern int wprintf (const wchar_t *, ...); +#undef vwprintf +#define vwprintf libintl_vwprintf +extern int vwprintf (const wchar_t *, va_list); + +#undef swprintf +#define swprintf libintl_swprintf +extern int swprintf (wchar_t *, size_t, const wchar_t *, ...); +#undef vswprintf +#define vswprintf libintl_vswprintf +extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); + +#endif + +#endif + + +/* Support for relocatable packages. */ + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +#define libintl_set_relocation_prefix libintl_set_relocation_prefix +extern void + libintl_set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + + +#ifdef __cplusplus +} +#endif + +#endif /* libintl.h */ diff --git a/intl/loadinfo.h b/intl/loadinfo.h new file mode 100755 index 0000000..65e5ebd --- /dev/null +++ b/intl/loadinfo.h @@ -0,0 +1,145 @@ +/* Copyright (C) 1996-1999, 2000-2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 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 + +/* Declarations of locale dependent catalog lookup functions. + Implemented in + + localealias.c Possibly replace a locale name by another. + explodename.c Split a locale name into its various fields. + l10nflist.c Generate a list of filenames of possible message catalogs. + finddomain.c Find and open the relevant message catalogs. + + The main function _nl_find_domain() in finddomain.c is declared + in gettextP.h. + */ + +#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 (const char *codeset, + size_t name_len); + +/* Lookup a locale dependent file. + *L10NFILE_LIST denotes a pool of lookup results of locale dependent + files of the same kind, sorted in decreasing order of ->filename. + DIRLIST and DIRLIST_LEN are an argz list of directories in which to + look, containing at least one directory (i.e. DIRLIST_LEN > 0). + MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER, + SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as + produced by _nl_explode_name(). FILENAME is the filename suffix. + The return value is the lookup result, either found in *L10NFILE_LIST, + or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL. + If the return value is non-NULL, it is added to *L10NFILE_LIST, and + its ->next field denotes the chaining inside *L10NFILE_LIST, and + furthermore its ->successor[] field contains a list of other lookup + results from which this lookup result inherits. */ +extern struct loaded_l10nfile * +_nl_make_l10nflist (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); + +/* Lookup the real locale name for a locale alias NAME, or NULL if + NAME is not a locale alias (but possibly a real locale name). + The return value is statically allocated and must not be freed. */ +extern const char *_nl_expand_alias (const char *name); + +/* Split a locale name NAME into its pieces: language, modifier, + territory, codeset, special, sponsor, revision. + NAME gets destructively modified: NUL bytes are inserted here and + there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY, + *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a + pointer into the old NAME string, or NULL. *NORMALIZED_CODESET + gets assigned the expanded *CODESET, if it is different from *CODESET; + this one is dynamically allocated and has to be freed by the caller. + The return value is a bitmask, where each bit corresponds to one + filled-in value: + XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER, + TERRITORY for *TERRITORY, + XPG_CODESET for *CODESET, + XPG_NORM_CODESET for *NORMALIZED_CODESET, + CEN_SPECIAL for *SPECIAL, + CEN_SPONSOR for *SPONSOR, + CEN_REVISION for *REVISION. + */ +extern int _nl_explode_name (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); + +/* Split a locale name NAME into a leading language part and all the + rest. Return a pointer to the first character after the language, + i.e. to the first byte of the rest. */ +extern char *_nl_find_language (const char *name); + +#endif /* loadinfo.h */ diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c new file mode 100755 index 0000000..99c51b4 --- /dev/null +++ b/intl/loadmsgcat.c @@ -0,0 +1,1420 @@ +/* Load needed message catalogs. + Copyright (C) 1995-1999, 2000-2004 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 to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include + +#ifdef __GNUC__ +# undef alloca +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#ifdef _LIBC +# include +# include +#endif + +#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ + || (defined _LIBC && defined _POSIX_MAPPED_FILES) +# include +# undef HAVE_MMAP +# define HAVE_MMAP 1 +#else +# undef HAVE_MMAP +#endif + +#if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC +# include +#endif +#if defined HAVE_INTTYPES_H || defined _LIBC +# include +#endif + +#include "gmo.h" +#include "gettextP.h" +#include "hash-string.h" +#include "plural-exp.h" + +#ifdef _LIBC +# include "../locale/localeinfo.h" +#endif + +/* Provide fallback values for macros that ought to be defined in . + Note that our fallback values need not be literal strings, because we don't + use them with preprocessor string concatenation. */ +#if !defined PRId8 || PRI_MACROS_BROKEN +# undef PRId8 +# define PRId8 "d" +#endif +#if !defined PRIi8 || PRI_MACROS_BROKEN +# undef PRIi8 +# define PRIi8 "i" +#endif +#if !defined PRIo8 || PRI_MACROS_BROKEN +# undef PRIo8 +# define PRIo8 "o" +#endif +#if !defined PRIu8 || PRI_MACROS_BROKEN +# undef PRIu8 +# define PRIu8 "u" +#endif +#if !defined PRIx8 || PRI_MACROS_BROKEN +# undef PRIx8 +# define PRIx8 "x" +#endif +#if !defined PRIX8 || PRI_MACROS_BROKEN +# undef PRIX8 +# define PRIX8 "X" +#endif +#if !defined PRId16 || PRI_MACROS_BROKEN +# undef PRId16 +# define PRId16 "d" +#endif +#if !defined PRIi16 || PRI_MACROS_BROKEN +# undef PRIi16 +# define PRIi16 "i" +#endif +#if !defined PRIo16 || PRI_MACROS_BROKEN +# undef PRIo16 +# define PRIo16 "o" +#endif +#if !defined PRIu16 || PRI_MACROS_BROKEN +# undef PRIu16 +# define PRIu16 "u" +#endif +#if !defined PRIx16 || PRI_MACROS_BROKEN +# undef PRIx16 +# define PRIx16 "x" +#endif +#if !defined PRIX16 || PRI_MACROS_BROKEN +# undef PRIX16 +# define PRIX16 "X" +#endif +#if !defined PRId32 || PRI_MACROS_BROKEN +# undef PRId32 +# define PRId32 "d" +#endif +#if !defined PRIi32 || PRI_MACROS_BROKEN +# undef PRIi32 +# define PRIi32 "i" +#endif +#if !defined PRIo32 || PRI_MACROS_BROKEN +# undef PRIo32 +# define PRIo32 "o" +#endif +#if !defined PRIu32 || PRI_MACROS_BROKEN +# undef PRIu32 +# define PRIu32 "u" +#endif +#if !defined PRIx32 || PRI_MACROS_BROKEN +# undef PRIx32 +# define PRIx32 "x" +#endif +#if !defined PRIX32 || PRI_MACROS_BROKEN +# undef PRIX32 +# define PRIX32 "X" +#endif +#if !defined PRId64 || PRI_MACROS_BROKEN +# undef PRId64 +# define PRId64 (sizeof (long) == 8 ? "ld" : "lld") +#endif +#if !defined PRIi64 || PRI_MACROS_BROKEN +# undef PRIi64 +# define PRIi64 (sizeof (long) == 8 ? "li" : "lli") +#endif +#if !defined PRIo64 || PRI_MACROS_BROKEN +# undef PRIo64 +# define PRIo64 (sizeof (long) == 8 ? "lo" : "llo") +#endif +#if !defined PRIu64 || PRI_MACROS_BROKEN +# undef PRIu64 +# define PRIu64 (sizeof (long) == 8 ? "lu" : "llu") +#endif +#if !defined PRIx64 || PRI_MACROS_BROKEN +# undef PRIx64 +# define PRIx64 (sizeof (long) == 8 ? "lx" : "llx") +#endif +#if !defined PRIX64 || PRI_MACROS_BROKEN +# undef PRIX64 +# define PRIX64 (sizeof (long) == 8 ? "lX" : "llX") +#endif +#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN +# undef PRIdLEAST8 +# define PRIdLEAST8 "d" +#endif +#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN +# undef PRIiLEAST8 +# define PRIiLEAST8 "i" +#endif +#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN +# undef PRIoLEAST8 +# define PRIoLEAST8 "o" +#endif +#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN +# undef PRIuLEAST8 +# define PRIuLEAST8 "u" +#endif +#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN +# undef PRIxLEAST8 +# define PRIxLEAST8 "x" +#endif +#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN +# undef PRIXLEAST8 +# define PRIXLEAST8 "X" +#endif +#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN +# undef PRIdLEAST16 +# define PRIdLEAST16 "d" +#endif +#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN +# undef PRIiLEAST16 +# define PRIiLEAST16 "i" +#endif +#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN +# undef PRIoLEAST16 +# define PRIoLEAST16 "o" +#endif +#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN +# undef PRIuLEAST16 +# define PRIuLEAST16 "u" +#endif +#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN +# undef PRIxLEAST16 +# define PRIxLEAST16 "x" +#endif +#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN +# undef PRIXLEAST16 +# define PRIXLEAST16 "X" +#endif +#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN +# undef PRIdLEAST32 +# define PRIdLEAST32 "d" +#endif +#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN +# undef PRIiLEAST32 +# define PRIiLEAST32 "i" +#endif +#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN +# undef PRIoLEAST32 +# define PRIoLEAST32 "o" +#endif +#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN +# undef PRIuLEAST32 +# define PRIuLEAST32 "u" +#endif +#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN +# undef PRIxLEAST32 +# define PRIxLEAST32 "x" +#endif +#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN +# undef PRIXLEAST32 +# define PRIXLEAST32 "X" +#endif +#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN +# undef PRIdLEAST64 +# define PRIdLEAST64 PRId64 +#endif +#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN +# undef PRIiLEAST64 +# define PRIiLEAST64 PRIi64 +#endif +#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN +# undef PRIoLEAST64 +# define PRIoLEAST64 PRIo64 +#endif +#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN +# undef PRIuLEAST64 +# define PRIuLEAST64 PRIu64 +#endif +#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN +# undef PRIxLEAST64 +# define PRIxLEAST64 PRIx64 +#endif +#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN +# undef PRIXLEAST64 +# define PRIXLEAST64 PRIX64 +#endif +#if !defined PRIdFAST8 || PRI_MACROS_BROKEN +# undef PRIdFAST8 +# define PRIdFAST8 "d" +#endif +#if !defined PRIiFAST8 || PRI_MACROS_BROKEN +# undef PRIiFAST8 +# define PRIiFAST8 "i" +#endif +#if !defined PRIoFAST8 || PRI_MACROS_BROKEN +# undef PRIoFAST8 +# define PRIoFAST8 "o" +#endif +#if !defined PRIuFAST8 || PRI_MACROS_BROKEN +# undef PRIuFAST8 +# define PRIuFAST8 "u" +#endif +#if !defined PRIxFAST8 || PRI_MACROS_BROKEN +# undef PRIxFAST8 +# define PRIxFAST8 "x" +#endif +#if !defined PRIXFAST8 || PRI_MACROS_BROKEN +# undef PRIXFAST8 +# define PRIXFAST8 "X" +#endif +#if !defined PRIdFAST16 || PRI_MACROS_BROKEN +# undef PRIdFAST16 +# define PRIdFAST16 "d" +#endif +#if !defined PRIiFAST16 || PRI_MACROS_BROKEN +# undef PRIiFAST16 +# define PRIiFAST16 "i" +#endif +#if !defined PRIoFAST16 || PRI_MACROS_BROKEN +# undef PRIoFAST16 +# define PRIoFAST16 "o" +#endif +#if !defined PRIuFAST16 || PRI_MACROS_BROKEN +# undef PRIuFAST16 +# define PRIuFAST16 "u" +#endif +#if !defined PRIxFAST16 || PRI_MACROS_BROKEN +# undef PRIxFAST16 +# define PRIxFAST16 "x" +#endif +#if !defined PRIXFAST16 || PRI_MACROS_BROKEN +# undef PRIXFAST16 +# define PRIXFAST16 "X" +#endif +#if !defined PRIdFAST32 || PRI_MACROS_BROKEN +# undef PRIdFAST32 +# define PRIdFAST32 "d" +#endif +#if !defined PRIiFAST32 || PRI_MACROS_BROKEN +# undef PRIiFAST32 +# define PRIiFAST32 "i" +#endif +#if !defined PRIoFAST32 || PRI_MACROS_BROKEN +# undef PRIoFAST32 +# define PRIoFAST32 "o" +#endif +#if !defined PRIuFAST32 || PRI_MACROS_BROKEN +# undef PRIuFAST32 +# define PRIuFAST32 "u" +#endif +#if !defined PRIxFAST32 || PRI_MACROS_BROKEN +# undef PRIxFAST32 +# define PRIxFAST32 "x" +#endif +#if !defined PRIXFAST32 || PRI_MACROS_BROKEN +# undef PRIXFAST32 +# define PRIXFAST32 "X" +#endif +#if !defined PRIdFAST64 || PRI_MACROS_BROKEN +# undef PRIdFAST64 +# define PRIdFAST64 PRId64 +#endif +#if !defined PRIiFAST64 || PRI_MACROS_BROKEN +# undef PRIiFAST64 +# define PRIiFAST64 PRIi64 +#endif +#if !defined PRIoFAST64 || PRI_MACROS_BROKEN +# undef PRIoFAST64 +# define PRIoFAST64 PRIo64 +#endif +#if !defined PRIuFAST64 || PRI_MACROS_BROKEN +# undef PRIuFAST64 +# define PRIuFAST64 PRIu64 +#endif +#if !defined PRIxFAST64 || PRI_MACROS_BROKEN +# undef PRIxFAST64 +# define PRIxFAST64 PRIx64 +#endif +#if !defined PRIXFAST64 || PRI_MACROS_BROKEN +# undef PRIXFAST64 +# define PRIXFAST64 PRIX64 +#endif +#if !defined PRIdMAX || PRI_MACROS_BROKEN +# undef PRIdMAX +# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld") +#endif +#if !defined PRIiMAX || PRI_MACROS_BROKEN +# undef PRIiMAX +# define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli") +#endif +#if !defined PRIoMAX || PRI_MACROS_BROKEN +# undef PRIoMAX +# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo") +#endif +#if !defined PRIuMAX || PRI_MACROS_BROKEN +# undef PRIuMAX +# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu") +#endif +#if !defined PRIxMAX || PRI_MACROS_BROKEN +# undef PRIxMAX +# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx") +#endif +#if !defined PRIXMAX || PRI_MACROS_BROKEN +# undef PRIXMAX +# define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX") +#endif +#if !defined PRIdPTR || PRI_MACROS_BROKEN +# undef PRIdPTR +# define PRIdPTR \ + (sizeof (void *) == sizeof (long) ? "ld" : \ + sizeof (void *) == sizeof (int) ? "d" : \ + "lld") +#endif +#if !defined PRIiPTR || PRI_MACROS_BROKEN +# undef PRIiPTR +# define PRIiPTR \ + (sizeof (void *) == sizeof (long) ? "li" : \ + sizeof (void *) == sizeof (int) ? "i" : \ + "lli") +#endif +#if !defined PRIoPTR || PRI_MACROS_BROKEN +# undef PRIoPTR +# define PRIoPTR \ + (sizeof (void *) == sizeof (long) ? "lo" : \ + sizeof (void *) == sizeof (int) ? "o" : \ + "llo") +#endif +#if !defined PRIuPTR || PRI_MACROS_BROKEN +# undef PRIuPTR +# define PRIuPTR \ + (sizeof (void *) == sizeof (long) ? "lu" : \ + sizeof (void *) == sizeof (int) ? "u" : \ + "llu") +#endif +#if !defined PRIxPTR || PRI_MACROS_BROKEN +# undef PRIxPTR +# define PRIxPTR \ + (sizeof (void *) == sizeof (long) ? "lx" : \ + sizeof (void *) == sizeof (int) ? "x" : \ + "llx") +#endif +#if !defined PRIXPTR || PRI_MACROS_BROKEN +# undef PRIXPTR +# define PRIXPTR \ + (sizeof (void *) == sizeof (long) ? "lX" : \ + sizeof (void *) == sizeof (int) ? "X" : \ + "llX") +#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 + +/* 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 . */ +#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; + + +/* Expand a system dependent string segment. Return NULL if unsupported. */ +static const char * +get_sysdep_segment_value (const char *name) +{ + /* Test for an ISO C 99 section 7.8.1 format string directive. + Syntax: + P R I { d | i | o | u | x | X } + { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */ + /* We don't use a table of 14 times 6 'const char *' strings here, because + data relocations cost startup time. */ + if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I') + { + if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u' + || name[3] == 'x' || name[3] == 'X') + { + if (name[4] == '8' && name[5] == '\0') + { + if (name[3] == 'd') + return PRId8; + if (name[3] == 'i') + return PRIi8; + if (name[3] == 'o') + return PRIo8; + if (name[3] == 'u') + return PRIu8; + if (name[3] == 'x') + return PRIx8; + if (name[3] == 'X') + return PRIX8; + abort (); + } + if (name[4] == '1' && name[5] == '6' && name[6] == '\0') + { + if (name[3] == 'd') + return PRId16; + if (name[3] == 'i') + return PRIi16; + if (name[3] == 'o') + return PRIo16; + if (name[3] == 'u') + return PRIu16; + if (name[3] == 'x') + return PRIx16; + if (name[3] == 'X') + return PRIX16; + abort (); + } + if (name[4] == '3' && name[5] == '2' && name[6] == '\0') + { + if (name[3] == 'd') + return PRId32; + if (name[3] == 'i') + return PRIi32; + if (name[3] == 'o') + return PRIo32; + if (name[3] == 'u') + return PRIu32; + if (name[3] == 'x') + return PRIx32; + if (name[3] == 'X') + return PRIX32; + abort (); + } + if (name[4] == '6' && name[5] == '4' && name[6] == '\0') + { + if (name[3] == 'd') + return PRId64; + if (name[3] == 'i') + return PRIi64; + if (name[3] == 'o') + return PRIo64; + if (name[3] == 'u') + return PRIu64; + if (name[3] == 'x') + return PRIx64; + if (name[3] == 'X') + return PRIX64; + abort (); + } + if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A' + && name[7] == 'S' && name[8] == 'T') + { + if (name[9] == '8' && name[10] == '\0') + { + if (name[3] == 'd') + return PRIdLEAST8; + if (name[3] == 'i') + return PRIiLEAST8; + if (name[3] == 'o') + return PRIoLEAST8; + if (name[3] == 'u') + return PRIuLEAST8; + if (name[3] == 'x') + return PRIxLEAST8; + if (name[3] == 'X') + return PRIXLEAST8; + abort (); + } + if (name[9] == '1' && name[10] == '6' && name[11] == '\0') + { + if (name[3] == 'd') + return PRIdLEAST16; + if (name[3] == 'i') + return PRIiLEAST16; + if (name[3] == 'o') + return PRIoLEAST16; + if (name[3] == 'u') + return PRIuLEAST16; + if (name[3] == 'x') + return PRIxLEAST16; + if (name[3] == 'X') + return PRIXLEAST16; + abort (); + } + if (name[9] == '3' && name[10] == '2' && name[11] == '\0') + { + if (name[3] == 'd') + return PRIdLEAST32; + if (name[3] == 'i') + return PRIiLEAST32; + if (name[3] == 'o') + return PRIoLEAST32; + if (name[3] == 'u') + return PRIuLEAST32; + if (name[3] == 'x') + return PRIxLEAST32; + if (name[3] == 'X') + return PRIXLEAST32; + abort (); + } + if (name[9] == '6' && name[10] == '4' && name[11] == '\0') + { + if (name[3] == 'd') + return PRIdLEAST64; + if (name[3] == 'i') + return PRIiLEAST64; + if (name[3] == 'o') + return PRIoLEAST64; + if (name[3] == 'u') + return PRIuLEAST64; + if (name[3] == 'x') + return PRIxLEAST64; + if (name[3] == 'X') + return PRIXLEAST64; + abort (); + } + } + if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S' + && name[7] == 'T') + { + if (name[8] == '8' && name[9] == '\0') + { + if (name[3] == 'd') + return PRIdFAST8; + if (name[3] == 'i') + return PRIiFAST8; + if (name[3] == 'o') + return PRIoFAST8; + if (name[3] == 'u') + return PRIuFAST8; + if (name[3] == 'x') + return PRIxFAST8; + if (name[3] == 'X') + return PRIXFAST8; + abort (); + } + if (name[8] == '1' && name[9] == '6' && name[10] == '\0') + { + if (name[3] == 'd') + return PRIdFAST16; + if (name[3] == 'i') + return PRIiFAST16; + if (name[3] == 'o') + return PRIoFAST16; + if (name[3] == 'u') + return PRIuFAST16; + if (name[3] == 'x') + return PRIxFAST16; + if (name[3] == 'X') + return PRIXFAST16; + abort (); + } + if (name[8] == '3' && name[9] == '2' && name[10] == '\0') + { + if (name[3] == 'd') + return PRIdFAST32; + if (name[3] == 'i') + return PRIiFAST32; + if (name[3] == 'o') + return PRIoFAST32; + if (name[3] == 'u') + return PRIuFAST32; + if (name[3] == 'x') + return PRIxFAST32; + if (name[3] == 'X') + return PRIXFAST32; + abort (); + } + if (name[8] == '6' && name[9] == '4' && name[10] == '\0') + { + if (name[3] == 'd') + return PRIdFAST64; + if (name[3] == 'i') + return PRIiFAST64; + if (name[3] == 'o') + return PRIoFAST64; + if (name[3] == 'u') + return PRIuFAST64; + if (name[3] == 'x') + return PRIxFAST64; + if (name[3] == 'X') + return PRIXFAST64; + abort (); + } + } + if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X' + && name[7] == '\0') + { + if (name[3] == 'd') + return PRIdMAX; + if (name[3] == 'i') + return PRIiMAX; + if (name[3] == 'o') + return PRIoMAX; + if (name[3] == 'u') + return PRIuMAX; + if (name[3] == 'x') + return PRIxMAX; + if (name[3] == 'X') + return PRIXMAX; + abort (); + } + if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R' + && name[7] == '\0') + { + if (name[3] == 'd') + return PRIdPTR; + if (name[3] == 'i') + return PRIiPTR; + if (name[3] == 'o') + return PRIoPTR; + if (name[3] == 'u') + return PRIuPTR; + if (name[3] == 'x') + return PRIxPTR; + if (name[3] == 'X') + return PRIXPTR; + abort (); + } + } + } + /* Test for a glibc specific printf() format directive flag. */ + if (name[0] == 'I' && name[1] == '\0') + { +#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) + /* The 'I' flag, in numeric format directives, replaces ASCII digits + with the 'outdigits' defined in the LC_CTYPE locale facet. This is + used for Farsi (Persian) and maybe Arabic. */ + return "I"; +#else + return ""; +#endif + } + /* Other system dependent strings are not valid. */ + return NULL; +} + +/* Initialize the codeset dependent parts of an opened message catalog. + Return the header entry. */ +const char * +internal_function +_nl_init_domain_conv (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, CODESET); +# 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 libc >= 2.2 or GNU libiconv >= 1.5, + we want to use transliteration. */ +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ + || _LIBICONV_VERSION >= 0x0105 + if (strchr (outcharset, '/') == NULL) + { + char *tmp; + + len = strlen (outcharset); + tmp = (char *) alloca (len + 10 + 1); + memcpy (tmp, outcharset, len); + memcpy (tmp + len, "//TRANSLIT", 10 + 1); + outcharset = tmp; + + domain->conv = iconv_open (outcharset, charset); + + freea (outcharset); + } + else +# endif + domain->conv = iconv_open (outcharset, charset); +# 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 (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 (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; + int revision; + 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; + domain->malloced = NULL; + + /* Fill in the information about the available tables. */ + revision = W (domain->must_swap, data->revision); + /* We support only the major revisions 0 and 1. */ + switch (revision >> 16) + { + case 0: + case 1: + domain->nstrings = W (domain->must_swap, data->nstrings); + domain->orig_tab = (const struct string_desc *) + ((char *) data + W (domain->must_swap, data->orig_tab_offset)); + domain->trans_tab = (const 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 = + (domain->hash_size > 2 + ? (const nls_uint32 *) + ((char *) data + W (domain->must_swap, data->hash_tab_offset)) + : NULL); + domain->must_swap_hash_tab = domain->must_swap; + + /* Now dispatch on the minor revision. */ + switch (revision & 0xffff) + { + case 0: + domain->n_sysdep_strings = 0; + domain->orig_sysdep_tab = NULL; + domain->trans_sysdep_tab = NULL; + break; + case 1: + default: + { + nls_uint32 n_sysdep_strings; + + if (domain->hash_tab == NULL) + /* This is invalid. These minor revisions need a hash table. */ + goto invalid; + + n_sysdep_strings = + W (domain->must_swap, data->n_sysdep_strings); + if (n_sysdep_strings > 0) + { + nls_uint32 n_sysdep_segments; + const struct sysdep_segment *sysdep_segments; + const char **sysdep_segment_values; + const nls_uint32 *orig_sysdep_tab; + const nls_uint32 *trans_sysdep_tab; + nls_uint32 n_inmem_sysdep_strings; + size_t memneed; + char *mem; + struct sysdep_string_desc *inmem_orig_sysdep_tab; + struct sysdep_string_desc *inmem_trans_sysdep_tab; + nls_uint32 *inmem_hash_tab; + unsigned int i, j; + + /* Get the values of the system dependent segments. */ + n_sysdep_segments = + W (domain->must_swap, data->n_sysdep_segments); + sysdep_segments = (const struct sysdep_segment *) + ((char *) data + + W (domain->must_swap, data->sysdep_segments_offset)); + sysdep_segment_values = + alloca (n_sysdep_segments * sizeof (const char *)); + for (i = 0; i < n_sysdep_segments; i++) + { + const char *name = + (char *) data + + W (domain->must_swap, sysdep_segments[i].offset); + nls_uint32 namelen = + W (domain->must_swap, sysdep_segments[i].length); + + if (!(namelen > 0 && name[namelen - 1] == '\0')) + { + freea (sysdep_segment_values); + goto invalid; + } + + sysdep_segment_values[i] = get_sysdep_segment_value (name); + } + + orig_sysdep_tab = (const nls_uint32 *) + ((char *) data + + W (domain->must_swap, data->orig_sysdep_tab_offset)); + trans_sysdep_tab = (const nls_uint32 *) + ((char *) data + + W (domain->must_swap, data->trans_sysdep_tab_offset)); + + /* Compute the amount of additional memory needed for the + system dependent strings and the augmented hash table. + At the same time, also drop string pairs which refer to + an undefined system dependent segment. */ + n_inmem_sysdep_strings = 0; + memneed = domain->hash_size * sizeof (nls_uint32); + for (i = 0; i < n_sysdep_strings; i++) + { + int valid = 1; + size_t needs[2]; + + for (j = 0; j < 2; j++) + { + const struct sysdep_string *sysdep_string = + (const struct sysdep_string *) + ((char *) data + + W (domain->must_swap, + j == 0 + ? orig_sysdep_tab[i] + : trans_sysdep_tab[i])); + size_t need = 0; + const struct segment_pair *p = sysdep_string->segments; + + if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) + for (p = sysdep_string->segments;; p++) + { + nls_uint32 sysdepref; + + need += W (domain->must_swap, p->segsize); + + sysdepref = W (domain->must_swap, p->sysdepref); + if (sysdepref == SEGMENTS_END) + break; + + if (sysdepref >= n_sysdep_segments) + { + /* Invalid. */ + freea (sysdep_segment_values); + goto invalid; + } + + if (sysdep_segment_values[sysdepref] == NULL) + { + /* This particular string pair is invalid. */ + valid = 0; + break; + } + + need += strlen (sysdep_segment_values[sysdepref]); + } + + needs[j] = need; + if (!valid) + break; + } + + if (valid) + { + n_inmem_sysdep_strings++; + memneed += needs[0] + needs[1]; + } + } + memneed += 2 * n_inmem_sysdep_strings + * sizeof (struct sysdep_string_desc); + + if (n_inmem_sysdep_strings > 0) + { + unsigned int k; + + /* Allocate additional memory. */ + mem = (char *) malloc (memneed); + if (mem == NULL) + goto invalid; + + domain->malloced = mem; + inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem; + mem += n_inmem_sysdep_strings + * sizeof (struct sysdep_string_desc); + inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem; + mem += n_inmem_sysdep_strings + * sizeof (struct sysdep_string_desc); + inmem_hash_tab = (nls_uint32 *) mem; + mem += domain->hash_size * sizeof (nls_uint32); + + /* Compute the system dependent strings. */ + k = 0; + for (i = 0; i < n_sysdep_strings; i++) + { + int valid = 1; + + for (j = 0; j < 2; j++) + { + const struct sysdep_string *sysdep_string = + (const struct sysdep_string *) + ((char *) data + + W (domain->must_swap, + j == 0 + ? orig_sysdep_tab[i] + : trans_sysdep_tab[i])); + const struct segment_pair *p = + sysdep_string->segments; + + if (W (domain->must_swap, p->sysdepref) + != SEGMENTS_END) + for (p = sysdep_string->segments;; p++) + { + nls_uint32 sysdepref; + + sysdepref = + W (domain->must_swap, p->sysdepref); + if (sysdepref == SEGMENTS_END) + break; + + if (sysdep_segment_values[sysdepref] == NULL) + { + /* This particular string pair is + invalid. */ + valid = 0; + break; + } + } + + if (!valid) + break; + } + + if (valid) + { + for (j = 0; j < 2; j++) + { + const struct sysdep_string *sysdep_string = + (const struct sysdep_string *) + ((char *) data + + W (domain->must_swap, + j == 0 + ? orig_sysdep_tab[i] + : trans_sysdep_tab[i])); + const char *static_segments = + (char *) data + + W (domain->must_swap, sysdep_string->offset); + const struct segment_pair *p = + sysdep_string->segments; + + /* Concatenate the segments, and fill + inmem_orig_sysdep_tab[k] (for j == 0) and + inmem_trans_sysdep_tab[k] (for j == 1). */ + + struct sysdep_string_desc *inmem_tab_entry = + (j == 0 + ? inmem_orig_sysdep_tab + : inmem_trans_sysdep_tab) + + k; + + if (W (domain->must_swap, p->sysdepref) + == SEGMENTS_END) + { + /* Only one static segment. */ + inmem_tab_entry->length = + W (domain->must_swap, p->segsize); + inmem_tab_entry->pointer = static_segments; + } + else + { + inmem_tab_entry->pointer = mem; + + for (p = sysdep_string->segments;; p++) + { + nls_uint32 segsize = + W (domain->must_swap, p->segsize); + nls_uint32 sysdepref = + W (domain->must_swap, p->sysdepref); + size_t n; + + if (segsize > 0) + { + memcpy (mem, static_segments, segsize); + mem += segsize; + static_segments += segsize; + } + + if (sysdepref == SEGMENTS_END) + break; + + n = strlen (sysdep_segment_values[sysdepref]); + memcpy (mem, sysdep_segment_values[sysdepref], n); + mem += n; + } + + inmem_tab_entry->length = + mem - inmem_tab_entry->pointer; + } + } + + k++; + } + } + if (k != n_inmem_sysdep_strings) + abort (); + + /* Compute the augmented hash table. */ + for (i = 0; i < domain->hash_size; i++) + inmem_hash_tab[i] = + W (domain->must_swap_hash_tab, domain->hash_tab[i]); + for (i = 0; i < n_inmem_sysdep_strings; i++) + { + const char *msgid = inmem_orig_sysdep_tab[i].pointer; + nls_uint32 hash_val = hash_string (msgid); + nls_uint32 idx = hash_val % domain->hash_size; + nls_uint32 incr = + 1 + (hash_val % (domain->hash_size - 2)); + + for (;;) + { + if (inmem_hash_tab[idx] == 0) + { + /* Hash table entry is empty. Use it. */ + inmem_hash_tab[idx] = 1 + domain->nstrings + i; + break; + } + + if (idx >= domain->hash_size - incr) + idx -= domain->hash_size - incr; + else + idx += incr; + } + } + + domain->n_sysdep_strings = n_inmem_sysdep_strings; + domain->orig_sysdep_tab = inmem_orig_sysdep_tab; + domain->trans_sysdep_tab = inmem_trans_sysdep_tab; + + domain->hash_tab = inmem_hash_tab; + domain->must_swap_hash_tab = 0; + } + else + { + domain->n_sysdep_strings = 0; + domain->orig_sysdep_tab = NULL; + domain->trans_sysdep_tab = NULL; + } + + freea (sysdep_segment_values); + } + else + { + domain->n_sysdep_strings = 0; + domain->orig_sysdep_tab = NULL; + domain->trans_sysdep_tab = NULL; + } + } + break; + } + break; + default: + /* This is an invalid revision. */ + invalid: + /* This is an invalid .mo file. */ + if (domain->malloced) + free (domain->malloced); +#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. */ + EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); +} + + +#ifdef _LIBC +void +internal_function +_nl_unload_domain (struct loaded_domain *domain) +{ + if (domain->plural != &__gettext_germanic_plural) + __gettext_free_exp (domain->plural); + + _nl_free_domain_conv (domain); + + if (domain->malloced) + free (domain->malloced); + +# 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 diff --git a/intl/localcharset.c b/intl/localcharset.c new file mode 100755 index 0000000..4865f10 --- /dev/null +++ b/intl/localcharset.c @@ -0,0 +1,398 @@ +/* Determine a canonical name for the current locale's character encoding. + + Copyright (C) 2000-2003 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 . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* Specification. */ +#include "localcharset.h" + +#if HAVE_STDDEF_H +# include +#endif + +#include +#if HAVE_STRING_H +# include +#else +# include +#endif +#if HAVE_STDLIB_H +# include +#endif + +#if defined _WIN32 || defined __WIN32__ +# undef WIN32 /* avoid warning on mingw32 */ +# define WIN32 +#endif + +#if defined __EMX__ +/* Assume EMX program runs on OS/2, even if compiled under DOS. */ +# define OS2 +#endif + +#if !defined WIN32 +# if HAVE_LANGINFO_CODESET +# include +# else +# if HAVE_SETLOCALE +# include +# endif +# endif +#elif defined WIN32 +# define WIN32_LEAN_AND_MEAN +# include +#endif +#if defined OS2 +# define INCL_DOS +# include +#endif + +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +#endif + +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#endif + +#ifndef DIRECTORY_SEPARATOR +# define DIRECTORY_SEPARATOR '/' +#endif + +#ifndef ISSLASH +# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) +#endif + +#if HAVE_DECL_GETC_UNLOCKED +# undef getc +# define getc getc_unlocked +#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) + { +#if !(defined VMS || defined WIN32) + FILE *fp; + const char *dir = relocate (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 = (char *) malloc (res_size + 1); + } + else + { + res_size += l1 + 1 + l2 + 1; + res_ptr = (char *) 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 + +# if defined VMS + /* To avoid the troubles of an extra file charset.alias_vms in the + sources of many GNU packages, simply inline the aliases here. */ + /* The list of encodings is taken from the OpenVMS 7.3-1 documentation + "Compaq C Run-Time Library Reference Manual for OpenVMS systems" + section 10.7 "Handling Different Character Sets". */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-8" "\0" "ISO-8859-8" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + /* Japanese */ + "eucJP" "\0" "EUC-JP" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "DECKANJI" "\0" "DEC-KANJI" "\0" + "SDECKANJI" "\0" "EUC-JP" "\0" + /* Chinese */ + "eucTW" "\0" "EUC-TW" "\0" + "DECHANYU" "\0" "DEC-HANYU" "\0" + "DECHANZI" "\0" "GB2312" "\0" + /* Korean */ + "DECKOREAN" "\0" "EUC-KR" "\0"; +# endif + +# if defined 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" + "CP20127" "\0" "ASCII" "\0" + "CP20866" "\0" "KOI8-R" "\0" + "CP21866" "\0" "KOI8-RU" "\0" + "CP28591" "\0" "ISO-8859-1" "\0" + "CP28592" "\0" "ISO-8859-2" "\0" + "CP28593" "\0" "ISO-8859-3" "\0" + "CP28594" "\0" "ISO-8859-4" "\0" + "CP28595" "\0" "ISO-8859-5" "\0" + "CP28596" "\0" "ISO-8859-6" "\0" + "CP28597" "\0" "ISO-8859-7" "\0" + "CP28598" "\0" "ISO-8859-8" "\0" + "CP28599" "\0" "ISO-8859-9" "\0" + "CP28605" "\0" "ISO-8859-15" "\0"; +# endif +#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; + +#if !(defined WIN32 || defined OS2) + +# 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 + +#elif defined WIN32 + + static char buf[2 + 10 + 1]; + + /* Woe32 has a function returning the locale's codepage as a number. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; + +#elif defined OS2 + + const char *locale; + static char buf[2 + 10 + 1]; + ULONG cp[3]; + ULONG cplen; + + /* Allow user to override the codeset, as set in the operating system, + with standard language environment variables. */ + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + if (locale != NULL && locale[0] != '\0') + { + /* If the locale name contains an encoding after the dot, return it. */ + const char *dot = strchr (locale, '.'); + + if (dot != NULL) + { + const char *modifier; + + dot++; + /* Look for the possible @... trailer and remove it, if any. */ + modifier = strchr (dot, '@'); + if (modifier == NULL) + return dot; + if (modifier - dot < sizeof (buf)) + { + memcpy (buf, dot, modifier - dot); + buf [modifier - dot] = '\0'; + return buf; + } + } + + /* Resolve through the charset.alias file. */ + codeset = locale; + } + else + { + /* OS/2 has a function returning the locale's codepage as a number. */ + if (DosQueryCp (sizeof (cp), cp, &cplen)) + codeset = ""; + else + { + sprintf (buf, "CP%u", cp[0]); + 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; + } + + /* Don't return an empty string. GNU libc and GNU libiconv interpret + the empty string as denoting "the locale's character encoding", + thus GNU libiconv would call this function a second time. */ + if (codeset[0] == '\0') + codeset = "ASCII"; + + return codeset; +} diff --git a/intl/localcharset.h b/intl/localcharset.h new file mode 100755 index 0000000..3b137e7 --- /dev/null +++ b/intl/localcharset.h @@ -0,0 +1,42 @@ +/* Determine a canonical name for the current locale's character encoding. + Copyright (C) 2000-2003 Free Software Foundation, Inc. + This file is part of the GNU CHARSET Library. + + 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 _LOCALCHARSET_H +#define _LOCALCHARSET_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* 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. */ +extern const char * locale_charset (void); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LOCALCHARSET_H */ diff --git a/intl/locale.alias b/intl/locale.alias new file mode 100755 index 0000000..bd6bb25 --- /dev/null +++ b/intl/locale.alias @@ -0,0 +1,78 @@ +# Locale name alias data base. +# Copyright (C) 1996-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 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 +# bugs@gnu.org. + +# Packages using this file: + +bokmal nb_NO.ISO-8859-1 +bokmål nb_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 +no_NO nb_NO.ISO-8859-1 +no_NO.ISO-8859-1 nb_NO.ISO-8859-1 +norwegian nb_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 diff --git a/intl/localealias.c b/intl/localealias.c new file mode 100755 index 0000000..2eaf881 --- /dev/null +++ b/intl/localealias.c @@ -0,0 +1,414 @@ +/* Handle aliases for locale names. + Copyright (C) 1995-1999, 2000-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 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 to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#if defined _LIBC || defined HAVE___FSETLOCKING +# include +#endif +#include + +#ifdef __GNUC__ +# undef alloca +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#include +#include + +#include "gettextP.h" + +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +#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. */ +# define strcasecmp __strcasecmp + +# ifndef mempcpy +# define mempcpy __mempcpy +# endif +# define HAVE_MEMPCPY 1 +# define HAVE___FSETLOCKING 1 + +/* We need locking here since we can be called from different places. */ +# include + +__libc_lock_define_initialized (static, lock); +#endif + +#ifndef internal_function +# define internal_function +#endif + +/* Some optimizations for glibc. */ +#ifdef _LIBC +# define FEOF(fp) feof_unlocked (fp) +# define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp) +#else +# define FEOF(fp) feof (fp) +# define FGETS(buf, n, fp) fgets (buf, n, fp) +#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 + +#if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED +# undef fgets +# define fgets(buf, len, s) fgets_unlocked (buf, len, s) +#endif +#if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED +# undef feof +# define feof(s) feof_unlocked (s) +#endif + + +struct alias_map +{ + const char *alias; + const char *value; +}; + + +#ifndef _LIBC +# define libc_freeres_ptr(decl) decl +#endif + +libc_freeres_ptr (static char *string_space); +static size_t string_space_act; +static size_t string_space_max; +libc_freeres_ptr (static struct alias_map *map); +static size_t nmap; +static size_t maxmap; + + +/* Prototypes for local functions. */ +static size_t read_alias_file (const char *fname, int fname_len) + internal_function; +static int extend_alias_table (void); +static int alias_compare (const struct alias_map *map1, + const struct alias_map *map2); + + +const char * +_nl_expand_alias (const char *name) +{ + static const char *locale_alias_path; + struct alias_map *retval; + const char *result = NULL; + size_t added; + +#ifdef _LIBC + __libc_lock_lock (lock); +#endif + + if (locale_alias_path == NULL) + locale_alias_path = LOCALE_ALIAS_PATH; + + do + { + struct alias_map item; + + item.alias = name; + + if (nmap > 0) + retval = (struct alias_map *) bsearch (&item, map, nmap, + sizeof (struct alias_map), + (int (*) (const void *, + const void *) + ) alias_compare); + else + retval = NULL; + + /* We really found an alias. Return the value. */ + if (retval != NULL) + { + result = retval->value; + break; + } + + /* Perhaps we can find another alias file. */ + added = 0; + while (added == 0 && locale_alias_path[0] != '\0') + { + const char *start; + + while (locale_alias_path[0] == PATH_SEPARATOR) + ++locale_alias_path; + start = locale_alias_path; + + while (locale_alias_path[0] != '\0' + && locale_alias_path[0] != PATH_SEPARATOR) + ++locale_alias_path; + + if (start < locale_alias_path) + added = read_alias_file (start, locale_alias_path - start); + } + } + while (added != 0); + +#ifdef _LIBC + __libc_lock_unlock (lock); +#endif + + return result; +} + + +static size_t +internal_function +read_alias_file (const char *fname, int fname_len) +{ + FILE *fp; + char *full_fname; + size_t added; + static const char aliasfile[] = "/locale.alias"; + + full_fname = (char *) alloca (fname_len + sizeof aliasfile); +#ifdef HAVE_MEMPCPY + mempcpy (mempcpy (full_fname, fname, fname_len), + aliasfile, sizeof aliasfile); +#else + memcpy (full_fname, fname, fname_len); + memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); +#endif + + fp = fopen (relocate (full_fname), "r"); + freea (full_fname); + if (fp == NULL) + return 0; + +#ifdef HAVE___FSETLOCKING + /* No threads present. */ + __fsetlocking (fp, FSETLOCKING_BYCALLER); +#endif + + added = 0; + while (!FEOF (fp)) + { + /* It is a reasonable approach to use a fix buffer here because + a) we are only interested in the first two fields + b) these fields must be usable as file names and so must not + be that long + We avoid a multi-kilobyte buffer here since this would use up + stack space which we might not have if the program ran out of + memory. */ + char buf[400]; + char *alias; + char *value; + char *cp; + + if (FGETS (buf, sizeof buf, fp) == NULL) + /* EOF reached. */ + break; + + cp = buf; + /* Ignore leading white space. */ + while (isspace ((unsigned char) cp[0])) + ++cp; + + /* A leading '#' signals a comment line. */ + if (cp[0] != '\0' && cp[0] != '#') + { + alias = cp++; + while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) + ++cp; + /* Terminate alias name. */ + if (cp[0] != '\0') + *cp++ = '\0'; + + /* Now look for the beginning of the value. */ + while (isspace ((unsigned char) cp[0])) + ++cp; + + if (cp[0] != '\0') + { + size_t alias_len; + size_t value_len; + + value = cp++; + while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) + ++cp; + /* Terminate value. */ + if (cp[0] == '\n') + { + /* This has to be done to make the following test + for the end of line possible. We are looking for + the terminating '\n' which do not overwrite here. */ + *cp++ = '\0'; + *cp = '\n'; + } + else if (cp[0] != '\0') + *cp++ = '\0'; + + if (nmap >= maxmap) + if (__builtin_expect (extend_alias_table (), 0)) + return added; + + alias_len = strlen (alias) + 1; + value_len = strlen (value) + 1; + + if (string_space_act + alias_len + value_len > string_space_max) + { + /* Increase size of memory pool. */ + size_t new_size = (string_space_max + + (alias_len + value_len > 1024 + ? alias_len + value_len : 1024)); + char *new_pool = (char *) realloc (string_space, new_size); + if (new_pool == NULL) + return added; + + if (__builtin_expect (string_space != new_pool, 0)) + { + size_t i; + + for (i = 0; i < nmap; i++) + { + map[i].alias += new_pool - string_space; + map[i].value += new_pool - string_space; + } + } + + string_space = new_pool; + string_space_max = new_size; + } + + map[nmap].alias = memcpy (&string_space[string_space_act], + alias, alias_len); + string_space_act += alias_len; + + map[nmap].value = memcpy (&string_space[string_space_act], + value, value_len); + string_space_act += value_len; + + ++nmap; + ++added; + } + } + + /* Possibly not the whole line fits into the buffer. Ignore + the rest of the line. */ + while (strchr (buf, '\n') == NULL) + if (FGETS (buf, sizeof buf, fp) == NULL) + /* Make sure the inner loop will be left. The outer loop + will exit at the `feof' test. */ + break; + } + + /* Should we test for ferror()? I think we have to silently ignore + errors. --drepper */ + fclose (fp); + + if (added > 0) + qsort (map, nmap, sizeof (struct alias_map), + (int (*) (const void *, const void *)) alias_compare); + + return added; +} + + +static int +extend_alias_table () +{ + size_t new_size; + struct alias_map *new_map; + + new_size = maxmap == 0 ? 100 : 2 * maxmap; + new_map = (struct alias_map *) realloc (map, (new_size + * sizeof (struct alias_map))); + if (new_map == NULL) + /* Simply don't extend: we don't have any more core. */ + return -1; + + map = new_map; + maxmap = new_size; + return 0; +} + + +static int +alias_compare (const struct alias_map *map1, const struct alias_map *map2) +{ +#if defined _LIBC || defined HAVE_STRCASECMP + return strcasecmp (map1->alias, map2->alias); +#else + const unsigned char *p1 = (const unsigned char *) map1->alias; + const unsigned char *p2 = (const unsigned char *) map2->alias; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + /* I know this seems to be odd but the tolower() function in + some systems libc cannot handle nonalpha characters. */ + c1 = isupper (*p1) ? tolower (*p1) : *p1; + c2 = isupper (*p2) ? tolower (*p2) : *p2; + if (c1 == '\0') + break; + ++p1; + ++p2; + } + while (c1 == c2); + + return c1 - c2; +#endif +} diff --git a/intl/localename.c b/intl/localename.c new file mode 100755 index 0000000..5662e54 --- /dev/null +++ b/intl/localename.c @@ -0,0 +1,1142 @@ +/* Determine the current selected locale. + Copyright (C) 1995-1999, 2000-2004 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 Ulrich Drepper , 1995. */ +/* Win32 code written by Tor Lillqvist . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#if defined _WIN32 || defined __WIN32__ +# undef WIN32 /* avoid warning on mingw32 */ +# define WIN32 +#endif + +#ifdef WIN32 +# define WIN32_LEAN_AND_MEAN +# include +/* List of language codes, sorted by value: + 0x01 LANG_ARABIC + 0x02 LANG_BULGARIAN + 0x03 LANG_CATALAN + 0x04 LANG_CHINESE + 0x05 LANG_CZECH + 0x06 LANG_DANISH + 0x07 LANG_GERMAN + 0x08 LANG_GREEK + 0x09 LANG_ENGLISH + 0x0a LANG_SPANISH + 0x0b LANG_FINNISH + 0x0c LANG_FRENCH + 0x0d LANG_HEBREW + 0x0e LANG_HUNGARIAN + 0x0f LANG_ICELANDIC + 0x10 LANG_ITALIAN + 0x11 LANG_JAPANESE + 0x12 LANG_KOREAN + 0x13 LANG_DUTCH + 0x14 LANG_NORWEGIAN + 0x15 LANG_POLISH + 0x16 LANG_PORTUGUESE + 0x17 LANG_RHAETO_ROMANCE + 0x18 LANG_ROMANIAN + 0x19 LANG_RUSSIAN + 0x1a LANG_CROATIAN == LANG_SERBIAN + 0x1b LANG_SLOVAK + 0x1c LANG_ALBANIAN + 0x1d LANG_SWEDISH + 0x1e LANG_THAI + 0x1f LANG_TURKISH + 0x20 LANG_URDU + 0x21 LANG_INDONESIAN + 0x22 LANG_UKRAINIAN + 0x23 LANG_BELARUSIAN + 0x24 LANG_SLOVENIAN + 0x25 LANG_ESTONIAN + 0x26 LANG_LATVIAN + 0x27 LANG_LITHUANIAN + 0x28 LANG_TAJIK + 0x29 LANG_FARSI + 0x2a LANG_VIETNAMESE + 0x2b LANG_ARMENIAN + 0x2c LANG_AZERI + 0x2d LANG_BASQUE + 0x2e LANG_SORBIAN + 0x2f LANG_MACEDONIAN + 0x30 LANG_SUTU + 0x31 LANG_TSONGA + 0x32 LANG_TSWANA + 0x33 LANG_VENDA + 0x34 LANG_XHOSA + 0x35 LANG_ZULU + 0x36 LANG_AFRIKAANS + 0x37 LANG_GEORGIAN + 0x38 LANG_FAEROESE + 0x39 LANG_HINDI + 0x3a LANG_MALTESE + 0x3b LANG_SAAMI + 0x3c LANG_GAELIC + 0x3d LANG_YIDDISH + 0x3e LANG_MALAY + 0x3f LANG_KAZAK + 0x40 LANG_KYRGYZ + 0x41 LANG_SWAHILI + 0x42 LANG_TURKMEN + 0x43 LANG_UZBEK + 0x44 LANG_TATAR + 0x45 LANG_BENGALI + 0x46 LANG_PUNJABI + 0x47 LANG_GUJARATI + 0x48 LANG_ORIYA + 0x49 LANG_TAMIL + 0x4a LANG_TELUGU + 0x4b LANG_KANNADA + 0x4c LANG_MALAYALAM + 0x4d LANG_ASSAMESE + 0x4e LANG_MARATHI + 0x4f LANG_SANSKRIT + 0x50 LANG_MONGOLIAN + 0x51 LANG_TIBETAN + 0x52 LANG_WELSH + 0x53 LANG_CAMBODIAN + 0x54 LANG_LAO + 0x55 LANG_BURMESE + 0x56 LANG_GALICIAN + 0x57 LANG_KONKANI + 0x58 LANG_MANIPURI + 0x59 LANG_SINDHI + 0x5a LANG_SYRIAC + 0x5b LANG_SINHALESE + 0x5c LANG_CHEROKEE + 0x5d LANG_INUKTITUT + 0x5e LANG_AMHARIC + 0x5f LANG_TAMAZIGHT + 0x60 LANG_KASHMIRI + 0x61 LANG_NEPALI + 0x62 LANG_FRISIAN + 0x63 LANG_PASHTO + 0x64 LANG_TAGALOG + 0x65 LANG_DIVEHI + 0x66 LANG_EDO + 0x67 LANG_FULFULDE + 0x68 LANG_HAUSA + 0x69 LANG_IBIBIO + 0x6a LANG_YORUBA + 0x70 LANG_IGBO + 0x71 LANG_KANURI + 0x72 LANG_OROMO + 0x73 LANG_TIGRINYA + 0x74 LANG_GUARANI + 0x75 LANG_HAWAIIAN + 0x76 LANG_LATIN + 0x77 LANG_SOMALI + 0x78 LANG_YI + 0x79 LANG_PAPIAMENTU +*/ +/* Mingw headers don't have latest language and sublanguage codes. */ +# ifndef LANG_AFRIKAANS +# define LANG_AFRIKAANS 0x36 +# endif +# ifndef LANG_ALBANIAN +# define LANG_ALBANIAN 0x1c +# endif +# ifndef LANG_AMHARIC +# define LANG_AMHARIC 0x5e +# endif +# ifndef LANG_ARABIC +# define LANG_ARABIC 0x01 +# endif +# ifndef LANG_ARMENIAN +# define LANG_ARMENIAN 0x2b +# endif +# ifndef LANG_ASSAMESE +# define LANG_ASSAMESE 0x4d +# endif +# ifndef LANG_AZERI +# define LANG_AZERI 0x2c +# endif +# ifndef LANG_BASQUE +# define LANG_BASQUE 0x2d +# endif +# ifndef LANG_BELARUSIAN +# define LANG_BELARUSIAN 0x23 +# endif +# ifndef LANG_BENGALI +# define LANG_BENGALI 0x45 +# endif +# ifndef LANG_BURMESE +# define LANG_BURMESE 0x55 +# endif +# ifndef LANG_CAMBODIAN +# define LANG_CAMBODIAN 0x53 +# endif +# ifndef LANG_CATALAN +# define LANG_CATALAN 0x03 +# endif +# ifndef LANG_CHEROKEE +# define LANG_CHEROKEE 0x5c +# endif +# ifndef LANG_DIVEHI +# define LANG_DIVEHI 0x65 +# endif +# ifndef LANG_EDO +# define LANG_EDO 0x66 +# endif +# ifndef LANG_ESTONIAN +# define LANG_ESTONIAN 0x25 +# endif +# ifndef LANG_FAEROESE +# define LANG_FAEROESE 0x38 +# endif +# ifndef LANG_FARSI +# define LANG_FARSI 0x29 +# endif +# ifndef LANG_FRISIAN +# define LANG_FRISIAN 0x62 +# endif +# ifndef LANG_FULFULDE +# define LANG_FULFULDE 0x67 +# endif +# ifndef LANG_GAELIC +# define LANG_GAELIC 0x3c +# endif +# ifndef LANG_GALICIAN +# define LANG_GALICIAN 0x56 +# endif +# ifndef LANG_GEORGIAN +# define LANG_GEORGIAN 0x37 +# endif +# ifndef LANG_GUARANI +# define LANG_GUARANI 0x74 +# endif +# ifndef LANG_GUJARATI +# define LANG_GUJARATI 0x47 +# endif +# ifndef LANG_HAUSA +# define LANG_HAUSA 0x68 +# endif +# ifndef LANG_HAWAIIAN +# define LANG_HAWAIIAN 0x75 +# endif +# ifndef LANG_HEBREW +# define LANG_HEBREW 0x0d +# endif +# ifndef LANG_HINDI +# define LANG_HINDI 0x39 +# endif +# ifndef LANG_IBIBIO +# define LANG_IBIBIO 0x69 +# endif +# ifndef LANG_IGBO +# define LANG_IGBO 0x70 +# endif +# ifndef LANG_INDONESIAN +# define LANG_INDONESIAN 0x21 +# endif +# ifndef LANG_INUKTITUT +# define LANG_INUKTITUT 0x5d +# endif +# ifndef LANG_KANNADA +# define LANG_KANNADA 0x4b +# endif +# ifndef LANG_KANURI +# define LANG_KANURI 0x71 +# endif +# ifndef LANG_KASHMIRI +# define LANG_KASHMIRI 0x60 +# endif +# ifndef LANG_KAZAK +# define LANG_KAZAK 0x3f +# endif +# ifndef LANG_KONKANI +# define LANG_KONKANI 0x57 +# endif +# ifndef LANG_KYRGYZ +# define LANG_KYRGYZ 0x40 +# endif +# ifndef LANG_LAO +# define LANG_LAO 0x54 +# endif +# ifndef LANG_LATIN +# define LANG_LATIN 0x76 +# endif +# ifndef LANG_LATVIAN +# define LANG_LATVIAN 0x26 +# endif +# ifndef LANG_LITHUANIAN +# define LANG_LITHUANIAN 0x27 +# endif +# ifndef LANG_MACEDONIAN +# define LANG_MACEDONIAN 0x2f +# endif +# ifndef LANG_MALAY +# define LANG_MALAY 0x3e +# endif +# ifndef LANG_MALAYALAM +# define LANG_MALAYALAM 0x4c +# endif +# ifndef LANG_MALTESE +# define LANG_MALTESE 0x3a +# endif +# ifndef LANG_MANIPURI +# define LANG_MANIPURI 0x58 +# endif +# ifndef LANG_MARATHI +# define LANG_MARATHI 0x4e +# endif +# ifndef LANG_MONGOLIAN +# define LANG_MONGOLIAN 0x50 +# endif +# ifndef LANG_NEPALI +# define LANG_NEPALI 0x61 +# endif +# ifndef LANG_ORIYA +# define LANG_ORIYA 0x48 +# endif +# ifndef LANG_OROMO +# define LANG_OROMO 0x72 +# endif +# ifndef LANG_PAPIAMENTU +# define LANG_PAPIAMENTU 0x79 +# endif +# ifndef LANG_PASHTO +# define LANG_PASHTO 0x63 +# endif +# ifndef LANG_PUNJABI +# define LANG_PUNJABI 0x46 +# endif +# ifndef LANG_RHAETO_ROMANCE +# define LANG_RHAETO_ROMANCE 0x17 +# endif +# ifndef LANG_SAAMI +# define LANG_SAAMI 0x3b +# endif +# ifndef LANG_SANSKRIT +# define LANG_SANSKRIT 0x4f +# endif +# ifndef LANG_SERBIAN +# define LANG_SERBIAN 0x1a +# endif +# ifndef LANG_SINDHI +# define LANG_SINDHI 0x59 +# endif +# ifndef LANG_SINHALESE +# define LANG_SINHALESE 0x5b +# endif +# ifndef LANG_SLOVAK +# define LANG_SLOVAK 0x1b +# endif +# ifndef LANG_SOMALI +# define LANG_SOMALI 0x77 +# endif +# ifndef LANG_SORBIAN +# define LANG_SORBIAN 0x2e +# endif +# ifndef LANG_SUTU +# define LANG_SUTU 0x30 +# endif +# ifndef LANG_SWAHILI +# define LANG_SWAHILI 0x41 +# endif +# ifndef LANG_SYRIAC +# define LANG_SYRIAC 0x5a +# endif +# ifndef LANG_TAGALOG +# define LANG_TAGALOG 0x64 +# endif +# ifndef LANG_TAJIK +# define LANG_TAJIK 0x28 +# endif +# ifndef LANG_TAMAZIGHT +# define LANG_TAMAZIGHT 0x5f +# endif +# ifndef LANG_TAMIL +# define LANG_TAMIL 0x49 +# endif +# ifndef LANG_TATAR +# define LANG_TATAR 0x44 +# endif +# ifndef LANG_TELUGU +# define LANG_TELUGU 0x4a +# endif +# ifndef LANG_THAI +# define LANG_THAI 0x1e +# endif +# ifndef LANG_TIBETAN +# define LANG_TIBETAN 0x51 +# endif +# ifndef LANG_TIGRINYA +# define LANG_TIGRINYA 0x73 +# endif +# ifndef LANG_TSONGA +# define LANG_TSONGA 0x31 +# endif +# ifndef LANG_TSWANA +# define LANG_TSWANA 0x32 +# endif +# ifndef LANG_TURKMEN +# define LANG_TURKMEN 0x42 +# endif +# ifndef LANG_UKRAINIAN +# define LANG_UKRAINIAN 0x22 +# endif +# ifndef LANG_URDU +# define LANG_URDU 0x20 +# endif +# ifndef LANG_UZBEK +# define LANG_UZBEK 0x43 +# endif +# ifndef LANG_VENDA +# define LANG_VENDA 0x33 +# endif +# ifndef LANG_VIETNAMESE +# define LANG_VIETNAMESE 0x2a +# endif +# ifndef LANG_WELSH +# define LANG_WELSH 0x52 +# endif +# ifndef LANG_XHOSA +# define LANG_XHOSA 0x34 +# endif +# ifndef LANG_YI +# define LANG_YI 0x78 +# endif +# ifndef LANG_YIDDISH +# define LANG_YIDDISH 0x3d +# endif +# ifndef LANG_YORUBA +# define LANG_YORUBA 0x6a +# endif +# ifndef LANG_ZULU +# define LANG_ZULU 0x35 +# endif +# ifndef SUBLANG_ARABIC_SAUDI_ARABIA +# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 +# endif +# ifndef SUBLANG_ARABIC_IRAQ +# define SUBLANG_ARABIC_IRAQ 0x02 +# endif +# ifndef SUBLANG_ARABIC_EGYPT +# define SUBLANG_ARABIC_EGYPT 0x03 +# endif +# ifndef SUBLANG_ARABIC_LIBYA +# define SUBLANG_ARABIC_LIBYA 0x04 +# endif +# ifndef SUBLANG_ARABIC_ALGERIA +# define SUBLANG_ARABIC_ALGERIA 0x05 +# endif +# ifndef SUBLANG_ARABIC_MOROCCO +# define SUBLANG_ARABIC_MOROCCO 0x06 +# endif +# ifndef SUBLANG_ARABIC_TUNISIA +# define SUBLANG_ARABIC_TUNISIA 0x07 +# endif +# ifndef SUBLANG_ARABIC_OMAN +# define SUBLANG_ARABIC_OMAN 0x08 +# endif +# ifndef SUBLANG_ARABIC_YEMEN +# define SUBLANG_ARABIC_YEMEN 0x09 +# endif +# ifndef SUBLANG_ARABIC_SYRIA +# define SUBLANG_ARABIC_SYRIA 0x0a +# endif +# ifndef SUBLANG_ARABIC_JORDAN +# define SUBLANG_ARABIC_JORDAN 0x0b +# endif +# ifndef SUBLANG_ARABIC_LEBANON +# define SUBLANG_ARABIC_LEBANON 0x0c +# endif +# ifndef SUBLANG_ARABIC_KUWAIT +# define SUBLANG_ARABIC_KUWAIT 0x0d +# endif +# ifndef SUBLANG_ARABIC_UAE +# define SUBLANG_ARABIC_UAE 0x0e +# endif +# ifndef SUBLANG_ARABIC_BAHRAIN +# define SUBLANG_ARABIC_BAHRAIN 0x0f +# endif +# ifndef SUBLANG_ARABIC_QATAR +# define SUBLANG_ARABIC_QATAR 0x10 +# endif +# ifndef SUBLANG_AZERI_LATIN +# define SUBLANG_AZERI_LATIN 0x01 +# endif +# ifndef SUBLANG_AZERI_CYRILLIC +# define SUBLANG_AZERI_CYRILLIC 0x02 +# endif +# ifndef SUBLANG_BENGALI_INDIA +# define SUBLANG_BENGALI_INDIA 0x00 +# endif +# ifndef SUBLANG_BENGALI_BANGLADESH +# define SUBLANG_BENGALI_BANGLADESH 0x01 +# endif +# ifndef SUBLANG_CHINESE_MACAU +# define SUBLANG_CHINESE_MACAU 0x05 +# endif +# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA +# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 +# endif +# ifndef SUBLANG_ENGLISH_JAMAICA +# define SUBLANG_ENGLISH_JAMAICA 0x08 +# endif +# ifndef SUBLANG_ENGLISH_CARIBBEAN +# define SUBLANG_ENGLISH_CARIBBEAN 0x09 +# endif +# ifndef SUBLANG_ENGLISH_BELIZE +# define SUBLANG_ENGLISH_BELIZE 0x0a +# endif +# ifndef SUBLANG_ENGLISH_TRINIDAD +# define SUBLANG_ENGLISH_TRINIDAD 0x0b +# endif +# ifndef SUBLANG_ENGLISH_ZIMBABWE +# define SUBLANG_ENGLISH_ZIMBABWE 0x0c +# endif +# ifndef SUBLANG_ENGLISH_PHILIPPINES +# define SUBLANG_ENGLISH_PHILIPPINES 0x0d +# endif +# ifndef SUBLANG_ENGLISH_INDONESIA +# define SUBLANG_ENGLISH_INDONESIA 0x0e +# endif +# ifndef SUBLANG_ENGLISH_HONGKONG +# define SUBLANG_ENGLISH_HONGKONG 0x0f +# endif +# ifndef SUBLANG_ENGLISH_INDIA +# define SUBLANG_ENGLISH_INDIA 0x10 +# endif +# ifndef SUBLANG_ENGLISH_MALAYSIA +# define SUBLANG_ENGLISH_MALAYSIA 0x11 +# endif +# ifndef SUBLANG_ENGLISH_SINGAPORE +# define SUBLANG_ENGLISH_SINGAPORE 0x12 +# endif +# ifndef SUBLANG_FRENCH_LUXEMBOURG +# define SUBLANG_FRENCH_LUXEMBOURG 0x05 +# endif +# ifndef SUBLANG_FRENCH_MONACO +# define SUBLANG_FRENCH_MONACO 0x06 +# endif +# ifndef SUBLANG_FRENCH_WESTINDIES +# define SUBLANG_FRENCH_WESTINDIES 0x07 +# endif +# ifndef SUBLANG_FRENCH_REUNION +# define SUBLANG_FRENCH_REUNION 0x08 +# endif +# ifndef SUBLANG_FRENCH_CONGO +# define SUBLANG_FRENCH_CONGO 0x09 +# endif +# ifndef SUBLANG_FRENCH_SENEGAL +# define SUBLANG_FRENCH_SENEGAL 0x0a +# endif +# ifndef SUBLANG_FRENCH_CAMEROON +# define SUBLANG_FRENCH_CAMEROON 0x0b +# endif +# ifndef SUBLANG_FRENCH_COTEDIVOIRE +# define SUBLANG_FRENCH_COTEDIVOIRE 0x0c +# endif +# ifndef SUBLANG_FRENCH_MALI +# define SUBLANG_FRENCH_MALI 0x0d +# endif +# ifndef SUBLANG_FRENCH_MOROCCO +# define SUBLANG_FRENCH_MOROCCO 0x0e +# endif +# ifndef SUBLANG_FRENCH_HAITI +# define SUBLANG_FRENCH_HAITI 0x0f +# endif +# ifndef SUBLANG_GERMAN_LUXEMBOURG +# define SUBLANG_GERMAN_LUXEMBOURG 0x04 +# endif +# ifndef SUBLANG_GERMAN_LIECHTENSTEIN +# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 +# endif +# ifndef SUBLANG_KASHMIRI_INDIA +# define SUBLANG_KASHMIRI_INDIA 0x02 +# endif +# ifndef SUBLANG_MALAY_MALAYSIA +# define SUBLANG_MALAY_MALAYSIA 0x01 +# endif +# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM +# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 +# endif +# ifndef SUBLANG_NEPALI_INDIA +# define SUBLANG_NEPALI_INDIA 0x02 +# endif +# ifndef SUBLANG_PUNJABI_INDIA +# define SUBLANG_PUNJABI_INDIA 0x00 +# endif +# ifndef SUBLANG_PUNJABI_PAKISTAN +# define SUBLANG_PUNJABI_PAKISTAN 0x01 +# endif +# ifndef SUBLANG_ROMANIAN_ROMANIA +# define SUBLANG_ROMANIAN_ROMANIA 0x00 +# endif +# ifndef SUBLANG_ROMANIAN_MOLDOVA +# define SUBLANG_ROMANIAN_MOLDOVA 0x01 +# endif +# ifndef SUBLANG_SERBIAN_LATIN +# define SUBLANG_SERBIAN_LATIN 0x02 +# endif +# ifndef SUBLANG_SERBIAN_CYRILLIC +# define SUBLANG_SERBIAN_CYRILLIC 0x03 +# endif +# ifndef SUBLANG_SINDHI_INDIA +# define SUBLANG_SINDHI_INDIA 0x00 +# endif +# ifndef SUBLANG_SINDHI_PAKISTAN +# define SUBLANG_SINDHI_PAKISTAN 0x01 +# endif +# ifndef SUBLANG_SPANISH_GUATEMALA +# define SUBLANG_SPANISH_GUATEMALA 0x04 +# endif +# ifndef SUBLANG_SPANISH_COSTA_RICA +# define SUBLANG_SPANISH_COSTA_RICA 0x05 +# endif +# ifndef SUBLANG_SPANISH_PANAMA +# define SUBLANG_SPANISH_PANAMA 0x06 +# endif +# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC +# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 +# endif +# ifndef SUBLANG_SPANISH_VENEZUELA +# define SUBLANG_SPANISH_VENEZUELA 0x08 +# endif +# ifndef SUBLANG_SPANISH_COLOMBIA +# define SUBLANG_SPANISH_COLOMBIA 0x09 +# endif +# ifndef SUBLANG_SPANISH_PERU +# define SUBLANG_SPANISH_PERU 0x0a +# endif +# ifndef SUBLANG_SPANISH_ARGENTINA +# define SUBLANG_SPANISH_ARGENTINA 0x0b +# endif +# ifndef SUBLANG_SPANISH_ECUADOR +# define SUBLANG_SPANISH_ECUADOR 0x0c +# endif +# ifndef SUBLANG_SPANISH_CHILE +# define SUBLANG_SPANISH_CHILE 0x0d +# endif +# ifndef SUBLANG_SPANISH_URUGUAY +# define SUBLANG_SPANISH_URUGUAY 0x0e +# endif +# ifndef SUBLANG_SPANISH_PARAGUAY +# define SUBLANG_SPANISH_PARAGUAY 0x0f +# endif +# ifndef SUBLANG_SPANISH_BOLIVIA +# define SUBLANG_SPANISH_BOLIVIA 0x10 +# endif +# ifndef SUBLANG_SPANISH_EL_SALVADOR +# define SUBLANG_SPANISH_EL_SALVADOR 0x11 +# endif +# ifndef SUBLANG_SPANISH_HONDURAS +# define SUBLANG_SPANISH_HONDURAS 0x12 +# endif +# ifndef SUBLANG_SPANISH_NICARAGUA +# define SUBLANG_SPANISH_NICARAGUA 0x13 +# endif +# ifndef SUBLANG_SPANISH_PUERTO_RICO +# define SUBLANG_SPANISH_PUERTO_RICO 0x14 +# endif +# ifndef SUBLANG_SWEDISH_FINLAND +# define SUBLANG_SWEDISH_FINLAND 0x02 +# endif +# ifndef SUBLANG_TAMAZIGHT_ARABIC +# define SUBLANG_TAMAZIGHT_ARABIC 0x01 +# endif +# ifndef SUBLANG_TAMAZIGHT_LATIN +# define SUBLANG_TAMAZIGHT_LATIN 0x02 +# endif +# ifndef SUBLANG_TIGRINYA_ETHIOPIA +# define SUBLANG_TIGRINYA_ETHIOPIA 0x00 +# endif +# ifndef SUBLANG_TIGRINYA_ERITREA +# define SUBLANG_TIGRINYA_ERITREA 0x01 +# endif +# ifndef SUBLANG_URDU_PAKISTAN +# define SUBLANG_URDU_PAKISTAN 0x01 +# endif +# ifndef SUBLANG_URDU_INDIA +# define SUBLANG_URDU_INDIA 0x02 +# endif +# ifndef SUBLANG_UZBEK_LATIN +# define SUBLANG_UZBEK_LATIN 0x01 +# endif +# ifndef SUBLANG_UZBEK_CYRILLIC +# define SUBLANG_UZBEK_CYRILLIC 0x02 +# endif +#endif + +/* XPG3 defines the result of 'setlocale (category, NULL)' as: + "Directs 'setlocale()' to query 'category' and return the current + setting of 'local'." + However it does not specify the exact format. Neither do SUSV2 and + ISO C 99. So we can use this feature only on selected systems (e.g. + those using GNU C Library). */ +#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2) +# define HAVE_LOCALE_NULL +#endif + +/* Determine the current locale's name, and canonicalize it into XPG syntax + language[_territory[.codeset]][@modifier] + The codeset part in the result is not reliable; the locale_charset() + should be used for codeset information instead. + The result must not be freed; it is statically allocated. */ + +const char * +_nl_locale_name (int category, const char *categoryname) +{ + const char *retval; + +#ifndef WIN32 + + /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. + On some systems this can be done by the 'setlocale' function itself. */ +# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL + retval = setlocale (category, NULL); +# else + /* Setting of LC_ALL overwrites all other. */ + retval = getenv ("LC_ALL"); + if (retval == NULL || retval[0] == '\0') + { + /* Next comes the name of the desired category. */ + retval = getenv (categoryname); + if (retval == NULL || retval[0] == '\0') + { + /* Last possibility is the LANG environment variable. */ + retval = getenv ("LANG"); + if (retval == NULL || retval[0] == '\0') + /* We use C as the default domain. POSIX says this is + implementation defined. */ + retval = "C"; + } + } +# endif + + return retval; + +#else /* WIN32 */ + + /* Return an XPG style locale name language[_territory][@modifier]. + Don't even bother determining the codeset; it's not useful in this + context, because message catalogs are not specific to a single + codeset. */ + + LCID lcid; + LANGID langid; + int primary, sub; + + /* Let the user override the system settings through environment + variables, as on POSIX systems. */ + retval = getenv ("LC_ALL"); + if (retval != NULL && retval[0] != '\0') + return retval; + retval = getenv (categoryname); + if (retval != NULL && retval[0] != '\0') + return retval; + retval = getenv ("LANG"); + if (retval != NULL && retval[0] != '\0') + return retval; + + /* Use native Win32 API locale ID. */ + lcid = GetThreadLocale (); + + /* Strip off the sorting rules, keep only the language part. */ + langid = LANGIDFROMLCID (lcid); + + /* Split into language and territory part. */ + primary = PRIMARYLANGID (langid); + sub = SUBLANGID (langid); + + /* Dispatch on language. + See also http://www.unicode.org/unicode/onlinedat/languages.html . + For details about languages, see http://www.ethnologue.com/ . */ + switch (primary) + { + case LANG_AFRIKAANS: return "af_ZA"; + case LANG_ALBANIAN: return "sq_AL"; + case LANG_AMHARIC: return "am_ET"; + case LANG_ARABIC: + switch (sub) + { + case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; + case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; + case SUBLANG_ARABIC_EGYPT: return "ar_EG"; + case SUBLANG_ARABIC_LIBYA: return "ar_LY"; + case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; + case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; + case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; + case SUBLANG_ARABIC_OMAN: return "ar_OM"; + case SUBLANG_ARABIC_YEMEN: return "ar_YE"; + case SUBLANG_ARABIC_SYRIA: return "ar_SY"; + case SUBLANG_ARABIC_JORDAN: return "ar_JO"; + case SUBLANG_ARABIC_LEBANON: return "ar_LB"; + case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; + case SUBLANG_ARABIC_UAE: return "ar_AE"; + case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; + case SUBLANG_ARABIC_QATAR: return "ar_QA"; + } + return "ar"; + case LANG_ARMENIAN: return "hy_AM"; + case LANG_ASSAMESE: return "as_IN"; + case LANG_AZERI: + switch (sub) + { + /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */ + case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; + case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; + } + return "az"; + case LANG_BASQUE: + return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */ + case LANG_BELARUSIAN: return "be_BY"; + case LANG_BENGALI: + switch (sub) + { + case SUBLANG_BENGALI_INDIA: return "bn_IN"; + case SUBLANG_BENGALI_BANGLADESH: return "bn_BD"; + } + return "bn"; + case LANG_BULGARIAN: return "bg_BG"; + case LANG_BURMESE: return "my_MM"; + case LANG_CAMBODIAN: return "km_KH"; + case LANG_CATALAN: return "ca_ES"; + case LANG_CHEROKEE: return "chr_US"; + case LANG_CHINESE: + switch (sub) + { + case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW"; + case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN"; + case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; + case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; + case SUBLANG_CHINESE_MACAU: return "zh_MO"; + } + return "zh"; + case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN + * What used to be called Serbo-Croatian + * should really now be two separate + * languages because of political reasons. + * (Says tml, who knows nothing about Serbian + * or Croatian.) + * (I can feel those flames coming already.) + */ + switch (sub) + { + case SUBLANG_DEFAULT: return "hr_HR"; + case SUBLANG_SERBIAN_LATIN: return "sr_CS"; + case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic"; + } + return "hr"; + case LANG_CZECH: return "cs_CZ"; + case LANG_DANISH: return "da_DK"; + case LANG_DIVEHI: return "dv_MV"; + case LANG_DUTCH: + switch (sub) + { + case SUBLANG_DUTCH: return "nl_NL"; + case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE"; + } + return "nl"; + case LANG_EDO: return "bin_NG"; + case LANG_ENGLISH: + switch (sub) + { + /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought + * English was the language spoken in England. + * Oh well. + */ + case SUBLANG_ENGLISH_US: return "en_US"; + case SUBLANG_ENGLISH_UK: return "en_GB"; + case SUBLANG_ENGLISH_AUS: return "en_AU"; + case SUBLANG_ENGLISH_CAN: return "en_CA"; + case SUBLANG_ENGLISH_NZ: return "en_NZ"; + case SUBLANG_ENGLISH_EIRE: return "en_IE"; + case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; + case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; + case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ + case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; + case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; + case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; + case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; + case SUBLANG_ENGLISH_INDONESIA: return "en_ID"; + case SUBLANG_ENGLISH_HONGKONG: return "en_HK"; + case SUBLANG_ENGLISH_INDIA: return "en_IN"; + case SUBLANG_ENGLISH_MALAYSIA: return "en_MY"; + case SUBLANG_ENGLISH_SINGAPORE: return "en_SG"; + } + return "en"; + case LANG_ESTONIAN: return "et_EE"; + case LANG_FAEROESE: return "fo_FO"; + case LANG_FARSI: return "fa_IR"; + case LANG_FINNISH: return "fi_FI"; + case LANG_FRENCH: + switch (sub) + { + case SUBLANG_FRENCH: return "fr_FR"; + case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE"; + case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; + case SUBLANG_FRENCH_SWISS: return "fr_CH"; + case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; + case SUBLANG_FRENCH_MONACO: return "fr_MC"; + case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */ + case SUBLANG_FRENCH_REUNION: return "fr_RE"; + case SUBLANG_FRENCH_CONGO: return "fr_CG"; + case SUBLANG_FRENCH_SENEGAL: return "fr_SN"; + case SUBLANG_FRENCH_CAMEROON: return "fr_CM"; + case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI"; + case SUBLANG_FRENCH_MALI: return "fr_ML"; + case SUBLANG_FRENCH_MOROCCO: return "fr_MA"; + case SUBLANG_FRENCH_HAITI: return "fr_HT"; + } + return "fr"; + case LANG_FRISIAN: return "fy_NL"; + case LANG_FULFULDE: + /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */ + return "ff_NG"; + case LANG_GAELIC: + switch (sub) + { + case 0x01: /* SCOTTISH */ return "gd_GB"; + case 0x02: /* IRISH */ return "ga_IE"; + } + return "C"; + case LANG_GALICIAN: return "gl_ES"; + case LANG_GEORGIAN: return "ka_GE"; + case LANG_GERMAN: + switch (sub) + { + case SUBLANG_GERMAN: return "de_DE"; + case SUBLANG_GERMAN_SWISS: return "de_CH"; + case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; + case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; + case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; + } + return "de"; + case LANG_GREEK: return "el_GR"; + case LANG_GUARANI: return "gn_PY"; + case LANG_GUJARATI: return "gu_IN"; + case LANG_HAUSA: return "ha_NG"; + case LANG_HAWAIIAN: + /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers) + or Hawaii Creole English ("cpe_US", 600000 speakers)? */ + return "cpe_US"; + case LANG_HEBREW: return "he_IL"; + case LANG_HINDI: return "hi_IN"; + case LANG_HUNGARIAN: return "hu_HU"; + case LANG_IBIBIO: return "nic_NG"; + case LANG_ICELANDIC: return "is_IS"; + case LANG_IGBO: return "ig_NG"; + case LANG_INDONESIAN: return "id_ID"; + case LANG_INUKTITUT: return "iu_CA"; + case LANG_ITALIAN: + switch (sub) + { + case SUBLANG_ITALIAN: return "it_IT"; + case SUBLANG_ITALIAN_SWISS: return "it_CH"; + } + return "it"; + case LANG_JAPANESE: return "ja_JP"; + case LANG_KANNADA: return "kn_IN"; + case LANG_KANURI: return "kr_NG"; + case LANG_KASHMIRI: + switch (sub) + { + case SUBLANG_DEFAULT: return "ks_PK"; + case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; + } + return "ks"; + case LANG_KAZAK: return "kk_KZ"; + case LANG_KONKANI: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "kok_IN"; + case LANG_KOREAN: return "ko_KR"; + case LANG_KYRGYZ: return "ky_KG"; + case LANG_LAO: return "lo_LA"; + case LANG_LATIN: return "la_VA"; + case LANG_LATVIAN: return "lv_LV"; + case LANG_LITHUANIAN: return "lt_LT"; + case LANG_MACEDONIAN: return "mk_MK"; + case LANG_MALAY: + switch (sub) + { + case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; + case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; + } + return "ms"; + case LANG_MALAYALAM: return "ml_IN"; + case LANG_MALTESE: return "mt_MT"; + case LANG_MANIPURI: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "mni_IN"; + case LANG_MARATHI: return "mr_IN"; + case LANG_MONGOLIAN: + return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */ + case LANG_NEPALI: + switch (sub) + { + case SUBLANG_DEFAULT: return "ne_NP"; + case SUBLANG_NEPALI_INDIA: return "ne_IN"; + } + return "ne"; + case LANG_NORWEGIAN: + switch (sub) + { + case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO"; + case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; + } + return "no"; + case LANG_ORIYA: return "or_IN"; + case LANG_OROMO: return "om_ET"; + case LANG_PAPIAMENTU: return "pap_AN"; + case LANG_PASHTO: + return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */ + case LANG_POLISH: return "pl_PL"; + case LANG_PORTUGUESE: + switch (sub) + { + case SUBLANG_PORTUGUESE: return "pt_PT"; + /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. + Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ + case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; + } + return "pt"; + case LANG_PUNJABI: + switch (sub) + { + case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */ + case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */ + } + return "pa"; + case LANG_RHAETO_ROMANCE: return "rm_CH"; + case LANG_ROMANIAN: + switch (sub) + { + case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO"; + case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD"; + } + return "ro"; + case LANG_RUSSIAN: + return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */ + case LANG_SAAMI: /* actually Northern Sami */ return "se_NO"; + case LANG_SANSKRIT: return "sa_IN"; + case LANG_SINDHI: + switch (sub) + { + case SUBLANG_SINDHI_INDIA: return "sd_IN"; + case SUBLANG_SINDHI_PAKISTAN: return "sd_PK"; + } + return "sd"; + case LANG_SINHALESE: return "si_LK"; + case LANG_SLOVAK: return "sk_SK"; + case LANG_SLOVENIAN: return "sl_SI"; + case LANG_SOMALI: return "so_SO"; + case LANG_SORBIAN: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "wen_DE"; + case LANG_SPANISH: + switch (sub) + { + case SUBLANG_SPANISH: return "es_ES"; + case SUBLANG_SPANISH_MEXICAN: return "es_MX"; + case SUBLANG_SPANISH_MODERN: + return "es_ES@modern"; /* not seen on Unix */ + case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; + case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; + case SUBLANG_SPANISH_PANAMA: return "es_PA"; + case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; + case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; + case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; + case SUBLANG_SPANISH_PERU: return "es_PE"; + case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; + case SUBLANG_SPANISH_ECUADOR: return "es_EC"; + case SUBLANG_SPANISH_CHILE: return "es_CL"; + case SUBLANG_SPANISH_URUGUAY: return "es_UY"; + case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; + case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; + case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; + case SUBLANG_SPANISH_HONDURAS: return "es_HN"; + case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; + case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; + } + return "es"; + case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */ + case LANG_SWAHILI: return "sw_KE"; + case LANG_SWEDISH: + switch (sub) + { + case SUBLANG_DEFAULT: return "sv_SE"; + case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; + } + return "sv"; + case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */ + case LANG_TAGALOG: return "tl_PH"; + case LANG_TAJIK: return "tg_TJ"; + case LANG_TAMAZIGHT: + switch (sub) + { + /* FIXME: Adjust this when Tamazight locales appear on Unix. */ + case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic"; + case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin"; + } + return "ber_MA"; + case LANG_TAMIL: + return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */ + case LANG_TATAR: return "tt_RU"; + case LANG_TELUGU: return "te_IN"; + case LANG_THAI: return "th_TH"; + case LANG_TIBETAN: return "bo_CN"; + case LANG_TIGRINYA: + switch (sub) + { + case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET"; + case SUBLANG_TIGRINYA_ERITREA: return "ti_ER"; + } + return "ti"; + case LANG_TSONGA: return "ts_ZA"; + case LANG_TSWANA: return "tn_BW"; + case LANG_TURKISH: return "tr_TR"; + case LANG_TURKMEN: return "tk_TM"; + case LANG_UKRAINIAN: return "uk_UA"; + case LANG_URDU: + switch (sub) + { + case SUBLANG_URDU_PAKISTAN: return "ur_PK"; + case SUBLANG_URDU_INDIA: return "ur_IN"; + } + return "ur"; + case LANG_UZBEK: + switch (sub) + { + case SUBLANG_UZBEK_LATIN: return "uz_UZ"; + case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic"; + } + return "uz"; + case LANG_VENDA: return "ve_ZA"; + case LANG_VIETNAMESE: return "vi_VN"; + case LANG_WELSH: return "cy_GB"; + case LANG_XHOSA: return "xh_ZA"; + case LANG_YI: return "sit_CN"; + case LANG_YIDDISH: return "yi_IL"; + case LANG_YORUBA: return "yo_NG"; + case LANG_ZULU: return "zu_ZA"; + default: return "C"; + } + +#endif +} diff --git a/intl/log.c b/intl/log.c new file mode 100755 index 0000000..cb6076e --- /dev/null +++ b/intl/log.c @@ -0,0 +1,98 @@ +/* Log file output. + 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 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 . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +/* Print an ASCII string with quotes and escape sequences where needed. */ +static void +print_escaped (FILE *stream, const char *str) +{ + putc ('"', stream); + for (; *str != '\0'; str++) + if (*str == '\n') + { + fputs ("\\n\"", stream); + if (str[1] == '\0') + return; + fputs ("\n\"", stream); + } + else + { + if (*str == '"' || *str == '\\') + putc ('\\', stream); + putc (*str, stream); + } + putc ('"', stream); +} + +/* Add to the log file an entry denoting a failed translation. */ +void +_nl_log_untranslated (const char *logfilename, const char *domainname, + const char *msgid1, const char *msgid2, int plural) +{ + static char *last_logfilename = NULL; + static FILE *last_logfile = NULL; + FILE *logfile; + + /* Can we reuse the last opened logfile? */ + if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0) + { + /* Close the last used logfile. */ + if (last_logfilename != NULL) + { + if (last_logfile != NULL) + { + fclose (last_logfile); + last_logfile = NULL; + } + free (last_logfilename); + last_logfilename = NULL; + } + /* Open the logfile. */ + last_logfilename = (char *) malloc (strlen (logfilename) + 1); + if (last_logfilename == NULL) + return; + strcpy (last_logfilename, logfilename); + last_logfile = fopen (logfilename, "a"); + if (last_logfile == NULL) + return; + } + logfile = last_logfile; + + fprintf (logfile, "domain "); + print_escaped (logfile, domainname); + fprintf (logfile, "\nmsgid "); + print_escaped (logfile, msgid1); + if (plural) + { + fprintf (logfile, "\nmsgid_plural "); + print_escaped (logfile, msgid2); + fprintf (logfile, "\nmsgstr[0] \"\"\n"); + } + else + fprintf (logfile, "\nmsgstr \"\"\n"); + putc ('\n', logfile); +} diff --git a/intl/ngettext.c b/intl/ngettext.c new file mode 100755 index 0000000..e73e00c --- /dev/null +++ b/intl/ngettext.c @@ -0,0 +1,65 @@ +/* Implementation of ngettext(3) function. + Copyright (C) 1995, 1997, 2000-2003 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 +#endif + +#ifdef _LIBC +# define __need_NULL +# include +#else +# include /* Just for NULL. */ +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +#include + +/* @@ 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 NGETTEXT __ngettext +# define DCNGETTEXT __dcngettext +#else +# define NGETTEXT libintl_ngettext +# define DCNGETTEXT libintl_dcngettext +#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 * +NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n) +{ + return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__ngettext, ngettext); +#endif diff --git a/intl/os2compat.c b/intl/os2compat.c new file mode 100755 index 0000000..c8dc33e --- /dev/null +++ b/intl/os2compat.c @@ -0,0 +1,98 @@ +/* OS/2 compatibility functions. + Copyright (C) 2001-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU 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. */ + +#define OS2_AWARE +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +/* A version of getenv() that works from DLLs */ +extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); + +char * +_nl_getenv (const char *name) +{ + unsigned char *value; + if (DosScanEnv (name, &value)) + return NULL; + else + return value; +} + +/* A fixed size buffer. */ +char libintl_nl_default_dirname[MAXPATHLEN+1]; + +char *_nlos2_libdir = NULL; +char *_nlos2_localealiaspath = NULL; +char *_nlos2_localedir = NULL; + +static __attribute__((constructor)) void +nlos2_initialize () +{ + char *root = getenv ("UNIXROOT"); + char *gnulocaledir = getenv ("GNULOCALEDIR"); + + _nlos2_libdir = gnulocaledir; + if (!_nlos2_libdir) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); + memcpy (_nlos2_libdir, root, sl); + memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); + } + else + _nlos2_libdir = LIBDIR; + } + + _nlos2_localealiaspath = gnulocaledir; + if (!_nlos2_localealiaspath) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); + memcpy (_nlos2_localealiaspath, root, sl); + memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); + } + else + _nlos2_localealiaspath = LOCALE_ALIAS_PATH; + } + + _nlos2_localedir = gnulocaledir; + if (!_nlos2_localedir) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); + memcpy (_nlos2_localedir, root, sl); + memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); + } + else + _nlos2_localedir = LOCALEDIR; + } + + if (strlen (_nlos2_localedir) <= MAXPATHLEN) + strcpy (libintl_nl_default_dirname, _nlos2_localedir); +} diff --git a/intl/os2compat.h b/intl/os2compat.h new file mode 100755 index 0000000..4f74e8c --- /dev/null +++ b/intl/os2compat.h @@ -0,0 +1,46 @@ +/* OS/2 compatibility defines. + This file is intended to be included from config.h + Copyright (C) 2001-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU 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. */ + +/* When included from os2compat.h we need all the original definitions */ +#ifndef OS2_AWARE + +#undef LIBDIR +#define LIBDIR _nlos2_libdir +extern char *_nlos2_libdir; + +#undef LOCALEDIR +#define LOCALEDIR _nlos2_localedir +extern char *_nlos2_localedir; + +#undef LOCALE_ALIAS_PATH +#define LOCALE_ALIAS_PATH _nlos2_localealiaspath +extern char *_nlos2_localealiaspath; + +#endif + +#undef HAVE_STRCASECMP +#define HAVE_STRCASECMP 1 +#define strcasecmp stricmp +#define strncasecmp strnicmp + +/* We have our own getenv() which works even if library is compiled as DLL */ +#define getenv _nl_getenv + +/* Older versions of gettext used -1 as the value of LC_MESSAGES */ +#define LC_MESSAGES_COMPAT (-1) diff --git a/intl/osdep.c b/intl/osdep.c new file mode 100755 index 0000000..b372598 --- /dev/null +++ b/intl/osdep.c @@ -0,0 +1,24 @@ +/* OS dependent parts of libintl. + Copyright (C) 2001-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU 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. */ + +#if defined __EMX__ +# include "os2compat.c" +#else +/* Avoid AIX compiler warning. */ +typedef int dummy; +#endif diff --git a/intl/plural-exp.c b/intl/plural-exp.c new file mode 100755 index 0000000..8c04e64 --- /dev/null +++ b/intl/plural-exp.c @@ -0,0 +1,154 @@ +/* Expression parsing for plural form selection. + Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + 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 +#endif + +#include +#include +#include + +#include "plural-exp.h" + +#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 + } +}; +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; +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 + +void +internal_function +EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp, + unsigned long int *npluralsp) +{ + 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 + { + char *endp; + unsigned long int n; + struct parse_args args; + + /* First get the number. */ + nplurals += 9; + while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) + ++nplurals; + if (!(*nplurals >= '0' && *nplurals <= '9')) + goto no_plural; +#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 + if (nplurals == endp) + goto no_plural; + *npluralsp = n; + + /* 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; + *pluralp = 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 (); + *pluralp = &GERMANIC_PLURAL; + *npluralsp = 2; + } +} diff --git a/intl/plural-exp.h b/intl/plural-exp.h new file mode 100755 index 0000000..49e2c5b --- /dev/null +++ b/intl/plural-exp.h @@ -0,0 +1,118 @@ +/* Expression parsing and evaluation for plural form selection. + Copyright (C) 2000-2003 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + 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 _PLURAL_EXP_H +#define _PLURAL_EXP_H + +#ifndef internal_function +# define internal_function +#endif + +#ifndef attribute_hidden +# define attribute_hidden +#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, /* Modulo operation. */ + plus, /* Addition. */ + minus, /* Subtraction. */ + less_than, /* Comparison. */ + greater_than, /* Comparison. */ + less_or_equal, /* Comparison. */ + greater_or_equal, /* Comparison. */ + equal, /* Comparison for equality. */ + not_equal, /* Comparison 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; +}; + + +/* Names for the libintl functions are a problem. This source code is used + 1. in the GNU C Library library, + 2. in the GNU libintl library, + 3. in the GNU gettext tools. + The function names in each situation must be different, to allow for + binary incompatible changes in 'struct expression'. Furthermore, + 1. in the GNU C Library library, the names have a __ prefix, + 2.+3. in the GNU libintl library and in the GNU gettext tools, the names + must follow ANSI C and not start with __. + So we have to distinguish the three cases. */ +#ifdef _LIBC +# define FREE_EXPRESSION __gettext_free_exp +# define PLURAL_PARSE __gettextparse +# define GERMANIC_PLURAL __gettext_germanic_plural +# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural +#elif defined (IN_LIBINTL) +# define FREE_EXPRESSION libintl_gettext_free_exp +# define PLURAL_PARSE libintl_gettextparse +# define GERMANIC_PLURAL libintl_gettext_germanic_plural +# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural +#else +# define FREE_EXPRESSION free_plural_expression +# define PLURAL_PARSE parse_plural_expression +# define GERMANIC_PLURAL germanic_plural +# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression +#endif + +extern void FREE_EXPRESSION (struct expression *exp) + internal_function; +extern int PLURAL_PARSE (void *arg); +extern struct expression GERMANIC_PLURAL attribute_hidden; +extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry, + struct expression **pluralp, + unsigned long int *npluralsp) + internal_function; + +#if !defined (_LIBC) && !defined (IN_LIBINTL) +extern unsigned long int plural_eval (struct expression *pexp, + unsigned long int n); +#endif + +#endif /* _PLURAL_EXP_H */ diff --git a/intl/plural.c b/intl/plural.c new file mode 100755 index 0000000..72494f9 --- /dev/null +++ b/intl/plural.c @@ -0,0 +1,1490 @@ +/* A Bison parser, made from plural.y + by GNU bison 1.35. */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define yyparse __gettextparse +#define yylex __gettextlex +#define yyerror __gettexterror +#define yylval __gettextlval +#define yychar __gettextchar +#define yydebug __gettextdebug +#define yynerrs __gettextnerrs +# define EQUOP2 257 +# define CMPOP2 258 +# define ADDOP2 259 +# define MULOP2 260 +# define NUMBER 261 + +#line 1 "plural.y" + +/* Expression parsing for plural form selection. + Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + 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 bison generated parser uses alloca. AIX 3 forces us to put this + declaration at the beginning of the file. The declaration in bison's + skeleton file comes too late. This must come before + because may include arbitrary system headers. */ +#if defined _AIX && !defined __GNUC__ + #pragma alloca +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include "plural-exp.h" + +/* The main function generated by the parser is called __gettextparse, + but we want it to be called PLURAL_PARSE. */ +#ifndef _LIBC +# define __gettextparse PLURAL_PARSE +#endif + +#define YYLEX_PARAM &((struct parse_args *) arg)->cp +#define YYPARSE_PARAM arg + +#line 49 "plural.y" +#ifndef YYSTYPE +typedef union { + unsigned long int num; + enum operator op; + struct expression *exp; +} yystype; +# define YYSTYPE yystype +# define YYSTYPE_IS_TRIVIAL 1 +#endif +#line 55 "plural.y" + +/* Prototypes for local functions. */ +static int yylex (YYSTYPE *lval, const char **pexp); +static void yyerror (const char *str); + +/* Allocation of expressions. */ + +static struct expression * +new_exp (int nargs, enum operator op, struct expression * const *args) +{ + int i; + struct expression *newp; + + /* If any of the argument could not be malloc'ed, just return NULL. */ + for (i = nargs - 1; i >= 0; i--) + if (args[i] == NULL) + goto fail; + + /* Allocate a new expression. */ + newp = (struct expression *) malloc (sizeof (*newp)); + if (newp != NULL) + { + newp->nargs = nargs; + newp->operation = op; + for (i = nargs - 1; i >= 0; i--) + newp->val.args[i] = args[i]; + return newp; + } + + fail: + for (i = nargs - 1; i >= 0; i--) + FREE_EXPRESSION (args[i]); + + return NULL; +} + +static inline struct expression * +new_exp_0 (enum operator op) +{ + return new_exp (0, op, NULL); +} + +static inline struct expression * +new_exp_1 (enum operator op, struct expression *right) +{ + struct expression *args[1]; + + args[0] = right; + return new_exp (1, op, args); +} + +static struct expression * +new_exp_2 (enum operator op, struct expression *left, struct expression *right) +{ + struct expression *args[2]; + + args[0] = left; + args[1] = right; + return new_exp (2, op, args); +} + +static inline struct expression * +new_exp_3 (enum operator op, struct expression *bexp, + struct expression *tbranch, struct expression *fbranch) +{ + struct expression *args[3]; + + args[0] = bexp; + args[1] = tbranch; + args[2] = fbranch; + return new_exp (3, op, args); +} + +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + + + +#define YYFINAL 27 +#define YYFLAG -32768 +#define YYNTBASE 16 + +/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ +#define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18) + +/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ +static const char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 10, 2, 2, 2, 2, 5, 2, + 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, + 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 6, 7, 8, + 9, 11 +}; + +#if YYDEBUG +static const short yyprhs[] = +{ + 0, 0, 2, 8, 12, 16, 20, 24, 28, 32, + 35, 37, 39 +}; +static const short yyrhs[] = +{ + 17, 0, 17, 3, 17, 12, 17, 0, 17, 4, + 17, 0, 17, 5, 17, 0, 17, 6, 17, 0, + 17, 7, 17, 0, 17, 8, 17, 0, 17, 9, + 17, 0, 10, 17, 0, 13, 0, 11, 0, 14, + 17, 15, 0 +}; + +#endif + +#if YYDEBUG +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const short yyrline[] = +{ + 0, 150, 158, 162, 166, 170, 174, 178, 182, 186, + 190, 194, 199 +}; +#endif + + +#if (YYDEBUG) || defined YYERROR_VERBOSE + +/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ +static const char *const yytname[] = +{ + "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", + "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", + "start", "exp", 0 +}; +#endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const short yyr1[] = +{ + 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const short yyr2[] = +{ + 0, 1, 5, 3, 3, 3, 3, 3, 3, 2, + 1, 1, 3 +}; + +/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE + doesn't specify something else to do. Zero means the default is an + error. */ +static const short yydefact[] = +{ + 0, 0, 11, 10, 0, 1, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 12, 0, 3, 4, 5, + 6, 7, 8, 0, 2, 0, 0, 0 +}; + +static const short yydefgoto[] = +{ + 25, 5 +}; + +static const short yypact[] = +{ + -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, + -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16, + 26, -3,-32768, -9, 34, 21, 53,-32768 +}; + +static const short yypgoto[] = +{ + -32768, -1 +}; + + +#define YYLAST 53 + + +static const short yytable[] = +{ + 6, 1, 2, 7, 3, 4, 14, 16, 17, 18, + 19, 20, 21, 22, 8, 9, 10, 11, 12, 13, + 14, 26, 24, 12, 13, 14, 15, 8, 9, 10, + 11, 12, 13, 14, 13, 14, 23, 8, 9, 10, + 11, 12, 13, 14, 10, 11, 12, 13, 14, 11, + 12, 13, 14, 27 +}; + +static const short yycheck[] = +{ + 1, 10, 11, 4, 13, 14, 9, 8, 9, 10, + 11, 12, 13, 14, 3, 4, 5, 6, 7, 8, + 9, 0, 23, 7, 8, 9, 15, 3, 4, 5, + 6, 7, 8, 9, 8, 9, 12, 3, 4, 5, + 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, + 7, 8, 9, 0 +}; +#define YYPURE 1 + +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/local/share/bison/bison.simple" + +/* Skeleton output parser for bison, + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser when + the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca +# else +# ifndef YYSTACK_USE_ALLOCA +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# else +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +# define YYSTACK_ALLOC malloc +# define YYSTACK_FREE free +# endif +#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short yyss; + YYSTYPE yyvs; +# if YYLSP_NEEDED + YYLTYPE yyls; +# endif +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# if YYLSP_NEEDED +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAX) +# else +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAX) +# endif + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror ("syntax error: cannot back up"); \ + YYERROR; \ + } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Compute the default location (before the actions + are run). + + When YYLLOC_DEFAULT is run, CURRENT is set the location of the + first token. By default, to implement support for ranges, extend + its range to the last symbol. */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#if YYPURE +# if YYLSP_NEEDED +# ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) +# else +# define YYLEX yylex (&yylval, &yylloc) +# endif +# else /* !YYLSP_NEEDED */ +# ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +# else +# define YYLEX yylex (&yylval) +# endif +# endif /* !YYLSP_NEEDED */ +#else /* !YYPURE */ +# define YYLEX yylex () +#endif /* !YYPURE */ + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +#endif /* !YYDEBUG */ + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#if YYMAXDEPTH == 0 +# undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + +#ifdef YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif +{ + register const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; +} +# endif +# endif + +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + register char *yyd = yydest; + register const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif +#endif + +#line 315 "/usr/local/share/bison/bison.simple" + + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +# define YYPARSE_PARAM_DECL +# else +# define YYPARSE_PARAM_ARG YYPARSE_PARAM +# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +# endif +#else /* !YYPARSE_PARAM */ +# define YYPARSE_PARAM_ARG +# define YYPARSE_PARAM_DECL +#endif /* !YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +# ifdef YYPARSE_PARAM +int yyparse (void *); +# else +int yyparse (void); +# endif +#endif + +/* YY_DECL_VARIABLES -- depending whether we use a pure parser, + variables are global, or local to YYPARSE. */ + +#define YY_DECL_NON_LSP_VARIABLES \ +/* The lookahead symbol. */ \ +int yychar; \ + \ +/* The semantic value of the lookahead symbol. */ \ +YYSTYPE yylval; \ + \ +/* Number of parse errors so far. */ \ +int yynerrs; + +#if YYLSP_NEEDED +# define YY_DECL_VARIABLES \ +YY_DECL_NON_LSP_VARIABLES \ + \ +/* Location data for the lookahead symbol. */ \ +YYLTYPE yylloc; +#else +# define YY_DECL_VARIABLES \ +YY_DECL_NON_LSP_VARIABLES +#endif + + +/* If nonreentrant, generate the variables here. */ + +#if !YYPURE +YY_DECL_VARIABLES +#endif /* !YYPURE */ + +int +yyparse (YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + /* If reentrant, generate the variables here. */ +#if YYPURE + YY_DECL_VARIABLES +#endif /* !YYPURE */ + + register int yystate; + register int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Lookahead token as an internal (translated) token number. */ + int yychar1 = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; + register short *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + register YYSTYPE *yyvsp; + +#if YYLSP_NEEDED + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; +#endif + +#if YYLSP_NEEDED +# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +# define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + YYSIZE_T yystacksize = YYINITDEPTH; + + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; +#if YYLSP_NEEDED + YYLTYPE yyloc; +#endif + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; +#if YYLSP_NEEDED + yylsp = yyls; +#endif + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. */ +# if YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + yyls = yyls1; +# else + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); +# endif + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyoverflowlab; +# else + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + goto yyoverflowlab; + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; + + { + short *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); +# if YYLSP_NEEDED + YYSTACK_RELOCATE (yyls); +# endif +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; +#if YYLSP_NEEDED + yylsp = yyls + yysize - 1; +#endif + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yychar1 = YYTRANSLATE (yychar); + +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables + which are defined only if `YYDEBUG' is set. */ + if (yydebug) + { + YYFPRINTF (stderr, "Next token is %d (%s", + yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise + meaning of a token, for further debugging info. */ +# ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +# endif + YYFPRINTF (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + YYDPRINTF ((stderr, "Shifting token %d (%s), ", + yychar, yytname[yychar1])); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#if YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to the semantic value of + the lookahead token. This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + +#if YYLSP_NEEDED + /* Similarly for the default location. Let the user run additional + commands if for instance locations are ranges. */ + yyloc = yylsp[1-yylen]; + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); +#endif + +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables which + are defined only if `YYDEBUG' is set. */ + if (yydebug) + { + int yyi; + + YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + switch (yyn) { + +case 1: +#line 151 "plural.y" +{ + if (yyvsp[0].exp == NULL) + YYABORT; + ((struct parse_args *) arg)->res = yyvsp[0].exp; + } + break; +case 2: +#line 159 "plural.y" +{ + yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp); + } + break; +case 3: +#line 163 "plural.y" +{ + yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp); + } + break; +case 4: +#line 167 "plural.y" +{ + yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp); + } + break; +case 5: +#line 171 "plural.y" +{ + yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); + } + break; +case 6: +#line 175 "plural.y" +{ + yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); + } + break; +case 7: +#line 179 "plural.y" +{ + yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); + } + break; +case 8: +#line 183 "plural.y" +{ + yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); + } + break; +case 9: +#line 187 "plural.y" +{ + yyval.exp = new_exp_1 (lnot, yyvsp[0].exp); + } + break; +case 10: +#line 191 "plural.y" +{ + yyval.exp = new_exp_0 (var); + } + break; +case 11: +#line 195 "plural.y" +{ + if ((yyval.exp = new_exp_0 (num)) != NULL) + yyval.exp->val.num = yyvsp[0].num; + } + break; +case 12: +#line 200 "plural.y" +{ + yyval.exp = yyvsp[-1].exp; + } + break; +} + +#line 705 "/usr/local/share/bison/bison.simple" + + + yyvsp -= yylen; + yyssp -= yylen; +#if YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG + if (yydebug) + { + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; +#if YYLSP_NEEDED + *++yylsp = yyloc; +#endif + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + YYSIZE_T yysize = 0; + char *yymsg; + int yyx, yycount; + + yycount = 0; + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) + if (yycheck[yyx + yyn] == yyx) + yysize += yystrlen (yytname[yyx]) + 15, yycount++; + yysize += yystrlen ("parse error, unexpected ") + 1; + yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) + { + char *yyp = yystpcpy (yymsg, "parse error, unexpected "); + yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); + + if (yycount < 5) + { + yycount = 0; + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); + yyx++) + if (yycheck[yyx + yyn] == yyx) + { + const char *yyq = ! yycount ? ", expecting " : " or "; + yyp = yystpcpy (yyp, yyq); + yyp = yystpcpy (yyp, yytname[yyx]); + yycount++; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + yyerror ("parse error; also virtual memory exhausted"); + } + else +#endif /* defined (YYERROR_VERBOSE) */ + yyerror ("parse error"); + } + goto yyerrlab1; + + +/*--------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action | +`--------------------------------------------------*/ +yyerrlab1: + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + YYDPRINTF ((stderr, "Discarding token %d (%s).\n", + yychar, yytname[yychar1])); + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + + +/*-------------------------------------------------------------------. +| yyerrdefault -- current state does not do anything special for the | +| error token. | +`-------------------------------------------------------------------*/ +yyerrdefault: +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + + /* If its default is to accept any token, ok. Otherwise pop it. */ + yyn = yydefact[yystate]; + if (yyn) + goto yydefault; +#endif + + +/*---------------------------------------------------------------. +| yyerrpop -- pop the current state because it cannot handle the | +| error token | +`---------------------------------------------------------------*/ +yyerrpop: + if (yyssp == yyss) + YYABORT; + yyvsp--; + yystate = *--yyssp; +#if YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG + if (yydebug) + { + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "Error: state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); + } +#endif + +/*--------------. +| yyerrhandle. | +`--------------*/ +yyerrhandle: + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + + YYDPRINTF ((stderr, "Shifting error token, ")); + + *++yyvsp = yylval; +#if YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +/*---------------------------------------------. +| yyoverflowab -- parser overflow comes here. | +`---------------------------------------------*/ +yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ + +yyreturn: +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + return yyresult; +} +#line 205 "plural.y" + + +void +internal_function +FREE_EXPRESSION (struct expression *exp) +{ + if (exp == NULL) + return; + + /* Handle the recursive case. */ + switch (exp->nargs) + { + case 3: + FREE_EXPRESSION (exp->val.args[2]); + /* FALLTHROUGH */ + case 2: + FREE_EXPRESSION (exp->val.args[1]); + /* FALLTHROUGH */ + case 1: + FREE_EXPRESSION (exp->val.args[0]); + /* FALLTHROUGH */ + default: + break; + } + + free (exp); +} + + +static int +yylex (YYSTYPE *lval, const char **pexp) +{ + const char *exp = *pexp; + int result; + + while (1) + { + if (exp[0] == '\0') + { + *pexp = exp; + return YYEOF; + } + + if (exp[0] != ' ' && exp[0] != '\t') + break; + + ++exp; + } + + result = *exp++; + switch (result) + { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + unsigned long int n = result - '0'; + while (exp[0] >= '0' && exp[0] <= '9') + { + n *= 10; + n += exp[0] - '0'; + ++exp; + } + lval->num = n; + result = NUMBER; + } + break; + + case '=': + if (exp[0] == '=') + { + ++exp; + lval->op = equal; + result = EQUOP2; + } + else + result = YYERRCODE; + break; + + case '!': + if (exp[0] == '=') + { + ++exp; + lval->op = not_equal; + result = EQUOP2; + } + break; + + case '&': + case '|': + if (exp[0] == result) + ++exp; + else + result = YYERRCODE; + break; + + case '<': + if (exp[0] == '=') + { + ++exp; + lval->op = less_or_equal; + } + else + lval->op = less_than; + result = CMPOP2; + break; + + case '>': + if (exp[0] == '=') + { + ++exp; + lval->op = greater_or_equal; + } + else + lval->op = greater_than; + result = CMPOP2; + break; + + case '*': + lval->op = mult; + result = MULOP2; + break; + + case '/': + lval->op = divide; + result = MULOP2; + break; + + case '%': + lval->op = module; + result = MULOP2; + break; + + case '+': + lval->op = plus; + result = ADDOP2; + break; + + case '-': + lval->op = minus; + result = ADDOP2; + break; + + case 'n': + case '?': + case ':': + case '(': + case ')': + /* Nothing, just return the character. */ + break; + + case ';': + case '\n': + case '\0': + /* Be safe and let the user call this function again. */ + --exp; + result = YYEOF; + break; + + default: + result = YYERRCODE; +#if YYDEBUG != 0 + --exp; +#endif + break; + } + + *pexp = exp; + + return result; +} + + +static void +yyerror (const char *str) +{ + /* Do nothing. We don't print error messages here. */ +} diff --git a/intl/plural.y b/intl/plural.y new file mode 100755 index 0000000..4d33bd7 --- /dev/null +++ b/intl/plural.y @@ -0,0 +1,381 @@ +%{ +/* Expression parsing for plural form selection. + Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + 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 bison generated parser uses alloca. AIX 3 forces us to put this + declaration at the beginning of the file. The declaration in bison's + skeleton file comes too late. This must come before + because may include arbitrary system headers. */ +#if defined _AIX && !defined __GNUC__ + #pragma alloca +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include "plural-exp.h" + +/* The main function generated by the parser is called __gettextparse, + but we want it to be called PLURAL_PARSE. */ +#ifndef _LIBC +# define __gettextparse PLURAL_PARSE +#endif + +#define YYLEX_PARAM &((struct parse_args *) arg)->cp +#define YYPARSE_PARAM arg +%} +%pure_parser +%expect 7 + +%union { + unsigned long int num; + enum operator op; + struct expression *exp; +} + +%{ +/* Prototypes for local functions. */ +static int yylex (YYSTYPE *lval, const char **pexp); +static void yyerror (const char *str); + +/* Allocation of expressions. */ + +static struct expression * +new_exp (int nargs, enum operator op, struct expression * const *args) +{ + int i; + struct expression *newp; + + /* If any of the argument could not be malloc'ed, just return NULL. */ + for (i = nargs - 1; i >= 0; i--) + if (args[i] == NULL) + goto fail; + + /* Allocate a new expression. */ + newp = (struct expression *) malloc (sizeof (*newp)); + if (newp != NULL) + { + newp->nargs = nargs; + newp->operation = op; + for (i = nargs - 1; i >= 0; i--) + newp->val.args[i] = args[i]; + return newp; + } + + fail: + for (i = nargs - 1; i >= 0; i--) + FREE_EXPRESSION (args[i]); + + return NULL; +} + +static inline struct expression * +new_exp_0 (enum operator op) +{ + return new_exp (0, op, NULL); +} + +static inline struct expression * +new_exp_1 (enum operator op, struct expression *right) +{ + struct expression *args[1]; + + args[0] = right; + return new_exp (1, op, args); +} + +static struct expression * +new_exp_2 (enum operator op, struct expression *left, struct expression *right) +{ + struct expression *args[2]; + + args[0] = left; + args[1] = right; + return new_exp (2, op, args); +} + +static inline struct expression * +new_exp_3 (enum operator op, struct expression *bexp, + struct expression *tbranch, struct expression *fbranch) +{ + struct expression *args[3]; + + args[0] = bexp; + args[1] = tbranch; + args[2] = fbranch; + return new_exp (3, op, args); +} + +%} + +/* This declares that all operators have the same associativity and the + precedence order as in C. See [Harbison, Steele: C, A Reference Manual]. + There is no unary minus and no bitwise operators. + Operators with the same syntactic behaviour have been merged into a single + token, to save space in the array generated by bison. */ +%right '?' /* ? */ +%left '|' /* || */ +%left '&' /* && */ +%left EQUOP2 /* == != */ +%left CMPOP2 /* < > <= >= */ +%left ADDOP2 /* + - */ +%left MULOP2 /* * / % */ +%right '!' /* ! */ + +%token EQUOP2 CMPOP2 ADDOP2 MULOP2 +%token NUMBER +%type exp + +%% + +start: exp + { + if ($1 == NULL) + YYABORT; + ((struct parse_args *) arg)->res = $1; + } + ; + +exp: exp '?' exp ':' exp + { + $$ = new_exp_3 (qmop, $1, $3, $5); + } + | exp '|' exp + { + $$ = new_exp_2 (lor, $1, $3); + } + | exp '&' exp + { + $$ = new_exp_2 (land, $1, $3); + } + | exp EQUOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp CMPOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp ADDOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp MULOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | '!' exp + { + $$ = new_exp_1 (lnot, $2); + } + | 'n' + { + $$ = new_exp_0 (var); + } + | NUMBER + { + if (($$ = new_exp_0 (num)) != NULL) + $$->val.num = $1; + } + | '(' exp ')' + { + $$ = $2; + } + ; + +%% + +void +internal_function +FREE_EXPRESSION (struct expression *exp) +{ + if (exp == NULL) + return; + + /* Handle the recursive case. */ + switch (exp->nargs) + { + case 3: + FREE_EXPRESSION (exp->val.args[2]); + /* FALLTHROUGH */ + case 2: + FREE_EXPRESSION (exp->val.args[1]); + /* FALLTHROUGH */ + case 1: + FREE_EXPRESSION (exp->val.args[0]); + /* FALLTHROUGH */ + default: + break; + } + + free (exp); +} + + +static int +yylex (YYSTYPE *lval, const char **pexp) +{ + const char *exp = *pexp; + int result; + + while (1) + { + if (exp[0] == '\0') + { + *pexp = exp; + return YYEOF; + } + + if (exp[0] != ' ' && exp[0] != '\t') + break; + + ++exp; + } + + result = *exp++; + switch (result) + { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + unsigned long int n = result - '0'; + while (exp[0] >= '0' && exp[0] <= '9') + { + n *= 10; + n += exp[0] - '0'; + ++exp; + } + lval->num = n; + result = NUMBER; + } + break; + + case '=': + if (exp[0] == '=') + { + ++exp; + lval->op = equal; + result = EQUOP2; + } + else + result = YYERRCODE; + break; + + case '!': + if (exp[0] == '=') + { + ++exp; + lval->op = not_equal; + result = EQUOP2; + } + break; + + case '&': + case '|': + if (exp[0] == result) + ++exp; + else + result = YYERRCODE; + break; + + case '<': + if (exp[0] == '=') + { + ++exp; + lval->op = less_or_equal; + } + else + lval->op = less_than; + result = CMPOP2; + break; + + case '>': + if (exp[0] == '=') + { + ++exp; + lval->op = greater_or_equal; + } + else + lval->op = greater_than; + result = CMPOP2; + break; + + case '*': + lval->op = mult; + result = MULOP2; + break; + + case '/': + lval->op = divide; + result = MULOP2; + break; + + case '%': + lval->op = module; + result = MULOP2; + break; + + case '+': + lval->op = plus; + result = ADDOP2; + break; + + case '-': + lval->op = minus; + result = ADDOP2; + break; + + case 'n': + case '?': + case ':': + case '(': + case ')': + /* Nothing, just return the character. */ + break; + + case ';': + case '\n': + case '\0': + /* Be safe and let the user call this function again. */ + --exp; + result = YYEOF; + break; + + default: + result = YYERRCODE; +#if YYDEBUG != 0 + --exp; +#endif + break; + } + + *pexp = exp; + + return result; +} + + +static void +yyerror (const char *str) +{ + /* Do nothing. We don't print error messages here. */ +} diff --git a/intl/printf-args.c b/intl/printf-args.c new file mode 100755 index 0000000..f6f3219 --- /dev/null +++ b/intl/printf-args.c @@ -0,0 +1,119 @@ +/* Decomposed printf argument list. + Copyright (C) 1999, 2002-2003 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 +#endif + +/* Specification. */ +#include "printf-args.h" + +#ifdef STATIC +STATIC +#endif +int +printf_fetchargs (va_list args, arguments *a) +{ + size_t i; + argument *ap; + + for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) + switch (ap->type) + { + case TYPE_SCHAR: + ap->a.a_schar = va_arg (args, /*signed char*/ int); + break; + case TYPE_UCHAR: + ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); + break; + case TYPE_SHORT: + ap->a.a_short = va_arg (args, /*short*/ int); + break; + case TYPE_USHORT: + ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); + break; + case TYPE_INT: + ap->a.a_int = va_arg (args, int); + break; + case TYPE_UINT: + ap->a.a_uint = va_arg (args, unsigned int); + break; + case TYPE_LONGINT: + ap->a.a_longint = va_arg (args, long int); + break; + case TYPE_ULONGINT: + ap->a.a_ulongint = va_arg (args, unsigned long int); + break; +#ifdef HAVE_LONG_LONG + case TYPE_LONGLONGINT: + ap->a.a_longlongint = va_arg (args, long long int); + break; + case TYPE_ULONGLONGINT: + ap->a.a_ulonglongint = va_arg (args, unsigned long long int); + break; +#endif + case TYPE_DOUBLE: + ap->a.a_double = va_arg (args, double); + break; +#ifdef HAVE_LONG_DOUBLE + case TYPE_LONGDOUBLE: + ap->a.a_longdouble = va_arg (args, long double); + break; +#endif + case TYPE_CHAR: + ap->a.a_char = va_arg (args, int); + break; +#ifdef HAVE_WINT_T + case TYPE_WIDE_CHAR: + ap->a.a_wide_char = va_arg (args, wint_t); + break; +#endif + case TYPE_STRING: + ap->a.a_string = va_arg (args, const char *); + break; +#ifdef HAVE_WCHAR_T + case TYPE_WIDE_STRING: + ap->a.a_wide_string = va_arg (args, const wchar_t *); + break; +#endif + case TYPE_POINTER: + ap->a.a_pointer = va_arg (args, void *); + break; + case TYPE_COUNT_SCHAR_POINTER: + ap->a.a_count_schar_pointer = va_arg (args, signed char *); + break; + case TYPE_COUNT_SHORT_POINTER: + ap->a.a_count_short_pointer = va_arg (args, short *); + break; + case TYPE_COUNT_INT_POINTER: + ap->a.a_count_int_pointer = va_arg (args, int *); + break; + case TYPE_COUNT_LONGINT_POINTER: + ap->a.a_count_longint_pointer = va_arg (args, long int *); + break; +#ifdef HAVE_LONG_LONG + case TYPE_COUNT_LONGLONGINT_POINTER: + ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); + break; +#endif + default: + /* Unknown type. */ + return -1; + } + return 0; +} diff --git a/intl/printf-args.h b/intl/printf-args.h new file mode 100755 index 0000000..f11e64c --- /dev/null +++ b/intl/printf-args.h @@ -0,0 +1,137 @@ +/* Decomposed printf argument list. + Copyright (C) 1999, 2002-2003 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 _PRINTF_ARGS_H +#define _PRINTF_ARGS_H + +/* Get size_t. */ +#include + +/* Get wchar_t. */ +#ifdef HAVE_WCHAR_T +# include +#endif + +/* Get wint_t. */ +#ifdef HAVE_WINT_T +# include +#endif + +/* Get va_list. */ +#include + + +/* Argument types */ +typedef enum +{ + TYPE_NONE, + TYPE_SCHAR, + TYPE_UCHAR, + TYPE_SHORT, + TYPE_USHORT, + TYPE_INT, + TYPE_UINT, + TYPE_LONGINT, + TYPE_ULONGINT, +#ifdef HAVE_LONG_LONG + TYPE_LONGLONGINT, + TYPE_ULONGLONGINT, +#endif + TYPE_DOUBLE, +#ifdef HAVE_LONG_DOUBLE + TYPE_LONGDOUBLE, +#endif + TYPE_CHAR, +#ifdef HAVE_WINT_T + TYPE_WIDE_CHAR, +#endif + TYPE_STRING, +#ifdef HAVE_WCHAR_T + TYPE_WIDE_STRING, +#endif + TYPE_POINTER, + TYPE_COUNT_SCHAR_POINTER, + TYPE_COUNT_SHORT_POINTER, + TYPE_COUNT_INT_POINTER, + TYPE_COUNT_LONGINT_POINTER +#ifdef HAVE_LONG_LONG +, TYPE_COUNT_LONGLONGINT_POINTER +#endif +} arg_type; + +/* Polymorphic argument */ +typedef struct +{ + arg_type type; + union + { + signed char a_schar; + unsigned char a_uchar; + short a_short; + unsigned short a_ushort; + int a_int; + unsigned int a_uint; + long int a_longint; + unsigned long int a_ulongint; +#ifdef HAVE_LONG_LONG + long long int a_longlongint; + unsigned long long int a_ulonglongint; +#endif + float a_float; + double a_double; +#ifdef HAVE_LONG_DOUBLE + long double a_longdouble; +#endif + int a_char; +#ifdef HAVE_WINT_T + wint_t a_wide_char; +#endif + const char* a_string; +#ifdef HAVE_WCHAR_T + const wchar_t* a_wide_string; +#endif + void* a_pointer; + signed char * a_count_schar_pointer; + short * a_count_short_pointer; + int * a_count_int_pointer; + long int * a_count_longint_pointer; +#ifdef HAVE_LONG_LONG + long long int * a_count_longlongint_pointer; +#endif + } + a; +} +argument; + +typedef struct +{ + size_t count; + argument *arg; +} +arguments; + + +/* Fetch the arguments, putting them into a. */ +#ifdef STATIC +STATIC +#else +extern +#endif +int printf_fetchargs (va_list args, arguments *a); + +#endif /* _PRINTF_ARGS_H */ diff --git a/intl/printf-parse.c b/intl/printf-parse.c new file mode 100755 index 0000000..d19f903 --- /dev/null +++ b/intl/printf-parse.c @@ -0,0 +1,537 @@ +/* Formatted output to strings. + Copyright (C) 1999-2000, 2002-2003 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 +#endif + +/* Specification. */ +#if WIDE_CHAR_VERSION +# include "wprintf-parse.h" +#else +# include "printf-parse.h" +#endif + +/* Get size_t, NULL. */ +#include + +/* Get intmax_t. */ +#if HAVE_STDINT_H_WITH_UINTMAX +# include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +# include +#endif + +/* malloc(), realloc(), free(). */ +#include + +/* Checked size_t computations. */ +#include "xsize.h" + +#if WIDE_CHAR_VERSION +# define PRINTF_PARSE wprintf_parse +# define CHAR_T wchar_t +# define DIRECTIVE wchar_t_directive +# define DIRECTIVES wchar_t_directives +#else +# define PRINTF_PARSE printf_parse +# define CHAR_T char +# define DIRECTIVE char_directive +# define DIRECTIVES char_directives +#endif + +#ifdef STATIC +STATIC +#endif +int +PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) +{ + const CHAR_T *cp = format; /* pointer into format */ + size_t arg_posn = 0; /* number of regular arguments consumed */ + size_t d_allocated; /* allocated elements of d->dir */ + size_t a_allocated; /* allocated elements of a->arg */ + size_t max_width_length = 0; + size_t max_precision_length = 0; + + d->count = 0; + d_allocated = 1; + d->dir = malloc (d_allocated * sizeof (DIRECTIVE)); + if (d->dir == NULL) + /* Out of memory. */ + return -1; + + a->count = 0; + a_allocated = 0; + a->arg = NULL; + +#define REGISTER_ARG(_index_,_type_) \ + { \ + size_t n = (_index_); \ + if (n >= a_allocated) \ + { \ + size_t memory_size; \ + argument *memory; \ + \ + a_allocated = xtimes (a_allocated, 2); \ + if (a_allocated <= n) \ + a_allocated = xsum (n, 1); \ + memory_size = xtimes (a_allocated, sizeof (argument)); \ + if (size_overflow_p (memory_size)) \ + /* Overflow, would lead to out of memory. */ \ + goto error; \ + memory = (a->arg \ + ? realloc (a->arg, memory_size) \ + : malloc (memory_size)); \ + if (memory == NULL) \ + /* Out of memory. */ \ + goto error; \ + a->arg = memory; \ + } \ + while (a->count <= n) \ + a->arg[a->count++].type = TYPE_NONE; \ + if (a->arg[n].type == TYPE_NONE) \ + a->arg[n].type = (_type_); \ + else if (a->arg[n].type != (_type_)) \ + /* Ambiguous type for positional argument. */ \ + goto error; \ + } + + while (*cp != '\0') + { + CHAR_T c = *cp++; + if (c == '%') + { + size_t arg_index = ARG_NONE; + DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */ + + /* Initialize the next directive. */ + dp->dir_start = cp - 1; + dp->flags = 0; + dp->width_start = NULL; + dp->width_end = NULL; + dp->width_arg_index = ARG_NONE; + dp->precision_start = NULL; + dp->precision_end = NULL; + dp->precision_arg_index = ARG_NONE; + dp->arg_index = ARG_NONE; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory later. */ + goto error; + arg_index = n - 1; + cp = np + 1; + } + } + + /* Read the flags. */ + for (;;) + { + if (*cp == '\'') + { + dp->flags |= FLAG_GROUP; + cp++; + } + else if (*cp == '-') + { + dp->flags |= FLAG_LEFT; + cp++; + } + else if (*cp == '+') + { + dp->flags |= FLAG_SHOWSIGN; + cp++; + } + else if (*cp == ' ') + { + dp->flags |= FLAG_SPACE; + cp++; + } + else if (*cp == '#') + { + dp->flags |= FLAG_ALT; + cp++; + } + else if (*cp == '0') + { + dp->flags |= FLAG_ZERO; + cp++; + } + else + break; + } + + /* Parse the field width. */ + if (*cp == '*') + { + dp->width_start = cp; + cp++; + dp->width_end = cp; + if (max_width_length < 1) + max_width_length = 1; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory later. */ + goto error; + dp->width_arg_index = n - 1; + cp = np + 1; + } + } + if (dp->width_arg_index == ARG_NONE) + { + dp->width_arg_index = arg_posn++; + if (dp->width_arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->width_arg_index, TYPE_INT); + } + else if (*cp >= '0' && *cp <= '9') + { + size_t width_length; + + dp->width_start = cp; + for (; *cp >= '0' && *cp <= '9'; cp++) + ; + dp->width_end = cp; + width_length = dp->width_end - dp->width_start; + if (max_width_length < width_length) + max_width_length = width_length; + } + + /* Parse the precision. */ + if (*cp == '.') + { + cp++; + if (*cp == '*') + { + dp->precision_start = cp - 1; + cp++; + dp->precision_end = cp; + if (max_precision_length < 2) + max_precision_length = 2; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory + later. */ + goto error; + dp->precision_arg_index = n - 1; + cp = np + 1; + } + } + if (dp->precision_arg_index == ARG_NONE) + { + dp->precision_arg_index = arg_posn++; + if (dp->precision_arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->precision_arg_index, TYPE_INT); + } + else + { + size_t precision_length; + + dp->precision_start = cp - 1; + for (; *cp >= '0' && *cp <= '9'; cp++) + ; + dp->precision_end = cp; + precision_length = dp->precision_end - dp->precision_start; + if (max_precision_length < precision_length) + max_precision_length = precision_length; + } + } + + { + arg_type type; + + /* Parse argument type/size specifiers. */ + { + int flags = 0; + + for (;;) + { + if (*cp == 'h') + { + flags |= (1 << (flags & 1)); + cp++; + } + else if (*cp == 'L') + { + flags |= 4; + cp++; + } + else if (*cp == 'l') + { + flags += 8; + cp++; + } +#ifdef HAVE_INTMAX_T + else if (*cp == 'j') + { + if (sizeof (intmax_t) > sizeof (long)) + { + /* intmax_t = long long */ + flags += 16; + } + else if (sizeof (intmax_t) > sizeof (int)) + { + /* intmax_t = long */ + flags += 8; + } + cp++; + } +#endif + else if (*cp == 'z' || *cp == 'Z') + { + /* 'z' is standardized in ISO C 99, but glibc uses 'Z' + because the warning facility in gcc-2.95.2 understands + only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ + if (sizeof (size_t) > sizeof (long)) + { + /* size_t = long long */ + flags += 16; + } + else if (sizeof (size_t) > sizeof (int)) + { + /* size_t = long */ + flags += 8; + } + cp++; + } + else if (*cp == 't') + { + if (sizeof (ptrdiff_t) > sizeof (long)) + { + /* ptrdiff_t = long long */ + flags += 16; + } + else if (sizeof (ptrdiff_t) > sizeof (int)) + { + /* ptrdiff_t = long */ + flags += 8; + } + cp++; + } + else + break; + } + + /* Read the conversion character. */ + c = *cp++; + switch (c) + { + case 'd': case 'i': +#ifdef HAVE_LONG_LONG + if (flags >= 16 || (flags & 4)) + type = TYPE_LONGLONGINT; + else +#endif + if (flags >= 8) + type = TYPE_LONGINT; + else if (flags & 2) + type = TYPE_SCHAR; + else if (flags & 1) + type = TYPE_SHORT; + else + type = TYPE_INT; + break; + case 'o': case 'u': case 'x': case 'X': +#ifdef HAVE_LONG_LONG + if (flags >= 16 || (flags & 4)) + type = TYPE_ULONGLONGINT; + else +#endif + if (flags >= 8) + type = TYPE_ULONGINT; + else if (flags & 2) + type = TYPE_UCHAR; + else if (flags & 1) + type = TYPE_USHORT; + else + type = TYPE_UINT; + break; + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': +#ifdef HAVE_LONG_DOUBLE + if (flags >= 16 || (flags & 4)) + type = TYPE_LONGDOUBLE; + else +#endif + type = TYPE_DOUBLE; + break; + case 'c': + if (flags >= 8) +#ifdef HAVE_WINT_T + type = TYPE_WIDE_CHAR; +#else + goto error; +#endif + else + type = TYPE_CHAR; + break; +#ifdef HAVE_WINT_T + case 'C': + type = TYPE_WIDE_CHAR; + c = 'c'; + break; +#endif + case 's': + if (flags >= 8) +#ifdef HAVE_WCHAR_T + type = TYPE_WIDE_STRING; +#else + goto error; +#endif + else + type = TYPE_STRING; + break; +#ifdef HAVE_WCHAR_T + case 'S': + type = TYPE_WIDE_STRING; + c = 's'; + break; +#endif + case 'p': + type = TYPE_POINTER; + break; + case 'n': +#ifdef HAVE_LONG_LONG + if (flags >= 16 || (flags & 4)) + type = TYPE_COUNT_LONGLONGINT_POINTER; + else +#endif + if (flags >= 8) + type = TYPE_COUNT_LONGINT_POINTER; + else if (flags & 2) + type = TYPE_COUNT_SCHAR_POINTER; + else if (flags & 1) + type = TYPE_COUNT_SHORT_POINTER; + else + type = TYPE_COUNT_INT_POINTER; + break; + case '%': + type = TYPE_NONE; + break; + default: + /* Unknown conversion character. */ + goto error; + } + } + + if (type != TYPE_NONE) + { + dp->arg_index = arg_index; + if (dp->arg_index == ARG_NONE) + { + dp->arg_index = arg_posn++; + if (dp->arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->arg_index, type); + } + dp->conversion = c; + dp->dir_end = cp; + } + + d->count++; + if (d->count >= d_allocated) + { + size_t memory_size; + DIRECTIVE *memory; + + d_allocated = xtimes (d_allocated, 2); + memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); + if (size_overflow_p (memory_size)) + /* Overflow, would lead to out of memory. */ + goto error; + memory = realloc (d->dir, memory_size); + if (memory == NULL) + /* Out of memory. */ + goto error; + d->dir = memory; + } + } + } + d->dir[d->count].dir_start = cp; + + d->max_width_length = max_width_length; + d->max_precision_length = max_precision_length; + return 0; + +error: + if (a->arg) + free (a->arg); + if (d->dir) + free (d->dir); + return -1; +} + +#undef DIRECTIVES +#undef DIRECTIVE +#undef CHAR_T +#undef PRINTF_PARSE diff --git a/intl/printf-parse.h b/intl/printf-parse.h new file mode 100755 index 0000000..8aec50e --- /dev/null +++ b/intl/printf-parse.h @@ -0,0 +1,75 @@ +/* Parse printf format string. + Copyright (C) 1999, 2002-2003 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 _PRINTF_PARSE_H +#define _PRINTF_PARSE_H + +#include "printf-args.h" + + +/* Flags */ +#define FLAG_GROUP 1 /* ' flag */ +#define FLAG_LEFT 2 /* - flag */ +#define FLAG_SHOWSIGN 4 /* + flag */ +#define FLAG_SPACE 8 /* space flag */ +#define FLAG_ALT 16 /* # flag */ +#define FLAG_ZERO 32 + +/* arg_index value indicating that no argument is consumed. */ +#define ARG_NONE (~(size_t)0) + +/* A parsed directive. */ +typedef struct +{ + const char* dir_start; + const char* dir_end; + int flags; + const char* width_start; + const char* width_end; + size_t width_arg_index; + const char* precision_start; + const char* precision_end; + size_t precision_arg_index; + char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ + size_t arg_index; +} +char_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + char_directive *dir; + size_t max_width_length; + size_t max_precision_length; +} +char_directives; + + +/* Parses the format string. Fills in the number N of directives, and fills + in directives[0], ..., directives[N-1], and sets directives[N].dir_start + to the end of the format string. Also fills in the arg_type fields of the + arguments and the needed count of arguments. */ +#ifdef STATIC +STATIC +#else +extern +#endif +int printf_parse (const char *format, char_directives *d, arguments *a); + +#endif /* _PRINTF_PARSE_H */ diff --git a/intl/printf.c b/intl/printf.c new file mode 100755 index 0000000..878646c --- /dev/null +++ b/intl/printf.c @@ -0,0 +1,371 @@ +/* Formatted output to strings, using POSIX/XSI format strings with positions. + Copyright (C) 2003 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + 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 +#endif + +#ifdef __GNUC__ +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#include + +#if !HAVE_POSIX_PRINTF + +#include +#include + +/* When building a DLL, we must export some functions. Note that because + the functions are only defined for binary backward compatibility, we + don't need to use __declspec(dllimport) in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define DLL_EXPORTED __declspec(dllexport) +#else +# define DLL_EXPORTED +#endif + +#define STATIC static + +/* Define auxiliary functions declared in "printf-args.h". */ +#include "printf-args.c" + +/* Define auxiliary functions declared in "printf-parse.h". */ +#include "printf-parse.c" + +/* Define functions declared in "vasnprintf.h". */ +#define vasnprintf libintl_vasnprintf +#include "vasnprintf.c" +#if 0 /* not needed */ +#define asnprintf libintl_asnprintf +#include "asnprintf.c" +#endif + +DLL_EXPORTED +int +libintl_vfprintf (FILE *stream, const char *format, va_list args) +{ + if (strchr (format, '$') == NULL) + return vfprintf (stream, format, args); + else + { + size_t length; + char *result = libintl_vasnprintf (NULL, &length, format, args); + int retval = -1; + if (result != NULL) + { + if (fwrite (result, 1, length, stream) == length) + retval = length; + free (result); + } + return retval; + } +} + +DLL_EXPORTED +int +libintl_fprintf (FILE *stream, const char *format, ...) +{ + va_list args; + int retval; + + va_start (args, format); + retval = libintl_vfprintf (stream, format, args); + va_end (args); + return retval; +} + +DLL_EXPORTED +int +libintl_vprintf (const char *format, va_list args) +{ + return libintl_vfprintf (stdout, format, args); +} + +DLL_EXPORTED +int +libintl_printf (const char *format, ...) +{ + va_list args; + int retval; + + va_start (args, format); + retval = libintl_vprintf (format, args); + va_end (args); + return retval; +} + +DLL_EXPORTED +int +libintl_vsprintf (char *resultbuf, const char *format, va_list args) +{ + if (strchr (format, '$') == NULL) + return vsprintf (resultbuf, format, args); + else + { + size_t length = (size_t) ~0 / (4 * sizeof (char)); + char *result = libintl_vasnprintf (resultbuf, &length, format, args); + if (result != resultbuf) + { + free (result); + return -1; + } + else + return length; + } +} + +DLL_EXPORTED +int +libintl_sprintf (char *resultbuf, const char *format, ...) +{ + va_list args; + int retval; + + va_start (args, format); + retval = libintl_vsprintf (resultbuf, format, args); + va_end (args); + return retval; +} + +#if HAVE_SNPRINTF + +# if HAVE_DECL__SNPRINTF + /* Windows. */ +# define system_vsnprintf _vsnprintf +# else + /* Unix. */ +# define system_vsnprintf vsnprintf +# endif + +DLL_EXPORTED +int +libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args) +{ + if (strchr (format, '$') == NULL) + return system_vsnprintf (resultbuf, length, format, args); + else + { + size_t maxlength = length; + char *result = libintl_vasnprintf (resultbuf, &length, format, args); + if (result != resultbuf) + { + if (maxlength > 0) + { + if (length < maxlength) + abort (); + memcpy (resultbuf, result, maxlength - 1); + resultbuf[maxlength - 1] = '\0'; + } + free (result); + return -1; + } + else + return length; + } +} + +DLL_EXPORTED +int +libintl_snprintf (char *resultbuf, size_t length, const char *format, ...) +{ + va_list args; + int retval; + + va_start (args, format); + retval = libintl_vsnprintf (resultbuf, length, format, args); + va_end (args); + return retval; +} + +#endif + +#if HAVE_ASPRINTF + +DLL_EXPORTED +int +libintl_vasprintf (char **resultp, const char *format, va_list args) +{ + size_t length; + char *result = libintl_vasnprintf (NULL, &length, format, args); + if (result == NULL) + return -1; + *resultp = result; + return length; +} + +DLL_EXPORTED +int +libintl_asprintf (char **resultp, const char *format, ...) +{ + va_list args; + int retval; + + va_start (args, format); + retval = libintl_vasprintf (resultp, format, args); + va_end (args); + return retval; +} + +#endif + +#if HAVE_FWPRINTF + +#include + +#define WIDE_CHAR_VERSION 1 + +/* Define auxiliary functions declared in "wprintf-parse.h". */ +#include "printf-parse.c" + +/* Define functions declared in "vasnprintf.h". */ +#define vasnwprintf libintl_vasnwprintf +#include "vasnprintf.c" +#if 0 /* not needed */ +#define asnwprintf libintl_asnwprintf +#include "asnprintf.c" +#endif + +# if HAVE_DECL__SNWPRINTF + /* Windows. */ +# define system_vswprintf _vsnwprintf +# else + /* Unix. */ +# define system_vswprintf vswprintf +# endif + +DLL_EXPORTED +int +libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args) +{ + if (wcschr (format, '$') == NULL) + return vfwprintf (stream, format, args); + else + { + size_t length; + wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args); + int retval = -1; + if (result != NULL) + { + size_t i; + for (i = 0; i < length; i++) + if (fputwc (result[i], stream) == WEOF) + break; + if (i == length) + retval = length; + free (result); + } + return retval; + } +} + +DLL_EXPORTED +int +libintl_fwprintf (FILE *stream, const wchar_t *format, ...) +{ + va_list args; + int retval; + + va_start (args, format); + retval = libintl_vfwprintf (stream, format, args); + va_end (args); + return retval; +} + +DLL_EXPORTED +int +libintl_vwprintf (const wchar_t *format, va_list args) +{ + return libintl_vfwprintf (stdout, format, args); +} + +DLL_EXPORTED +int +libintl_wprintf (const wchar_t *format, ...) +{ + va_list args; + int retval; + + va_start (args, format); + retval = libintl_vwprintf (format, args); + va_end (args); + return retval; +} + +DLL_EXPORTED +int +libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args) +{ + if (wcschr (format, '$') == NULL) + return system_vswprintf (resultbuf, length, format, args); + else + { + size_t maxlength = length; + wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args); + if (result != resultbuf) + { + if (maxlength > 0) + { + if (length < maxlength) + abort (); + memcpy (resultbuf, result, (maxlength - 1) * sizeof (wchar_t)); + resultbuf[maxlength - 1] = 0; + } + free (result); + return -1; + } + else + return length; + } +} + +DLL_EXPORTED +int +libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...) +{ + va_list args; + int retval; + + va_start (args, format); + retval = libintl_vswprintf (resultbuf, length, format, args); + va_end (args); + return retval; +} + +#endif + +#endif diff --git a/intl/ref-add.sin b/intl/ref-add.sin new file mode 100755 index 0000000..167374e --- /dev/null +++ b/intl/ref-add.sin @@ -0,0 +1,31 @@ +# Add this package to a list of references stored in a text file. +# +# Copyright (C) 2000 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 . +# +/^# Packages using this file: / { + s/# Packages using this file:// + ta + :a + s/ @PACKAGE@ / @PACKAGE@ / + tb + s/ $/ @PACKAGE@ / + :b + s/^/# Packages using this file:/ +} diff --git a/intl/ref-del.sin b/intl/ref-del.sin new file mode 100755 index 0000000..613cf37 --- /dev/null +++ b/intl/ref-del.sin @@ -0,0 +1,26 @@ +# Remove this package from a list of references stored in a text file. +# +# Copyright (C) 2000 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 . +# +/^# Packages using this file: / { + s/# Packages using this file:// + s/ @PACKAGE@ / / + s/^/# Packages using this file:/ +} diff --git a/intl/relocatable.c b/intl/relocatable.c new file mode 100755 index 0000000..bf7c708 --- /dev/null +++ b/intl/relocatable.c @@ -0,0 +1,449 @@ +/* Provide relocatable packages. + Copyright (C) 2003 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + 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 to provide a prototype for getline(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +/* Specification. */ +#include "relocatable.h" + +#if ENABLE_RELOCATABLE + +#include +#include +#include +#include + +#ifdef NO_XMALLOC +# define xmalloc malloc +#else +# include "xalloc.h" +#endif + +#if defined _WIN32 || defined __WIN32__ +# define WIN32_LEAN_AND_MEAN +# include +#endif + +#if DEPENDS_ON_LIBCHARSET +# include +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV +# include +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS +# include +#endif + +/* Faked cheap 'bool'. */ +#undef bool +#undef false +#undef true +#define bool int +#define false 0 +#define true 1 + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. + */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_PATH_WITH_DIR(P) \ + (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) +# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) +# define FILESYSTEM_PREFIX_LEN(P) 0 +#endif + +/* Original installation prefix. */ +static char *orig_prefix; +static size_t orig_prefix_len; +/* Current installation prefix. */ +static char *curr_prefix; +static size_t curr_prefix_len; +/* These prefixes do not end in a slash. Anything that will be concatenated + to them must start with a slash. */ + +/* Sets the original and the current installation prefix of this module. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +static void +set_this_relocation_prefix (const char *orig_prefix_arg, + const char *curr_prefix_arg) +{ + if (orig_prefix_arg != NULL && curr_prefix_arg != NULL + /* Optimization: if orig_prefix and curr_prefix are equal, the + relocation is a nop. */ + && strcmp (orig_prefix_arg, curr_prefix_arg) != 0) + { + /* Duplicate the argument strings. */ + char *memory; + + orig_prefix_len = strlen (orig_prefix_arg); + curr_prefix_len = strlen (curr_prefix_arg); + memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1); +#ifdef NO_XMALLOC + if (memory != NULL) +#endif + { + memcpy (memory, orig_prefix_arg, orig_prefix_len + 1); + orig_prefix = memory; + memory += orig_prefix_len + 1; + memcpy (memory, curr_prefix_arg, curr_prefix_len + 1); + curr_prefix = memory; + return; + } + } + orig_prefix = NULL; + curr_prefix = NULL; + /* Don't worry about wasted memory here - this function is usually only + called once. */ +} + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +void +set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) +{ + set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); + + /* Now notify all dependent libraries. */ +#if DEPENDS_ON_LIBCHARSET + libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 + libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix + libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +} + +#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR) + +/* Convenience function: + Computes the current installation prefix, based on the original + installation prefix, the original installation directory of a particular + file, and the current pathname of this file. Returns NULL upon failure. */ +#ifdef IN_LIBRARY +#define compute_curr_prefix local_compute_curr_prefix +static +#endif +const char * +compute_curr_prefix (const char *orig_installprefix, + const char *orig_installdir, + const char *curr_pathname) +{ + const char *curr_installdir; + const char *rel_installdir; + + if (curr_pathname == NULL) + return NULL; + + /* Determine the relative installation directory, relative to the prefix. + This is simply the difference between orig_installprefix and + orig_installdir. */ + if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix)) + != 0) + /* Shouldn't happen - nothing should be installed outside $(prefix). */ + return NULL; + rel_installdir = orig_installdir + strlen (orig_installprefix); + + /* Determine the current installation directory. */ + { + const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname); + const char *p = curr_pathname + strlen (curr_pathname); + char *q; + + while (p > p_base) + { + p--; + if (ISSLASH (*p)) + break; + } + + q = (char *) xmalloc (p - curr_pathname + 1); +#ifdef NO_XMALLOC + if (q == NULL) + return NULL; +#endif + memcpy (q, curr_pathname, p - curr_pathname); + q[p - curr_pathname] = '\0'; + curr_installdir = q; + } + + /* Compute the current installation prefix by removing the trailing + rel_installdir from it. */ + { + const char *rp = rel_installdir + strlen (rel_installdir); + const char *cp = curr_installdir + strlen (curr_installdir); + const char *cp_base = + curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir); + + while (rp > rel_installdir && cp > cp_base) + { + bool same = false; + const char *rpi = rp; + const char *cpi = cp; + + while (rpi > rel_installdir && cpi > cp_base) + { + rpi--; + cpi--; + if (ISSLASH (*rpi) || ISSLASH (*cpi)) + { + if (ISSLASH (*rpi) && ISSLASH (*cpi)) + same = true; + break; + } +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS - case insignificant filesystem */ + if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi) + != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi)) + break; +#else + if (*rpi != *cpi) + break; +#endif + } + if (!same) + break; + /* The last pathname component was the same. opi and cpi now point + to the slash before it. */ + rp = rpi; + cp = cpi; + } + + if (rp > rel_installdir) + /* Unexpected: The curr_installdir does not end with rel_installdir. */ + return NULL; + + { + size_t curr_prefix_len = cp - curr_installdir; + char *curr_prefix; + + curr_prefix = (char *) xmalloc (curr_prefix_len + 1); +#ifdef NO_XMALLOC + if (curr_prefix == NULL) + return NULL; +#endif + memcpy (curr_prefix, curr_installdir, curr_prefix_len); + curr_prefix[curr_prefix_len] = '\0'; + + return curr_prefix; + } + } +} + +#endif /* !IN_LIBRARY || PIC */ + +#if defined PIC && defined INSTALLDIR + +/* Full pathname of shared library, or NULL. */ +static char *shared_library_fullname; + +#if defined _WIN32 || defined __WIN32__ + +/* Determine the full pathname of the shared library when it is loaded. */ + +BOOL WINAPI +DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved) +{ + (void) reserved; + + if (event == DLL_PROCESS_ATTACH) + { + /* The DLL is being loaded into an application's address range. */ + static char location[MAX_PATH]; + + if (!GetModuleFileName (module_handle, location, sizeof (location))) + /* Shouldn't happen. */ + return FALSE; + + if (!IS_PATH_WITH_DIR (location)) + /* Shouldn't happen. */ + return FALSE; + + shared_library_fullname = strdup (location); + } + + return TRUE; +} + +#else /* Unix */ + +static void +find_shared_library_fullname () +{ +#if defined __linux__ && __GLIBC__ >= 2 + /* Linux has /proc/self/maps. glibc 2 has the getline() function. */ + FILE *fp; + + /* Open the current process' maps file. It describes one VMA per line. */ + fp = fopen ("/proc/self/maps", "r"); + if (fp) + { + unsigned long address = (unsigned long) &find_shared_library_fullname; + for (;;) + { + unsigned long start, end; + int c; + + if (fscanf (fp, "%lx-%lx", &start, &end) != 2) + break; + if (address >= start && address <= end - 1) + { + /* Found it. Now see if this line contains a filename. */ + while (c = getc (fp), c != EOF && c != '\n' && c != '/') + continue; + if (c == '/') + { + size_t size; + int len; + + ungetc (c, fp); + shared_library_fullname = NULL; size = 0; + len = getline (&shared_library_fullname, &size, fp); + if (len >= 0) + { + /* Success: filled shared_library_fullname. */ + if (len > 0 && shared_library_fullname[len - 1] == '\n') + shared_library_fullname[len - 1] = '\0'; + } + } + break; + } + while (c = getc (fp), c != EOF && c != '\n') + continue; + } + fclose (fp); + } +#endif +} + +#endif /* WIN32 / Unix */ + +/* Return the full pathname of the current shared library. + Return NULL if unknown. + Guaranteed to work only on Linux and Woe32. */ +static char * +get_shared_library_fullname () +{ +#if !(defined _WIN32 || defined __WIN32__) + static bool tried_find_shared_library_fullname; + if (!tried_find_shared_library_fullname) + { + find_shared_library_fullname (); + tried_find_shared_library_fullname = true; + } +#endif + return shared_library_fullname; +} + +#endif /* PIC */ + +/* Returns the pathname, relocated according to the current installation + directory. */ +const char * +relocate (const char *pathname) +{ +#if defined PIC && defined INSTALLDIR + static int initialized; + + /* Initialization code for a shared library. */ + if (!initialized) + { + /* At this point, orig_prefix and curr_prefix likely have already been + set through the main program's set_program_name_and_installdir + function. This is sufficient in the case that the library has + initially been installed in the same orig_prefix. But we can do + better, to also cover the cases that 1. it has been installed + in a different prefix before being moved to orig_prefix and (later) + to curr_prefix, 2. unlike the program, it has not moved away from + orig_prefix. */ + const char *orig_installprefix = INSTALLPREFIX; + const char *orig_installdir = INSTALLDIR; + const char *curr_prefix_better; + + curr_prefix_better = + compute_curr_prefix (orig_installprefix, orig_installdir, + get_shared_library_fullname ()); + if (curr_prefix_better == NULL) + curr_prefix_better = curr_prefix; + + set_relocation_prefix (orig_installprefix, curr_prefix_better); + + initialized = 1; + } +#endif + + /* Note: It is not necessary to perform case insensitive comparison here, + even for DOS-like filesystems, because the pathname argument was + typically created from the same Makefile variable as orig_prefix came + from. */ + if (orig_prefix != NULL && curr_prefix != NULL + && strncmp (pathname, orig_prefix, orig_prefix_len) == 0) + { + if (pathname[orig_prefix_len] == '\0') + /* pathname equals orig_prefix. */ + return curr_prefix; + if (ISSLASH (pathname[orig_prefix_len])) + { + /* pathname starts with orig_prefix. */ + const char *pathname_tail = &pathname[orig_prefix_len]; + char *result = + (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1); + +#ifdef NO_XMALLOC + if (result != NULL) +#endif + { + memcpy (result, curr_prefix, curr_prefix_len); + strcpy (result + curr_prefix_len, pathname_tail); + return result; + } + } + } + /* Nothing to relocate. */ + return pathname; +} + +#endif diff --git a/intl/relocatable.h b/intl/relocatable.h new file mode 100755 index 0000000..48c5b71 --- /dev/null +++ b/intl/relocatable.h @@ -0,0 +1,77 @@ +/* Provide relocatable packages. + Copyright (C) 2003 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + 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 _RELOCATABLE_H +#define _RELOCATABLE_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* This can be enabled through the configure --enable-relocatable option. */ +#if ENABLE_RELOCATABLE + +/* When building a DLL, we must export some functions. Note that because + this is a private .h file, we don't need to use __declspec(dllimport) + in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) +#else +# define RELOCATABLE_DLL_EXPORTED +#endif + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +extern RELOCATABLE_DLL_EXPORTED void + set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + +/* Returns the pathname, relocated according to the current installation + directory. */ +extern const char * relocate (const char *pathname); + +/* Memory management: relocate() leaks memory, because it has to construct + a fresh pathname. If this is a problem because your program calls + relocate() frequently, think about caching the result. */ + +/* Convenience function: + Computes the current installation prefix, based on the original + installation prefix, the original installation directory of a particular + file, and the current pathname of this file. Returns NULL upon failure. */ +extern const char * compute_curr_prefix (const char *orig_installprefix, + const char *orig_installdir, + const char *curr_pathname); + +#else + +/* By default, we use the hardwired pathnames. */ +#define relocate(pathname) (pathname) + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _RELOCATABLE_H */ diff --git a/intl/textdomain.c b/intl/textdomain.c new file mode 100755 index 0000000..8745a84 --- /dev/null +++ b/intl/textdomain.c @@ -0,0 +1,141 @@ +/* Implementation of the textdomain(3) function. + Copyright (C) 1995-1998, 2000-2003 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 +#endif + +#include +#include + +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "gettextP.h" + +#ifdef _LIBC +/* We have to handle multi-threaded applications. */ +# include +#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_default_domain libintl_nl_default_default_domain +# define _nl_current_default_domain libintl_nl_current_default_domain +#endif + +/* @@ end of prolog @@ */ + +/* Name of the default text domain. */ +extern const char _nl_default_default_domain[] attribute_hidden; + +/* Default text domain in which entries for gettext(3) are to be found. */ +extern const char *_nl_current_default_domain attribute_hidden; + + +/* 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 TEXTDOMAIN __textdomain +# ifndef strdup +# define strdup(str) __strdup (str) +# endif +#else +# define TEXTDOMAIN libintl_textdomain +#endif + +/* Lock variable to protect the global data in the gettext implementation. */ +__libc_rwlock_define (extern, _nl_state_lock attribute_hidden) + +/* 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". */ +char * +TEXTDOMAIN (const char *domainname) +{ + char *new_domain; + char *old_domain; + + /* A NULL pointer requests the current setting. */ + if (domainname == NULL) + return (char *) _nl_current_default_domain; + + __libc_rwlock_wrlock (_nl_state_lock); + + old_domain = (char *) _nl_current_default_domain; + + /* If domain name is the null string set to default domain "messages". */ + if (domainname[0] == '\0' + || strcmp (domainname, _nl_default_default_domain) == 0) + { + _nl_current_default_domain = _nl_default_default_domain; + new_domain = (char *) _nl_current_default_domain; + } + else if (strcmp (domainname, old_domain) == 0) + /* This can happen and people will use it to signal that some + environment variable changed. */ + new_domain = old_domain; + else + { + /* If the following malloc fails `_nl_current_default_domain' + will be NULL. This value will be returned and so signals we + are out of core. */ +#if defined _LIBC || defined HAVE_STRDUP + new_domain = strdup (domainname); +#else + size_t len = strlen (domainname) + 1; + new_domain = (char *) malloc (len); + if (new_domain != NULL) + memcpy (new_domain, domainname, len); +#endif + + if (new_domain != NULL) + _nl_current_default_domain = new_domain; + } + + /* We use this possibility to signal a change of the loaded catalogs + since this is most likely the case and there is no other easy we + to do it. Do it only when the call was successful. */ + if (new_domain != NULL) + { + ++_nl_msg_cat_cntr; + + if (old_domain != new_domain && old_domain != _nl_default_default_domain) + free (old_domain); + } + + __libc_rwlock_unlock (_nl_state_lock); + + return new_domain; +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__textdomain, textdomain); +#endif diff --git a/intl/vasnprintf.c b/intl/vasnprintf.c new file mode 100755 index 0000000..8a62282 --- /dev/null +++ b/intl/vasnprintf.c @@ -0,0 +1,887 @@ +/* vsprintf with automatic memory allocation. + Copyright (C) 1999, 2002-2003 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 to provide a prototype for snprintf(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif +#ifndef IN_LIBINTL +# include +#endif + +/* Specification. */ +#if WIDE_CHAR_VERSION +# include "vasnwprintf.h" +#else +# include "vasnprintf.h" +#endif + +#include /* snprintf(), sprintf() */ +#include /* abort(), malloc(), realloc(), free() */ +#include /* memcpy(), strlen() */ +#include /* errno */ +#include /* CHAR_BIT */ +#include /* DBL_MAX_EXP, LDBL_MAX_EXP */ +#if WIDE_CHAR_VERSION +# include "wprintf-parse.h" +#else +# include "printf-parse.h" +#endif + +/* Checked size_t computations. */ +#include "xsize.h" + +#ifdef HAVE_WCHAR_T +# ifdef HAVE_WCSLEN +# define local_wcslen wcslen +# else + /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid + a dependency towards this library, here is a local substitute. + Define this substitute only once, even if this file is included + twice in the same compilation unit. */ +# ifndef local_wcslen_defined +# define local_wcslen_defined 1 +static size_t +local_wcslen (const wchar_t *s) +{ + const wchar_t *ptr; + + for (ptr = s; *ptr != (wchar_t) 0; ptr++) + ; + return ptr - s; +} +# endif +# endif +#endif + +#if WIDE_CHAR_VERSION +# define VASNPRINTF vasnwprintf +# define CHAR_T wchar_t +# define DIRECTIVE wchar_t_directive +# define DIRECTIVES wchar_t_directives +# define PRINTF_PARSE wprintf_parse +# define USE_SNPRINTF 1 +# if HAVE_DECL__SNWPRINTF + /* On Windows, the function swprintf() has a different signature than + on Unix; we use the _snwprintf() function instead. */ +# define SNPRINTF _snwprintf +# else + /* Unix. */ +# define SNPRINTF swprintf +# endif +#else +# define VASNPRINTF vasnprintf +# define CHAR_T char +# define DIRECTIVE char_directive +# define DIRECTIVES char_directives +# define PRINTF_PARSE printf_parse +# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) +# if HAVE_DECL__SNPRINTF + /* Windows. */ +# define SNPRINTF _snprintf +# else + /* Unix. */ +# define SNPRINTF snprintf +# endif +#endif + +CHAR_T * +VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) +{ + DIRECTIVES d; + arguments a; + + if (PRINTF_PARSE (format, &d, &a) < 0) + { + errno = EINVAL; + return NULL; + } + +#define CLEANUP() \ + free (d.dir); \ + if (a.arg) \ + free (a.arg); + + if (printf_fetchargs (args, &a) < 0) + { + CLEANUP (); + errno = EINVAL; + return NULL; + } + + { + size_t buf_neededlength; + CHAR_T *buf; + CHAR_T *buf_malloced; + const CHAR_T *cp; + size_t i; + DIRECTIVE *dp; + /* Output string accumulator. */ + CHAR_T *result; + size_t allocated; + size_t length; + + /* Allocate a small buffer that will hold a directive passed to + sprintf or snprintf. */ + buf_neededlength = + xsum4 (7, d.max_width_length, d.max_precision_length, 6); +#if HAVE_ALLOCA + if (buf_neededlength < 4000 / sizeof (CHAR_T)) + { + buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T)); + buf_malloced = NULL; + } + else +#endif + { + size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T)); + if (size_overflow_p (buf_memsize)) + goto out_of_memory_1; + buf = (CHAR_T *) malloc (buf_memsize); + if (buf == NULL) + goto out_of_memory_1; + buf_malloced = buf; + } + + if (resultbuf != NULL) + { + result = resultbuf; + allocated = *lengthp; + } + else + { + result = NULL; + allocated = 0; + } + length = 0; + /* Invariants: + result is either == resultbuf or == NULL or malloc-allocated. + If length > 0, then result != NULL. */ + + /* Ensures that allocated >= needed. Aborts through a jump to + out_of_memory if needed is SIZE_MAX or otherwise too big. */ +#define ENSURE_ALLOCATION(needed) \ + if ((needed) > allocated) \ + { \ + size_t memory_size; \ + CHAR_T *memory; \ + \ + allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ + if ((needed) > allocated) \ + allocated = (needed); \ + memory_size = xtimes (allocated, sizeof (CHAR_T)); \ + if (size_overflow_p (memory_size)) \ + goto out_of_memory; \ + if (result == resultbuf || result == NULL) \ + memory = (CHAR_T *) malloc (memory_size); \ + else \ + memory = (CHAR_T *) realloc (result, memory_size); \ + if (memory == NULL) \ + goto out_of_memory; \ + if (result == resultbuf && length > 0) \ + memcpy (memory, result, length * sizeof (CHAR_T)); \ + result = memory; \ + } + + for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) + { + if (cp != dp->dir_start) + { + size_t n = dp->dir_start - cp; + size_t augmented_length = xsum (length, n); + + ENSURE_ALLOCATION (augmented_length); + memcpy (result + length, cp, n * sizeof (CHAR_T)); + length = augmented_length; + } + if (i == d.count) + break; + + /* Execute a single directive. */ + if (dp->conversion == '%') + { + size_t augmented_length; + + if (!(dp->arg_index == ARG_NONE)) + abort (); + augmented_length = xsum (length, 1); + ENSURE_ALLOCATION (augmented_length); + result[length] = '%'; + length = augmented_length; + } + else + { + if (!(dp->arg_index != ARG_NONE)) + abort (); + + if (dp->conversion == 'n') + { + switch (a.arg[dp->arg_index].type) + { + case TYPE_COUNT_SCHAR_POINTER: + *a.arg[dp->arg_index].a.a_count_schar_pointer = length; + break; + case TYPE_COUNT_SHORT_POINTER: + *a.arg[dp->arg_index].a.a_count_short_pointer = length; + break; + case TYPE_COUNT_INT_POINTER: + *a.arg[dp->arg_index].a.a_count_int_pointer = length; + break; + case TYPE_COUNT_LONGINT_POINTER: + *a.arg[dp->arg_index].a.a_count_longint_pointer = length; + break; +#ifdef HAVE_LONG_LONG + case TYPE_COUNT_LONGLONGINT_POINTER: + *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; + break; +#endif + default: + abort (); + } + } + else + { + arg_type type = a.arg[dp->arg_index].type; + CHAR_T *p; + unsigned int prefix_count; + int prefixes[2]; +#if !USE_SNPRINTF + size_t tmp_length; + CHAR_T tmpbuf[700]; + CHAR_T *tmp; + + /* Allocate a temporary buffer of sufficient size for calling + sprintf. */ + { + size_t width; + size_t precision; + + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = (arg < 0 ? (unsigned int) (-arg) : arg); + } + else + { + const CHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + } + + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + precision = (arg < 0 ? 0 : arg); + } + else + { + const CHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + do + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + while (digitp != dp->precision_end); + } + } + + switch (dp->conversion) + { + + case 'd': case 'i': case 'u': +# ifdef HAVE_LONG_LONG + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 1; /* account for leading sign */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 1; /* account for leading sign */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 1; /* account for leading sign */ + break; + + case 'o': +# ifdef HAVE_LONG_LONG + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1 /* turn floor into ceil */ + + 1; /* account for leading sign */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1 /* turn floor into ceil */ + + 1; /* account for leading sign */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1 /* turn floor into ceil */ + + 1; /* account for leading sign */ + break; + + case 'x': case 'X': +# ifdef HAVE_LONG_LONG + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1 /* turn floor into ceil */ + + 2; /* account for leading sign or alternate form */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1 /* turn floor into ceil */ + + 2; /* account for leading sign or alternate form */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1 /* turn floor into ceil */ + + 2; /* account for leading sign or alternate form */ + break; + + case 'f': case 'F': +# ifdef HAVE_LONG_DOUBLE + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) (LDBL_MAX_EXP + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 10; /* sign, decimal point etc. */ + else +# endif + tmp_length = + (unsigned int) (DBL_MAX_EXP + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 10; /* sign, decimal point etc. */ + tmp_length = xsum (tmp_length, precision); + break; + + case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': + tmp_length = + 12; /* sign, decimal point, exponent etc. */ + tmp_length = xsum (tmp_length, precision); + break; + + case 'c': +# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION + if (type == TYPE_WIDE_CHAR) + tmp_length = MB_CUR_MAX; + else +# endif + tmp_length = 1; + break; + + case 's': +# ifdef HAVE_WCHAR_T + if (type == TYPE_WIDE_STRING) + { + tmp_length = + local_wcslen (a.arg[dp->arg_index].a.a_wide_string); + +# if !WIDE_CHAR_VERSION + tmp_length = xtimes (tmp_length, MB_CUR_MAX); +# endif + } + else +# endif + tmp_length = strlen (a.arg[dp->arg_index].a.a_string); + break; + + case 'p': + tmp_length = + (unsigned int) (sizeof (void *) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1 /* turn floor into ceil */ + + 2; /* account for leading 0x */ + break; + + default: + abort (); + } + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + } + + if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (CHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } +#endif + + /* Construct the format string for calling snprintf or + sprintf. */ + p = buf; + *p++ = '%'; + if (dp->flags & FLAG_GROUP) + *p++ = '\''; + if (dp->flags & FLAG_LEFT) + *p++ = '-'; + if (dp->flags & FLAG_SHOWSIGN) + *p++ = '+'; + if (dp->flags & FLAG_SPACE) + *p++ = ' '; + if (dp->flags & FLAG_ALT) + *p++ = '#'; + if (dp->flags & FLAG_ZERO) + *p++ = '0'; + if (dp->width_start != dp->width_end) + { + size_t n = dp->width_end - dp->width_start; + memcpy (p, dp->width_start, n * sizeof (CHAR_T)); + p += n; + } + if (dp->precision_start != dp->precision_end) + { + size_t n = dp->precision_end - dp->precision_start; + memcpy (p, dp->precision_start, n * sizeof (CHAR_T)); + p += n; + } + + switch (type) + { +#ifdef HAVE_LONG_LONG + case TYPE_LONGLONGINT: + case TYPE_ULONGLONGINT: + *p++ = 'l'; + /*FALLTHROUGH*/ +#endif + case TYPE_LONGINT: + case TYPE_ULONGINT: +#ifdef HAVE_WINT_T + case TYPE_WIDE_CHAR: +#endif +#ifdef HAVE_WCHAR_T + case TYPE_WIDE_STRING: +#endif + *p++ = 'l'; + break; +#ifdef HAVE_LONG_DOUBLE + case TYPE_LONGDOUBLE: + *p++ = 'L'; + break; +#endif + default: + break; + } + *p = dp->conversion; +#if USE_SNPRINTF + p[1] = '%'; + p[2] = 'n'; + p[3] = '\0'; +#else + p[1] = '\0'; +#endif + + /* Construct the arguments for calling snprintf or sprintf. */ + prefix_count = 0; + if (dp->width_arg_index != ARG_NONE) + { + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; + } + if (dp->precision_arg_index != ARG_NONE) + { + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; + } + +#if USE_SNPRINTF + /* Prepare checking whether snprintf returns the count + via %n. */ + ENSURE_ALLOCATION (xsum (length, 1)); + result[length] = '\0'; +#endif + + for (;;) + { + size_t maxlen; + int count; + int retcount; + + maxlen = allocated - length; + count = -1; + retcount = 0; + +#if USE_SNPRINTF +# define SNPRINTF_BUF(arg) \ + switch (prefix_count) \ + { \ + case 0: \ + retcount = SNPRINTF (result + length, maxlen, buf, \ + arg, &count); \ + break; \ + case 1: \ + retcount = SNPRINTF (result + length, maxlen, buf, \ + prefixes[0], arg, &count); \ + break; \ + case 2: \ + retcount = SNPRINTF (result + length, maxlen, buf, \ + prefixes[0], prefixes[1], arg, \ + &count); \ + break; \ + default: \ + abort (); \ + } +#else +# define SNPRINTF_BUF(arg) \ + switch (prefix_count) \ + { \ + case 0: \ + count = sprintf (tmp, buf, arg); \ + break; \ + case 1: \ + count = sprintf (tmp, buf, prefixes[0], arg); \ + break; \ + case 2: \ + count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ + arg); \ + break; \ + default: \ + abort (); \ + } +#endif + + switch (type) + { + case TYPE_SCHAR: + { + int arg = a.arg[dp->arg_index].a.a_schar; + SNPRINTF_BUF (arg); + } + break; + case TYPE_UCHAR: + { + unsigned int arg = a.arg[dp->arg_index].a.a_uchar; + SNPRINTF_BUF (arg); + } + break; + case TYPE_SHORT: + { + int arg = a.arg[dp->arg_index].a.a_short; + SNPRINTF_BUF (arg); + } + break; + case TYPE_USHORT: + { + unsigned int arg = a.arg[dp->arg_index].a.a_ushort; + SNPRINTF_BUF (arg); + } + break; + case TYPE_INT: + { + int arg = a.arg[dp->arg_index].a.a_int; + SNPRINTF_BUF (arg); + } + break; + case TYPE_UINT: + { + unsigned int arg = a.arg[dp->arg_index].a.a_uint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_LONGINT: + { + long int arg = a.arg[dp->arg_index].a.a_longint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_ULONGINT: + { + unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; + SNPRINTF_BUF (arg); + } + break; +#ifdef HAVE_LONG_LONG + case TYPE_LONGLONGINT: + { + long long int arg = a.arg[dp->arg_index].a.a_longlongint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_ULONGLONGINT: + { + unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_DOUBLE: + { + double arg = a.arg[dp->arg_index].a.a_double; + SNPRINTF_BUF (arg); + } + break; +#ifdef HAVE_LONG_DOUBLE + case TYPE_LONGDOUBLE: + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_CHAR: + { + int arg = a.arg[dp->arg_index].a.a_char; + SNPRINTF_BUF (arg); + } + break; +#ifdef HAVE_WINT_T + case TYPE_WIDE_CHAR: + { + wint_t arg = a.arg[dp->arg_index].a.a_wide_char; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_STRING: + { + const char *arg = a.arg[dp->arg_index].a.a_string; + SNPRINTF_BUF (arg); + } + break; +#ifdef HAVE_WCHAR_T + case TYPE_WIDE_STRING: + { + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_POINTER: + { + void *arg = a.arg[dp->arg_index].a.a_pointer; + SNPRINTF_BUF (arg); + } + break; + default: + abort (); + } + +#if USE_SNPRINTF + /* Portability: Not all implementations of snprintf() + are ISO C 99 compliant. Determine the number of + bytes that snprintf() has produced or would have + produced. */ + if (count >= 0) + { + /* Verify that snprintf() has NUL-terminated its + result. */ + if (count < maxlen && result[length + count] != '\0') + abort (); + /* Portability hack. */ + if (retcount > count) + count = retcount; + } + else + { + /* snprintf() doesn't understand the '%n' + directive. */ + if (p[1] != '\0') + { + /* Don't use the '%n' directive; instead, look + at the snprintf() return value. */ + p[1] = '\0'; + continue; + } + else + { + /* Look at the snprintf() return value. */ + if (retcount < 0) + { + /* HP-UX 10.20 snprintf() is doubly deficient: + It doesn't understand the '%n' directive, + *and* it returns -1 (rather than the length + that would have been required) when the + buffer is too small. */ + size_t bigger_need = + xsum (xtimes (allocated, 2), 12); + ENSURE_ALLOCATION (bigger_need); + continue; + } + else + count = retcount; + } + } +#endif + + /* Attempt to handle failure. */ + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EINVAL; + return NULL; + } + +#if !USE_SNPRINTF + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); +#endif + + /* Make room for the result. */ + if (count >= maxlen) + { + /* Need at least count bytes. But allocate + proportionally, to avoid looping eternally if + snprintf() reports a too small count. */ + size_t n = + xmax (xsum (length, count), xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); +#if USE_SNPRINTF + continue; +#endif + } + +#if USE_SNPRINTF + /* The snprintf() result did fit. */ +#else + /* Append the sprintf() result. */ + memcpy (result + length, tmp, count * sizeof (CHAR_T)); + if (tmp != tmpbuf) + free (tmp); +#endif + + length += count; + break; + } + } + } + } + + /* Add the final NUL. */ + ENSURE_ALLOCATION (xsum (length, 1)); + result[length] = '\0'; + + if (result != resultbuf && length + 1 < allocated) + { + /* Shrink the allocated memory if possible. */ + CHAR_T *memory; + + memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T)); + if (memory != NULL) + result = memory; + } + + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + *lengthp = length; + return result; + + out_of_memory: + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + out_of_memory_1: + CLEANUP (); + errno = ENOMEM; + return NULL; + } +} + +#undef SNPRINTF +#undef USE_SNPRINTF +#undef PRINTF_PARSE +#undef DIRECTIVES +#undef DIRECTIVE +#undef CHAR_T +#undef VASNPRINTF diff --git a/intl/vasnprintf.h b/intl/vasnprintf.h new file mode 100755 index 0000000..65f1bc1 --- /dev/null +++ b/intl/vasnprintf.h @@ -0,0 +1,61 @@ +/* vsprintf with automatic memory allocation. + Copyright (C) 2002-2003 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 _VASNPRINTF_H +#define _VASNPRINTF_H + +/* Get va_list. */ +#include + +/* Get size_t. */ +#include + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# define __attribute__(Spec) /* empty */ +# endif +/* The __-protected variants of `format' and `printf' attributes + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Write formatted output to a string dynamically allocated with malloc(). + You can pass a preallocated buffer for the result in RESULTBUF and its + size in *LENGTHP; otherwise you pass RESULTBUF = NULL. + If successful, return the address of the string (this may be = RESULTBUF + if no dynamic memory allocation was necessary) and set *LENGTHP to the + number of resulting bytes, excluding the trailing NUL. Upon error, set + errno and return NULL. */ +extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); +extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 3, 0))); + +#ifdef __cplusplus +} +#endif + +#endif /* _VASNPRINTF_H */ diff --git a/intl/vasnwprintf.h b/intl/vasnwprintf.h new file mode 100755 index 0000000..d3cef4c --- /dev/null +++ b/intl/vasnwprintf.h @@ -0,0 +1,46 @@ +/* vswprintf with automatic memory allocation. + Copyright (C) 2002-2003 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 _VASNWPRINTF_H +#define _VASNWPRINTF_H + +/* Get va_list. */ +#include + +/* Get wchar_t, size_t. */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Write formatted output to a string dynamically allocated with malloc(). + You can pass a preallocated buffer for the result in RESULTBUF and its + size in *LENGTHP; otherwise you pass RESULTBUF = NULL. + If successful, return the address of the string (this may be = RESULTBUF + if no dynamic memory allocation was necessary) and set *LENGTHP to the + number of resulting bytes, excluding the trailing NUL. Upon error, set + errno and return NULL. */ +extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...); +extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args); + +#ifdef __cplusplus +} +#endif + +#endif /* _VASNWPRINTF_H */ diff --git a/intl/wprintf-parse.h b/intl/wprintf-parse.h new file mode 100755 index 0000000..24a2cfc --- /dev/null +++ b/intl/wprintf-parse.h @@ -0,0 +1,75 @@ +/* Parse printf format string. + Copyright (C) 1999, 2002-2003 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 _WPRINTF_PARSE_H +#define _WPRINTF_PARSE_H + +#include "printf-args.h" + + +/* Flags */ +#define FLAG_GROUP 1 /* ' flag */ +#define FLAG_LEFT 2 /* - flag */ +#define FLAG_SHOWSIGN 4 /* + flag */ +#define FLAG_SPACE 8 /* space flag */ +#define FLAG_ALT 16 /* # flag */ +#define FLAG_ZERO 32 + +/* arg_index value indicating that no argument is consumed. */ +#define ARG_NONE (~(size_t)0) + +/* A parsed directive. */ +typedef struct +{ + const wchar_t* dir_start; + const wchar_t* dir_end; + int flags; + const wchar_t* width_start; + const wchar_t* width_end; + size_t width_arg_index; + const wchar_t* precision_start; + const wchar_t* precision_end; + size_t precision_arg_index; + wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */ + size_t arg_index; +} +wchar_t_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + wchar_t_directive *dir; + size_t max_width_length; + size_t max_precision_length; +} +wchar_t_directives; + + +/* Parses the format string. Fills in the number N of directives, and fills + in directives[0], ..., directives[N-1], and sets directives[N].dir_start + to the end of the format string. Also fills in the arg_type fields of the + arguments and the needed count of arguments. */ +#ifdef STATIC +STATIC +#else +extern +#endif +int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a); + +#endif /* _WPRINTF_PARSE_H */ diff --git a/intl/xsize.h b/intl/xsize.h new file mode 100755 index 0000000..362e24b --- /dev/null +++ b/intl/xsize.h @@ -0,0 +1,109 @@ +/* xsize.h -- Checked size_t computations. + + 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 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 _XSIZE_H +#define _XSIZE_H + +/* Get size_t. */ +#include + +/* Get SIZE_MAX. */ +#include +#if HAVE_STDINT_H +# include +#endif + +/* The size of memory objects is often computed through expressions of + type size_t. Example: + void* p = malloc (header_size + n * element_size). + These computations can lead to overflow. When this happens, malloc() + returns a piece of memory that is way too small, and the program then + crashes while attempting to fill the memory. + To avoid this, the functions and macros in this file check for overflow. + The convention is that SIZE_MAX represents overflow. + malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc + implementation that uses mmap --, it's recommended to use size_overflow_p() + or size_in_bounds_p() before invoking malloc(). + The example thus becomes: + size_t size = xsum (header_size, xtimes (n, element_size)); + void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); +*/ + +/* Convert an arbitrary value >= 0 to type size_t. */ +#define xcast_size_t(N) \ + ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) + +/* Sum of two sizes, with overflow check. */ +static inline size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum (size_t size1, size_t size2) +{ + size_t sum = size1 + size2; + return (sum >= size1 ? sum : SIZE_MAX); +} + +/* Sum of three sizes, with overflow check. */ +static inline size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum3 (size_t size1, size_t size2, size_t size3) +{ + return xsum (xsum (size1, size2), size3); +} + +/* Sum of four sizes, with overflow check. */ +static inline size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) +{ + return xsum (xsum (xsum (size1, size2), size3), size4); +} + +/* Maximum of two sizes, with overflow check. */ +static inline size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xmax (size_t size1, size_t size2) +{ + /* No explicit check is needed here, because for any n: + max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ + return (size1 >= size2 ? size1 : size2); +} + +/* Multiplication of a count with an element size, with overflow check. + The count must be >= 0 and the element size must be > 0. + This is a macro, not an inline function, so that it works correctly even + when N is of a wider tupe and N > SIZE_MAX. */ +#define xtimes(N, ELSIZE) \ + ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) + +/* Check for overflow. */ +#define size_overflow_p(SIZE) \ + ((SIZE) == SIZE_MAX) +/* Check against overflow. */ +#define size_in_bounds_p(SIZE) \ + ((SIZE) != SIZE_MAX) + +#endif /* _XSIZE_H */ diff --git a/ltmain.sh b/ltmain.sh new file mode 100755 index 0000000..2160ef7 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,6938 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 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 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. +# +# 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. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION="1.5.24 Debian 1.5.24-1ubuntu1" +TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)" + +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + extracted_serial=`expr $extracted_serial + 1` + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + echo "\ +$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP + +Copyright (C) 2007 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.[fF][09]?) xform=[fF][09]. ;; + *.for) xform=for ;; + *.java) xform=java ;; + *.obj) xform=obj ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + major=`expr $current - $age` + else + major=`expr $current - $age + 1` + fi + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + case $archive_cmds in + *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; + *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; + esac + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + else + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + fi + ;; + * ) + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \$*\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` + else + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $echo "Libraries have been installed in:" + for libdir in $libdirs; do + $echo " $libdir" + done + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" + fi + if test -n "$runpath_var"; then + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $echo + $echo "See any operating system documentation about shared libraries for" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/m4/ChangeLog b/m4/ChangeLog new file mode 100755 index 0000000..f2112d5 --- /dev/null +++ b/m4/ChangeLog @@ -0,0 +1,32 @@ +2004-11-19 gettextize + + * codeset.m4: New file, from gettext-0.14.1. + * gettext.m4: New file, from gettext-0.14.1. + * glibc21.m4: New file, from gettext-0.14.1. + * iconv.m4: New file, from gettext-0.14.1. + * intdiv0.m4: New file, from gettext-0.14.1. + * intmax.m4: New file, from gettext-0.14.1. + * inttypes.m4: New file, from gettext-0.14.1. + * inttypes_h.m4: New file, from gettext-0.14.1. + * inttypes-pri.m4: New file, from gettext-0.14.1. + * isc-posix.m4: New file, from gettext-0.14.1. + * lcmessage.m4: New file, from gettext-0.14.1. + * lib-ld.m4: New file, from gettext-0.14.1. + * lib-link.m4: New file, from gettext-0.14.1. + * lib-prefix.m4: New file, from gettext-0.14.1. + * longdouble.m4: New file, from gettext-0.14.1. + * longlong.m4: New file, from gettext-0.14.1. + * nls.m4: New file, from gettext-0.14.1. + * po.m4: New file, from gettext-0.14.1. + * printf-posix.m4: New file, from gettext-0.14.1. + * progtest.m4: New file, from gettext-0.14.1. + * signed.m4: New file, from gettext-0.14.1. + * size_max.m4: New file, from gettext-0.14.1. + * stdint_h.m4: New file, from gettext-0.14.1. + * uintmax_t.m4: New file, from gettext-0.14.1. + * ulonglong.m4: New file, from gettext-0.14.1. + * wchar_t.m4: New file, from gettext-0.14.1. + * wint_t.m4: New file, from gettext-0.14.1. + * xsize.m4: New file, from gettext-0.14.1. + * Makefile.am: New file. + diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100755 index 0000000..f971283 --- /dev/null +++ b/m4/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 diff --git a/m4/Makefile.in b/m4/Makefile.in new file mode 100755 index 0000000..c6dcf2a --- /dev/null +++ b/m4/Makefile.in @@ -0,0 +1,390 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = m4 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longdouble.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +ANTHY_CFLAGS = @ANTHY_CFLAGS@ +ANTHY_LIBS = @ANTHY_LIBS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GENCAT = @GENCAT@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK2_CFLAGS = @GTK2_CFLAGS@ +GTK2_LIBS = @GTK2_LIBS@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIBTOOL_EXPORT_OPTIONS = @LIBTOOL_EXPORT_OPTIONS@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SCIM_ANTHY_DATADIR = @SCIM_ANTHY_DATADIR@ +SCIM_ANTHY_MAJOR_VERSION = @SCIM_ANTHY_MAJOR_VERSION@ +SCIM_ANTHY_MICRO_VERSION = @SCIM_ANTHY_MICRO_VERSION@ +SCIM_ANTHY_MINOR_VERSION = @SCIM_ANTHY_MINOR_VERSION@ +SCIM_ANTHY_VERSION = @SCIM_ANTHY_VERSION@ +SCIM_BUILD_HELPER = @SCIM_BUILD_HELPER@ +SCIM_BUILD_SETUP = @SCIM_BUILD_SETUP@ +SCIM_CFLAGS = @SCIM_CFLAGS@ +SCIM_DATADIR = @SCIM_DATADIR@ +SCIM_DEBUG_FLAGS = @SCIM_DEBUG_FLAGS@ +SCIM_GTKUTILS_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ +SCIM_GTKUTILS_LIBS = @SCIM_GTKUTILS_LIBS@ +SCIM_ICONDIR = @SCIM_ICONDIR@ +SCIM_LIBS = @SCIM_LIBS@ +SCIM_MODULEDIR = @SCIM_MODULEDIR@ +SCIM_VERSION = @SCIM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu m4/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || 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)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: diff --git a/m4/codeset.m4 b/m4/codeset.m4 new file mode 100755 index 0000000..59535eb --- /dev/null +++ b/m4/codeset.m4 @@ -0,0 +1,23 @@ +# codeset.m4 serial AM1 (gettext-0.10.40) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have and nl_langinfo(CODESET).]) + fi +]) diff --git a/m4/gettext.m4 b/m4/gettext.m4 new file mode 100755 index 0000000..a374f03 --- /dev/null +++ b/m4/gettext.m4 @@ -0,0 +1,487 @@ +# gettext.m4 serial 28 (gettext-0.13) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +dnl Macro to add for using GNU gettext. + +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The +dnl default (if it is not specified or empty) is 'no-libtool'. +dnl INTLSYMBOL should be 'external' for packages with no intl directory, +dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. +dnl If INTLSYMBOL is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. If NEEDSYMBOL is specified and is +dnl 'need-formatstring-macros', then GNU gettext implementations that don't +dnl support the ISO C 99 formatstring macros will be ignored. +dnl INTLDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_GNU_GETTEXT], +[ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define(gt_included_intl, ifelse([$1], [external], [no], [yes])) + define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then + dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. + ifelse(gt_included_intl, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Set USE_NLS. + AM_NLS + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + dnl Add a version number to the cache macros. + define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) + define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) + define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) + + AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, + [AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], + gt_cv_func_gnugettext_libc=yes, + gt_cv_func_gnugettext_libc=no)]) + + if test "$gt_cv_func_gnugettext_libc" != "yes"; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + gt_cv_func_gnugettext_libintl, + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias ();], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], + gt_cv_func_gnugettext_libintl=yes, + gt_cv_func_gnugettext_libintl=no) + dnl Now see whether libintl exists and depends on libiconv. + if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias ();], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext_libintl=yes + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if test "$gt_cv_func_gnugettext_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE(HAVE_DCGETTEXT, 1, + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATOBJEXT) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST(GENCAT) + + dnl For backward compatibility. Some Makefiles may be using this. + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST(INTLOBJS) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST(INTLLIBS) + + dnl Make all documented variables known to autoconf. + AC_SUBST(LIBINTL) + AC_SUBST(LTLIBINTL) + AC_SUBST(POSUB) +]) + + +dnl Checks for all prerequisites of the intl subdirectory, +dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, +dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. +AC_DEFUN([AM_INTL_SUBDIR], +[ + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([bh_C_SIGNED])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl + AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl + AC_REQUIRE([gt_TYPE_WCHAR_T])dnl + AC_REQUIRE([gt_TYPE_WINT_T])dnl + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([jm_AC_HEADER_STDINT_H]) + AC_REQUIRE([gt_TYPE_INTMAX_T]) + AC_REQUIRE([gt_PRINTF_POSIX]) + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([jm_GLIBC21])dnl + AC_REQUIRE([gt_INTDIV0])dnl + AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl + AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl + AC_REQUIRE([gt_INTTYPES_PRI])dnl + AC_REQUIRE([gl_XSIZE])dnl + + AC_CHECK_TYPE([ptrdiff_t], , + [AC_DEFINE([ptrdiff_t], [long], + [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) + ]) + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h]) + AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ +mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ +strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ +__fsetlocking]) + + dnl Use the _snprintf function only if it is declared (because on NetBSD it + dnl is defined as a weak alias of snprintf; we prefer to use the latter). + gt_CHECK_DECL(_snprintf, [#include ]) + gt_CHECK_DECL(_snwprintf, [#include ]) + + dnl Use the *_unlocked functions only if they are declared. + dnl (because some of them were defined without being declared in Solaris + dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built + dnl on Solaris 2.5.1 to run on Solaris 2.6). + dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. + gt_CHECK_DECL(feof_unlocked, [#include ]) + gt_CHECK_DECL(fgets_unlocked, [#include ]) + gt_CHECK_DECL(getc_unlocked, [#include ]) + + case $gt_cv_func_printf_posix in + *yes) HAVE_POSIX_PRINTF=1 ;; + *) HAVE_POSIX_PRINTF=0 ;; + esac + AC_SUBST([HAVE_POSIX_PRINTF]) + if test "$ac_cv_func_asprintf" = yes; then + HAVE_ASPRINTF=1 + else + HAVE_ASPRINTF=0 + fi + AC_SUBST([HAVE_ASPRINTF]) + if test "$ac_cv_func_snprintf" = yes; then + HAVE_SNPRINTF=1 + else + HAVE_SNPRINTF=0 + fi + AC_SUBST([HAVE_SNPRINTF]) + if test "$ac_cv_func_wprintf" = yes; then + HAVE_WPRINTF=1 + else + HAVE_WPRINTF=0 + fi + AC_SUBST([HAVE_WPRINTF]) + + AM_ICONV + AM_LANGINFO_CODESET + if test $ac_cv_header_locale_h = yes; then + AM_LC_MESSAGES + fi + + dnl intl/plural.c is generated from intl/plural.y. It requires bison, + dnl because plural.y uses bison specific features. It requires at least + dnl bison-1.26 because earlier versions generate a plural.c that doesn't + dnl compile. + dnl bison is only needed for the maintainer (who touches plural.y). But in + dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put + dnl the rule in general Makefile. Now, some people carelessly touch the + dnl files or have a broken "make" program, hence the plural.c rule will + dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not + dnl present or too old. + AC_CHECK_PROGS([INTLBISON], [bison]) + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + dnl Found it, now check the version. + AC_MSG_CHECKING([version of bison]) +changequote(<<,>>)dnl + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) +changequote([,])dnl + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + AC_MSG_RESULT([$ac_prog_version]) + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi +]) + + +dnl gt_CHECK_DECL(FUNC, INCLUDES) +dnl Check whether a function is declared. +AC_DEFUN([gt_CHECK_DECL], +[ + AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, + [AC_TRY_COMPILE([$2], [ +#ifndef $1 + char *p = (char *) $1; +#endif +], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) + if test $ac_cv_have_decl_$1 = yes; then + gt_value=1 + else + gt_value=0 + fi + AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], + [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/m4/glibc21.m4 b/m4/glibc21.m4 new file mode 100755 index 0000000..9c9f3db --- /dev/null +++ b/m4/glibc21.m4 @@ -0,0 +1,32 @@ +# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +# Test for the GNU C Library, version 2.1 or newer. +# From Bruno Haible. + +AC_DEFUN([jm_GLIBC21], + [ + AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, + ac_cv_gnu_library_2_1, + [AC_EGREP_CPP([Lucky GNU user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + ], + ac_cv_gnu_library_2_1=yes, + ac_cv_gnu_library_2_1=no) + ] + ) + AC_SUBST(GLIBC21) + GLIBC21="$ac_cv_gnu_library_2_1" + ] +) diff --git a/m4/iconv.m4 b/m4/iconv.m4 new file mode 100755 index 0000000..c5f3579 --- /dev/null +++ b/m4/iconv.m4 @@ -0,0 +1,103 @@ +# iconv.m4 serial AM4 (gettext-0.11.3) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) +]) + +AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi +]) diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4 new file mode 100755 index 0000000..55dddcf --- /dev/null +++ b/m4/intdiv0.m4 @@ -0,0 +1,72 @@ +# intdiv0.m4 serial 1 (gettext-0.11.3) +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([gt_INTDIV0], +[ + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + + AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], + gt_cv_int_divbyzero_sigfpe, + [ + AC_TRY_RUN([ +#include +#include + +static void +#ifdef __cplusplus +sigfpe_handler (int sig) +#else +sigfpe_handler (sig) int sig; +#endif +{ + /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ + exit (sig != SIGFPE); +} + +int x = 1; +int y = 0; +int z; +int nan; + +int main () +{ + signal (SIGFPE, sigfpe_handler); +/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ +#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) + signal (SIGTRAP, sigfpe_handler); +#endif +/* Linux/SPARC yields signal SIGILL. */ +#if defined (__sparc__) && defined (__linux__) + signal (SIGILL, sigfpe_handler); +#endif + + z = x / y; + nan = y / y; + exit (1); +} +], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, + [ + # Guess based on the CPU. + case "$host_cpu" in + alpha* | i[34567]86 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; + esac + ]) + ]) + case "$gt_cv_int_divbyzero_sigfpe" in + *yes) value=1;; + *) value=0;; + esac + AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, + [Define if integer division by zero raises signal SIGFPE.]) +]) diff --git a/m4/intmax.m4 b/m4/intmax.m4 new file mode 100755 index 0000000..dfb08cc --- /dev/null +++ b/m4/intmax.m4 @@ -0,0 +1,32 @@ +# intmax.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. +dnl Test whether the system has the 'intmax_t' type, but don't attempt to +dnl find a replacement if it is lacking. + +AC_DEFUN([gt_TYPE_INTMAX_T], +[ + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([jm_AC_HEADER_STDINT_H]) + AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, + [AC_TRY_COMPILE([ +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif +], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) + if test $gt_cv_c_intmax_t = yes; then + AC_DEFINE(HAVE_INTMAX_T, 1, + [Define if you have the 'intmax_t' type in or .]) + fi +]) diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 new file mode 100755 index 0000000..fd007c3 --- /dev/null +++ b/m4/inttypes-pri.m4 @@ -0,0 +1,32 @@ +# inttypes-pri.m4 serial 1 (gettext-0.11.4) +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +# Define PRI_MACROS_BROKEN if exists and defines the PRI* +# macros to non-string values. This is the case on AIX 4.3.3. + +AC_DEFUN([gt_INTTYPES_PRI], +[ + AC_REQUIRE([gt_HEADER_INTTYPES_H]) + if test $gt_cv_header_inttypes_h = yes; then + AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], + gt_cv_inttypes_pri_broken, + [ + AC_TRY_COMPILE([#include +#ifdef PRId32 +char *p = PRId32; +#endif +], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) + ]) + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, + [Define if exists and defines unusable PRI* macros.]) + fi +]) diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 new file mode 100755 index 0000000..ab370ff --- /dev/null +++ b/m4/inttypes.m4 @@ -0,0 +1,27 @@ +# inttypes.m4 serial 1 (gettext-0.11.4) +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H if exists and doesn't clash with +# . + +AC_DEFUN([gt_HEADER_INTTYPES_H], +[ + AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, + [ + AC_TRY_COMPILE( + [#include +#include ], + [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) + ]) + if test $gt_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, + [Define if exists and doesn't clash with .]) + fi +]) diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 new file mode 100755 index 0000000..f342eba --- /dev/null +++ b/m4/inttypes_h.m4 @@ -0,0 +1,28 @@ +# inttypes_h.m4 serial 5 (gettext-0.12) +dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN([jm_AC_HEADER_INTTYPES_H], +[ + AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1;], + jm_ac_cv_header_inttypes_h=yes, + jm_ac_cv_header_inttypes_h=no)]) + if test $jm_ac_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff --git a/m4/isc-posix.m4 b/m4/isc-posix.m4 new file mode 100755 index 0000000..1319dd1 --- /dev/null +++ b/m4/isc-posix.m4 @@ -0,0 +1,26 @@ +# isc-posix.m4 serial 2 (gettext-0.11.2) +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. + +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4 new file mode 100755 index 0000000..ffd4008 --- /dev/null +++ b/m4/lcmessage.m4 @@ -0,0 +1,32 @@ +# lcmessage.m4 serial 3 (gettext-0.11.3) +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995. + +# Check whether LC_MESSAGES is available in . + +AC_DEFUN([AM_LC_MESSAGES], +[ + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi +]) diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 new file mode 100755 index 0000000..38aeaec --- /dev/null +++ b/m4/lib-ld.m4 @@ -0,0 +1,112 @@ +# lib-ld.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl Subroutines of libtool.m4, +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +dnl with libtool.m4. + +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(acl_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$acl_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_LIB_PROG_LD_GNU +]) diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 new file mode 100755 index 0000000..eeb200d --- /dev/null +++ b/m4/lib-link.m4 @@ -0,0 +1,551 @@ +# lib-link.m4 serial 4 (gettext-0.12) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +dnl hardcode_direct, hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib$1-prefix], +[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 new file mode 100755 index 0000000..8aff5a9 --- /dev/null +++ b/m4/lib-prefix.m4 @@ -0,0 +1,155 @@ +# lib-prefix.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) diff --git a/m4/longdouble.m4 b/m4/longdouble.m4 new file mode 100755 index 0000000..1333d2f --- /dev/null +++ b/m4/longdouble.m4 @@ -0,0 +1,30 @@ +# longdouble.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. +dnl Test whether the compiler supports the 'long double' type. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_LONGDOUBLE], +[ + AC_CACHE_CHECK([for long double], gt_cv_c_long_double, + [if test "$GCC" = yes; then + gt_cv_c_long_double=yes + else + AC_TRY_COMPILE([ + /* The Stardent Vistra knows sizeof(long double), but does not support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + int array [2*(sizeof(long double) >= sizeof(double)) - 1]; + ], , + gt_cv_c_long_double=yes, gt_cv_c_long_double=no) + fi]) + if test $gt_cv_c_long_double = yes; then + AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) + fi +]) diff --git a/m4/longlong.m4 b/m4/longlong.m4 new file mode 100755 index 0000000..d7d7350 --- /dev/null +++ b/m4/longlong.m4 @@ -0,0 +1,25 @@ +# longlong.m4 serial 4 +dnl Copyright (C) 1999-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +# Define HAVE_LONG_LONG if 'long long' works. + +AC_DEFUN([jm_AC_TYPE_LONG_LONG], +[ + AC_CACHE_CHECK([for long long], ac_cv_type_long_long, + [AC_TRY_LINK([long long ll = 1LL; int i = 63;], + [long long llmax = (long long) -1; + return ll << i | ll >> i | llmax / ll | llmax % ll;], + ac_cv_type_long_long=yes, + ac_cv_type_long_long=no)]) + if test $ac_cv_type_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, + [Define if you have the 'long long' type.]) + fi +]) diff --git a/m4/nls.m4 b/m4/nls.m4 new file mode 100755 index 0000000..36bc493 --- /dev/null +++ b/m4/nls.m4 @@ -0,0 +1,49 @@ +# nls.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) +]) + +AC_DEFUN([AM_MKINSTALLDIRS], +[ + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but $(top_srcdir). + dnl Try to locate it. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) +]) diff --git a/m4/po.m4 b/m4/po.m4 new file mode 100755 index 0000000..e161998 --- /dev/null +++ b/m4/po.m4 @@ -0,0 +1,426 @@ +# po.m4 serial 3 (gettext-0.14) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU msgfmt. + if test "$GMSGFMT" != ":"; then + dnl If it is no GNU msgfmt we define it as : so that the + dnl Makefiles still can work. + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + AC_MSG_RESULT( + [found $GMSGFMT program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + fi + + AC_OUTPUT_COMMANDS([ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done], + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) + +dnl Postprocesses a Makefile in a directory containing PO files. +AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], +[ + # When this code is run, in config.status, two variables have already been + # set: + # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, + # - LINGUAS is the value of the environment variable LINGUAS at configure + # time. + +changequote(,)dnl + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + # Find a way to echo strings without interpreting backslash. + if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='echo' + else + if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='printf %s\n' + else + echo_func () { + cat < "$ac_file.tmp" + if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + cat >> "$ac_file.tmp" < /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/_/-/g'` + cat >> "$ac_file.tmp" <> "$ac_file.tmp" < +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, + [ + AC_EGREP_CPP(notposix, [ +#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ + notposix +#endif + ], gt_cv_func_printf_posix="guessing no", + gt_cv_func_printf_posix="guessing yes") + ]) + ]) + case $gt_cv_func_printf_posix in + *yes) + AC_DEFINE(HAVE_POSIX_PRINTF, 1, + [Define if your printf() function supports format strings with positions.]) + ;; + esac +]) diff --git a/m4/progtest.m4 b/m4/progtest.m4 new file mode 100755 index 0000000..8fe527c --- /dev/null +++ b/m4/progtest.m4 @@ -0,0 +1,91 @@ +# progtest.m4 serial 3 (gettext-0.12) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1996. + +# Search path for a program which passes the given test. + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) diff --git a/m4/signed.m4 b/m4/signed.m4 new file mode 100755 index 0000000..dc1f54f --- /dev/null +++ b/m4/signed.m4 @@ -0,0 +1,19 @@ +# signed.m4 serial 1 (gettext-0.10.40) +dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([bh_C_SIGNED], +[ + AC_CACHE_CHECK([for signed], bh_cv_c_signed, + [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) + if test $bh_cv_c_signed = no; then + AC_DEFINE(signed, , + [Define to empty if the C compiler doesn't support this keyword.]) + fi +]) diff --git a/m4/size_max.m4 b/m4/size_max.m4 new file mode 100755 index 0000000..5762fc3 --- /dev/null +++ b/m4/size_max.m4 @@ -0,0 +1,61 @@ +# size_max.m4 serial 2 +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([gl_SIZE_MAX], +[ + AC_CHECK_HEADERS(stdint.h) + dnl First test whether the system already has SIZE_MAX. + AC_MSG_CHECKING([for SIZE_MAX]) + result= + AC_EGREP_CPP([Found it], [ +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif +], result=yes) + if test -z "$result"; then + dnl Define it ourselves. Here we assume that the type 'size_t' is not wider + dnl than the type 'unsigned long'. + dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', + dnl which is guaranteed to work from LONG_MIN to LONG_MAX. + _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, + [#include ], result=?) + _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, + [#include ], result=?) + _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, + [#include ], result=?) + if test "$fits_in_uint" = 1; then + dnl Even though SIZE_MAX fits in an unsigned int, it must be of type + dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. + AC_TRY_COMPILE([#include + extern size_t foo; + extern unsigned long foo; + ], [], fits_in_uint=0) + fi + if test -z "$result"; then + if test "$fits_in_uint" = 1; then + result="$res_hi$res_lo"U + else + result="$res_hi$res_lo"UL + fi + else + dnl Shouldn't happen, but who knows... + result='~(size_t)0' + fi + fi + AC_MSG_RESULT([$result]) + if test "$result" != yes; then + AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], + [Define as the maximum value of type 'size_t', if the system doesn't define it.]) + fi +]) diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 new file mode 100755 index 0000000..32ba7ae --- /dev/null +++ b/m4/stdint_h.m4 @@ -0,0 +1,28 @@ +# stdint_h.m4 serial 3 (gettext-0.12) +dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +# Define HAVE_STDINT_H_WITH_UINTMAX if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN([jm_AC_HEADER_STDINT_H], +[ + AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1;], + jm_ac_cv_header_stdint_h=yes, + jm_ac_cv_header_stdint_h=no)]) + if test $jm_ac_cv_header_stdint_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4 new file mode 100755 index 0000000..b5f28d4 --- /dev/null +++ b/m4/uintmax_t.m4 @@ -0,0 +1,32 @@ +# uintmax_t.m4 serial 7 (gettext-0.12) +dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +AC_PREREQ(2.13) + +# Define uintmax_t to 'unsigned long' or 'unsigned long long' +# if it is not already defined in or . + +AC_DEFUN([jm_AC_TYPE_UINTMAX_T], +[ + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([jm_AC_HEADER_STDINT_H]) + if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, + [Define to unsigned long or unsigned long long + if and don't define.]) + else + AC_DEFINE(HAVE_UINTMAX_T, 1, + [Define if you have the 'uintmax_t' type in or .]) + fi +]) diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4 new file mode 100755 index 0000000..1da8b80 --- /dev/null +++ b/m4/ulonglong.m4 @@ -0,0 +1,25 @@ +# ulonglong.m4 serial 3 +dnl Copyright (C) 1999-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. + +AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], +[ + AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, + [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], + [unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull;], + ac_cv_type_unsigned_long_long=yes, + ac_cv_type_unsigned_long_long=no)]) + if test $ac_cv_type_unsigned_long_long = yes; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, + [Define if you have the 'unsigned long long' type.]) + fi +]) diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 new file mode 100755 index 0000000..d8fd1ec --- /dev/null +++ b/m4/wchar_t.m4 @@ -0,0 +1,22 @@ +# wchar_t.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. +dnl Test whether has the 'wchar_t' type. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_WCHAR_T], +[ + AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, + [AC_TRY_COMPILE([#include + wchar_t foo = (wchar_t)'\0';], , + gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) + if test $gt_cv_c_wchar_t = yes; then + AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) + fi +]) diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 new file mode 100755 index 0000000..3d8d215 --- /dev/null +++ b/m4/wint_t.m4 @@ -0,0 +1,22 @@ +# wint_t.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. +dnl Test whether has the 'wint_t' type. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_WINT_T], +[ + AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, + [AC_TRY_COMPILE([#include + wint_t foo = (wchar_t)'\0';], , + gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) + if test $gt_cv_c_wint_t = yes; then + AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) + fi +]) diff --git a/m4/xsize.m4 b/m4/xsize.m4 new file mode 100755 index 0000000..9b7cf9b --- /dev/null +++ b/m4/xsize.m4 @@ -0,0 +1,14 @@ +# xsize.m4 serial 2 +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_XSIZE], +[ + dnl Prerequisites of lib/xsize.h. + AC_REQUIRE([gl_SIZE_MAX]) + AC_CHECK_HEADERS(stdint.h) +]) diff --git a/missing b/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, 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=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# 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 + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -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' + autom4te touch the output file, or create a stub one + 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] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + 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' $msg. 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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # 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 "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && 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 is $msg. + 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 prerequisites 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 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..4f58503 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/packaging/ise-engine-anthy.changes b/packaging/ise-engine-anthy.changes new file mode 100644 index 0000000..3f8105c --- /dev/null +++ b/packaging/ise-engine-anthy.changes @@ -0,0 +1,9 @@ +* Thu Jan 31 2013 Li Zhang submit/tizen_2.0/20130102.010626@7a7fec3 +- upload package +- Fix package information +- Support --no-configure in GBS +- commit preedit string when reset +- Remove anthy +- upload japanese input method engine +- Initial empty repository + diff --git a/packaging/ise-engine-anthy.spec b/packaging/ise-engine-anthy.spec new file mode 100755 index 0000000..c150a5c --- /dev/null +++ b/packaging/ise-engine-anthy.spec @@ -0,0 +1,40 @@ +Name: ise-engine-anthy +Summary: Japanese input method +Version: 0.0.0125 +Release: 1 +Group: System/I18n/Japanese +License: GPL +URL: http://sourceforge.jp/projects/scim-imengine/ +Source0: %{name}-%{version}.tar.gz +BuildRequires: prelink +BuildRequires: gettext-tools +BuildRequires: pkgconfig(isf) +BuildRequires: pkgconfig(anthy) + + +%description +ISF is an input service framework for TIZEN. +Ise-engine-anthy is ISF IMEngine module for Japanese input method base.It converts Hiragana text to Kana Kanji mixed text. + + + +%prep +%setup -q + +%build +%autogen +%configure --prefix=%{_prefix} --disable-static + +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +%make_install + + +%files +%defattr(-,root,root,-) +%{_datadir}/scim/icons/* +%{_datadir}/locale/* +%{_datadir}/scim/Anthy/* +%{_libdir}/scim-1.0/1.4.0/IMEngine/* diff --git a/po/ChangeLog b/po/ChangeLog new file mode 100755 index 0000000..b488b99 --- /dev/null +++ b/po/ChangeLog @@ -0,0 +1,11 @@ +2004-11-19 gettextize + + * Makefile.in.in: New file, from gettext-0.14.1. + * Rules-quot: New file, from gettext-0.14.1. + * boldquot.sed: New file, from gettext-0.14.1. + * en@boldquot.header: New file, from gettext-0.14.1. + * en@quot.header: New file, from gettext-0.14.1. + * insert-header.sin: New file, from gettext-0.14.1. + * quot.sed: New file, from gettext-0.14.1. + * remove-potcdate.sin: New file, from gettext-0.14.1. + diff --git a/po/Makefile.in.in b/po/Makefile.in.in new file mode 100755 index 0000000..53efc5e --- /dev/null +++ b/po/Makefile.in.in @@ -0,0 +1,366 @@ +# Makefile for PO directory in any package using GNU gettext. +# Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License but which still want to provide support for the GNU gettext +# functionality. +# Please note that the actual code of GNU gettext is covered by the GNU +# General Public License and is *not* in the public domain. +# +# Origin: gettext-0.14 + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = @datadir@ +localedir = $(datadir)/locale +gettextsrcdir = $(datadir)/gettext/po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) + +GMSGFMT = @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = @XGETTEXT@ +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +UPDATEPOFILES = @UPDATEPOFILES@ +DUMMYPOFILES = @DUMMYPOFILES@ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ +$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) + +POTFILES = \ + +CATALOGS = @CATALOGS@ + +# Makevars gets inserted here. (Don't remove this line!) + +.SUFFIXES: +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all: all-@USE_NLS@ + +all-yes: stamp-po +all-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common) Makevars.template; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +install-data-no: all +install-data-yes: all + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +install-strip: install + +installdirs: installdirs-exec installdirs-data +installdirs-exec: +installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: uninstall-exec uninstall-data +uninstall-exec: +uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +uninstall-data-no: +uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +check: all + +info dvi ps pdf html tags TAGS ctags CTAGS ID: + +mostlyclean: + rm -f remove-potcdate.sed + rm -f stamp-poT + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f stamp-po $(GMOFILES) + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: + $(MAKE) update-po + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: $(DISTFILES) + dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ + done; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ + for file in $$dists; do \ + if test -f $$file; then \ + cp -p $$file $(distdir); \ + else \ + cp -p $(srcdir)/$$file $(distdir); \ + fi; \ + done + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: + +Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@ + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +force: + +# 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: diff --git a/po/Makevars b/po/Makevars new file mode 100755 index 0000000..eda034f --- /dev/null +++ b/po/Makevars @@ -0,0 +1,41 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = ise-engine-anthy + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Takuro Ashie + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = ashie@homa.ne.jp + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100755 index 0000000..c517cd4 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,8 @@ +src/scim_anthy_imengine.cpp +src/scim_anthy_factory.cpp +src/scim_anthy_setup.cpp +src/scim_anthy_setup_romaji.cpp +src/scim_anthy_setup_kana.cpp +src/scim_anthy_table_editor.cpp +src/scim_anthy_prefs.cpp +src/scim_anthy_color_button.cpp diff --git a/po/Rules-quot b/po/Rules-quot new file mode 100755 index 0000000..9c2a995 --- /dev/null +++ b/po/Rules-quot @@ -0,0 +1,47 @@ +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff --git a/po/boldquot.sed b/po/boldquot.sed new file mode 100755 index 0000000..4b937aa --- /dev/null +++ b/po/boldquot.sed @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff --git a/po/de.po b/po/de.po new file mode 100755 index 0000000..b49ec5b --- /dev/null +++ b/po/de.po @@ -0,0 +1,1669 @@ +# translation of de.po to German +# German translations for PACKAGE package. +# Copyright (C) 2007 Takuro Ashie +# This file is distributed under the same license as the PACKAGE package. +# +# Gerrit Sangel , 2007. +msgid "" +msgstr "" +"Project-Id-Version: de\n" +"Report-Msgid-Bugs-To: ashie@homa.ne.jp\n" +"POT-Creation-Date: 2009-01-15 12:04+0900\n" +"PO-Revision-Date: 2007-07-03 20:23+0200\n" +"Last-Translator: Gerrit Sangel \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: KBabel 1.11.4\n" + +#: src/scim_anthy_imengine.cpp:488 +#, c-format +msgid "Candidates (%d/%d)" +msgstr "Kandidaten (%d/%d)" + +#: src/scim_anthy_imengine.cpp:565 +msgid "Input mode" +msgstr "Eingabemodus" + +#: src/scim_anthy_imengine.cpp:569 src/scim_anthy_setup.cpp:203 +msgid "Hiragana" +msgstr "Hiragana" + +#: src/scim_anthy_imengine.cpp:573 src/scim_anthy_setup.cpp:204 +msgid "Katakana" +msgstr "Katakana" + +#: src/scim_anthy_imengine.cpp:577 src/scim_anthy_imengine.cpp:578 +#: src/scim_anthy_setup.cpp:205 +msgid "Half width katakana" +msgstr "Halbbreite Katakana" + +#: src/scim_anthy_imengine.cpp:582 src/scim_anthy_setup.cpp:206 +msgid "Latin" +msgstr "Latein" + +#: src/scim_anthy_imengine.cpp:582 +msgid "Direct input" +msgstr "Direkteingabe" + +#: src/scim_anthy_imengine.cpp:586 src/scim_anthy_setup.cpp:207 +msgid "Wide latin" +msgstr "Breites Latein" + +#: src/scim_anthy_imengine.cpp:592 +msgid "Typing method" +msgstr "Schreibmethode" + +#: src/scim_anthy_imengine.cpp:596 +msgid "Romaji" +msgstr "Romaji" + +#: src/scim_anthy_imengine.cpp:600 +msgid "Kana" +msgstr "Kana" + +#: src/scim_anthy_imengine.cpp:604 +msgid "Thumb shift" +msgstr "Umschalt" + +#: src/scim_anthy_imengine.cpp:611 +#, fuzzy +msgid "Conversion mode" +msgstr "Konvertierungsmethode" + +#: src/scim_anthy_imengine.cpp:615 src/scim_anthy_imengine.cpp:616 +#: src/scim_anthy_setup.cpp:221 +msgid "Multi segment" +msgstr "Mehrfachsegment" + +#: src/scim_anthy_imengine.cpp:620 src/scim_anthy_imengine.cpp:621 +#: src/scim_anthy_setup.cpp:222 +msgid "Single segment" +msgstr "Einzelsegment" + +#: src/scim_anthy_imengine.cpp:625 src/scim_anthy_imengine.cpp:627 +#: src/scim_anthy_setup.cpp:223 +msgid "Convert as you type (Multi segment)" +msgstr "Beim Tippen konvertieren (Mehrfachsegment)" + +#: src/scim_anthy_imengine.cpp:631 src/scim_anthy_imengine.cpp:633 +#: src/scim_anthy_setup.cpp:224 +msgid "Convert as you type (Single segment)" +msgstr "Beim Tippen konvertieren (Einzelsegment)" + +#: src/scim_anthy_imengine.cpp:640 +#, fuzzy +msgid "Period style" +msgstr "Punkttyp" + +#: src/scim_anthy_imengine.cpp:669 +msgid "Symbol style" +msgstr "Symboltyp" + +#: src/scim_anthy_imengine.cpp:717 +msgid "Dictionary menu" +msgstr "Wörterbuchmenü" + +#: src/scim_anthy_imengine.cpp:722 +msgid "Edit the dictionary" +msgstr "Wörterbuch bearbeiten" + +#: src/scim_anthy_imengine.cpp:724 +msgid "Launch the dictionary administration tool." +msgstr "Die Wörterbuchverwaltung starten." + +#: src/scim_anthy_imengine.cpp:730 src/scim_anthy_prefs.cpp:1205 +msgid "Add a word" +msgstr "Wort hinzufügen" + +#: src/scim_anthy_imengine.cpp:732 +#, fuzzy +msgid "Add a word to the dictionary." +msgstr "Ein Wort dem Wörterbuch hinzufügen." + +#: src/scim_anthy_factory.cpp:195 +#, fuzzy +msgid "" +"Authors of scim-anthy:\n" +" Copyright (C) 2004,2005 Takuro Ashie \n" +" Copyright (C) 2004,2005 Hiroyuki Ikezoe \n" +" \n" +"Authors of Anthy:\n" +" Copyright (C) 2000-2005 Yusuke TABATA \n" +" Copyright (C) 2004-2005 Yuichi YOSHIDA \n" +" You can find out all credits of Anthy from AUTHORS file in Anthy package.\n" +msgstr "" +"Autoren von Scim-Anthy:\n" +" Copyright © 2004, 2005 Takuro Ashie \n" +" Copyright © 2004, 2005 Hiroyuki Ikezoe \n" +" Copyright © 2006, 2007 Takashi Nakamoto \n" +" \n" +"Autoren von Anthy:\n" +" Copyright © 2000–2005 Yusuke TABATA \n" +" Copyright © 2004–2005 Yuichi YOSHIDA \n" +" Sie können alle Mitwirkenden von Anthy in der AUTHORS-Datei im Anthy-Paket " +"finden.\n" + +#: src/scim_anthy_factory.cpp:211 +#, fuzzy +msgid "" +"Art work:\n" +" SHIMODA Hiroshi \n" +"\n" +"Translation:\n" +" Gerrit Sangel \n" +"Special thanks:\n" +" UTUMI Hirosi \n" +" Yukiko Bando \n" +" Mike Fabian \n" +" David Oftedal \n" +" Ryo Dairiki \n" +" Seiichi SATO\n" +" AWASHIRO Ikuya \n" +" Hatuka*nezumi \n" +" Teppei Tamra \n" +" Akira TAGOH \n" +" Tatsuki Sugiura \n" +" Takashi Nakamoto " +msgstr "" +"Art work:\n" +" SHIMODA Hiroshi \n" +"Besonderen Dank an:\n" +" UTUMI Hirosi \n" +" Yukiko Bando \n" +" Mike Fabian \n" +" David Oftedal \n" +" Ryo Dairiki \n" +" Seiichi SATO\n" +" AWASHIRO Ikuya \n" +" Hatuka*nezumi \n" +" Teppei Tamra \n" +" Akira TAGOH \n" +" Tatsuki Sugiura \n" +" Takashi Nakamoto " + +#: src/scim_anthy_factory.cpp:236 +msgid "" +"Basic operation:\n" +" \n" +msgstr "" +"Grundoperation:\n" +" \n" + +#: src/scim_anthy_factory.cpp:240 +msgid "" +"1. Switch input mode:\n" +" You can switch on/off Japanese input mode by pressing Zenkaku_Hankaku key\n" +" or Control+J. Or you can rotate all input modes by pressing Control+,\n" +" (comma).\n" +" \n" +msgstr "" +"1. Eingabemodus wechseln:\n" +" Sie können den japanischen Eingabemodus durch Drücken der Zenkaku_Hankaku-" +"Taste\n" +" oder Strg+J ein-/ausschalten. Oder sie können alle Eingabemodus durch " +"Drücken von Strg+,\n" +" (Komma) rotieren.\n" +" \n" + +#: src/scim_anthy_factory.cpp:247 +#, fuzzy +msgid "" +"2. Input Japanese hiragana and katakana:\n" +" You can input Japanese hiragana and katakana by inputting romaji.\n" +" The Romaji table can be found out from the \"Anthy\" section of the setup\n" +" window in SCIM or SKIM.\n" +" If you want to hiragana and katakana directly by using Japanese keyboard,\n" +" please press Alt + Romaji key or Conrol+\\ key to switch typing method.\n" +" \n" +msgstr "" +"2. Hiragana und Katakana eingeben:\n" +" Sie können Hiragana und Katakana durch Eingabe von Romaji eingeben.\n" +" Die Romaji-Tabelle wird aus der „Anthy“-Sektion im Einrichtungsfenster von " +"SCIM\n" +" oder SKIM gefunden.\n" +" Wenn Sie Hiragana und Katakana direkt mit der japanischen Tastatur " +"eingeben\n" +" möchten, drücken Sie Alt + Romaji-Taste oder Strg+\\-Taste um die " +"Schreibmethode zu\n" +" wechseln.\n" +" \n" + +#: src/scim_anthy_factory.cpp:256 +#, fuzzy +msgid "" +"3. Convert hiragana or katakana to Japanese kanji\n" +" After inputting hiragana or katakana, you can convert it to Japanese\n" +" kanji by pressing Space key. Then it will show some candidates. You can\n" +" select the next candidate by pressing Space key, and can commit it by\n" +" pressing Enter key.\n" +" If you input a sentense, Anthy will split it to some segments. You can\n" +" select the next or previous segment by pressing left or right cursor key,\n" +" and can extend or shrink the selected segment by pressing Shift + left or\n" +" right cursor key.\n" +" \n" +msgstr "" +"3. Hiragana oder Katakana in Kanji konvertieren\n" +" Nach der Eingabe von Hiragana oder Katakana können Sie sie in Kanji durch\n" +" Drücken der Leertaste konvertieren. Dann werden einige Kandidaten " +"gezeigt.\n" +" Sie können den nächsten Kandidaten durch Drücken der Leertaste auswählen\n" +" und ihn dann durch Drücken der Eingabetaste festlegen.\n" +" Wenn sie einen Satz eingeben, wird Anthy ihn in einige Segmente " +"aufteilen.\n" +" Sie können das nächste oder vorherige Segmente durch Drücken der linken\n" +" oder rechten Pfeiltaste auswählen und das ausgewählte Segment durch " +"Drücken\n" +" von Shift + linker oder rechter Pfeiltaste vergrößern bzw. verkleinern.\n" +" \n" + +#: src/scim_anthy_factory.cpp:268 +msgid "" +"4. Other key bindings:\n" +" You can find out all key bindings definition of scim-anthy from \"Anthy\"\n" +" section on setup window of SCIM or SKIM.\n" +msgstr "" +"4, Andere Tastatenkürzel:\n" +" Sie können alle Tastenkürzel von Scim-Anthy auf der „Anthy“-\n" +" Sektion im Einrichtungsbildschirm von SCIM oder SKIM finden.\n" + +#: src/scim_anthy_setup.cpp:119 +msgid "Anthy" +msgstr "Anthy" + +#: src/scim_anthy_setup.cpp:124 +msgid "An Anthy IMEngine Module." +msgstr "Ein Anthy-IMEngine-Modul" + +#: src/scim_anthy_setup.cpp:184 +msgid "Mode keys" +msgstr "Modustasten" + +#: src/scim_anthy_setup.cpp:185 +#, fuzzy +msgid "Edit keys" +msgstr "Bearbeitungstasten" + +#: src/scim_anthy_setup.cpp:186 +msgid "Caret keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:187 +#, fuzzy +msgid "Segments keys" +msgstr "Segmenttasten" + +#: src/scim_anthy_setup.cpp:188 +msgid "Candidates keys" +msgstr "Kandidatentasten" + +#: src/scim_anthy_setup.cpp:189 +msgid "Direct select keys" +msgstr "Direktauswahltasten" + +#: src/scim_anthy_setup.cpp:190 +msgid "Convert keys" +msgstr "Konvertierungsteasten" + +#: src/scim_anthy_setup.cpp:191 +msgid "Dictionary keys" +msgstr "Wörterbuchtasten" + +#: src/scim_anthy_setup.cpp:213 +msgid "Romaji typing method" +msgstr "Romaji-Schreibmethode" + +#: src/scim_anthy_setup.cpp:214 +msgid "Kana typing method" +msgstr "Kana-Schreibmethode" + +#: src/scim_anthy_setup.cpp:215 +msgid "Thumb shift typing method" +msgstr "" + +#: src/scim_anthy_setup.cpp:248 src/scim_anthy_setup.cpp:256 +#, fuzzy +msgid "Follow input mode" +msgstr "Eingabemodus folgen" + +#: src/scim_anthy_setup.cpp:249 src/scim_anthy_setup.cpp:257 +msgid "Wide" +msgstr "Breit" + +#: src/scim_anthy_setup.cpp:250 src/scim_anthy_setup.cpp:258 +msgid "Half" +msgstr "Halb" + +#: src/scim_anthy_setup.cpp:264 src/scim_anthy_prefs.cpp:740 +msgid "Do nothing" +msgstr "Nichts tun" + +#: src/scim_anthy_setup.cpp:265 +msgid "Start conversion" +msgstr "Konvertierung starten" + +#: src/scim_anthy_setup.cpp:266 src/scim_anthy_setup.cpp:272 +#: src/scim_anthy_prefs.cpp:680 +msgid "Commit" +msgstr "Übergabe" + +#: src/scim_anthy_setup.cpp:273 +#, fuzzy +msgid "Clear" +msgstr "Löschen" + +#: src/scim_anthy_setup.cpp:279 +msgid "UTF-8" +msgstr "UTF-8" + +#: src/scim_anthy_setup.cpp:280 +msgid "EUC-JP" +msgstr "EUC-JP" + +#: src/scim_anthy_setup.cpp:281 +msgid "EUC-JP-MS" +msgstr "EUC-JP-MS" + +#: src/scim_anthy_setup.cpp:287 +#, fuzzy +msgid "No decoration" +msgstr "Keine Hervorhebung" + +#: src/scim_anthy_setup.cpp:288 +msgid "Underline" +msgstr "Unterstreichen" + +#: src/scim_anthy_setup.cpp:289 +#, fuzzy +msgid "Reverse" +msgstr "Umkehren" + +#: src/scim_anthy_setup.cpp:290 +msgid "Highlight" +msgstr "Hervorheben" + +#: src/scim_anthy_setup.cpp:291 +msgid "String color" +msgstr "Farbe der Zeichenkette" + +#: src/scim_anthy_setup.cpp:292 +msgid "BG color" +msgstr "Hintergrundfarbe" + +#: src/scim_anthy_setup.cpp:293 +msgid "Both color" +msgstr "" + +#: src/scim_anthy_setup.cpp:805 +msgid "_Group:" +msgstr "_Gruppe:" + +#: src/scim_anthy_setup.cpp:826 +msgid "Search by key" +msgstr "Nach Taste suchen" + +#: src/scim_anthy_setup.cpp:830 +#, fuzzy +msgid "all" +msgstr "Alles" + +#: src/scim_anthy_setup.cpp:873 +msgid "Feature" +msgstr "Funktion" + +#: src/scim_anthy_setup.cpp:882 src/scim_anthy_setup.cpp:1289 +#, fuzzy +msgid "Key bindings" +msgstr "_Tastenkürzel:" + +#: src/scim_anthy_setup.cpp:890 +msgid "Description" +msgstr "Beschreibung" + +#: src/scim_anthy_setup.cpp:914 +msgid "Key bindings _theme:" +msgstr "Tastenkürzel-_Vorlage" + +#: src/scim_anthy_setup.cpp:928 +msgid "_Choose keys..." +msgstr "Tasten _auswählen..." + +#: src/scim_anthy_setup.cpp:955 +#, fuzzy +msgid "Enable/Disable learning" +msgstr "Lernen an-/ausschalten" + +#: src/scim_anthy_setup.cpp:982 +#, fuzzy +msgid "Key preferences to commit with reversing learning preference" +msgstr "Tastenpräferenzen zur Übergabe bei umgekehrten Lernpräferenzen" + +#: src/scim_anthy_setup.cpp:1056 src/scim_anthy_setup.cpp:1070 +msgid "_Launch" +msgstr "_Starten" + +#: src/scim_anthy_setup.cpp:1241 +#, c-format +msgid "" +"%s-%s\n" +"\n" +"A Japanese input method module\n" +"for SCIM using Anthy\n" +"\n" +"\n" +"\n" +"Copyright 2005-2006, Takuro Ashie <ashie@homa.ne." +"jp>" +msgstr "" +"%s-%s\n" +"\n" +"Eine japanische Eingabemethode\n" +"für SCIM, benutzt Anthy\n" +"\n" +"\n" +"\n" +"Copyright 2005-2006, Takuro Ashie <ashie@homa.ne." +"jp>" + +#: src/scim_anthy_setup.cpp:1277 +msgid "Common" +msgstr "Gemeinsam" + +#: src/scim_anthy_setup.cpp:1283 +msgid "Symbols" +msgstr "Symbole" + +#: src/scim_anthy_setup.cpp:1295 +#, fuzzy +msgid "Romaji typing" +msgstr "Romaji tippen" + +#: src/scim_anthy_setup.cpp:1301 +#, fuzzy +msgid "Kana typing" +msgstr "Kana tippen" + +#: src/scim_anthy_setup.cpp:1307 +#, fuzzy +msgid "Prediction" +msgstr "Vorhersagen" + +#: src/scim_anthy_setup.cpp:1313 +#, fuzzy +msgid "Learning" +msgstr "Lernen" + +#: src/scim_anthy_setup.cpp:1319 +msgid "Dictionary" +msgstr "Wörterbuch" + +#: src/scim_anthy_setup.cpp:1325 +#, fuzzy +msgid "Candidates window" +msgstr "Kandidatenfenster" + +#: src/scim_anthy_setup.cpp:1331 +msgid "Toolbar" +msgstr "Werkzeugleiste" + +#: src/scim_anthy_setup.cpp:1337 +msgid "Appearance" +msgstr "" + +#: src/scim_anthy_setup.cpp:1343 +msgid "About" +msgstr "Über" + +#: src/scim_anthy_setup.cpp:1405 src/scim_anthy_setup_romaji.cpp:255 +#: src/scim_anthy_setup_kana.cpp:413 src/scim_anthy_setup_kana.cpp:480 +msgid "User defined" +msgstr "Benutzerdefiniert" + +#: src/scim_anthy_setup.cpp:1408 src/scim_anthy_setup_romaji.cpp:258 +#: src/scim_anthy_setup_kana.cpp:416 src/scim_anthy_setup_kana.cpp:483 +#, fuzzy +msgid "Default" +msgstr "Standard" + +#: src/scim_anthy_setup.cpp:2006 +msgid "Set key filter" +msgstr "Tastenfilter setzen" + +#: src/scim_anthy_setup_romaji.cpp:124 src/scim_anthy_setup_romaji.cpp:195 +msgid "Romaji _table:" +msgstr "Romaji-_Tabelle" + +#: src/scim_anthy_setup_romaji.cpp:137 src/scim_anthy_setup_kana.cpp:143 +#: src/scim_anthy_setup_kana.cpp:188 +msgid "_Customize..." +msgstr "_Bearbeiten..." + +#: src/scim_anthy_setup_romaji.cpp:177 +msgid "Sequence" +msgstr "Sequenz" + +#: src/scim_anthy_setup_romaji.cpp:178 src/scim_anthy_setup_kana.cpp:263 +msgid "Result" +msgstr "Ergebnis" + +#: src/scim_anthy_setup_romaji.cpp:185 +#, fuzzy +msgid "Customize romaji table" +msgstr "Romaji-Tabelle bearbeiten" + +#: src/scim_anthy_setup_kana.cpp:114 +msgid "JIS Kana Layout" +msgstr "JIS Kana-Anordnung" + +#: src/scim_anthy_setup_kana.cpp:130 src/scim_anthy_setup_kana.cpp:175 +msgid "La_yout:" +msgstr "_Anordnung:" + +#: src/scim_anthy_setup_kana.cpp:155 +msgid "Thumb Shift Layout" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:262 src/scim_anthy_setup_kana.cpp:332 +msgid "Key" +msgstr "Taste" + +#: src/scim_anthy_setup_kana.cpp:270 +#, fuzzy +msgid "Customize kana layout table" +msgstr "Kana-Anordnungstabelle bearbeiten" + +#: src/scim_anthy_setup_kana.cpp:280 src/scim_anthy_setup_kana.cpp:352 +msgid "Layout _table:" +msgstr "Anordnungs_tabelle" + +#: src/scim_anthy_setup_kana.cpp:333 +#, fuzzy +msgid "Single press" +msgstr "Einzelklick" + +#: src/scim_anthy_setup_kana.cpp:334 +msgid "Left thumb shift" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:335 +msgid "Right thumb shift" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:342 +#, fuzzy +msgid "Customize thumb shift layout table" +msgstr "Kana-Anordnungstabelle bearbeiten" + +#: src/scim_anthy_prefs.cpp:35 +#, fuzzy +msgid "Show \"_Candidates\" label" +msgstr "„Kandidaten“-Beschriftung anzeigen" + +#: src/scim_anthy_prefs.cpp:45 +msgid "Close candidate window when select a candidate _directly" +msgstr "" +"Kandidatenfenster schließen, wenn ein Kandidat _direkt ausgewählt wurde" + +#: src/scim_anthy_prefs.cpp:55 +#, fuzzy +msgid "Learn on _manual committing" +msgstr "Bei _manueller Übergabe lernen" + +#: src/scim_anthy_prefs.cpp:65 +msgid "Learn on a_uto committing" +msgstr "Bei a_utomatischer Übergabe lernen" + +#: src/scim_anthy_prefs.cpp:75 +msgid "Use half-width characters for _symbols" +msgstr "Benutze halbbreite Zeichen für _Symbole" + +#: src/scim_anthy_prefs.cpp:85 +msgid "Use half-width characters for _numbers" +msgstr "Benutze halbbreite Zeichen für _Nummern" + +#: src/scim_anthy_prefs.cpp:95 +msgid "A_llow spliting romaji on editing preedit string" +msgstr "Teilen der Romaji bei unbearbeiteter Zeichenkette _erlauben" + +#: src/scim_anthy_prefs.cpp:97 +#, fuzzy +msgid "If this check is enabled, you can delete each letter." +msgstr "Wenn diese Box angeklickt ist, können Sie jeden Buchstaben löschen" + +#: src/scim_anthy_prefs.cpp:104 +#, fuzzy +msgid "_Entering the pseudo ASCII input mode with capital letters." +msgstr "Pseudo-ASCII-Eingabemodus mit Großbuchstaben _eingeben" + +#: src/scim_anthy_prefs.cpp:106 +msgid "" +"If this check is enabled, capital letters will becomes a trigger to enter " +"the pseudo ASCII input mode." +msgstr "" +"Wenn diese Box angeklickt ist, werden Großbuchstaben Auslöser um zum Pseudo-" +"ASCII-Eingabemodus zu gelangen" + +#: src/scim_anthy_prefs.cpp:113 +msgid "Insert a _blank with a blank key." +msgstr "Eine _Lücke mit einer Leertaste einfügen" + +#: src/scim_anthy_prefs.cpp:115 +msgid "" +"If this check is enabled, a blank key will works to insert a blank when " +"entering the pseudo ASCII input mode." +msgstr "" +"Wenn diese Box angeklickt ist, wird bei der Eingabe mit dem Pseudo-ASCII-" +"Modus eine Leertaste eine Lücke einfügen " + +#: src/scim_anthy_prefs.cpp:122 +msgid "_Show predicted candidates while inputting letters" +msgstr "_Zeige vorhergesagte Kandidaten bei der Eingabe der Buchstaben" + +#: src/scim_anthy_prefs.cpp:131 +msgid "Use _direct select keys while predicting" +msgstr "Nutze Direktauswahltasten bei der Vorhersage" + +#: src/scim_anthy_prefs.cpp:140 +msgid "Show _input mode label" +msgstr "_Eingabemodus-Beschriftung zeigen" + +#: src/scim_anthy_prefs.cpp:150 +#, fuzzy +msgid "Show _conversion mode label" +msgstr "_Konvertierungsmethoden-Beschriftung zeigen" + +#: src/scim_anthy_prefs.cpp:160 +msgid "Show _typing method label" +msgstr "_Schreibmethoden-Beschriftung zeigen" + +#: src/scim_anthy_prefs.cpp:170 +msgid "Show _period style label" +msgstr "Zeige Punkt-Stilbezeichnung" + +#: src/scim_anthy_prefs.cpp:180 +#, fuzzy +msgid "Show _symbol style label" +msgstr "Zeige Symbol-Stilbezeichnung" + +#: src/scim_anthy_prefs.cpp:190 +msgid "Show _dictionary menu label" +msgstr "_Wörterbuchmenü-Beschriftung zeigen" + +#: src/scim_anthy_prefs.cpp:200 +msgid "Show _edit dictionary label" +msgstr "Wörterbuch-_bearbeiten-Beschriftung zeigen" + +#: src/scim_anthy_prefs.cpp:210 +msgid "Show _add word label" +msgstr "Wort-_hinzufügen-Beschriftung zeigen" + +#: src/scim_anthy_prefs.cpp:235 +msgid "Number of candidates to show in a _page:" +msgstr "Anzahl der auf einer _Seite anzuzeigenden Kandidaten" + +#: src/scim_anthy_prefs.cpp:238 +msgid "" +"Specify the number of candidates to show in a page of the candidates window." +msgstr "" +"Die Anzahl der Kandidaten, die af einer Seite in dem Kandidatenfenster " +"angezeigt werden, angeben" + +#: src/scim_anthy_prefs.cpp:247 +msgid "Number of _triggers until show:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:248 +msgid "[times]" +msgstr "" + +#: src/scim_anthy_prefs.cpp:250 +msgid "" +"The number of times to press a conversion key until show the candidates " +"window.Specify 0 to never show it." +msgstr "" +"Die Anzahl der Zeiten, die eine Konvertierungstaste gedrückt werden muss, " +"bis das Kandidatenfenster gezeigt wird. 0 eingeben, um es nie zu zeigen." + +#: src/scim_anthy_prefs.cpp:260 +#, fuzzy +msgid "_Simultaneous pressing time:" +msgstr "_Gleichzeitige Drückzeit" + +#: src/scim_anthy_prefs.cpp:261 +msgid "[msec]" +msgstr "[msec]" + +#: src/scim_anthy_prefs.cpp:263 +msgid "Time to regard as simultaneous key pressing." +msgstr "" + +#: src/scim_anthy_prefs.cpp:286 +msgid "_Input mode: " +msgstr "_Eingabemodus:" + +#: src/scim_anthy_prefs.cpp:296 +msgid "Typing _method: " +msgstr "Schreibmethode:" + +#: src/scim_anthy_prefs.cpp:306 +#, fuzzy +msgid "_Conversion mode: " +msgstr "_Konvertierungsmethode:" + +#: src/scim_anthy_prefs.cpp:316 +msgid "St_yle of comma and period: " +msgstr "Stil von Komma und Punkt" + +#: src/scim_anthy_prefs.cpp:326 +msgid "Symb_ol input style: " +msgstr "Symbol-Eingabestil" + +#: src/scim_anthy_prefs.cpp:336 +msgid "_Space type: " +msgstr "_Leertastentyp:" + +#: src/scim_anthy_prefs.cpp:346 +#, fuzzy +msgid "Input from _ten key: " +msgstr "Eingabe von _Ziffernblock" + +#: src/scim_anthy_prefs.cpp:356 +msgid "_Behavior on a comma or a period:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:366 +msgid "_Behavior on focus out:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:376 +msgid "_Left thumb shift keys:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:386 +msgid "_Right thumb shift keys:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:396 +msgid "_Commit:" +msgstr "_Übergabe:" + +#: src/scim_anthy_prefs.cpp:397 src/scim_anthy_prefs.cpp:681 +msgid "Select commit keys" +msgstr "Übergabe-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:398 +msgid "" +"The key events to commit the preedit string with reversing the preference of " +"learning. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:407 +msgid "Commit the _first segment:" +msgstr "Das _erste Segment übergeben:" + +#: src/scim_anthy_prefs.cpp:408 src/scim_anthy_prefs.cpp:880 +msgid "Select keys to commit the first segment" +msgstr " Tasten wählen, um das erste Segment zu übergeben" + +#: src/scim_anthy_prefs.cpp:409 +msgid "" +"The key events to commit the first segment with reversing the preference of " +"learning. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:418 +msgid "Commit the _selected segment:" +msgstr "Das _ausgewählte Segment übergeben:" + +#: src/scim_anthy_prefs.cpp:419 src/scim_anthy_prefs.cpp:890 +msgid "Select keys to commit the selected segment" +msgstr " Tasten wählen, um das ausgewählte Segment zu übergeben" + +#: src/scim_anthy_prefs.cpp:420 +msgid "" +"The key events to commit the selected segment with reversing the preference " +"of learning. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:429 +msgid "En_coding of dictionary:" +msgstr "_Kodierung des Wörterbuchs:" + +#: src/scim_anthy_prefs.cpp:431 +msgid "" +"If you choose \"EUC-JP-MS\", interoperatability of documents created on this " +"system with Microsoft Windows may improve, but it depends on the " +"implementation of your operating system and actual encoding of your " +"dictionary." +msgstr "" +"Wenn Sie „EUC-JP-MS“ auswählen, kann sich die Interoperabilität mit " +"Microsoft Windows bei Dokumenten, die auf diesem System erstellt werden, " +"verbessern, allerdings hängt es von der Implementierung Ihres Betriebssystem " +"und der tatsächlichen Kodierung Ihres Wörterbuchs ab." + +#: src/scim_anthy_prefs.cpp:442 +msgid "\"_Edit dictionary\" command:" +msgstr "„Wörterbuch b_earbeiten“-Befehl" + +#: src/scim_anthy_prefs.cpp:452 +msgid "\"_Add word\" command:" +msgstr "„Wort hinzufügen“-Befehl:" + +#: src/scim_anthy_prefs.cpp:462 +msgid "_Preedit string:" +msgstr "_Unbearbeitete Zeichenkette:" + +#: src/scim_anthy_prefs.cpp:472 +msgid "_Conversion string:" +msgstr "_Konvertierungszeichenkette" + +#: src/scim_anthy_prefs.cpp:482 +msgid "_Selected segment:" +msgstr "_Ausgewähltes Segment" + +#: src/scim_anthy_prefs.cpp:506 +msgid "Toggle on/off" +msgstr "an/aus umschalten" + +#: src/scim_anthy_prefs.cpp:507 +msgid "Select toggle on/off keys" +msgstr "Tasten um an/aus umzuschalten auswählen" + +#: src/scim_anthy_prefs.cpp:508 +msgid "The key events to toggle on/off Japanese mode. " +msgstr "Die Tastatureignisse, die an/aus umschalten" + +#: src/scim_anthy_prefs.cpp:516 +msgid "Circle input mode" +msgstr "Eingabemodus durchschalten" + +#: src/scim_anthy_prefs.cpp:517 +msgid "Select circle input mode keys" +msgstr "Tasten um Eingabemodus durchzuschalten, auswählen" + +#: src/scim_anthy_prefs.cpp:518 +msgid "The key events to circle input mode. " +msgstr "Die Tastatureignisse, die den Eingabemodus durchschalten" + +#: src/scim_anthy_prefs.cpp:526 +msgid "Circle kana mode" +msgstr "Kana-Modus durchschalten" + +#: src/scim_anthy_prefs.cpp:527 +msgid "Select circle kana mode keys" +msgstr "Tasten um Kana-Modus durchzuschalten, auswählen" + +#: src/scim_anthy_prefs.cpp:528 +msgid "The key events to circle kana mode. " +msgstr "Die Tastatureignisse, die den Kana-Modus durchschalten" + +#: src/scim_anthy_prefs.cpp:536 +msgid "Latin mode" +msgstr "Latein-Modus" + +#: src/scim_anthy_prefs.cpp:537 +msgid "Select Latin mode keys" +msgstr "Latein-Modus-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:538 +msgid "The key events to switch input mode to Latin. " +msgstr "Die Tastatureignisse, die den Eingabemodus zu Latein umschalten." + +#: src/scim_anthy_prefs.cpp:546 +msgid "Wide Latin mode" +msgstr "Breites-Latein-Modus" + +#: src/scim_anthy_prefs.cpp:547 +msgid "Select wide Latin mode keys" +msgstr "Breites-Latein-Modus-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:548 +msgid "The key events to switch input mode to wide Latin. " +msgstr "" +"Die Tastatureignisse, die den Eingabemodus zu breitem Latein umschalten." + +#: src/scim_anthy_prefs.cpp:556 +msgid "Hiragana mode" +msgstr "Hiragana-Modus" + +#: src/scim_anthy_prefs.cpp:557 +msgid "Select hiragana mode keys" +msgstr "Hiragana-Modus-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:558 +msgid "The key events to switch input mode to hiragana. " +msgstr "Die Tastatureignisse, die den Eingabemodus zu Hiragana umschalten." + +#: src/scim_anthy_prefs.cpp:566 +msgid "Katakana mode" +msgstr "Katakana-Modus" + +#: src/scim_anthy_prefs.cpp:567 +msgid "Select katakana mode keys" +msgstr "Katakana-Modus-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:568 +msgid "The key events to switch input mode to katakana. " +msgstr "Die Tastatureignisse, die den Eingabemodus zu Katakana umschalten." + +#: src/scim_anthy_prefs.cpp:576 +msgid "Half katakana mode" +msgstr "Halb-Katakana-Modus" + +#: src/scim_anthy_prefs.cpp:577 +msgid "Select half katakana mode keys" +msgstr "Halb-Katakana-Modus-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:578 +msgid "The key events to switch input mode to half katakana. " +msgstr "" +"Die Tastatureignisse, die den Eingabemodus zu Halb-Katakana umschalten." + +#: src/scim_anthy_prefs.cpp:586 +msgid "Pseudo ASCII mode cancel" +msgstr "Pseudo-ASCII-Modus abbrechen" + +#: src/scim_anthy_prefs.cpp:587 +msgid "Select pseudo ASCII mode cancel key" +msgstr "Tasten, um den Pseudo-ASCII-Modus abzubrechen, auswählen" + +#: src/scim_anthy_prefs.cpp:588 +msgid "The key events to cancel the pseudo ASCII mode." +msgstr "Die Tastaturereignisse, die den Pseudo-ASCII-Modus abbrechen" + +#: src/scim_anthy_prefs.cpp:596 +msgid "Circle typing method" +msgstr "Schreibmethode durchschalten" + +#: src/scim_anthy_prefs.cpp:597 +msgid "Select circle typing method keys" +msgstr "Tasten um Schreibmethode durchzuschalten, auswählen" + +#: src/scim_anthy_prefs.cpp:598 +msgid "The key events to circle typing method. " +msgstr "Die Tastatureignisse, die die Schreibmethode durchschalten" + +#: src/scim_anthy_prefs.cpp:620 +msgid "Insert space" +msgstr "Leerzeichen hinzufügen" + +#: src/scim_anthy_prefs.cpp:621 +msgid "Select inserting space keys" +msgstr "Tasten um ein Leerzeichen hinzuzufügen, auswählen" + +#: src/scim_anthy_prefs.cpp:622 +msgid "The key events to insert a space. " +msgstr "Die Tastatureignisse, die ein Leerzeichen hinzufügen." + +#: src/scim_anthy_prefs.cpp:630 +msgid "Insert alternative space" +msgstr "Alternatives Leerzeichen hinzuf+gen" + +#: src/scim_anthy_prefs.cpp:631 +msgid "Select inserting alternative space keys" +msgstr "Tasten um ein alternatives Leerzeichen hinzuzufügen, auswählen" + +#: src/scim_anthy_prefs.cpp:632 +msgid "The key events to insert a alternative space. " +msgstr "Die Tastatureignisse, die ein alternatives Leerzeichen hinzufügen." + +#: src/scim_anthy_prefs.cpp:640 +msgid "Insert half space" +msgstr "Halbes Leerzeicehn hinzufügen" + +#: src/scim_anthy_prefs.cpp:641 +msgid "Select inserting half width space keys" +msgstr "Tasten um ein halbbreites Leerzeichen hinzuzufügen, auswählen" + +#: src/scim_anthy_prefs.cpp:642 +msgid "The key events to insert a half width space. " +msgstr "Die Tastatureignisse, die ein halbbreites Leerzeichen hinzufügen." + +#: src/scim_anthy_prefs.cpp:650 +msgid "Insert wide space" +msgstr "Breites Leerzeichen hinzufügen" + +#: src/scim_anthy_prefs.cpp:651 +msgid "Select inserting wide space keys" +msgstr "Tasten um ein breites Leerzeichen hinzuzufügen, auswählen" + +#: src/scim_anthy_prefs.cpp:652 +msgid "The key events to insert a wide space. " +msgstr "Die Tastatureignisse, die ein breites Leerzeichen hinzufügen." + +#: src/scim_anthy_prefs.cpp:660 +msgid "Backspace" +msgstr "Backspace" + +#: src/scim_anthy_prefs.cpp:661 +msgid "Select backspace keys" +msgstr "Backspace-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:662 +msgid "The key events to delete a character before caret. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:670 +msgid "Delete" +msgstr "Entfernen" + +#: src/scim_anthy_prefs.cpp:671 +msgid "Select delete keys" +msgstr "Entfernen-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:672 +msgid "The key events to delete a character after caret. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:682 +msgid "The key events to commit the preedit string. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:690 +msgid "Convert" +msgstr "Konvertieren" + +#: src/scim_anthy_prefs.cpp:691 +msgid "Select convert keys" +msgstr "Konvertierungstasten auswählen" + +#: src/scim_anthy_prefs.cpp:692 +msgid "The key events to convert the preedit string to kanji. " +msgstr "" +"Die Tastatureignisse, die eine unbearbeitete Zeichenkette in Kanji " +"konvertieren." + +#: src/scim_anthy_prefs.cpp:700 +msgid "Predict" +msgstr "Vorhersagen" + +#: src/scim_anthy_prefs.cpp:701 +msgid "Select predict keys" +msgstr "Wähle Vorhersagetasten" + +#: src/scim_anthy_prefs.cpp:702 +msgid "" +"The key events to predict a word or sentence from already inserted text. " +msgstr "" +"Die Tastatureignisse, die ein Wort oder einen Satz aus einem bereits " +"eingegebenen Text vorhersagen" + +#: src/scim_anthy_prefs.cpp:710 +msgid "Cancel" +msgstr "Abbrechen" + +#: src/scim_anthy_prefs.cpp:711 +msgid "Select cancel keys" +msgstr "Abbrechen-Tasten auswählen" + +#: src/scim_anthy_prefs.cpp:712 +msgid "The key events to cancel preediting or converting. " +msgstr "" +"Die Tastatureignisse, die die Vorbearbeitung oder das Konvertieren abbrechen." + +#: src/scim_anthy_prefs.cpp:720 +msgid "Cancel all" +msgstr "Alles abbrechen." + +#: src/scim_anthy_prefs.cpp:721 +msgid "Select cancel all keys" +msgstr "Tasten um alles abzubrechen, auswählen." + +#: src/scim_anthy_prefs.cpp:722 +msgid "The key events to return to initial state. " +msgstr "Die Tastaturereignisse, die wieder zum Anfangszustand zurückkehren" + +#: src/scim_anthy_prefs.cpp:730 +msgid "Reconvert" +msgstr "Zurückkonvertieren" + +#: src/scim_anthy_prefs.cpp:731 +msgid "Select reconvert keys" +msgstr "Tasten zum zurückkonvertieren wählen" + +#: src/scim_anthy_prefs.cpp:732 +msgid "The key events to reconvert the commited string in selection. " +msgstr "" +"Die Tastatureignisse, die die übergebene Zeichenkette wieder in eine Auswahl " +"zurückkonvertieren" + +#: src/scim_anthy_prefs.cpp:741 +msgid "Select do nothing keys" +msgstr "Tasten um nichts zu tun, auswählen" + +#: src/scim_anthy_prefs.cpp:742 +msgid "" +"The key events to eat and do nothing anymore. For example, it can be used to " +"disable space key completely." +msgstr "" +"Die Tastatureignisse, um Essen zu gehen und nichts mehr zu tun. Das kann zum " +"Beispiel benutzt werden, um die Leertaste komplett zu deaktivieren." + +#: src/scim_anthy_prefs.cpp:765 +msgid "Move to first" +msgstr "" + +#: src/scim_anthy_prefs.cpp:766 +msgid "Select move caret to first keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:767 +msgid "The key events to move the caret to the first of preedit string. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:775 +msgid "Move to last" +msgstr "" + +#: src/scim_anthy_prefs.cpp:776 +msgid "Select move caret to last keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:777 +msgid "The key events to move the caret to the last of the preedit string. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:785 +msgid "Move forward" +msgstr "" + +#: src/scim_anthy_prefs.cpp:786 +#, fuzzy +msgid "Select move caret forward keys" +msgstr "Konvertierungstasten auswählen" + +#: src/scim_anthy_prefs.cpp:787 +#, fuzzy +msgid "The key events to move the caret forward. " +msgstr "Die Tastatureignisse, die den nöchsten Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:795 +msgid "Move backward" +msgstr "" + +#: src/scim_anthy_prefs.cpp:796 +#, fuzzy +msgid "Select move caret backward keys" +msgstr "Konvertierungstasten auswählen" + +#: src/scim_anthy_prefs.cpp:797 +#, fuzzy +msgid "The key events to move the caret backward. " +msgstr "Die Tastatureignisse, die den nöchsten Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:819 +msgid "Select the first segment" +msgstr "Das erste Segment auswählen" + +#: src/scim_anthy_prefs.cpp:820 +msgid "Select keys to select the first segment" +msgstr "Tasten auswählen, um das erste Segment auszuwählen" + +#: src/scim_anthy_prefs.cpp:821 +msgid "The key events to select the first segment. " +msgstr "Die Tastatureignisse, die das erste Segment auswählen" + +#: src/scim_anthy_prefs.cpp:829 +msgid "Select the last segment" +msgstr "Das letzte Segment auswählen" + +#: src/scim_anthy_prefs.cpp:830 +msgid "Select keys to select the last segment" +msgstr "Tasten auswählen, um das letzte Segment auszuwählen" + +#: src/scim_anthy_prefs.cpp:831 +msgid "The key events to select the the last segment. " +msgstr "Die Tastatureignisse, die das letzte Segment auswählen" + +#: src/scim_anthy_prefs.cpp:839 +msgid "Select the next segment" +msgstr "Das nächste Segment auswählen" + +#: src/scim_anthy_prefs.cpp:840 +msgid "Select keys to select the next segment" +msgstr "Tasten auswählen, um das nächste Segment auszuwählen" + +#: src/scim_anthy_prefs.cpp:841 +msgid "The key events to select the next segment. " +msgstr "Die Tastatureignisse, die das nächste Segment auswählen" + +#: src/scim_anthy_prefs.cpp:849 +msgid "Select the previous segment" +msgstr "Das vorherige Segment auswählen" + +#: src/scim_anthy_prefs.cpp:850 +msgid "Select keys to select the previous segment" +msgstr "Tasten auswählen, um das vorherige Segment auszuwählen" + +#: src/scim_anthy_prefs.cpp:851 +msgid "The key events to select the previous segment. " +msgstr "Die Tastatureignisse, die das vorherige Segment auswählen" + +#: src/scim_anthy_prefs.cpp:859 +msgid "Shrink the segment" +msgstr "Das Segment verkleinern" + +#: src/scim_anthy_prefs.cpp:860 +msgid "Select keys to shrink the segment" +msgstr "Tasten auswählen, um das Segment zu verkleinern" + +#: src/scim_anthy_prefs.cpp:861 +msgid "The key events to shrink the selected segment. " +msgstr "Die Tastatureignisse, die das ausgewählte Segment verkleinern" + +#: src/scim_anthy_prefs.cpp:869 +msgid "Expand the segment" +msgstr "Das Segment vergrößern" + +#: src/scim_anthy_prefs.cpp:870 +msgid "Select keys to expand the segment" +msgstr "Tasten auswählen, um das Segment zu vergrößern" + +#: src/scim_anthy_prefs.cpp:871 +msgid "The key events to expand the selected segment. " +msgstr "Die Tastatureignisse, die das ausgewählte Segment vergrößern" + +#: src/scim_anthy_prefs.cpp:879 +msgid "Commit the first segment" +msgstr "Das erste Segment übergeben" + +#: src/scim_anthy_prefs.cpp:881 +msgid "The key events to commit the first segment. " +msgstr "Die Tastatureignisse, die das erste Segment übergeben" + +#: src/scim_anthy_prefs.cpp:889 +msgid "Commit the selected segment" +msgstr "Das ausgewählte Segment übergeben" + +#: src/scim_anthy_prefs.cpp:891 +msgid "The key events to commit the selected segment. " +msgstr "Die Tastatureignisse, die das ausgewählte Segment übergeben" + +#: src/scim_anthy_prefs.cpp:913 +msgid "First candidate" +msgstr "Erster Kandidat" + +#: src/scim_anthy_prefs.cpp:914 +msgid "Select the first candidate keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:915 +msgid "The key events to select the first candidate. " +msgstr "Die Tastatureignisse, die den ersten Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:923 +msgid "Last candidate" +msgstr "Letzter Kandidat" + +#: src/scim_anthy_prefs.cpp:924 +msgid "Select the last candidate keys" +msgstr "Tasten für den letzten Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:925 +msgid "The key events to the select last candidate. " +msgstr "Die Tastatureignisse, die den letzten Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:933 +msgid "Next candidate" +msgstr "Nächster Kandidat" + +#: src/scim_anthy_prefs.cpp:934 +msgid "Select the next candidate keys" +msgstr "Tasten für den nächsten Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:935 +msgid "The key events to select the next candidate. " +msgstr "Die Tastatureignisse, die den nöchsten Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:943 +msgid "Previous candidate" +msgstr "Vorheriger Kandidat" + +#: src/scim_anthy_prefs.cpp:944 +msgid "Select the previous candidate keys" +msgstr "Tasten für den vorherigen Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:945 +msgid "The key events to select the previous candidate. " +msgstr "Die Tastatureignisse, die den vorherigen Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:953 +msgid "Page up" +msgstr "Seite hoch" + +#: src/scim_anthy_prefs.cpp:954 +msgid "Select page up candidates keys" +msgstr "Tasten auswählen, um eine Kandidatenseite hochzugehen" + +#: src/scim_anthy_prefs.cpp:955 +msgid "The key events to switch candidates page up. " +msgstr "Die Tastatureignisse, die eine Kandidatenseite hochgehen" + +#: src/scim_anthy_prefs.cpp:963 +msgid "Page down" +msgstr "Seite runter" + +#: src/scim_anthy_prefs.cpp:964 +msgid "Select page down candidates keys" +msgstr "Tasten auswählen, um eine Kandidatenseite herunterzugehen" + +#: src/scim_anthy_prefs.cpp:965 +msgid "The key events to switch candidates page down. " +msgstr "Die Tastatureignisse, die eine Kandidatenseite heruntergehen" + +#: src/scim_anthy_prefs.cpp:987 +msgid "1st candidate" +msgstr "1. Kandidat" + +#: src/scim_anthy_prefs.cpp:988 +msgid "Select keys to select 1st candidate" +msgstr " Tasten wählen, um 1. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:989 +msgid "The key events to select the 1st candidate. " +msgstr "Die Tastatureignisse, die den 1. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:997 +msgid "2nd candidate" +msgstr "2. Kandidat" + +#: src/scim_anthy_prefs.cpp:998 +msgid "Select keys to select 2nd candidate" +msgstr " Tasten wählen, um 2. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:999 +msgid "The key events to select the 2nd candidate. " +msgstr "Die Tastatureignisse, die den 2. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1007 +msgid "3rd candidate" +msgstr "3. Kandidat" + +#: src/scim_anthy_prefs.cpp:1008 +msgid "Select keys to select 3rd candidate" +msgstr " Tasten wählen, um 3. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:1009 +msgid "The key events to select the 3rd candidate. " +msgstr "Die Tastatureignisse, die den 3. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1017 +msgid "4th candidate" +msgstr "4. Kandidat" + +#: src/scim_anthy_prefs.cpp:1018 +msgid "Select keys to select 4th candidate" +msgstr " Tasten wählen, um 4. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:1019 +msgid "The key events to select the 4th candidate. " +msgstr "Die Tastatureignisse, die den 4. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1027 +msgid "5th candidate" +msgstr "5. Kandidat" + +#: src/scim_anthy_prefs.cpp:1028 +msgid "Select keys to select 5th candidate" +msgstr " Tasten wählen, um 5. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:1029 +msgid "The key events to select the 5th candidate. " +msgstr "Die Tastatureignisse, die den 5. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1037 +msgid "6th candidate" +msgstr "6. Kandidat" + +#: src/scim_anthy_prefs.cpp:1038 +msgid "Select keys to select 6th candidate" +msgstr " Tasten wählen, um 6. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:1039 +msgid "The key events to select the 6th candidate. " +msgstr "Die Tastatureignisse, die den 6. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1047 +msgid "7th candidate" +msgstr "7. Kandidat" + +#: src/scim_anthy_prefs.cpp:1048 +msgid "Select keys to select 7th candidate" +msgstr " Tasten wählen, um 7. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:1049 +msgid "The key events to select the 7th candidate. " +msgstr "Die Tastatureignisse, die den 7. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1057 +msgid "8th candidate" +msgstr "8. Kandidat" + +#: src/scim_anthy_prefs.cpp:1058 +msgid "Select keys to select 8th candidate" +msgstr " Tasten wählen, um 8. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:1059 +msgid "The key events to select the 8th candidate. " +msgstr "Die Tastatureignisse, die den 8. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1067 +msgid "9th candidate" +msgstr "9. Kandidat" + +#: src/scim_anthy_prefs.cpp:1068 +msgid "Select keys to select 9th candidate" +msgstr "Die Tastatureignisse, die den 9. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1069 +msgid "The key events to select the 9th candidate. " +msgstr "Die Tastatureignisse, um den 9. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:1077 +msgid "10th candidate" +msgstr "10. Kandidat" + +#: src/scim_anthy_prefs.cpp:1078 +msgid "Select keys to select 10th candidate" +msgstr "Die Tastatureignisse, die den 10. Kandidaten auswählen" + +#: src/scim_anthy_prefs.cpp:1079 +msgid "The key events to select the 10th candidate. " +msgstr "Die Tastatureignisse, um den 10. Kandidaten auszuwählen" + +#: src/scim_anthy_prefs.cpp:1101 +#, fuzzy +msgid "Convert character type forward" +msgstr "Zeichentyp vorwärts rotieren" + +#: src/scim_anthy_prefs.cpp:1102 +#, fuzzy +msgid "Select keys to convert character type forward" +msgstr "Zeichentyp vorwärts rotieren" + +#: src/scim_anthy_prefs.cpp:1103 +#, fuzzy +msgid "Rotate character type forward." +msgstr "Zeichentyp vorwärts rotieren" + +#: src/scim_anthy_prefs.cpp:1111 +#, fuzzy +msgid "Convert character type backward" +msgstr "Zeichentyp rückwärts rotieren" + +#: src/scim_anthy_prefs.cpp:1112 +#, fuzzy +msgid "Select keys to convert character type backward" +msgstr "Tasten auswählen, um in Katakana zu konvertieren" + +#: src/scim_anthy_prefs.cpp:1113 +#, fuzzy +msgid "Rotate character type backward." +msgstr "Zeichentyp rückwärts rotieren" + +#: src/scim_anthy_prefs.cpp:1121 +msgid "Convert to hiragana" +msgstr "In Hiragana konvertieren" + +#: src/scim_anthy_prefs.cpp:1122 +msgid "Select keys to convert to hiragana" +msgstr "Tasten auswählen, um in Hiragan zu konvertieren" + +#: src/scim_anthy_prefs.cpp:1123 +msgid "The key events to convert the preedit string to hiragana. " +msgstr "" +"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in Hiragana " +"konvertieren" + +#: src/scim_anthy_prefs.cpp:1131 +msgid "Convert to katakana" +msgstr "In Katakana konvertieren" + +#: src/scim_anthy_prefs.cpp:1132 +msgid "Select keys to convert to katakana" +msgstr "Tasten auswählen, um in Katakana zu konvertieren" + +#: src/scim_anthy_prefs.cpp:1133 +msgid "The key events to convert the preedit string to katakana. " +msgstr "" +"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in Katakana " +"konvertieren" + +#: src/scim_anthy_prefs.cpp:1141 +msgid "Convert to half width" +msgstr "in Halbbreit konvertieren" + +#: src/scim_anthy_prefs.cpp:1142 +msgid "Select keys to convert to half width" +msgstr "Tasten auswählen, um in Halbbreit zu konvertieren" + +#: src/scim_anthy_prefs.cpp:1143 +msgid "The key events to convert the preedit string to half width. " +msgstr "" +"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in Halbbreit " +"konvertieren" + +#: src/scim_anthy_prefs.cpp:1151 +msgid "Convert to half katakana" +msgstr "In halbbreite Katakana konvertieren" + +#: src/scim_anthy_prefs.cpp:1152 +msgid "Select keys to convert to half width katakana" +msgstr "Tasten auswählen, um in halbbreite Katakana zu konvertieren" + +#: src/scim_anthy_prefs.cpp:1153 +msgid "The key events to convert the preedit string to half width katakana. " +msgstr "" +"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in halbbreite " +"Katakana konvertieren" + +#: src/scim_anthy_prefs.cpp:1161 +msgid "Convert to wide latin" +msgstr "In breites Latein konvertieren" + +#: src/scim_anthy_prefs.cpp:1162 +msgid "Select keys to convert to wide latin" +msgstr "Tasten auswählen, um in breites Latein zu konvertieren" + +#: src/scim_anthy_prefs.cpp:1163 +msgid "The key events to convert the preedit string to wide latin. " +msgstr "" +"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in breites Latein " +"konvertieren" + +#: src/scim_anthy_prefs.cpp:1171 +msgid "Convert to latin" +msgstr "In Latein konvertieren" + +#: src/scim_anthy_prefs.cpp:1172 +msgid "Select keys to convert to latin" +msgstr "Tasten auswählen, um in Latein zu konvertieren" + +#: src/scim_anthy_prefs.cpp:1173 +msgid "The key events to convert the preedit string to latin. " +msgstr "" +"Die Tastaturereignisse, die die unbearbeitete Zeichenkette in Latein " +"konvertieren" + +#: src/scim_anthy_prefs.cpp:1195 +msgid "Edit dictionary" +msgstr "Wörterbuch bearbeiten" + +#: src/scim_anthy_prefs.cpp:1196 +msgid "Select edit dictionary keys" +msgstr "Tasten auswählen, um Wörterbuch zu bearbeiten" + +#: src/scim_anthy_prefs.cpp:1197 +msgid "The key events to launch dictionary administration tool. " +msgstr "Die Tastaturereignisse, die das Wörterbuchverwaltungsprogramm öffnen" + +#: src/scim_anthy_prefs.cpp:1206 +msgid "Select add a word keys" +msgstr "Tasten auswählen, um ein Wort hinzuzufügen" + +#: src/scim_anthy_prefs.cpp:1207 +msgid "The key events to launch the tool to add a word. " +msgstr "" +"Die Tastatureignisse, die das Programm zum Hinzufügen eines Wortes öffnen" + +#: src/scim_anthy_prefs.cpp:1232 src/scim_anthy_prefs.cpp:1245 +#: src/scim_anthy_prefs.cpp:1258 +msgid "Color:" +msgstr "Farbe:" + +#: src/scim_anthy_prefs.cpp:1233 src/scim_anthy_prefs.cpp:1234 +msgid "The color of preediting text" +msgstr "Farbe des unbearbeiteten Textes" + +#: src/scim_anthy_prefs.cpp:1246 src/scim_anthy_prefs.cpp:1247 +msgid "The color of conversion text" +msgstr "Farbe des konvertierten Textes" + +#: src/scim_anthy_prefs.cpp:1259 +msgid "The color of selected segment text" +msgstr "Die Farbe des ausgewählten Segments" + +#: src/scim_anthy_prefs.cpp:1260 +#, fuzzy +msgid "The color of selected segment text in the conversion text" +msgstr "Die Farbe des ausgewählten Segments im konvertierten Text" + +#: src/scim_anthy_color_button.cpp:320 +msgid "Foreground color" +msgstr "Vordergrundfarbe" + +#: src/scim_anthy_color_button.cpp:320 +msgid "Background color" +msgstr "Hintergrundfarbe" + +#~ msgid "Default Modes" +#~ msgstr "Standardmodi" + +#~ msgid "Input Prediction" +#~ msgstr "Eingabevorhersage" + +#~ msgid "Key Bindings" +#~ msgstr "Tastenkürzel" + +#~ msgid "Colors" +#~ msgstr "Farben" + +#~ msgid "Table _entries:" +#~ msgstr "Tabellen_einträge" + +#~ msgid "Use the scim-anthy's custom lookup _window instead of SCIM's one" +#~ msgstr "" +#~ "Das benutzerdefinierte Nachschlage_fenster von Scim-Anthy anstelle des " +#~ "von SCIM benutzen." + +#, fuzzy +#~ msgid "Show _diction of candidates" +#~ msgstr "Zeige Schreibweise der Kandidaten" + +#~ msgid "Show _tray icon" +#~ msgstr "_Tray-Icon anzeigen" + +#~ msgid "\"_Yomi\" option for \"Add word\" command:" +#~ msgstr "„Yomi“-Option für „Wort hinzufügen“-Befehl:" diff --git a/po/en@boldquot.header b/po/en@boldquot.header new file mode 100755 index 0000000..fedb6a0 --- /dev/null +++ b/po/en@boldquot.header @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff --git a/po/en@quot.header b/po/en@quot.header new file mode 100755 index 0000000..a9647fc --- /dev/null +++ b/po/en@quot.header @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff --git a/po/insert-header.sin b/po/insert-header.sin new file mode 100755 index 0000000..b26de01 --- /dev/null +++ b/po/insert-header.sin @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/po/ja.po b/po/ja.po new file mode 100755 index 0000000..73c94fe --- /dev/null +++ b/po/ja.po @@ -0,0 +1,1661 @@ +# translation of scim-anthy to Japanese +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) 2004 Takuro Ashie . +msgid "" +msgstr "" +"Project-Id-Version: anthy\n" +"Report-Msgid-Bugs-To: ashie@homa.ne.jp\n" +"POT-Creation-Date: 2009-01-15 12:04+0900\n" +"PO-Revision-Date: 2006-02-14 10:50+0900\n" +"Last-Translator: Takuro Ashie \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/scim_anthy_imengine.cpp:488 +#, c-format +msgid "Candidates (%d/%d)" +msgstr "候補一覧 (%d/%d)" + +#: src/scim_anthy_imengine.cpp:565 +msgid "Input mode" +msgstr "入力モード" + +#: src/scim_anthy_imengine.cpp:569 src/scim_anthy_setup.cpp:203 +msgid "Hiragana" +msgstr "ひらがな" + +#: src/scim_anthy_imengine.cpp:573 src/scim_anthy_setup.cpp:204 +msgid "Katakana" +msgstr "カタカナ" + +#: src/scim_anthy_imengine.cpp:577 src/scim_anthy_imengine.cpp:578 +#: src/scim_anthy_setup.cpp:205 +msgid "Half width katakana" +msgstr "半角カタカナ" + +#: src/scim_anthy_imengine.cpp:582 src/scim_anthy_setup.cpp:206 +msgid "Latin" +msgstr "英数" + +#: src/scim_anthy_imengine.cpp:582 +msgid "Direct input" +msgstr "直接入力" + +#: src/scim_anthy_imengine.cpp:586 src/scim_anthy_setup.cpp:207 +msgid "Wide latin" +msgstr "全角英数" + +#: src/scim_anthy_imengine.cpp:592 +msgid "Typing method" +msgstr "入力方式" + +#: src/scim_anthy_imengine.cpp:596 +msgid "Romaji" +msgstr "ローマ字" + +#: src/scim_anthy_imengine.cpp:600 +msgid "Kana" +msgstr "かな" + +#: src/scim_anthy_imengine.cpp:604 +msgid "Thumb shift" +msgstr "親指シフト" + +#: src/scim_anthy_imengine.cpp:611 +msgid "Conversion mode" +msgstr "変換モード" + +#: src/scim_anthy_imengine.cpp:615 src/scim_anthy_imengine.cpp:616 +#: src/scim_anthy_setup.cpp:221 +msgid "Multi segment" +msgstr "連文節" + +#: src/scim_anthy_imengine.cpp:620 src/scim_anthy_imengine.cpp:621 +#: src/scim_anthy_setup.cpp:222 +msgid "Single segment" +msgstr "単文節" + +#: src/scim_anthy_imengine.cpp:625 src/scim_anthy_imengine.cpp:627 +#: src/scim_anthy_setup.cpp:223 +msgid "Convert as you type (Multi segment)" +msgstr "逐次変換(連文節)" + +#: src/scim_anthy_imengine.cpp:631 src/scim_anthy_imengine.cpp:633 +#: src/scim_anthy_setup.cpp:224 +msgid "Convert as you type (Single segment)" +msgstr "逐次変換(単文節)" + +#: src/scim_anthy_imengine.cpp:640 +msgid "Period style" +msgstr "句読点のスタイル" + +#: src/scim_anthy_imengine.cpp:669 +msgid "Symbol style" +msgstr "記号のスタイル" + +#: src/scim_anthy_imengine.cpp:717 +msgid "Dictionary menu" +msgstr "辞書メニュー" + +#: src/scim_anthy_imengine.cpp:722 +msgid "Edit the dictionary" +msgstr "辞書を編集" + +#: src/scim_anthy_imengine.cpp:724 +msgid "Launch the dictionary administration tool." +msgstr "辞書管理ツールを起動" + +#: src/scim_anthy_imengine.cpp:730 src/scim_anthy_prefs.cpp:1205 +msgid "Add a word" +msgstr "単語を追加" + +#: src/scim_anthy_imengine.cpp:732 +msgid "Add a word to the dictionary." +msgstr "単語を辞書に追加" + +#: src/scim_anthy_factory.cpp:195 +msgid "" +"Authors of scim-anthy:\n" +" Copyright (C) 2004,2005 Takuro Ashie \n" +" Copyright (C) 2004,2005 Hiroyuki Ikezoe \n" +" \n" +"Authors of Anthy:\n" +" Copyright (C) 2000-2005 Yusuke TABATA \n" +" Copyright (C) 2004-2005 Yuichi YOSHIDA \n" +" You can find out all credits of Anthy from AUTHORS file in Anthy package.\n" +msgstr "" +"scim-anthyの作者:\n" +" Copyright (C) 2004,2005 Takuro Ashie \n" +" Copyright (C) 2004,2005 Hiroyuki Ikezoe \n" +" \n" +"Anthyの作者:\n" +" Copyright (C) 2000-2005 Yusuke TABATA \n" +" Copyright (C) 2004-2005 Yuichi YOSHIDA \n" +" Anthyの全てのクレジットはAnthyパッケージのAUTHORSファイルを参照して下さ" +"い。\n" + +#: src/scim_anthy_factory.cpp:211 +msgid "" +"Art work:\n" +" SHIMODA Hiroshi \n" +"\n" +"Translation:\n" +" Gerrit Sangel \n" +"Special thanks:\n" +" UTUMI Hirosi \n" +" Yukiko Bando \n" +" Mike Fabian \n" +" David Oftedal \n" +" Ryo Dairiki \n" +" Seiichi SATO\n" +" AWASHIRO Ikuya \n" +" Hatuka*nezumi \n" +" Teppei Tamra \n" +" Akira TAGOH \n" +" Tatsuki Sugiura \n" +" Takashi Nakamoto " +msgstr "" +"Art work:\n" +" SHIMODA Hiroshi \n" +"Translation:\n" +" Gerrit Sangel \n" +"Special thanks:\n" +" UTUMI Hirosi \n" +" Yukiko Bando \n" +" Mike Fabian \n" +" David Oftedal \n" +" Ryo Dairiki \n" +" Seiichi SATO\n" +" AWASHIRO Ikuya \n" +" Hatuka*nezumi \n" +" Teppei Tamra \n" +" Akira TAGOH \n" +" Tatsuki Sugiura \n" +" Takashi Nakamoto " + +#: src/scim_anthy_factory.cpp:236 +msgid "" +"Basic operation:\n" +" \n" +msgstr "" +"基本操作:\n" +" \n" + +#: src/scim_anthy_factory.cpp:240 +msgid "" +"1. Switch input mode:\n" +" You can switch on/off Japanese input mode by pressing Zenkaku_Hankaku key\n" +" or Control+J. Or you can rotate all input modes by pressing Control+,\n" +" (comma).\n" +" \n" +msgstr "" +"1. 入力モードの切り替え:\n" +" 全角/半角キーあるいはControl+Jキーを押すことで、日本語モードをON/OFFする\n" +" ことができます。あるいは、Conrol+,(コンマ)を押すことで、全ての入力モード" +"に\n" +" 順次切り替えることができます。\n" +" \n" + +#: src/scim_anthy_factory.cpp:247 +msgid "" +"2. Input Japanese hiragana and katakana:\n" +" You can input Japanese hiragana and katakana by inputting romaji.\n" +" The Romaji table can be found out from the \"Anthy\" section of the setup\n" +" window in SCIM or SKIM.\n" +" If you want to hiragana and katakana directly by using Japanese keyboard,\n" +" please press Alt + Romaji key or Conrol+\\ key to switch typing method.\n" +" \n" +msgstr "" +"2. ひらがな及びカタカナの入力:\n" +" ローマ字を入力することで、ひらがな及びカタカナを入力することができます。\n" +" ローマ字表は、SCIMあるいはSKIM設定ウィンドウの「Anthy」セクションで見るこ\n" +" とができます。日本語キーボードを使ってひらがなやカタカナを直接入力したい\n" +" 場合は、Alt+ローマ字キーあるいはConrol+\\キーを押して、入力方式を切り替え" +"て\n" +" 下さい。\n" +" \n" + +#: src/scim_anthy_factory.cpp:256 +msgid "" +"3. Convert hiragana or katakana to Japanese kanji\n" +" After inputting hiragana or katakana, you can convert it to Japanese\n" +" kanji by pressing Space key. Then it will show some candidates. You can\n" +" select the next candidate by pressing Space key, and can commit it by\n" +" pressing Enter key.\n" +" If you input a sentense, Anthy will split it to some segments. You can\n" +" select the next or previous segment by pressing left or right cursor key,\n" +" and can extend or shrink the selected segment by pressing Shift + left or\n" +" right cursor key.\n" +" \n" +msgstr "" +"3. ひらがなやカタカナを漢字に変換する\n" +" ひらがなやカタカナを入力後、スペースキーを押すことで漢字に変換することが\n" +" できます。この際、複数の候補が表示されるでしょう。更にスペースキーを押す\n" +" ことで、次の候補を選択することができます。Enterキーを押すと確定します。\n" +" 文章を入力した場合、Anthyはそれを複数の文節に分けます。この際、左あるいは\n" +" 右カーソルキーを押すことで、前後の文節を選択することができます。また、\n" +" Shift+左あるいは右カーソルキーを押すことで、文節を伸ばしたり縮めたりする\n" +" ことができます。\n" +" \n" + +#: src/scim_anthy_factory.cpp:268 +msgid "" +"4. Other key bindings:\n" +" You can find out all key bindings definition of scim-anthy from \"Anthy\"\n" +" section on setup window of SCIM or SKIM.\n" +msgstr "" +"4. その他のキーバインド:\n" +" その他の全てのscim-anthyのキー定義は、SCIMあるいはSKIM設定ウィンドウの\n" +" 「Anthy」セクションで見ることができます。\n" + +#: src/scim_anthy_setup.cpp:119 +msgid "Anthy" +msgstr "Anthy" + +#: src/scim_anthy_setup.cpp:124 +msgid "An Anthy IMEngine Module." +msgstr "Anthy IMEngineモジュール" + +#: src/scim_anthy_setup.cpp:184 +msgid "Mode keys" +msgstr "モードキー" + +#: src/scim_anthy_setup.cpp:185 +msgid "Edit keys" +msgstr "編集キー" + +#: src/scim_anthy_setup.cpp:186 +msgid "Caret keys" +msgstr "キャレットキー" + +#: src/scim_anthy_setup.cpp:187 +msgid "Segments keys" +msgstr "文節キー" + +#: src/scim_anthy_setup.cpp:188 +msgid "Candidates keys" +msgstr "候補選択キー" + +#: src/scim_anthy_setup.cpp:189 +msgid "Direct select keys" +msgstr "直接選択キー" + +#: src/scim_anthy_setup.cpp:190 +msgid "Convert keys" +msgstr "変換キー" + +#: src/scim_anthy_setup.cpp:191 +msgid "Dictionary keys" +msgstr "辞書関連キー" + +#: src/scim_anthy_setup.cpp:213 +msgid "Romaji typing method" +msgstr "ローマ字入力方式" + +#: src/scim_anthy_setup.cpp:214 +msgid "Kana typing method" +msgstr "かな入力方式" + +#: src/scim_anthy_setup.cpp:215 +msgid "Thumb shift typing method" +msgstr "親指シフト入力方式" + +#: src/scim_anthy_setup.cpp:248 src/scim_anthy_setup.cpp:256 +msgid "Follow input mode" +msgstr "入力モードに従う" + +#: src/scim_anthy_setup.cpp:249 src/scim_anthy_setup.cpp:257 +msgid "Wide" +msgstr "全角" + +#: src/scim_anthy_setup.cpp:250 src/scim_anthy_setup.cpp:258 +msgid "Half" +msgstr "半角" + +#: src/scim_anthy_setup.cpp:264 src/scim_anthy_prefs.cpp:740 +msgid "Do nothing" +msgstr "なにもしない" + +#: src/scim_anthy_setup.cpp:265 +msgid "Start conversion" +msgstr "変換を開始する" + +#: src/scim_anthy_setup.cpp:266 src/scim_anthy_setup.cpp:272 +#: src/scim_anthy_prefs.cpp:680 +msgid "Commit" +msgstr "確定" + +#: src/scim_anthy_setup.cpp:273 +msgid "Clear" +msgstr "クリア" + +#: src/scim_anthy_setup.cpp:279 +msgid "UTF-8" +msgstr "" + +#: src/scim_anthy_setup.cpp:280 +msgid "EUC-JP" +msgstr "EUC-JP" + +#: src/scim_anthy_setup.cpp:281 +msgid "EUC-JP-MS" +msgstr "EUC-JP-MS" + +#: src/scim_anthy_setup.cpp:287 +msgid "No decoration" +msgstr "装飾無し" + +#: src/scim_anthy_setup.cpp:288 +msgid "Underline" +msgstr "下線" + +#: src/scim_anthy_setup.cpp:289 +msgid "Reverse" +msgstr "反転" + +#: src/scim_anthy_setup.cpp:290 +msgid "Highlight" +msgstr "強調" + +#: src/scim_anthy_setup.cpp:291 +msgid "String color" +msgstr "文字色" + +#: src/scim_anthy_setup.cpp:292 +msgid "BG color" +msgstr "背景色" + +#: src/scim_anthy_setup.cpp:293 +msgid "Both color" +msgstr "文字色/背景色" + +#: src/scim_anthy_setup.cpp:805 +msgid "_Group:" +msgstr "グループ(_G):" + +#: src/scim_anthy_setup.cpp:826 +msgid "Search by key" +msgstr "キーで検索" + +#: src/scim_anthy_setup.cpp:830 +msgid "all" +msgstr "全て" + +#: src/scim_anthy_setup.cpp:873 +msgid "Feature" +msgstr "機能" + +#: src/scim_anthy_setup.cpp:882 src/scim_anthy_setup.cpp:1289 +msgid "Key bindings" +msgstr "キーバインド" + +#: src/scim_anthy_setup.cpp:890 +msgid "Description" +msgstr "説明" + +#: src/scim_anthy_setup.cpp:914 +msgid "Key bindings _theme:" +msgstr "キーバインドテーマ:" + +#: src/scim_anthy_setup.cpp:928 +msgid "_Choose keys..." +msgstr "キーを設定...(_C)" + +#: src/scim_anthy_setup.cpp:955 +msgid "Enable/Disable learning" +msgstr "学習の有効/無効" + +#: src/scim_anthy_setup.cpp:982 +msgid "Key preferences to commit with reversing learning preference" +msgstr "学習設定とは逆の方法で確定するキーの設定" + +#: src/scim_anthy_setup.cpp:1056 src/scim_anthy_setup.cpp:1070 +msgid "_Launch" +msgstr "起動(_L)" + +#: src/scim_anthy_setup.cpp:1241 +#, c-format +msgid "" +"%s-%s\n" +"\n" +"A Japanese input method module\n" +"for SCIM using Anthy\n" +"\n" +"\n" +"\n" +"Copyright 2005-2006, Takuro Ashie <ashie@homa.ne." +"jp>" +msgstr "" +"%s-%s\n" +"\n" +"Anthyを利用した\n" +"SCIM用日本語入力モジュール\n" +"\n" +"\n" +"\n" +"Copyright 2005-2006, Takuro Ashie <ashie@homa.ne." +"jp>" + +#: src/scim_anthy_setup.cpp:1277 +msgid "Common" +msgstr "一般" + +#: src/scim_anthy_setup.cpp:1283 +msgid "Symbols" +msgstr "記号等" + +#: src/scim_anthy_setup.cpp:1295 +msgid "Romaji typing" +msgstr "ローマ字入力" + +#: src/scim_anthy_setup.cpp:1301 +msgid "Kana typing" +msgstr "かな入力" + +#: src/scim_anthy_setup.cpp:1307 +msgid "Prediction" +msgstr "予測" + +#: src/scim_anthy_setup.cpp:1313 +msgid "Learning" +msgstr "学習" + +#: src/scim_anthy_setup.cpp:1319 +msgid "Dictionary" +msgstr "辞書" + +#: src/scim_anthy_setup.cpp:1325 +msgid "Candidates window" +msgstr "候補ウィンドウ" + +#: src/scim_anthy_setup.cpp:1331 +msgid "Toolbar" +msgstr "ツールバー" + +#: src/scim_anthy_setup.cpp:1337 +msgid "Appearance" +msgstr "外観" + +#: src/scim_anthy_setup.cpp:1343 +msgid "About" +msgstr "情報" + +#: src/scim_anthy_setup.cpp:1405 src/scim_anthy_setup_romaji.cpp:255 +#: src/scim_anthy_setup_kana.cpp:413 src/scim_anthy_setup_kana.cpp:480 +msgid "User defined" +msgstr "ユーザー定義" + +#: src/scim_anthy_setup.cpp:1408 src/scim_anthy_setup_romaji.cpp:258 +#: src/scim_anthy_setup_kana.cpp:416 src/scim_anthy_setup_kana.cpp:483 +msgid "Default" +msgstr "標準設定" + +#: src/scim_anthy_setup.cpp:2006 +msgid "Set key filter" +msgstr "キ-フィルタ-をセット" + +#: src/scim_anthy_setup_romaji.cpp:124 src/scim_anthy_setup_romaji.cpp:195 +msgid "Romaji _table:" +msgstr "ローマ字テーブル(_T):" + +#: src/scim_anthy_setup_romaji.cpp:137 src/scim_anthy_setup_kana.cpp:143 +#: src/scim_anthy_setup_kana.cpp:188 +msgid "_Customize..." +msgstr "カスタマイズ...(_C)" + +#: src/scim_anthy_setup_romaji.cpp:177 +msgid "Sequence" +msgstr "入力文字列" + +#: src/scim_anthy_setup_romaji.cpp:178 src/scim_anthy_setup_kana.cpp:263 +msgid "Result" +msgstr "出力文字列" + +#: src/scim_anthy_setup_romaji.cpp:185 +msgid "Customize romaji table" +msgstr "ローマ字テーブルのカスタマイズ" + +#: src/scim_anthy_setup_kana.cpp:114 +msgid "JIS Kana Layout" +msgstr "JISかな配列" + +#: src/scim_anthy_setup_kana.cpp:130 src/scim_anthy_setup_kana.cpp:175 +msgid "La_yout:" +msgstr "レイアウト(_Y):" + +#: src/scim_anthy_setup_kana.cpp:155 +msgid "Thumb Shift Layout" +msgstr "親指シフト配列" + +#: src/scim_anthy_setup_kana.cpp:262 src/scim_anthy_setup_kana.cpp:332 +msgid "Key" +msgstr "キー" + +#: src/scim_anthy_setup_kana.cpp:270 +msgid "Customize kana layout table" +msgstr "かなレイアウトテーブルのカスタマイズ" + +#: src/scim_anthy_setup_kana.cpp:280 src/scim_anthy_setup_kana.cpp:352 +msgid "Layout _table:" +msgstr "レイアウトテーブル(_T):" + +#: src/scim_anthy_setup_kana.cpp:333 +msgid "Single press" +msgstr "単独打鍵" + +#: src/scim_anthy_setup_kana.cpp:334 +msgid "Left thumb shift" +msgstr "左親指シフト" + +#: src/scim_anthy_setup_kana.cpp:335 +msgid "Right thumb shift" +msgstr "右親指シフト" + +#: src/scim_anthy_setup_kana.cpp:342 +msgid "Customize thumb shift layout table" +msgstr "親指シフトレイアウトテーブルのカスタマイズ" + +#: src/scim_anthy_prefs.cpp:35 +msgid "Show \"_Candidates\" label" +msgstr "「候補一覧」ラベルを表示(_C)" + +#: src/scim_anthy_prefs.cpp:45 +msgid "Close candidate window when select a candidate _directly" +msgstr "候補を直接選択した時に候補ウィンドウを閉じる(_D)" + +#: src/scim_anthy_prefs.cpp:55 +msgid "Learn on _manual committing" +msgstr "手動確定時に学習する(_M)" + +#: src/scim_anthy_prefs.cpp:65 +msgid "Learn on a_uto committing" +msgstr "自動確定時に学習する(_U)" + +#: src/scim_anthy_prefs.cpp:75 +msgid "Use half-width characters for _symbols" +msgstr "記号は半角で入力する(_S)" + +#: src/scim_anthy_prefs.cpp:85 +msgid "Use half-width characters for _numbers" +msgstr "数字は半角で入力する(_N)" + +#: src/scim_anthy_prefs.cpp:95 +msgid "A_llow spliting romaji on editing preedit string" +msgstr "文字列編集時にローマ字を分割できるようにする(_L)" + +#: src/scim_anthy_prefs.cpp:97 +msgid "If this check is enabled, you can delete each letter." +msgstr "" +"このチェックが入っている場合,各文字単位で文字を削除することができます。" + +#: src/scim_anthy_prefs.cpp:104 +msgid "_Entering the pseudo ASCII input mode with capital letters." +msgstr "大文字入力時に一時ASCIIモードに切り替える(_E)" + +#: src/scim_anthy_prefs.cpp:106 +msgid "" +"If this check is enabled, capital letters will becomes a trigger to enter " +"the pseudo ASCII input mode." +msgstr "" +"このチェックが入っている場合、大文字の入力は一時ASCIIモードへの切り替えのトリ" +"ガーになります。" + +#: src/scim_anthy_prefs.cpp:113 +msgid "Insert a _blank with a blank key." +msgstr "空白キーで空白を挿入する(_B)" + +#: src/scim_anthy_prefs.cpp:115 +msgid "" +"If this check is enabled, a blank key will works to insert a blank when " +"entering the pseudo ASCII input mode." +msgstr "" +"このチェックが入っている場合、一時ASCIIモード時に空白キーで空白を入力できるよ" +"うになります。" + +#: src/scim_anthy_prefs.cpp:122 +msgid "_Show predicted candidates while inputting letters" +msgstr "文字入力中に予測候補を表示する(_S)" + +#: src/scim_anthy_prefs.cpp:131 +msgid "Use _direct select keys while predicting" +msgstr "予測中に直接選択キーを使用する(_D)" + +#: src/scim_anthy_prefs.cpp:140 +msgid "Show _input mode label" +msgstr "入力モードラベルを表示(_I)" + +#: src/scim_anthy_prefs.cpp:150 +msgid "Show _conversion mode label" +msgstr "変換モードラベルを表示(_C)" + +#: src/scim_anthy_prefs.cpp:160 +msgid "Show _typing method label" +msgstr "入力方式ラベルを表示(_T)" + +#: src/scim_anthy_prefs.cpp:170 +msgid "Show _period style label" +msgstr "句読点スタイルラベルを表示(_P)" + +#: src/scim_anthy_prefs.cpp:180 +msgid "Show _symbol style label" +msgstr "記号スタイルラベルを表示(_S)" + +#: src/scim_anthy_prefs.cpp:190 +msgid "Show _dictionary menu label" +msgstr "辞書メニューラベルを表示(_D)" + +#: src/scim_anthy_prefs.cpp:200 +msgid "Show _edit dictionary label" +msgstr "辞書編集ラベルを表示(_E)" + +#: src/scim_anthy_prefs.cpp:210 +msgid "Show _add word label" +msgstr "単語追加ラベルを表示(_A)" + +#: src/scim_anthy_prefs.cpp:235 +msgid "Number of candidates to show in a _page:" +msgstr "1ページに表示する候補数(_P):" + +#: src/scim_anthy_prefs.cpp:238 +msgid "" +"Specify the number of candidates to show in a page of the candidates window." +msgstr "1ページに表示する候補数を指定します" + +#: src/scim_anthy_prefs.cpp:247 +msgid "Number of _triggers until show:" +msgstr "表示開始までの変換キー押下数(_T):" + +#: src/scim_anthy_prefs.cpp:248 +msgid "[times]" +msgstr "[回]" + +#: src/scim_anthy_prefs.cpp:250 +msgid "" +"The number of times to press a conversion key until show the candidates " +"window.Specify 0 to never show it." +msgstr "" +"候補ウィンドウを表示するまでに必要な変換キーの押下数です。0を指定すると候補" +"ウィンドウを一切表示しません。" + +#: src/scim_anthy_prefs.cpp:260 +msgid "_Simultaneous pressing time:" +msgstr "同時打鍵時間(_S):" + +#: src/scim_anthy_prefs.cpp:261 +msgid "[msec]" +msgstr "[ミリ秒]" + +#: src/scim_anthy_prefs.cpp:263 +msgid "Time to regard as simultaneous key pressing." +msgstr "同時打鍵とみなす時間" + +#: src/scim_anthy_prefs.cpp:286 +msgid "_Input mode: " +msgstr "入力モード(_I):" + +#: src/scim_anthy_prefs.cpp:296 +msgid "Typing _method: " +msgstr "入力方式(_M): " + +#: src/scim_anthy_prefs.cpp:306 +msgid "_Conversion mode: " +msgstr "変換モード(_C):" + +#: src/scim_anthy_prefs.cpp:316 +msgid "St_yle of comma and period: " +msgstr "句読点のスタイル(_Y): " + +#: src/scim_anthy_prefs.cpp:326 +msgid "Symb_ol input style: " +msgstr "記号のスタイル(_O):" + +#: src/scim_anthy_prefs.cpp:336 +msgid "_Space type: " +msgstr "空白のタイプ(_S): " + +#: src/scim_anthy_prefs.cpp:346 +msgid "Input from _ten key: " +msgstr "テンキーからの入力(_T):" + +#: src/scim_anthy_prefs.cpp:356 +msgid "_Behavior on a comma or a period:" +msgstr "句読点入力時の挙動(_B):" + +#: src/scim_anthy_prefs.cpp:366 +msgid "_Behavior on focus out:" +msgstr "フォーカスアウト時の挙動(_B):" + +#: src/scim_anthy_prefs.cpp:376 +msgid "_Left thumb shift keys:" +msgstr "左親指シフトキー(_L):" + +#: src/scim_anthy_prefs.cpp:386 +msgid "_Right thumb shift keys:" +msgstr "右親指シフトキー(_R):" + +#: src/scim_anthy_prefs.cpp:396 +msgid "_Commit:" +msgstr "確定(_C):" + +#: src/scim_anthy_prefs.cpp:397 src/scim_anthy_prefs.cpp:681 +msgid "Select commit keys" +msgstr "確定キーの設定" + +#: src/scim_anthy_prefs.cpp:398 +msgid "" +"The key events to commit the preedit string with reversing the preference of " +"learning. " +msgstr "学習設定とは逆の方法で文字列を確定するキーイベント" + +#: src/scim_anthy_prefs.cpp:407 +msgid "Commit the _first segment:" +msgstr "最初の文節を確定(_F):" + +#: src/scim_anthy_prefs.cpp:408 src/scim_anthy_prefs.cpp:880 +msgid "Select keys to commit the first segment" +msgstr "最初の文節を確定するキーイベント" + +#: src/scim_anthy_prefs.cpp:409 +msgid "" +"The key events to commit the first segment with reversing the preference of " +"learning. " +msgstr "学習設定とは逆の方法で最初の文節を確定するキーイベント" + +#: src/scim_anthy_prefs.cpp:418 +msgid "Commit the _selected segment:" +msgstr "選択文節を確定(_S):" + +#: src/scim_anthy_prefs.cpp:419 src/scim_anthy_prefs.cpp:890 +msgid "Select keys to commit the selected segment" +msgstr "選択文節を確定するキーイベント" + +#: src/scim_anthy_prefs.cpp:420 +msgid "" +"The key events to commit the selected segment with reversing the preference " +"of learning. " +msgstr "学習設定とは逆の方法で選択文節を確定するキーイベント" + +#: src/scim_anthy_prefs.cpp:429 +msgid "En_coding of dictionary:" +msgstr "辞書のエンコーディング(_C):" + +#: src/scim_anthy_prefs.cpp:431 +msgid "" +"If you choose \"EUC-JP-MS\", interoperatability of documents created on this " +"system with Microsoft Windows may improve, but it depends on the " +"implementation of your operating system and actual encoding of your " +"dictionary." +msgstr "" +"\"EUC-JP-MS\"を選択すると、このシステムで作成されたドキュメントのMicrosoft " +"Windowsとの相互運用性が向上するかもしれません。しかし、これはオペレーティング" +"システムの実装と、辞書の実際のエンコーディングに依存します。" + +#: src/scim_anthy_prefs.cpp:442 +msgid "\"_Edit dictionary\" command:" +msgstr "辞書編集コマンド(_E):" + +#: src/scim_anthy_prefs.cpp:452 +msgid "\"_Add word\" command:" +msgstr "単語追加コマンド(_A):" + +#: src/scim_anthy_prefs.cpp:462 +msgid "_Preedit string:" +msgstr "編集文字列(_P):" + +#: src/scim_anthy_prefs.cpp:472 +msgid "_Conversion string:" +msgstr "変換文字列(_C):" + +#: src/scim_anthy_prefs.cpp:482 +msgid "_Selected segment:" +msgstr "選択文節(_S):" + +#: src/scim_anthy_prefs.cpp:506 +msgid "Toggle on/off" +msgstr "ON/OFF切り替え" + +#: src/scim_anthy_prefs.cpp:507 +msgid "Select toggle on/off keys" +msgstr "ON/OFFキーの設定" + +#: src/scim_anthy_prefs.cpp:508 +msgid "The key events to toggle on/off Japanese mode. " +msgstr "日本語モードをオン/オフするキーイベント" + +#: src/scim_anthy_prefs.cpp:516 +msgid "Circle input mode" +msgstr "入力モード循環" + +#: src/scim_anthy_prefs.cpp:517 +msgid "Select circle input mode keys" +msgstr "入力モード循環キーの設定" + +#: src/scim_anthy_prefs.cpp:518 +msgid "The key events to circle input mode. " +msgstr "次の入力モードを選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:526 +msgid "Circle kana mode" +msgstr "かなモード循環" + +#: src/scim_anthy_prefs.cpp:527 +msgid "Select circle kana mode keys" +msgstr "かなモード循環キーの設定" + +#: src/scim_anthy_prefs.cpp:528 +msgid "The key events to circle kana mode. " +msgstr "次のかなモードを選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:536 +msgid "Latin mode" +msgstr "英数モード" + +#: src/scim_anthy_prefs.cpp:537 +msgid "Select Latin mode keys" +msgstr "英数モードキーの設定" + +#: src/scim_anthy_prefs.cpp:538 +msgid "The key events to switch input mode to Latin. " +msgstr "英数モードへ切り替えるキーイベント" + +#: src/scim_anthy_prefs.cpp:546 +msgid "Wide Latin mode" +msgstr "全角英数モード" + +#: src/scim_anthy_prefs.cpp:547 +msgid "Select wide Latin mode keys" +msgstr "全角英数モードキーの設定" + +#: src/scim_anthy_prefs.cpp:548 +msgid "The key events to switch input mode to wide Latin. " +msgstr "全角英数モードへ切り替えるキーイベント" + +#: src/scim_anthy_prefs.cpp:556 +msgid "Hiragana mode" +msgstr "ひらがなモード" + +#: src/scim_anthy_prefs.cpp:557 +msgid "Select hiragana mode keys" +msgstr "ひらがなモードキーの設定" + +#: src/scim_anthy_prefs.cpp:558 +msgid "The key events to switch input mode to hiragana. " +msgstr "ひらがなモードへ切り替えるキーイベント" + +#: src/scim_anthy_prefs.cpp:566 +msgid "Katakana mode" +msgstr "カタカナモード" + +#: src/scim_anthy_prefs.cpp:567 +msgid "Select katakana mode keys" +msgstr "カタカナモードキーの設定" + +#: src/scim_anthy_prefs.cpp:568 +msgid "The key events to switch input mode to katakana. " +msgstr "カタカナモードキーへ切り替えるキーイベント" + +#: src/scim_anthy_prefs.cpp:576 +msgid "Half katakana mode" +msgstr "半角カタカナモード" + +#: src/scim_anthy_prefs.cpp:577 +msgid "Select half katakana mode keys" +msgstr "半角カタカナモードキーの設定" + +#: src/scim_anthy_prefs.cpp:578 +msgid "The key events to switch input mode to half katakana. " +msgstr "半角カタカナモードキーへ切り替えるキーイベント" + +#: src/scim_anthy_prefs.cpp:586 +msgid "Pseudo ASCII mode cancel" +msgstr "一時ASCIIモードキャンセル" + +#: src/scim_anthy_prefs.cpp:587 +msgid "Select pseudo ASCII mode cancel key" +msgstr "一時ASCIIモードキャンセルキーの設定" + +#: src/scim_anthy_prefs.cpp:588 +msgid "The key events to cancel the pseudo ASCII mode." +msgstr "一時ASCIIモードをキャンセルするキーイベント" + +#: src/scim_anthy_prefs.cpp:596 +msgid "Circle typing method" +msgstr "入力方式切り替え" + +#: src/scim_anthy_prefs.cpp:597 +msgid "Select circle typing method keys" +msgstr "入力方式切り替えキーの設定" + +#: src/scim_anthy_prefs.cpp:598 +msgid "The key events to circle typing method. " +msgstr "入力方式を切り替えるキーイベント" + +#: src/scim_anthy_prefs.cpp:620 +msgid "Insert space" +msgstr "空白を挿入" + +#: src/scim_anthy_prefs.cpp:621 +msgid "Select inserting space keys" +msgstr "空白を挿入するキーの設定" + +#: src/scim_anthy_prefs.cpp:622 +msgid "The key events to insert a space. " +msgstr "空白を挿入するキーイベント" + +#: src/scim_anthy_prefs.cpp:630 +msgid "Insert alternative space" +msgstr "別幅空白を挿入" + +#: src/scim_anthy_prefs.cpp:631 +msgid "Select inserting alternative space keys" +msgstr "別幅空白を挿入するキーの設定" + +#: src/scim_anthy_prefs.cpp:632 +msgid "The key events to insert a alternative space. " +msgstr "別幅空白を挿入するキーイベント" + +#: src/scim_anthy_prefs.cpp:640 +msgid "Insert half space" +msgstr "半角空白を挿入" + +#: src/scim_anthy_prefs.cpp:641 +msgid "Select inserting half width space keys" +msgstr "半角空白を挿入するキーの設定" + +#: src/scim_anthy_prefs.cpp:642 +msgid "The key events to insert a half width space. " +msgstr "半角空白を挿入するキーイベント" + +#: src/scim_anthy_prefs.cpp:650 +msgid "Insert wide space" +msgstr "全角空白を挿入" + +#: src/scim_anthy_prefs.cpp:651 +msgid "Select inserting wide space keys" +msgstr "全角空白を挿入するキーの設定" + +#: src/scim_anthy_prefs.cpp:652 +msgid "The key events to insert a wide space. " +msgstr "全角空白を挿入するキーイベント" + +#: src/scim_anthy_prefs.cpp:660 +msgid "Backspace" +msgstr "バックスペース" + +#: src/scim_anthy_prefs.cpp:661 +msgid "Select backspace keys" +msgstr "バックスペースキーの設定" + +#: src/scim_anthy_prefs.cpp:662 +msgid "The key events to delete a character before caret. " +msgstr "キャレットの前の文字を削除するキーイベント" + +#: src/scim_anthy_prefs.cpp:670 +msgid "Delete" +msgstr "削除" + +#: src/scim_anthy_prefs.cpp:671 +msgid "Select delete keys" +msgstr "削除キーの設定" + +#: src/scim_anthy_prefs.cpp:672 +msgid "The key events to delete a character after caret. " +msgstr "キャレットの後の文字を削除するキーイベント" + +#: src/scim_anthy_prefs.cpp:682 +msgid "The key events to commit the preedit string. " +msgstr "文字列を確定するキーイベント" + +#: src/scim_anthy_prefs.cpp:690 +msgid "Convert" +msgstr "変換" + +#: src/scim_anthy_prefs.cpp:691 +msgid "Select convert keys" +msgstr "変換キーの設定" + +#: src/scim_anthy_prefs.cpp:692 +msgid "The key events to convert the preedit string to kanji. " +msgstr "文字列を漢字に変換するキーイベント" + +#: src/scim_anthy_prefs.cpp:700 +msgid "Predict" +msgstr "予測" + +#: src/scim_anthy_prefs.cpp:701 +msgid "Select predict keys" +msgstr "予測キーの設定" + +#: src/scim_anthy_prefs.cpp:702 +msgid "" +"The key events to predict a word or sentence from already inserted text. " +msgstr "入力された文字列から単語や文を予測するキーイベント" + +#: src/scim_anthy_prefs.cpp:710 +msgid "Cancel" +msgstr "キャンセル" + +#: src/scim_anthy_prefs.cpp:711 +msgid "Select cancel keys" +msgstr "キャンセルキーの設定" + +#: src/scim_anthy_prefs.cpp:712 +msgid "The key events to cancel preediting or converting. " +msgstr "文字変換や文字入力をキャンセルするキーイベント" + +#: src/scim_anthy_prefs.cpp:720 +msgid "Cancel all" +msgstr "全てキャンセル" + +#: src/scim_anthy_prefs.cpp:721 +msgid "Select cancel all keys" +msgstr "全てをキャンセルするキーの設定" + +#: src/scim_anthy_prefs.cpp:722 +msgid "The key events to return to initial state. " +msgstr "初期状態へ戻るキーイベント" + +#: src/scim_anthy_prefs.cpp:730 +msgid "Reconvert" +msgstr "再変換" + +#: src/scim_anthy_prefs.cpp:731 +msgid "Select reconvert keys" +msgstr "再変換キーの設定" + +#: src/scim_anthy_prefs.cpp:732 +msgid "The key events to reconvert the commited string in selection. " +msgstr "セレクション内の確定済み文字列を再変換するキーイベント" + +#: src/scim_anthy_prefs.cpp:741 +msgid "Select do nothing keys" +msgstr "なにもしないキーの設定" + +#: src/scim_anthy_prefs.cpp:742 +msgid "" +"The key events to eat and do nothing anymore. For example, it can be used to " +"disable space key completely." +msgstr "" +"アプリケーションに渡さず、それ以上何もしないキーイベント。例えば、スペース" +"キーを完全に無効にしたいときに指定します。" + +#: src/scim_anthy_prefs.cpp:765 +msgid "Move to first" +msgstr "最初へ移動" + +#: src/scim_anthy_prefs.cpp:766 +msgid "Select move caret to first keys" +msgstr "最初へ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:767 +msgid "The key events to move the caret to the first of preedit string. " +msgstr "キャレットを文字列の先頭に移動するキーイベント" + +#: src/scim_anthy_prefs.cpp:775 +msgid "Move to last" +msgstr "最後へ移動" + +#: src/scim_anthy_prefs.cpp:776 +msgid "Select move caret to last keys" +msgstr "最後へ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:777 +msgid "The key events to move the caret to the last of the preedit string. " +msgstr "キャレットを文字列の最後に移動するキーイベント" + +#: src/scim_anthy_prefs.cpp:785 +msgid "Move forward" +msgstr "前方へ移動" + +#: src/scim_anthy_prefs.cpp:786 +msgid "Select move caret forward keys" +msgstr "前方へ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:787 +msgid "The key events to move the caret forward. " +msgstr "キャレットを前方に移動するキーイベント" + +#: src/scim_anthy_prefs.cpp:795 +msgid "Move backward" +msgstr "後方へ移動" + +#: src/scim_anthy_prefs.cpp:796 +msgid "Select move caret backward keys" +msgstr "後方へ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:797 +msgid "The key events to move the caret backward. " +msgstr "キャレットを後方へ移動するキーイベント" + +#: src/scim_anthy_prefs.cpp:819 +msgid "Select the first segment" +msgstr "最初の文節を選択" + +#: src/scim_anthy_prefs.cpp:820 +msgid "Select keys to select the first segment" +msgstr "最初の文節を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:821 +msgid "The key events to select the first segment. " +msgstr "最初の文節を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:829 +msgid "Select the last segment" +msgstr "最後の文節を選択" + +#: src/scim_anthy_prefs.cpp:830 +msgid "Select keys to select the last segment" +msgstr "最後の文節を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:831 +msgid "The key events to select the the last segment. " +msgstr "最後の文節を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:839 +msgid "Select the next segment" +msgstr "次の文節を選択" + +#: src/scim_anthy_prefs.cpp:840 +msgid "Select keys to select the next segment" +msgstr "次の文節を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:841 +msgid "The key events to select the next segment. " +msgstr "次の文節を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:849 +msgid "Select the previous segment" +msgstr "前の文節を選択" + +#: src/scim_anthy_prefs.cpp:850 +msgid "Select keys to select the previous segment" +msgstr "前の文節を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:851 +msgid "The key events to select the previous segment. " +msgstr "前の文節を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:859 +msgid "Shrink the segment" +msgstr "文節を縮める" + +#: src/scim_anthy_prefs.cpp:860 +msgid "Select keys to shrink the segment" +msgstr "文節を縮めるキーの設定" + +#: src/scim_anthy_prefs.cpp:861 +msgid "The key events to shrink the selected segment. " +msgstr "文節を縮めるキーイベント" + +#: src/scim_anthy_prefs.cpp:869 +msgid "Expand the segment" +msgstr "文節を広げる" + +#: src/scim_anthy_prefs.cpp:870 +msgid "Select keys to expand the segment" +msgstr "文節を広げるキーの設定" + +#: src/scim_anthy_prefs.cpp:871 +msgid "The key events to expand the selected segment. " +msgstr "文節を広げるキーイベント" + +#: src/scim_anthy_prefs.cpp:879 +msgid "Commit the first segment" +msgstr "最初の文節を確定" + +#: src/scim_anthy_prefs.cpp:881 +msgid "The key events to commit the first segment. " +msgstr "最初の文節を確定するキーイベント" + +#: src/scim_anthy_prefs.cpp:889 +msgid "Commit the selected segment" +msgstr "選択文節を確定" + +#: src/scim_anthy_prefs.cpp:891 +msgid "The key events to commit the selected segment. " +msgstr "選択文節を確定するキーイベント" + +#: src/scim_anthy_prefs.cpp:913 +msgid "First candidate" +msgstr "最初の候補" + +#: src/scim_anthy_prefs.cpp:914 +msgid "Select the first candidate keys" +msgstr "最初の候補へ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:915 +msgid "The key events to select the first candidate. " +msgstr "最初の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:923 +msgid "Last candidate" +msgstr "最後の候補" + +#: src/scim_anthy_prefs.cpp:924 +msgid "Select the last candidate keys" +msgstr "最後の候補へ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:925 +msgid "The key events to the select last candidate. " +msgstr "最後の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:933 +msgid "Next candidate" +msgstr "次の候補" + +#: src/scim_anthy_prefs.cpp:934 +msgid "Select the next candidate keys" +msgstr "次の候補へ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:935 +msgid "The key events to select the next candidate. " +msgstr "次の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:943 +msgid "Previous candidate" +msgstr "前の候補" + +#: src/scim_anthy_prefs.cpp:944 +msgid "Select the previous candidate keys" +msgstr "前の候補へ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:945 +msgid "The key events to select the previous candidate. " +msgstr "前の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:953 +msgid "Page up" +msgstr "前のページへ移動" + +#: src/scim_anthy_prefs.cpp:954 +msgid "Select page up candidates keys" +msgstr "前の候補ページへ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:955 +msgid "The key events to switch candidates page up. " +msgstr "前の候補ページへ移動するキーイベント" + +#: src/scim_anthy_prefs.cpp:963 +msgid "Page down" +msgstr "次のページへ移動" + +#: src/scim_anthy_prefs.cpp:964 +msgid "Select page down candidates keys" +msgstr "次の候補ページへ移動するキーの設定" + +#: src/scim_anthy_prefs.cpp:965 +msgid "The key events to switch candidates page down. " +msgstr "次の候補ページへ移動するキーイベント" + +#: src/scim_anthy_prefs.cpp:987 +msgid "1st candidate" +msgstr "1番目の候補" + +#: src/scim_anthy_prefs.cpp:988 +msgid "Select keys to select 1st candidate" +msgstr "1番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:989 +msgid "The key events to select the 1st candidate. " +msgstr "1番目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:997 +msgid "2nd candidate" +msgstr "2番目の候補" + +#: src/scim_anthy_prefs.cpp:998 +msgid "Select keys to select 2nd candidate" +msgstr "2番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:999 +msgid "The key events to select the 2nd candidate. " +msgstr "2番得目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1007 +msgid "3rd candidate" +msgstr "3番目の候補" + +#: src/scim_anthy_prefs.cpp:1008 +msgid "Select keys to select 3rd candidate" +msgstr "3番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:1009 +msgid "The key events to select the 3rd candidate. " +msgstr "3番得目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1017 +msgid "4th candidate" +msgstr "4番目の候補" + +#: src/scim_anthy_prefs.cpp:1018 +msgid "Select keys to select 4th candidate" +msgstr "4番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:1019 +msgid "The key events to select the 4th candidate. " +msgstr "4番目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1027 +msgid "5th candidate" +msgstr "5番目の候補" + +#: src/scim_anthy_prefs.cpp:1028 +msgid "Select keys to select 5th candidate" +msgstr "5番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:1029 +msgid "The key events to select the 5th candidate. " +msgstr "5番目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1037 +msgid "6th candidate" +msgstr "6番目の候補" + +#: src/scim_anthy_prefs.cpp:1038 +msgid "Select keys to select 6th candidate" +msgstr "6番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:1039 +msgid "The key events to select the 6th candidate. " +msgstr "6番目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1047 +msgid "7th candidate" +msgstr "7番目の候補" + +#: src/scim_anthy_prefs.cpp:1048 +msgid "Select keys to select 7th candidate" +msgstr "7番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:1049 +msgid "The key events to select the 7th candidate. " +msgstr "7番目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1057 +msgid "8th candidate" +msgstr "8番目の候補" + +#: src/scim_anthy_prefs.cpp:1058 +msgid "Select keys to select 8th candidate" +msgstr "8番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:1059 +msgid "The key events to select the 8th candidate. " +msgstr "8番目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1067 +msgid "9th candidate" +msgstr "9番目の候補" + +#: src/scim_anthy_prefs.cpp:1068 +msgid "Select keys to select 9th candidate" +msgstr "9番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:1069 +msgid "The key events to select the 9th candidate. " +msgstr "9番目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1077 +msgid "10th candidate" +msgstr "10番目の候補" + +#: src/scim_anthy_prefs.cpp:1078 +msgid "Select keys to select 10th candidate" +msgstr "10番目の候補を選択するキーの設定" + +#: src/scim_anthy_prefs.cpp:1079 +msgid "The key events to select the 10th candidate. " +msgstr "10番目の候補を選択するキーイベント" + +#: src/scim_anthy_prefs.cpp:1101 +msgid "Convert character type forward" +msgstr "次の文字種に変換" + +#: src/scim_anthy_prefs.cpp:1102 +msgid "Select keys to convert character type forward" +msgstr "次の文字種に変換するキーの設定" + +#: src/scim_anthy_prefs.cpp:1103 +msgid "Rotate character type forward." +msgstr "文字種を次に変換" + +#: src/scim_anthy_prefs.cpp:1111 +msgid "Convert character type backward" +msgstr "前の文字種に変換" + +#: src/scim_anthy_prefs.cpp:1112 +msgid "Select keys to convert character type backward" +msgstr "前の文字種に変換するキーの設定" + +#: src/scim_anthy_prefs.cpp:1113 +msgid "Rotate character type backward." +msgstr "前の文字種に変換" + +#: src/scim_anthy_prefs.cpp:1121 +msgid "Convert to hiragana" +msgstr "ひらがな変換" + +#: src/scim_anthy_prefs.cpp:1122 +msgid "Select keys to convert to hiragana" +msgstr "ひらがな変換キーの設定" + +#: src/scim_anthy_prefs.cpp:1123 +msgid "The key events to convert the preedit string to hiragana. " +msgstr "文字列をひらがなへ変換するキーイベント" + +#: src/scim_anthy_prefs.cpp:1131 +msgid "Convert to katakana" +msgstr "カタカナ変換" + +#: src/scim_anthy_prefs.cpp:1132 +msgid "Select keys to convert to katakana" +msgstr "カタカナ変換キーの設定" + +#: src/scim_anthy_prefs.cpp:1133 +msgid "The key events to convert the preedit string to katakana. " +msgstr "文字列をカタカナへ変換するキーイベント" + +#: src/scim_anthy_prefs.cpp:1141 +msgid "Convert to half width" +msgstr "半角変換" + +#: src/scim_anthy_prefs.cpp:1142 +msgid "Select keys to convert to half width" +msgstr "半角変換キーの設定" + +#: src/scim_anthy_prefs.cpp:1143 +msgid "The key events to convert the preedit string to half width. " +msgstr "文字列を半角へ変換するキーイベント" + +#: src/scim_anthy_prefs.cpp:1151 +msgid "Convert to half katakana" +msgstr "半角カタカナ変換" + +#: src/scim_anthy_prefs.cpp:1152 +msgid "Select keys to convert to half width katakana" +msgstr "半角カタカナ変換キーの設定" + +#: src/scim_anthy_prefs.cpp:1153 +msgid "The key events to convert the preedit string to half width katakana. " +msgstr "文字列を半角カタカナへ変換するキーイベント" + +#: src/scim_anthy_prefs.cpp:1161 +msgid "Convert to wide latin" +msgstr "全角英数変換" + +#: src/scim_anthy_prefs.cpp:1162 +msgid "Select keys to convert to wide latin" +msgstr "全角英数変換キーの設定" + +#: src/scim_anthy_prefs.cpp:1163 +msgid "The key events to convert the preedit string to wide latin. " +msgstr "文字列を全角英数へ変換するキーイベント" + +#: src/scim_anthy_prefs.cpp:1171 +msgid "Convert to latin" +msgstr "英数変換" + +#: src/scim_anthy_prefs.cpp:1172 +msgid "Select keys to convert to latin" +msgstr "英数変換キーの設定" + +#: src/scim_anthy_prefs.cpp:1173 +msgid "The key events to convert the preedit string to latin. " +msgstr "文字列を英数へ変換するキーイベント" + +#: src/scim_anthy_prefs.cpp:1195 +msgid "Edit dictionary" +msgstr "辞書を編集" + +#: src/scim_anthy_prefs.cpp:1196 +msgid "Select edit dictionary keys" +msgstr "辞書編集キーの設定" + +#: src/scim_anthy_prefs.cpp:1197 +msgid "The key events to launch dictionary administration tool. " +msgstr "辞書管理ツールを起動するキーイベント" + +#: src/scim_anthy_prefs.cpp:1206 +msgid "Select add a word keys" +msgstr "単語追加キーの設定" + +#: src/scim_anthy_prefs.cpp:1207 +msgid "The key events to launch the tool to add a word. " +msgstr "単語追加ツールを起動するキーイベント" + +#: src/scim_anthy_prefs.cpp:1232 src/scim_anthy_prefs.cpp:1245 +#: src/scim_anthy_prefs.cpp:1258 +msgid "Color:" +msgstr "色:" + +#: src/scim_anthy_prefs.cpp:1233 src/scim_anthy_prefs.cpp:1234 +msgid "The color of preediting text" +msgstr "編集文字列の色" + +#: src/scim_anthy_prefs.cpp:1246 src/scim_anthy_prefs.cpp:1247 +msgid "The color of conversion text" +msgstr "変換文字列の色" + +#: src/scim_anthy_prefs.cpp:1259 +msgid "The color of selected segment text" +msgstr "選択文節の色" + +#: src/scim_anthy_prefs.cpp:1260 +msgid "The color of selected segment text in the conversion text" +msgstr "変換文字列内の選択文節の色" + +#: src/scim_anthy_color_button.cpp:320 +msgid "Foreground color" +msgstr "前景色" + +#: src/scim_anthy_color_button.cpp:320 +msgid "Background color" +msgstr "背景色" + +#~ msgid "NICOLA Layout" +#~ msgstr "NICOLA配列" + +#~ msgid "Customize NICOLA table" +#~ msgstr "NICOLAテーブルのカスタマイズ" + +#~ msgid "NICOLA _table:" +#~ msgstr "NICOLAテーブル(_T):" + +#~ msgid "NICOLA time:" +#~ msgstr "NICOLAタイム:" + +#~ msgid "NICOLA time" +#~ msgstr "NICOLAタイム" + +#~ msgid "" +#~ "Copyright (C) 2004,2005 Takuro Ashie \n" +#~ "Copyright (C) 2004,2005 Hiroyuki Ikezoe " +#~ msgstr "" +#~ "Copyright (C) 2004,2005 Takuro Ashie \n" +#~ "Copyright (C) 2004,2005 Hiroyuki Ikezoe " + +#~ msgid "The key events to toggle wide latin mode. " +#~ msgstr "全角英数モードをオン/オフするキーイベント" + +#~ msgid "La_yout (Not implemented yet):" +#~ msgstr "レイアウト(未実装)(_Y):" + +#~ msgid "Pending" +#~ msgstr "保留文字列" + +#~ msgid "_Sequence:" +#~ msgstr "入力文字列(_S):" + +#~ msgid "_Result:" +#~ msgstr "出力文字列(_R):" + +#~ msgid "None" +#~ msgstr "なし" + +#~ msgid "Style of selected segment:" +#~ msgstr "選択文節のスタイル:" + +#~ msgid "Style of preedit:" +#~ msgstr "編集文字列のスタイル:" + +#~ msgid "The color of preediting text in the preedition" +#~ msgstr "編集文字列の色" + +#~ msgid "Options" +#~ msgstr "オプション" + +#~ msgid "The key events to select page up candidates. " +#~ msgstr "前の候補ページへ移動するキーイベント" + +#~ msgid "The key events to select page down candidates. " +#~ msgstr "次の候補ページへ移動するキーイベント" + +#~ msgid "Convert keys:" +#~ msgstr "変換:" + +#~ msgid "First segment keys:" +#~ msgstr "最初の文節:" + +#~ msgid "Last segment keys:" +#~ msgstr "最後の文節:" + +#~ msgid "Next segment keys:" +#~ msgstr "次の文節:" + +#~ msgid "Previous segment keys:" +#~ msgstr "前の文節:" + +#~ msgid "Select commiting the first segment keys" +#~ msgstr "最初の文節を確定するキーの設定" + +#~ msgid "Next keys:" +#~ msgstr "次へ移動:" + +#~ msgid "Previous keys:" +#~ msgstr "前へ移動:" + +#~ msgid "Hiragana keys:" +#~ msgstr "ひらがな変換:" + +#~ msgid "Katakana keys:" +#~ msgstr "カタカナ変換:" + +#~ msgid "Half width keys:" +#~ msgstr "半角カタカナ変換:" + +#~ msgid "Latin keys:" +#~ msgstr "英数変換:" + +#~ msgid "Wide latin keys:" +#~ msgstr "全角英数変換:" + +#~ msgid "Edit dictionary keys:" +#~ msgstr "辞書編集:" + +#~ msgid "Add a word keys:" +#~ msgstr "単語追加:" + +#~ msgid "Candidates keys (Direct select)" +#~ msgstr "候補選択キー (直接選択)" diff --git a/po/quot.sed b/po/quot.sed new file mode 100755 index 0000000..0122c46 --- /dev/null +++ b/po/quot.sed @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin new file mode 100755 index 0000000..2436c49 --- /dev/null +++ b/po/remove-potcdate.sin @@ -0,0 +1,19 @@ +# Sed script that remove the POT-Creation-Date line in the header entry +# from a POT file. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/po/scim-anthy.pot b/po/scim-anthy.pot new file mode 100755 index 0000000..63234b9 --- /dev/null +++ b/po/scim-anthy.pot @@ -0,0 +1,1483 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Takuro Ashie +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: ashie@homa.ne.jp\n" +"POT-Creation-Date: 2009-01-15 12:04+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/scim_anthy_imengine.cpp:488 +#, c-format +msgid "Candidates (%d/%d)" +msgstr "" + +#: src/scim_anthy_imengine.cpp:565 +msgid "Input mode" +msgstr "" + +#: src/scim_anthy_imengine.cpp:569 src/scim_anthy_setup.cpp:203 +msgid "Hiragana" +msgstr "" + +#: src/scim_anthy_imengine.cpp:573 src/scim_anthy_setup.cpp:204 +msgid "Katakana" +msgstr "" + +#: src/scim_anthy_imengine.cpp:577 src/scim_anthy_imengine.cpp:578 +#: src/scim_anthy_setup.cpp:205 +msgid "Half width katakana" +msgstr "" + +#: src/scim_anthy_imengine.cpp:582 src/scim_anthy_setup.cpp:206 +msgid "Latin" +msgstr "" + +#: src/scim_anthy_imengine.cpp:582 +msgid "Direct input" +msgstr "" + +#: src/scim_anthy_imengine.cpp:586 src/scim_anthy_setup.cpp:207 +msgid "Wide latin" +msgstr "" + +#: src/scim_anthy_imengine.cpp:592 +msgid "Typing method" +msgstr "" + +#: src/scim_anthy_imengine.cpp:596 +msgid "Romaji" +msgstr "" + +#: src/scim_anthy_imengine.cpp:600 +msgid "Kana" +msgstr "" + +#: src/scim_anthy_imengine.cpp:604 +msgid "Thumb shift" +msgstr "" + +#: src/scim_anthy_imengine.cpp:611 +msgid "Conversion mode" +msgstr "" + +#: src/scim_anthy_imengine.cpp:615 src/scim_anthy_imengine.cpp:616 +#: src/scim_anthy_setup.cpp:221 +msgid "Multi segment" +msgstr "" + +#: src/scim_anthy_imengine.cpp:620 src/scim_anthy_imengine.cpp:621 +#: src/scim_anthy_setup.cpp:222 +msgid "Single segment" +msgstr "" + +#: src/scim_anthy_imengine.cpp:625 src/scim_anthy_imengine.cpp:627 +#: src/scim_anthy_setup.cpp:223 +msgid "Convert as you type (Multi segment)" +msgstr "" + +#: src/scim_anthy_imengine.cpp:631 src/scim_anthy_imengine.cpp:633 +#: src/scim_anthy_setup.cpp:224 +msgid "Convert as you type (Single segment)" +msgstr "" + +#: src/scim_anthy_imengine.cpp:640 +msgid "Period style" +msgstr "" + +#: src/scim_anthy_imengine.cpp:669 +msgid "Symbol style" +msgstr "" + +#: src/scim_anthy_imengine.cpp:717 +msgid "Dictionary menu" +msgstr "" + +#: src/scim_anthy_imengine.cpp:722 +msgid "Edit the dictionary" +msgstr "" + +#: src/scim_anthy_imengine.cpp:724 +msgid "Launch the dictionary administration tool." +msgstr "" + +#: src/scim_anthy_imengine.cpp:730 src/scim_anthy_prefs.cpp:1205 +msgid "Add a word" +msgstr "" + +#: src/scim_anthy_imengine.cpp:732 +msgid "Add a word to the dictionary." +msgstr "" + +#: src/scim_anthy_factory.cpp:195 +msgid "" +"Authors of scim-anthy:\n" +" Copyright (C) 2004,2005 Takuro Ashie \n" +" Copyright (C) 2004,2005 Hiroyuki Ikezoe \n" +" \n" +"Authors of Anthy:\n" +" Copyright (C) 2000-2005 Yusuke TABATA \n" +" Copyright (C) 2004-2005 Yuichi YOSHIDA \n" +" You can find out all credits of Anthy from AUTHORS file in Anthy package.\n" +msgstr "" + +#: src/scim_anthy_factory.cpp:211 +msgid "" +"Art work:\n" +" SHIMODA Hiroshi \n" +"\n" +"Translation:\n" +" Gerrit Sangel \n" +"Special thanks:\n" +" UTUMI Hirosi \n" +" Yukiko Bando \n" +" Mike Fabian \n" +" David Oftedal \n" +" Ryo Dairiki \n" +" Seiichi SATO\n" +" AWASHIRO Ikuya \n" +" Hatuka*nezumi \n" +" Teppei Tamra \n" +" Akira TAGOH \n" +" Tatsuki Sugiura \n" +" Takashi Nakamoto " +msgstr "" + +#: src/scim_anthy_factory.cpp:236 +msgid "" +"Basic operation:\n" +" \n" +msgstr "" + +#: src/scim_anthy_factory.cpp:240 +msgid "" +"1. Switch input mode:\n" +" You can switch on/off Japanese input mode by pressing Zenkaku_Hankaku key\n" +" or Control+J. Or you can rotate all input modes by pressing Control+,\n" +" (comma).\n" +" \n" +msgstr "" + +#: src/scim_anthy_factory.cpp:247 +msgid "" +"2. Input Japanese hiragana and katakana:\n" +" You can input Japanese hiragana and katakana by inputting romaji.\n" +" The Romaji table can be found out from the \"Anthy\" section of the setup\n" +" window in SCIM or SKIM.\n" +" If you want to hiragana and katakana directly by using Japanese keyboard,\n" +" please press Alt + Romaji key or Conrol+\\ key to switch typing method.\n" +" \n" +msgstr "" + +#: src/scim_anthy_factory.cpp:256 +msgid "" +"3. Convert hiragana or katakana to Japanese kanji\n" +" After inputting hiragana or katakana, you can convert it to Japanese\n" +" kanji by pressing Space key. Then it will show some candidates. You can\n" +" select the next candidate by pressing Space key, and can commit it by\n" +" pressing Enter key.\n" +" If you input a sentense, Anthy will split it to some segments. You can\n" +" select the next or previous segment by pressing left or right cursor key,\n" +" and can extend or shrink the selected segment by pressing Shift + left or\n" +" right cursor key.\n" +" \n" +msgstr "" + +#: src/scim_anthy_factory.cpp:268 +msgid "" +"4. Other key bindings:\n" +" You can find out all key bindings definition of scim-anthy from \"Anthy\"\n" +" section on setup window of SCIM or SKIM.\n" +msgstr "" + +#: src/scim_anthy_setup.cpp:119 +msgid "Anthy" +msgstr "" + +#: src/scim_anthy_setup.cpp:124 +msgid "An Anthy IMEngine Module." +msgstr "" + +#: src/scim_anthy_setup.cpp:184 +msgid "Mode keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:185 +msgid "Edit keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:186 +msgid "Caret keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:187 +msgid "Segments keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:188 +msgid "Candidates keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:189 +msgid "Direct select keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:190 +msgid "Convert keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:191 +msgid "Dictionary keys" +msgstr "" + +#: src/scim_anthy_setup.cpp:213 +msgid "Romaji typing method" +msgstr "" + +#: src/scim_anthy_setup.cpp:214 +msgid "Kana typing method" +msgstr "" + +#: src/scim_anthy_setup.cpp:215 +msgid "Thumb shift typing method" +msgstr "" + +#: src/scim_anthy_setup.cpp:248 src/scim_anthy_setup.cpp:256 +msgid "Follow input mode" +msgstr "" + +#: src/scim_anthy_setup.cpp:249 src/scim_anthy_setup.cpp:257 +msgid "Wide" +msgstr "" + +#: src/scim_anthy_setup.cpp:250 src/scim_anthy_setup.cpp:258 +msgid "Half" +msgstr "" + +#: src/scim_anthy_setup.cpp:264 src/scim_anthy_prefs.cpp:740 +msgid "Do nothing" +msgstr "" + +#: src/scim_anthy_setup.cpp:265 +msgid "Start conversion" +msgstr "" + +#: src/scim_anthy_setup.cpp:266 src/scim_anthy_setup.cpp:272 +#: src/scim_anthy_prefs.cpp:680 +msgid "Commit" +msgstr "" + +#: src/scim_anthy_setup.cpp:273 +msgid "Clear" +msgstr "" + +#: src/scim_anthy_setup.cpp:279 +msgid "UTF-8" +msgstr "" + +#: src/scim_anthy_setup.cpp:280 +msgid "EUC-JP" +msgstr "" + +#: src/scim_anthy_setup.cpp:281 +msgid "EUC-JP-MS" +msgstr "" + +#: src/scim_anthy_setup.cpp:287 +msgid "No decoration" +msgstr "" + +#: src/scim_anthy_setup.cpp:288 +msgid "Underline" +msgstr "" + +#: src/scim_anthy_setup.cpp:289 +msgid "Reverse" +msgstr "" + +#: src/scim_anthy_setup.cpp:290 +msgid "Highlight" +msgstr "" + +#: src/scim_anthy_setup.cpp:291 +msgid "String color" +msgstr "" + +#: src/scim_anthy_setup.cpp:292 +msgid "BG color" +msgstr "" + +#: src/scim_anthy_setup.cpp:293 +msgid "Both color" +msgstr "" + +#: src/scim_anthy_setup.cpp:805 +msgid "_Group:" +msgstr "" + +#: src/scim_anthy_setup.cpp:826 +msgid "Search by key" +msgstr "" + +#: src/scim_anthy_setup.cpp:830 +msgid "all" +msgstr "" + +#: src/scim_anthy_setup.cpp:873 +msgid "Feature" +msgstr "" + +#: src/scim_anthy_setup.cpp:882 src/scim_anthy_setup.cpp:1289 +msgid "Key bindings" +msgstr "" + +#: src/scim_anthy_setup.cpp:890 +msgid "Description" +msgstr "" + +#: src/scim_anthy_setup.cpp:914 +msgid "Key bindings _theme:" +msgstr "" + +#: src/scim_anthy_setup.cpp:928 +msgid "_Choose keys..." +msgstr "" + +#: src/scim_anthy_setup.cpp:955 +msgid "Enable/Disable learning" +msgstr "" + +#: src/scim_anthy_setup.cpp:982 +msgid "Key preferences to commit with reversing learning preference" +msgstr "" + +#: src/scim_anthy_setup.cpp:1056 src/scim_anthy_setup.cpp:1070 +msgid "_Launch" +msgstr "" + +#: src/scim_anthy_setup.cpp:1241 +#, c-format +msgid "" +"%s-%s\n" +"\n" +"A Japanese input method module\n" +"for SCIM using Anthy\n" +"\n" +"\n" +"\n" +"Copyright 2005-2006, Takuro Ashie <ashie@homa.ne." +"jp>" +msgstr "" + +#: src/scim_anthy_setup.cpp:1277 +msgid "Common" +msgstr "" + +#: src/scim_anthy_setup.cpp:1283 +msgid "Symbols" +msgstr "" + +#: src/scim_anthy_setup.cpp:1295 +msgid "Romaji typing" +msgstr "" + +#: src/scim_anthy_setup.cpp:1301 +msgid "Kana typing" +msgstr "" + +#: src/scim_anthy_setup.cpp:1307 +msgid "Prediction" +msgstr "" + +#: src/scim_anthy_setup.cpp:1313 +msgid "Learning" +msgstr "" + +#: src/scim_anthy_setup.cpp:1319 +msgid "Dictionary" +msgstr "" + +#: src/scim_anthy_setup.cpp:1325 +msgid "Candidates window" +msgstr "" + +#: src/scim_anthy_setup.cpp:1331 +msgid "Toolbar" +msgstr "" + +#: src/scim_anthy_setup.cpp:1337 +msgid "Appearance" +msgstr "" + +#: src/scim_anthy_setup.cpp:1343 +msgid "About" +msgstr "" + +#: src/scim_anthy_setup.cpp:1405 src/scim_anthy_setup_romaji.cpp:255 +#: src/scim_anthy_setup_kana.cpp:413 src/scim_anthy_setup_kana.cpp:480 +msgid "User defined" +msgstr "" + +#: src/scim_anthy_setup.cpp:1408 src/scim_anthy_setup_romaji.cpp:258 +#: src/scim_anthy_setup_kana.cpp:416 src/scim_anthy_setup_kana.cpp:483 +msgid "Default" +msgstr "" + +#: src/scim_anthy_setup.cpp:2006 +msgid "Set key filter" +msgstr "" + +#: src/scim_anthy_setup_romaji.cpp:124 src/scim_anthy_setup_romaji.cpp:195 +msgid "Romaji _table:" +msgstr "" + +#: src/scim_anthy_setup_romaji.cpp:137 src/scim_anthy_setup_kana.cpp:143 +#: src/scim_anthy_setup_kana.cpp:188 +msgid "_Customize..." +msgstr "" + +#: src/scim_anthy_setup_romaji.cpp:177 +msgid "Sequence" +msgstr "" + +#: src/scim_anthy_setup_romaji.cpp:178 src/scim_anthy_setup_kana.cpp:263 +msgid "Result" +msgstr "" + +#: src/scim_anthy_setup_romaji.cpp:185 +msgid "Customize romaji table" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:114 +msgid "JIS Kana Layout" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:130 src/scim_anthy_setup_kana.cpp:175 +msgid "La_yout:" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:155 +msgid "Thumb Shift Layout" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:262 src/scim_anthy_setup_kana.cpp:332 +msgid "Key" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:270 +msgid "Customize kana layout table" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:280 src/scim_anthy_setup_kana.cpp:352 +msgid "Layout _table:" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:333 +msgid "Single press" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:334 +msgid "Left thumb shift" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:335 +msgid "Right thumb shift" +msgstr "" + +#: src/scim_anthy_setup_kana.cpp:342 +msgid "Customize thumb shift layout table" +msgstr "" + +#: src/scim_anthy_prefs.cpp:35 +msgid "Show \"_Candidates\" label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:45 +msgid "Close candidate window when select a candidate _directly" +msgstr "" + +#: src/scim_anthy_prefs.cpp:55 +msgid "Learn on _manual committing" +msgstr "" + +#: src/scim_anthy_prefs.cpp:65 +msgid "Learn on a_uto committing" +msgstr "" + +#: src/scim_anthy_prefs.cpp:75 +msgid "Use half-width characters for _symbols" +msgstr "" + +#: src/scim_anthy_prefs.cpp:85 +msgid "Use half-width characters for _numbers" +msgstr "" + +#: src/scim_anthy_prefs.cpp:95 +msgid "A_llow spliting romaji on editing preedit string" +msgstr "" + +#: src/scim_anthy_prefs.cpp:97 +msgid "If this check is enabled, you can delete each letter." +msgstr "" + +#: src/scim_anthy_prefs.cpp:104 +msgid "_Entering the pseudo ASCII input mode with capital letters." +msgstr "" + +#: src/scim_anthy_prefs.cpp:106 +msgid "" +"If this check is enabled, capital letters will becomes a trigger to enter " +"the pseudo ASCII input mode." +msgstr "" + +#: src/scim_anthy_prefs.cpp:113 +msgid "Insert a _blank with a blank key." +msgstr "" + +#: src/scim_anthy_prefs.cpp:115 +msgid "" +"If this check is enabled, a blank key will works to insert a blank when " +"entering the pseudo ASCII input mode." +msgstr "" + +#: src/scim_anthy_prefs.cpp:122 +msgid "_Show predicted candidates while inputting letters" +msgstr "" + +#: src/scim_anthy_prefs.cpp:131 +msgid "Use _direct select keys while predicting" +msgstr "" + +#: src/scim_anthy_prefs.cpp:140 +msgid "Show _input mode label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:150 +msgid "Show _conversion mode label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:160 +msgid "Show _typing method label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:170 +msgid "Show _period style label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:180 +msgid "Show _symbol style label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:190 +msgid "Show _dictionary menu label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:200 +msgid "Show _edit dictionary label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:210 +msgid "Show _add word label" +msgstr "" + +#: src/scim_anthy_prefs.cpp:235 +msgid "Number of candidates to show in a _page:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:238 +msgid "" +"Specify the number of candidates to show in a page of the candidates window." +msgstr "" + +#: src/scim_anthy_prefs.cpp:247 +msgid "Number of _triggers until show:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:248 +msgid "[times]" +msgstr "" + +#: src/scim_anthy_prefs.cpp:250 +msgid "" +"The number of times to press a conversion key until show the candidates " +"window.Specify 0 to never show it." +msgstr "" + +#: src/scim_anthy_prefs.cpp:260 +msgid "_Simultaneous pressing time:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:261 +msgid "[msec]" +msgstr "" + +#: src/scim_anthy_prefs.cpp:263 +msgid "Time to regard as simultaneous key pressing." +msgstr "" + +#: src/scim_anthy_prefs.cpp:286 +msgid "_Input mode: " +msgstr "" + +#: src/scim_anthy_prefs.cpp:296 +msgid "Typing _method: " +msgstr "" + +#: src/scim_anthy_prefs.cpp:306 +msgid "_Conversion mode: " +msgstr "" + +#: src/scim_anthy_prefs.cpp:316 +msgid "St_yle of comma and period: " +msgstr "" + +#: src/scim_anthy_prefs.cpp:326 +msgid "Symb_ol input style: " +msgstr "" + +#: src/scim_anthy_prefs.cpp:336 +msgid "_Space type: " +msgstr "" + +#: src/scim_anthy_prefs.cpp:346 +msgid "Input from _ten key: " +msgstr "" + +#: src/scim_anthy_prefs.cpp:356 +msgid "_Behavior on a comma or a period:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:366 +msgid "_Behavior on focus out:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:376 +msgid "_Left thumb shift keys:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:386 +msgid "_Right thumb shift keys:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:396 +msgid "_Commit:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:397 src/scim_anthy_prefs.cpp:681 +msgid "Select commit keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:398 +msgid "" +"The key events to commit the preedit string with reversing the preference of " +"learning. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:407 +msgid "Commit the _first segment:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:408 src/scim_anthy_prefs.cpp:880 +msgid "Select keys to commit the first segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:409 +msgid "" +"The key events to commit the first segment with reversing the preference of " +"learning. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:418 +msgid "Commit the _selected segment:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:419 src/scim_anthy_prefs.cpp:890 +msgid "Select keys to commit the selected segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:420 +msgid "" +"The key events to commit the selected segment with reversing the preference " +"of learning. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:429 +msgid "En_coding of dictionary:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:431 +msgid "" +"If you choose \"EUC-JP-MS\", interoperatability of documents created on this " +"system with Microsoft Windows may improve, but it depends on the " +"implementation of your operating system and actual encoding of your " +"dictionary." +msgstr "" + +#: src/scim_anthy_prefs.cpp:442 +msgid "\"_Edit dictionary\" command:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:452 +msgid "\"_Add word\" command:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:462 +msgid "_Preedit string:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:472 +msgid "_Conversion string:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:482 +msgid "_Selected segment:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:506 +msgid "Toggle on/off" +msgstr "" + +#: src/scim_anthy_prefs.cpp:507 +msgid "Select toggle on/off keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:508 +msgid "The key events to toggle on/off Japanese mode. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:516 +msgid "Circle input mode" +msgstr "" + +#: src/scim_anthy_prefs.cpp:517 +msgid "Select circle input mode keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:518 +msgid "The key events to circle input mode. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:526 +msgid "Circle kana mode" +msgstr "" + +#: src/scim_anthy_prefs.cpp:527 +msgid "Select circle kana mode keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:528 +msgid "The key events to circle kana mode. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:536 +msgid "Latin mode" +msgstr "" + +#: src/scim_anthy_prefs.cpp:537 +msgid "Select Latin mode keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:538 +msgid "The key events to switch input mode to Latin. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:546 +msgid "Wide Latin mode" +msgstr "" + +#: src/scim_anthy_prefs.cpp:547 +msgid "Select wide Latin mode keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:548 +msgid "The key events to switch input mode to wide Latin. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:556 +msgid "Hiragana mode" +msgstr "" + +#: src/scim_anthy_prefs.cpp:557 +msgid "Select hiragana mode keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:558 +msgid "The key events to switch input mode to hiragana. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:566 +msgid "Katakana mode" +msgstr "" + +#: src/scim_anthy_prefs.cpp:567 +msgid "Select katakana mode keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:568 +msgid "The key events to switch input mode to katakana. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:576 +msgid "Half katakana mode" +msgstr "" + +#: src/scim_anthy_prefs.cpp:577 +msgid "Select half katakana mode keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:578 +msgid "The key events to switch input mode to half katakana. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:586 +msgid "Pseudo ASCII mode cancel" +msgstr "" + +#: src/scim_anthy_prefs.cpp:587 +msgid "Select pseudo ASCII mode cancel key" +msgstr "" + +#: src/scim_anthy_prefs.cpp:588 +msgid "The key events to cancel the pseudo ASCII mode." +msgstr "" + +#: src/scim_anthy_prefs.cpp:596 +msgid "Circle typing method" +msgstr "" + +#: src/scim_anthy_prefs.cpp:597 +msgid "Select circle typing method keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:598 +msgid "The key events to circle typing method. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:620 +msgid "Insert space" +msgstr "" + +#: src/scim_anthy_prefs.cpp:621 +msgid "Select inserting space keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:622 +msgid "The key events to insert a space. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:630 +msgid "Insert alternative space" +msgstr "" + +#: src/scim_anthy_prefs.cpp:631 +msgid "Select inserting alternative space keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:632 +msgid "The key events to insert a alternative space. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:640 +msgid "Insert half space" +msgstr "" + +#: src/scim_anthy_prefs.cpp:641 +msgid "Select inserting half width space keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:642 +msgid "The key events to insert a half width space. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:650 +msgid "Insert wide space" +msgstr "" + +#: src/scim_anthy_prefs.cpp:651 +msgid "Select inserting wide space keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:652 +msgid "The key events to insert a wide space. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:660 +msgid "Backspace" +msgstr "" + +#: src/scim_anthy_prefs.cpp:661 +msgid "Select backspace keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:662 +msgid "The key events to delete a character before caret. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:670 +msgid "Delete" +msgstr "" + +#: src/scim_anthy_prefs.cpp:671 +msgid "Select delete keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:672 +msgid "The key events to delete a character after caret. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:682 +msgid "The key events to commit the preedit string. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:690 +msgid "Convert" +msgstr "" + +#: src/scim_anthy_prefs.cpp:691 +msgid "Select convert keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:692 +msgid "The key events to convert the preedit string to kanji. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:700 +msgid "Predict" +msgstr "" + +#: src/scim_anthy_prefs.cpp:701 +msgid "Select predict keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:702 +msgid "" +"The key events to predict a word or sentence from already inserted text. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:710 +msgid "Cancel" +msgstr "" + +#: src/scim_anthy_prefs.cpp:711 +msgid "Select cancel keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:712 +msgid "The key events to cancel preediting or converting. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:720 +msgid "Cancel all" +msgstr "" + +#: src/scim_anthy_prefs.cpp:721 +msgid "Select cancel all keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:722 +msgid "The key events to return to initial state. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:730 +msgid "Reconvert" +msgstr "" + +#: src/scim_anthy_prefs.cpp:731 +msgid "Select reconvert keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:732 +msgid "The key events to reconvert the commited string in selection. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:741 +msgid "Select do nothing keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:742 +msgid "" +"The key events to eat and do nothing anymore. For example, it can be used to " +"disable space key completely." +msgstr "" + +#: src/scim_anthy_prefs.cpp:765 +msgid "Move to first" +msgstr "" + +#: src/scim_anthy_prefs.cpp:766 +msgid "Select move caret to first keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:767 +msgid "The key events to move the caret to the first of preedit string. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:775 +msgid "Move to last" +msgstr "" + +#: src/scim_anthy_prefs.cpp:776 +msgid "Select move caret to last keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:777 +msgid "The key events to move the caret to the last of the preedit string. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:785 +msgid "Move forward" +msgstr "" + +#: src/scim_anthy_prefs.cpp:786 +msgid "Select move caret forward keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:787 +msgid "The key events to move the caret forward. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:795 +msgid "Move backward" +msgstr "" + +#: src/scim_anthy_prefs.cpp:796 +msgid "Select move caret backward keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:797 +msgid "The key events to move the caret backward. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:819 +msgid "Select the first segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:820 +msgid "Select keys to select the first segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:821 +msgid "The key events to select the first segment. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:829 +msgid "Select the last segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:830 +msgid "Select keys to select the last segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:831 +msgid "The key events to select the the last segment. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:839 +msgid "Select the next segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:840 +msgid "Select keys to select the next segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:841 +msgid "The key events to select the next segment. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:849 +msgid "Select the previous segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:850 +msgid "Select keys to select the previous segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:851 +msgid "The key events to select the previous segment. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:859 +msgid "Shrink the segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:860 +msgid "Select keys to shrink the segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:861 +msgid "The key events to shrink the selected segment. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:869 +msgid "Expand the segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:870 +msgid "Select keys to expand the segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:871 +msgid "The key events to expand the selected segment. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:879 +msgid "Commit the first segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:881 +msgid "The key events to commit the first segment. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:889 +msgid "Commit the selected segment" +msgstr "" + +#: src/scim_anthy_prefs.cpp:891 +msgid "The key events to commit the selected segment. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:913 +msgid "First candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:914 +msgid "Select the first candidate keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:915 +msgid "The key events to select the first candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:923 +msgid "Last candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:924 +msgid "Select the last candidate keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:925 +msgid "The key events to the select last candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:933 +msgid "Next candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:934 +msgid "Select the next candidate keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:935 +msgid "The key events to select the next candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:943 +msgid "Previous candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:944 +msgid "Select the previous candidate keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:945 +msgid "The key events to select the previous candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:953 +msgid "Page up" +msgstr "" + +#: src/scim_anthy_prefs.cpp:954 +msgid "Select page up candidates keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:955 +msgid "The key events to switch candidates page up. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:963 +msgid "Page down" +msgstr "" + +#: src/scim_anthy_prefs.cpp:964 +msgid "Select page down candidates keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:965 +msgid "The key events to switch candidates page down. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:987 +msgid "1st candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:988 +msgid "Select keys to select 1st candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:989 +msgid "The key events to select the 1st candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:997 +msgid "2nd candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:998 +msgid "Select keys to select 2nd candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:999 +msgid "The key events to select the 2nd candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1007 +msgid "3rd candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1008 +msgid "Select keys to select 3rd candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1009 +msgid "The key events to select the 3rd candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1017 +msgid "4th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1018 +msgid "Select keys to select 4th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1019 +msgid "The key events to select the 4th candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1027 +msgid "5th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1028 +msgid "Select keys to select 5th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1029 +msgid "The key events to select the 5th candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1037 +msgid "6th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1038 +msgid "Select keys to select 6th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1039 +msgid "The key events to select the 6th candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1047 +msgid "7th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1048 +msgid "Select keys to select 7th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1049 +msgid "The key events to select the 7th candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1057 +msgid "8th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1058 +msgid "Select keys to select 8th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1059 +msgid "The key events to select the 8th candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1067 +msgid "9th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1068 +msgid "Select keys to select 9th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1069 +msgid "The key events to select the 9th candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1077 +msgid "10th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1078 +msgid "Select keys to select 10th candidate" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1079 +msgid "The key events to select the 10th candidate. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1101 +msgid "Convert character type forward" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1102 +msgid "Select keys to convert character type forward" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1103 +msgid "Rotate character type forward." +msgstr "" + +#: src/scim_anthy_prefs.cpp:1111 +msgid "Convert character type backward" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1112 +msgid "Select keys to convert character type backward" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1113 +msgid "Rotate character type backward." +msgstr "" + +#: src/scim_anthy_prefs.cpp:1121 +msgid "Convert to hiragana" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1122 +msgid "Select keys to convert to hiragana" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1123 +msgid "The key events to convert the preedit string to hiragana. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1131 +msgid "Convert to katakana" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1132 +msgid "Select keys to convert to katakana" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1133 +msgid "The key events to convert the preedit string to katakana. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1141 +msgid "Convert to half width" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1142 +msgid "Select keys to convert to half width" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1143 +msgid "The key events to convert the preedit string to half width. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1151 +msgid "Convert to half katakana" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1152 +msgid "Select keys to convert to half width katakana" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1153 +msgid "The key events to convert the preedit string to half width katakana. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1161 +msgid "Convert to wide latin" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1162 +msgid "Select keys to convert to wide latin" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1163 +msgid "The key events to convert the preedit string to wide latin. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1171 +msgid "Convert to latin" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1172 +msgid "Select keys to convert to latin" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1173 +msgid "The key events to convert the preedit string to latin. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1195 +msgid "Edit dictionary" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1196 +msgid "Select edit dictionary keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1197 +msgid "The key events to launch dictionary administration tool. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1206 +msgid "Select add a word keys" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1207 +msgid "The key events to launch the tool to add a word. " +msgstr "" + +#: src/scim_anthy_prefs.cpp:1232 src/scim_anthy_prefs.cpp:1245 +#: src/scim_anthy_prefs.cpp:1258 +msgid "Color:" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1233 src/scim_anthy_prefs.cpp:1234 +msgid "The color of preediting text" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1246 src/scim_anthy_prefs.cpp:1247 +msgid "The color of conversion text" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1259 +msgid "The color of selected segment text" +msgstr "" + +#: src/scim_anthy_prefs.cpp:1260 +msgid "The color of selected segment text in the conversion text" +msgstr "" + +#: src/scim_anthy_color_button.cpp:320 +msgid "Foreground color" +msgstr "" + +#: src/scim_anthy_color_button.cpp:320 +msgid "Background color" +msgstr "" diff --git a/po/stamp-po b/po/stamp-po new file mode 100755 index 0000000..9788f70 --- /dev/null +++ b/po/stamp-po @@ -0,0 +1 @@ +timestamp diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100755 index 0000000..71db7c1 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,144 @@ +## Copyright (C) 2004 Hiroyuki Ikezoe +## Copyright (C) 2004-2005 Takuro Ashie +## +## 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. + +AM_CPPFLAGS = \ + -DSCIM_ANTHY_LOCALEDIR=\"$(datadir)/locale\" \ + -DSCIM_ICONDIR=\"@SCIM_ICONDIR@\" \ + -DSCIM_ANTHY_DATADIR=\"@SCIM_ANTHY_DATADIR@\" \ + -DSCIM_ANTHY_STYLEDIR=\"@SCIM_ANTHY_DATADIR@/style\" +INCLUDE = \ + -I$(top_builddir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src + +noinst_HEADERS = \ + scim_anthy_intl.h \ + scim_anthy_prefs.h \ + scim_anthy_factory.h \ + scim_anthy_imengine.h \ + scim_anthy_action.h \ + scim_anthy_preedit.h \ + scim_anthy_reading.h \ + scim_anthy_conversion.h \ + scim_anthy_key2kana_table.h \ + scim_anthy_key2kana_base.h \ + scim_anthy_key2kana.h \ + scim_anthy_kana.h \ + scim_anthy_nicola.h \ + scim_anthy_default_tables.h \ + scim_anthy_style_file.h \ + scim_anthy_setup.h \ + scim_anthy_setup_romaji.h \ + scim_anthy_setup_kana.h \ + scim_anthy_table_editor.h \ + scim_anthy_utils.h \ + scim_anthy_color_button.h \ + scim_anthy_helper.h + + +# +# IMEngine Module +# +moduledir = @SCIM_MODULEDIR@/IMEngine +module_LTLIBRARIES = ise-engine-anthy.la + +ise_engine_anthy_la_SOURCES = \ + scim_anthy_factory.cpp \ + scim_anthy_imengine.cpp \ + scim_anthy_action.cpp \ + scim_anthy_preedit.cpp \ + scim_anthy_reading.cpp \ + scim_anthy_conversion.cpp \ + scim_anthy_key2kana.cpp \ + scim_anthy_key2kana_table.cpp \ + scim_anthy_kana.cpp \ + scim_anthy_nicola.cpp \ + scim_anthy_default_tables.cpp \ + scim_anthy_style_file.cpp \ + scim_anthy_utils.cpp + +ise_engine_anthy_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ @ANTHY_CFLAGS@ +ise_engine_anthy_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ @ANTHY_CFLAGS@ + +ise_engine_anthy_la_LDFLAGS = \ + -avoid-version \ + -rpath $(moduledir) \ + -module \ + @LIBTOOL_EXPORT_OPTIONS@ \ + @SCIM_LIBS@ \ + @ANTHY_LIBS@ + + +# +# Setup Module +# +if SCIM_BUILD_SETUP +SETUP_MODULE = anthy-imengine-setup.la +endif + +setupmoduledir = @SCIM_MODULEDIR@/SetupUI +setupmodule_LTLIBRARIES = $(SETUP_MODULE) + +anthy_imengine_setup_la_SOURCES = \ + scim_anthy_setup.cpp \ + scim_anthy_setup_romaji.cpp \ + scim_anthy_setup_kana.cpp \ + scim_anthy_style_file.cpp \ + scim_anthy_default_tables.cpp \ + scim_anthy_prefs.cpp \ + scim_anthy_utils.cpp \ + scim_anthy_table_editor.cpp \ + scim_anthy_color_button.cpp + +anthy_imengine_setup_la_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ \ + @SCIM_CFLAGS@ \ + @SCIM_DEBUG_FLAGS@ +anthy_imengine_setup_la_CXXFLAGS= @SCIM_GTKUTILS_CFLAGS@ \ + @SCIM_CFLAGS@ \ + @SCIM_DEBUG_FLAGS@ +anthy_imengine_setup_la_LDFLAGS = -avoid-version \ + -rpath $(setupmoduledir) \ + -module \ + @LIBTOOL_EXPORT_OPTIONS@ \ + @SCIM_GTKUTILS_LIBS@ \ + @INTLLIBS@ \ + @SCIM_LIBS@ + + +# +# Helper Program +# +if SCIM_BUILD_HELPER +HELPER_MODULE = anthy-imengine-helper.la +endif +helpermoduledir = @SCIM_MODULEDIR@/Helper +helpermodule_LTLIBRARIES = $(HELPER_MODULE) + +anthy_imengine_helper_la_SOURCES = scim_anthy_helper.cpp +anthy_imengine_helper_la_CFLAGS = @GTK2_CFLAGS@ \ + @SCIM_CFLAGS@ \ + @SCIM_DEBUG_FLAGS@ +anthy_imengine_helper_la_CXXFLAGS = @GTK2_CFLAGS@ \ + @SCIM_CFLAGS@ \ + @SCIM_DEBUG_FLAGS@ +anthy_imengine_helper_la_LDFLAGS = -avoid-version \ + -rpath $(setupmoduledir) \ + -module \ + @LIBTOOL_EXPORT_OPTIONS@ \ + @GTK2_LIBS@ \ + @INTLLIBS@ \ + @SCIM_LIBS@ diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100755 index 0000000..f7e2e73 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,949 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longdouble.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(helpermoduledir)" \ + "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(setupmoduledir)" +helpermoduleLTLIBRARIES_INSTALL = $(INSTALL) +moduleLTLIBRARIES_INSTALL = $(INSTALL) +setupmoduleLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(helpermodule_LTLIBRARIES) $(module_LTLIBRARIES) \ + $(setupmodule_LTLIBRARIES) +anthy_imengine_helper_la_LIBADD = +am_anthy_imengine_helper_la_OBJECTS = \ + anthy_imengine_helper_la-scim_anthy_helper.lo +anthy_imengine_helper_la_OBJECTS = \ + $(am_anthy_imengine_helper_la_OBJECTS) +anthy_imengine_helper_la_LINK = $(LIBTOOL) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(anthy_imengine_helper_la_CXXFLAGS) $(CXXFLAGS) \ + $(anthy_imengine_helper_la_LDFLAGS) $(LDFLAGS) -o $@ +@SCIM_BUILD_HELPER_TRUE@am_anthy_imengine_helper_la_rpath = -rpath \ +@SCIM_BUILD_HELPER_TRUE@ $(helpermoduledir) +anthy_imengine_setup_la_LIBADD = +am_anthy_imengine_setup_la_OBJECTS = \ + anthy_imengine_setup_la-scim_anthy_setup.lo \ + anthy_imengine_setup_la-scim_anthy_setup_romaji.lo \ + anthy_imengine_setup_la-scim_anthy_setup_kana.lo \ + anthy_imengine_setup_la-scim_anthy_style_file.lo \ + anthy_imengine_setup_la-scim_anthy_default_tables.lo \ + anthy_imengine_setup_la-scim_anthy_prefs.lo \ + anthy_imengine_setup_la-scim_anthy_utils.lo \ + anthy_imengine_setup_la-scim_anthy_table_editor.lo \ + anthy_imengine_setup_la-scim_anthy_color_button.lo +anthy_imengine_setup_la_OBJECTS = \ + $(am_anthy_imengine_setup_la_OBJECTS) +anthy_imengine_setup_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) \ + $(anthy_imengine_setup_la_LDFLAGS) $(LDFLAGS) -o $@ +@SCIM_BUILD_SETUP_TRUE@am_anthy_imengine_setup_la_rpath = -rpath \ +@SCIM_BUILD_SETUP_TRUE@ $(setupmoduledir) +anthy_la_LIBADD = +am_anthy_la_OBJECTS = anthy_la-scim_anthy_factory.lo \ + anthy_la-scim_anthy_imengine.lo anthy_la-scim_anthy_action.lo \ + anthy_la-scim_anthy_preedit.lo anthy_la-scim_anthy_reading.lo \ + anthy_la-scim_anthy_conversion.lo \ + anthy_la-scim_anthy_key2kana.lo \ + anthy_la-scim_anthy_key2kana_table.lo \ + anthy_la-scim_anthy_kana.lo anthy_la-scim_anthy_nicola.lo \ + anthy_la-scim_anthy_default_tables.lo \ + anthy_la-scim_anthy_style_file.lo anthy_la-scim_anthy_utils.lo +anthy_la_OBJECTS = $(am_anthy_la_OBJECTS) +anthy_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(anthy_la_CXXFLAGS) \ + $(CXXFLAGS) $(anthy_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(anthy_imengine_helper_la_SOURCES) \ + $(anthy_imengine_setup_la_SOURCES) $(anthy_la_SOURCES) +DIST_SOURCES = $(anthy_imengine_helper_la_SOURCES) \ + $(anthy_imengine_setup_la_SOURCES) $(anthy_la_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +ANTHY_CFLAGS = @ANTHY_CFLAGS@ +ANTHY_LIBS = @ANTHY_LIBS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GENCAT = @GENCAT@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTK2_CFLAGS = @GTK2_CFLAGS@ +GTK2_LIBS = @GTK2_LIBS@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIBTOOL_EXPORT_OPTIONS = @LIBTOOL_EXPORT_OPTIONS@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SCIM_ANTHY_DATADIR = @SCIM_ANTHY_DATADIR@ +SCIM_ANTHY_MAJOR_VERSION = @SCIM_ANTHY_MAJOR_VERSION@ +SCIM_ANTHY_MICRO_VERSION = @SCIM_ANTHY_MICRO_VERSION@ +SCIM_ANTHY_MINOR_VERSION = @SCIM_ANTHY_MINOR_VERSION@ +SCIM_ANTHY_VERSION = @SCIM_ANTHY_VERSION@ +SCIM_BUILD_HELPER = @SCIM_BUILD_HELPER@ +SCIM_BUILD_SETUP = @SCIM_BUILD_SETUP@ +SCIM_CFLAGS = @SCIM_CFLAGS@ +SCIM_DATADIR = @SCIM_DATADIR@ +SCIM_DEBUG_FLAGS = @SCIM_DEBUG_FLAGS@ +SCIM_GTKUTILS_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ +SCIM_GTKUTILS_LIBS = @SCIM_GTKUTILS_LIBS@ +SCIM_ICONDIR = @SCIM_ICONDIR@ +SCIM_LIBS = @SCIM_LIBS@ +SCIM_MODULEDIR = @SCIM_MODULEDIR@ +SCIM_VERSION = @SCIM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + -DSCIM_ANTHY_LOCALEDIR=\"$(datadir)/locale\" \ + -DSCIM_ICONDIR=\"@SCIM_ICONDIR@\" \ + -DSCIM_ANTHY_DATADIR=\"@SCIM_ANTHY_DATADIR@\" \ + -DSCIM_ANTHY_STYLEDIR=\"@SCIM_ANTHY_DATADIR@/style\" + +INCLUDE = \ + -I$(top_builddir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src + +noinst_HEADERS = \ + scim_anthy_intl.h \ + scim_anthy_prefs.h \ + scim_anthy_factory.h \ + scim_anthy_imengine.h \ + scim_anthy_action.h \ + scim_anthy_preedit.h \ + scim_anthy_reading.h \ + scim_anthy_conversion.h \ + scim_anthy_key2kana_table.h \ + scim_anthy_key2kana_base.h \ + scim_anthy_key2kana.h \ + scim_anthy_kana.h \ + scim_anthy_nicola.h \ + scim_anthy_default_tables.h \ + scim_anthy_style_file.h \ + scim_anthy_setup.h \ + scim_anthy_setup_romaji.h \ + scim_anthy_setup_kana.h \ + scim_anthy_table_editor.h \ + scim_anthy_utils.h \ + scim_anthy_color_button.h \ + scim_anthy_helper.h + + +# +# IMEngine Module +# +moduledir = @SCIM_MODULEDIR@/IMEngine +module_LTLIBRARIES = anthy.la +anthy_la_SOURCES = \ + scim_anthy_factory.cpp \ + scim_anthy_imengine.cpp \ + scim_anthy_action.cpp \ + scim_anthy_preedit.cpp \ + scim_anthy_reading.cpp \ + scim_anthy_conversion.cpp \ + scim_anthy_key2kana.cpp \ + scim_anthy_key2kana_table.cpp \ + scim_anthy_kana.cpp \ + scim_anthy_nicola.cpp \ + scim_anthy_default_tables.cpp \ + scim_anthy_style_file.cpp \ + scim_anthy_utils.cpp + +anthy_la_CFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ @ANTHY_CFLAGS@ +anthy_la_CXXFLAGS = @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ @ANTHY_CFLAGS@ +anthy_la_LDFLAGS = \ + -avoid-version \ + -rpath $(moduledir) \ + -module \ + @LIBTOOL_EXPORT_OPTIONS@ \ + @SCIM_LIBS@ \ + @ANTHY_LIBS@ + + +# +# Setup Module +# +@SCIM_BUILD_SETUP_TRUE@SETUP_MODULE = anthy-imengine-setup.la +setupmoduledir = @SCIM_MODULEDIR@/SetupUI +setupmodule_LTLIBRARIES = $(SETUP_MODULE) +anthy_imengine_setup_la_SOURCES = \ + scim_anthy_setup.cpp \ + scim_anthy_setup_romaji.cpp \ + scim_anthy_setup_kana.cpp \ + scim_anthy_style_file.cpp \ + scim_anthy_default_tables.cpp \ + scim_anthy_prefs.cpp \ + scim_anthy_utils.cpp \ + scim_anthy_table_editor.cpp \ + scim_anthy_color_button.cpp + +anthy_imengine_setup_la_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ \ + @SCIM_CFLAGS@ \ + @SCIM_DEBUG_FLAGS@ + +anthy_imengine_setup_la_CXXFLAGS = @SCIM_GTKUTILS_CFLAGS@ \ + @SCIM_CFLAGS@ \ + @SCIM_DEBUG_FLAGS@ + +anthy_imengine_setup_la_LDFLAGS = -avoid-version \ + -rpath $(setupmoduledir) \ + -module \ + @LIBTOOL_EXPORT_OPTIONS@ \ + @SCIM_GTKUTILS_LIBS@ \ + @INTLLIBS@ \ + @SCIM_LIBS@ + + +# +# Helper Program +# +@SCIM_BUILD_HELPER_TRUE@HELPER_MODULE = anthy-imengine-helper.la +helpermoduledir = @SCIM_MODULEDIR@/Helper +helpermodule_LTLIBRARIES = $(HELPER_MODULE) +anthy_imengine_helper_la_SOURCES = scim_anthy_helper.cpp +anthy_imengine_helper_la_CFLAGS = @GTK2_CFLAGS@ \ + @SCIM_CFLAGS@ \ + @SCIM_DEBUG_FLAGS@ + +anthy_imengine_helper_la_CXXFLAGS = @GTK2_CFLAGS@ \ + @SCIM_CFLAGS@ \ + @SCIM_DEBUG_FLAGS@ + +anthy_imengine_helper_la_LDFLAGS = -avoid-version \ + -rpath $(setupmoduledir) \ + -module \ + @LIBTOOL_EXPORT_OPTIONS@ \ + @GTK2_LIBS@ \ + @INTLLIBS@ \ + @SCIM_LIBS@ + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-helpermoduleLTLIBRARIES: $(helpermodule_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(helpermoduledir)" || $(MKDIR_P) "$(DESTDIR)$(helpermoduledir)" + @list='$(helpermodule_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(helpermoduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(helpermoduledir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(helpermoduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(helpermoduledir)/$$f"; \ + else :; fi; \ + done + +uninstall-helpermoduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(helpermodule_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(helpermoduledir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(helpermoduledir)/$$p"; \ + done + +clean-helpermoduleLTLIBRARIES: + -test -z "$(helpermodule_LTLIBRARIES)" || rm -f $(helpermodule_LTLIBRARIES) + @list='$(helpermodule_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +install-moduleLTLIBRARIES: $(module_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(moduledir)" || $(MKDIR_P) "$(DESTDIR)$(moduledir)" + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moduledir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moduledir)/$$f"; \ + else :; fi; \ + done + +uninstall-moduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$p"; \ + done + +clean-moduleLTLIBRARIES: + -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +install-setupmoduleLTLIBRARIES: $(setupmodule_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(setupmoduledir)" || $(MKDIR_P) "$(DESTDIR)$(setupmoduledir)" + @list='$(setupmodule_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(setupmoduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(setupmoduledir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(setupmoduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(setupmoduledir)/$$f"; \ + else :; fi; \ + done + +uninstall-setupmoduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(setupmodule_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(setupmoduledir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(setupmoduledir)/$$p"; \ + done + +clean-setupmoduleLTLIBRARIES: + -test -z "$(setupmodule_LTLIBRARIES)" || rm -f $(setupmodule_LTLIBRARIES) + @list='$(setupmodule_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +anthy-imengine-helper.la: $(anthy_imengine_helper_la_OBJECTS) $(anthy_imengine_helper_la_DEPENDENCIES) + $(anthy_imengine_helper_la_LINK) $(am_anthy_imengine_helper_la_rpath) $(anthy_imengine_helper_la_OBJECTS) $(anthy_imengine_helper_la_LIBADD) $(LIBS) +anthy-imengine-setup.la: $(anthy_imengine_setup_la_OBJECTS) $(anthy_imengine_setup_la_DEPENDENCIES) + $(anthy_imengine_setup_la_LINK) $(am_anthy_imengine_setup_la_rpath) $(anthy_imengine_setup_la_OBJECTS) $(anthy_imengine_setup_la_LIBADD) $(LIBS) +anthy.la: $(anthy_la_OBJECTS) $(anthy_la_DEPENDENCIES) + $(anthy_la_LINK) -rpath $(moduledir) $(anthy_la_OBJECTS) $(anthy_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_helper_la-scim_anthy_helper.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_color_button.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_default_tables.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_prefs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup_kana.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup_romaji.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_style_file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_table_editor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_imengine_setup_la-scim_anthy_utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_action.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_conversion.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_default_tables.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_factory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_imengine.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_kana.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_key2kana.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_key2kana_table.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_nicola.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_preedit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_reading.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_style_file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anthy_la-scim_anthy_utils.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +anthy_imengine_helper_la-scim_anthy_helper.lo: scim_anthy_helper.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_helper_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_helper_la-scim_anthy_helper.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_helper_la-scim_anthy_helper.Tpo -c -o anthy_imengine_helper_la-scim_anthy_helper.lo `test -f 'scim_anthy_helper.cpp' || echo '$(srcdir)/'`scim_anthy_helper.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_helper_la-scim_anthy_helper.Tpo $(DEPDIR)/anthy_imengine_helper_la-scim_anthy_helper.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_helper.cpp' object='anthy_imengine_helper_la-scim_anthy_helper.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_helper_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_helper_la-scim_anthy_helper.lo `test -f 'scim_anthy_helper.cpp' || echo '$(srcdir)/'`scim_anthy_helper.cpp + +anthy_imengine_setup_la-scim_anthy_setup.lo: scim_anthy_setup.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_setup.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup.Tpo -c -o anthy_imengine_setup_la-scim_anthy_setup.lo `test -f 'scim_anthy_setup.cpp' || echo '$(srcdir)/'`scim_anthy_setup.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_setup.cpp' object='anthy_imengine_setup_la-scim_anthy_setup.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_setup.lo `test -f 'scim_anthy_setup.cpp' || echo '$(srcdir)/'`scim_anthy_setup.cpp + +anthy_imengine_setup_la-scim_anthy_setup_romaji.lo: scim_anthy_setup_romaji.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_setup_romaji.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup_romaji.Tpo -c -o anthy_imengine_setup_la-scim_anthy_setup_romaji.lo `test -f 'scim_anthy_setup_romaji.cpp' || echo '$(srcdir)/'`scim_anthy_setup_romaji.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup_romaji.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup_romaji.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_setup_romaji.cpp' object='anthy_imengine_setup_la-scim_anthy_setup_romaji.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_setup_romaji.lo `test -f 'scim_anthy_setup_romaji.cpp' || echo '$(srcdir)/'`scim_anthy_setup_romaji.cpp + +anthy_imengine_setup_la-scim_anthy_setup_kana.lo: scim_anthy_setup_kana.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_setup_kana.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup_kana.Tpo -c -o anthy_imengine_setup_la-scim_anthy_setup_kana.lo `test -f 'scim_anthy_setup_kana.cpp' || echo '$(srcdir)/'`scim_anthy_setup_kana.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup_kana.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_setup_kana.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_setup_kana.cpp' object='anthy_imengine_setup_la-scim_anthy_setup_kana.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_setup_kana.lo `test -f 'scim_anthy_setup_kana.cpp' || echo '$(srcdir)/'`scim_anthy_setup_kana.cpp + +anthy_imengine_setup_la-scim_anthy_style_file.lo: scim_anthy_style_file.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_style_file.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_style_file.Tpo -c -o anthy_imengine_setup_la-scim_anthy_style_file.lo `test -f 'scim_anthy_style_file.cpp' || echo '$(srcdir)/'`scim_anthy_style_file.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_style_file.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_style_file.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_style_file.cpp' object='anthy_imengine_setup_la-scim_anthy_style_file.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_style_file.lo `test -f 'scim_anthy_style_file.cpp' || echo '$(srcdir)/'`scim_anthy_style_file.cpp + +anthy_imengine_setup_la-scim_anthy_default_tables.lo: scim_anthy_default_tables.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_default_tables.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_default_tables.Tpo -c -o anthy_imengine_setup_la-scim_anthy_default_tables.lo `test -f 'scim_anthy_default_tables.cpp' || echo '$(srcdir)/'`scim_anthy_default_tables.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_default_tables.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_default_tables.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_default_tables.cpp' object='anthy_imengine_setup_la-scim_anthy_default_tables.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_default_tables.lo `test -f 'scim_anthy_default_tables.cpp' || echo '$(srcdir)/'`scim_anthy_default_tables.cpp + +anthy_imengine_setup_la-scim_anthy_prefs.lo: scim_anthy_prefs.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_prefs.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_prefs.Tpo -c -o anthy_imengine_setup_la-scim_anthy_prefs.lo `test -f 'scim_anthy_prefs.cpp' || echo '$(srcdir)/'`scim_anthy_prefs.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_prefs.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_prefs.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_prefs.cpp' object='anthy_imengine_setup_la-scim_anthy_prefs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_prefs.lo `test -f 'scim_anthy_prefs.cpp' || echo '$(srcdir)/'`scim_anthy_prefs.cpp + +anthy_imengine_setup_la-scim_anthy_utils.lo: scim_anthy_utils.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_utils.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_utils.Tpo -c -o anthy_imengine_setup_la-scim_anthy_utils.lo `test -f 'scim_anthy_utils.cpp' || echo '$(srcdir)/'`scim_anthy_utils.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_utils.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_utils.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_utils.cpp' object='anthy_imengine_setup_la-scim_anthy_utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_utils.lo `test -f 'scim_anthy_utils.cpp' || echo '$(srcdir)/'`scim_anthy_utils.cpp + +anthy_imengine_setup_la-scim_anthy_table_editor.lo: scim_anthy_table_editor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_table_editor.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_table_editor.Tpo -c -o anthy_imengine_setup_la-scim_anthy_table_editor.lo `test -f 'scim_anthy_table_editor.cpp' || echo '$(srcdir)/'`scim_anthy_table_editor.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_table_editor.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_table_editor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_table_editor.cpp' object='anthy_imengine_setup_la-scim_anthy_table_editor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_table_editor.lo `test -f 'scim_anthy_table_editor.cpp' || echo '$(srcdir)/'`scim_anthy_table_editor.cpp + +anthy_imengine_setup_la-scim_anthy_color_button.lo: scim_anthy_color_button.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_imengine_setup_la-scim_anthy_color_button.lo -MD -MP -MF $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_color_button.Tpo -c -o anthy_imengine_setup_la-scim_anthy_color_button.lo `test -f 'scim_anthy_color_button.cpp' || echo '$(srcdir)/'`scim_anthy_color_button.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_color_button.Tpo $(DEPDIR)/anthy_imengine_setup_la-scim_anthy_color_button.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_color_button.cpp' object='anthy_imengine_setup_la-scim_anthy_color_button.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_imengine_setup_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_imengine_setup_la-scim_anthy_color_button.lo `test -f 'scim_anthy_color_button.cpp' || echo '$(srcdir)/'`scim_anthy_color_button.cpp + +anthy_la-scim_anthy_factory.lo: scim_anthy_factory.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_factory.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_factory.Tpo -c -o anthy_la-scim_anthy_factory.lo `test -f 'scim_anthy_factory.cpp' || echo '$(srcdir)/'`scim_anthy_factory.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_factory.Tpo $(DEPDIR)/anthy_la-scim_anthy_factory.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_factory.cpp' object='anthy_la-scim_anthy_factory.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_factory.lo `test -f 'scim_anthy_factory.cpp' || echo '$(srcdir)/'`scim_anthy_factory.cpp + +anthy_la-scim_anthy_imengine.lo: scim_anthy_imengine.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_imengine.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_imengine.Tpo -c -o anthy_la-scim_anthy_imengine.lo `test -f 'scim_anthy_imengine.cpp' || echo '$(srcdir)/'`scim_anthy_imengine.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_imengine.Tpo $(DEPDIR)/anthy_la-scim_anthy_imengine.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_imengine.cpp' object='anthy_la-scim_anthy_imengine.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_imengine.lo `test -f 'scim_anthy_imengine.cpp' || echo '$(srcdir)/'`scim_anthy_imengine.cpp + +anthy_la-scim_anthy_action.lo: scim_anthy_action.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_action.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_action.Tpo -c -o anthy_la-scim_anthy_action.lo `test -f 'scim_anthy_action.cpp' || echo '$(srcdir)/'`scim_anthy_action.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_action.Tpo $(DEPDIR)/anthy_la-scim_anthy_action.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_action.cpp' object='anthy_la-scim_anthy_action.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_action.lo `test -f 'scim_anthy_action.cpp' || echo '$(srcdir)/'`scim_anthy_action.cpp + +anthy_la-scim_anthy_preedit.lo: scim_anthy_preedit.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_preedit.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_preedit.Tpo -c -o anthy_la-scim_anthy_preedit.lo `test -f 'scim_anthy_preedit.cpp' || echo '$(srcdir)/'`scim_anthy_preedit.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_preedit.Tpo $(DEPDIR)/anthy_la-scim_anthy_preedit.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_preedit.cpp' object='anthy_la-scim_anthy_preedit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_preedit.lo `test -f 'scim_anthy_preedit.cpp' || echo '$(srcdir)/'`scim_anthy_preedit.cpp + +anthy_la-scim_anthy_reading.lo: scim_anthy_reading.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_reading.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_reading.Tpo -c -o anthy_la-scim_anthy_reading.lo `test -f 'scim_anthy_reading.cpp' || echo '$(srcdir)/'`scim_anthy_reading.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_reading.Tpo $(DEPDIR)/anthy_la-scim_anthy_reading.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_reading.cpp' object='anthy_la-scim_anthy_reading.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_reading.lo `test -f 'scim_anthy_reading.cpp' || echo '$(srcdir)/'`scim_anthy_reading.cpp + +anthy_la-scim_anthy_conversion.lo: scim_anthy_conversion.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_conversion.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_conversion.Tpo -c -o anthy_la-scim_anthy_conversion.lo `test -f 'scim_anthy_conversion.cpp' || echo '$(srcdir)/'`scim_anthy_conversion.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_conversion.Tpo $(DEPDIR)/anthy_la-scim_anthy_conversion.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_conversion.cpp' object='anthy_la-scim_anthy_conversion.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_conversion.lo `test -f 'scim_anthy_conversion.cpp' || echo '$(srcdir)/'`scim_anthy_conversion.cpp + +anthy_la-scim_anthy_key2kana.lo: scim_anthy_key2kana.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_key2kana.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_key2kana.Tpo -c -o anthy_la-scim_anthy_key2kana.lo `test -f 'scim_anthy_key2kana.cpp' || echo '$(srcdir)/'`scim_anthy_key2kana.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_key2kana.Tpo $(DEPDIR)/anthy_la-scim_anthy_key2kana.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_key2kana.cpp' object='anthy_la-scim_anthy_key2kana.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_key2kana.lo `test -f 'scim_anthy_key2kana.cpp' || echo '$(srcdir)/'`scim_anthy_key2kana.cpp + +anthy_la-scim_anthy_key2kana_table.lo: scim_anthy_key2kana_table.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_key2kana_table.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_key2kana_table.Tpo -c -o anthy_la-scim_anthy_key2kana_table.lo `test -f 'scim_anthy_key2kana_table.cpp' || echo '$(srcdir)/'`scim_anthy_key2kana_table.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_key2kana_table.Tpo $(DEPDIR)/anthy_la-scim_anthy_key2kana_table.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_key2kana_table.cpp' object='anthy_la-scim_anthy_key2kana_table.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_key2kana_table.lo `test -f 'scim_anthy_key2kana_table.cpp' || echo '$(srcdir)/'`scim_anthy_key2kana_table.cpp + +anthy_la-scim_anthy_kana.lo: scim_anthy_kana.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_kana.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_kana.Tpo -c -o anthy_la-scim_anthy_kana.lo `test -f 'scim_anthy_kana.cpp' || echo '$(srcdir)/'`scim_anthy_kana.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_kana.Tpo $(DEPDIR)/anthy_la-scim_anthy_kana.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_kana.cpp' object='anthy_la-scim_anthy_kana.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_kana.lo `test -f 'scim_anthy_kana.cpp' || echo '$(srcdir)/'`scim_anthy_kana.cpp + +anthy_la-scim_anthy_nicola.lo: scim_anthy_nicola.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_nicola.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_nicola.Tpo -c -o anthy_la-scim_anthy_nicola.lo `test -f 'scim_anthy_nicola.cpp' || echo '$(srcdir)/'`scim_anthy_nicola.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_nicola.Tpo $(DEPDIR)/anthy_la-scim_anthy_nicola.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_nicola.cpp' object='anthy_la-scim_anthy_nicola.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_nicola.lo `test -f 'scim_anthy_nicola.cpp' || echo '$(srcdir)/'`scim_anthy_nicola.cpp + +anthy_la-scim_anthy_default_tables.lo: scim_anthy_default_tables.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_default_tables.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_default_tables.Tpo -c -o anthy_la-scim_anthy_default_tables.lo `test -f 'scim_anthy_default_tables.cpp' || echo '$(srcdir)/'`scim_anthy_default_tables.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_default_tables.Tpo $(DEPDIR)/anthy_la-scim_anthy_default_tables.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_default_tables.cpp' object='anthy_la-scim_anthy_default_tables.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_default_tables.lo `test -f 'scim_anthy_default_tables.cpp' || echo '$(srcdir)/'`scim_anthy_default_tables.cpp + +anthy_la-scim_anthy_style_file.lo: scim_anthy_style_file.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_style_file.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_style_file.Tpo -c -o anthy_la-scim_anthy_style_file.lo `test -f 'scim_anthy_style_file.cpp' || echo '$(srcdir)/'`scim_anthy_style_file.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_style_file.Tpo $(DEPDIR)/anthy_la-scim_anthy_style_file.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_style_file.cpp' object='anthy_la-scim_anthy_style_file.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_style_file.lo `test -f 'scim_anthy_style_file.cpp' || echo '$(srcdir)/'`scim_anthy_style_file.cpp + +anthy_la-scim_anthy_utils.lo: scim_anthy_utils.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -MT anthy_la-scim_anthy_utils.lo -MD -MP -MF $(DEPDIR)/anthy_la-scim_anthy_utils.Tpo -c -o anthy_la-scim_anthy_utils.lo `test -f 'scim_anthy_utils.cpp' || echo '$(srcdir)/'`scim_anthy_utils.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/anthy_la-scim_anthy_utils.Tpo $(DEPDIR)/anthy_la-scim_anthy_utils.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scim_anthy_utils.cpp' object='anthy_la-scim_anthy_utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(anthy_la_CXXFLAGS) $(CXXFLAGS) -c -o anthy_la-scim_anthy_utils.lo `test -f 'scim_anthy_utils.cpp' || echo '$(srcdir)/'`scim_anthy_utils.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(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; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +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 tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || 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 $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(helpermoduledir)" "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(setupmoduledir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-helpermoduleLTLIBRARIES clean-libtool \ + clean-moduleLTLIBRARIES clean-setupmoduleLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-helpermoduleLTLIBRARIES \ + install-moduleLTLIBRARIES install-setupmoduleLTLIBRARIES + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-helpermoduleLTLIBRARIES \ + uninstall-moduleLTLIBRARIES uninstall-setupmoduleLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-helpermoduleLTLIBRARIES clean-libtool \ + clean-moduleLTLIBRARIES clean-setupmoduleLTLIBRARIES ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-helpermoduleLTLIBRARIES install-html \ + install-html-am install-info install-info-am install-man \ + install-moduleLTLIBRARIES install-pdf install-pdf-am \ + install-ps install-ps-am install-setupmoduleLTLIBRARIES \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-helpermoduleLTLIBRARIES uninstall-moduleLTLIBRARIES \ + uninstall-setupmoduleLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/scim_anthy_action.cpp b/src/scim_anthy_action.cpp new file mode 100755 index 0000000..bb446ee --- /dev/null +++ b/src/scim_anthy_action.cpp @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "scim_anthy_action.h" +#include "scim_anthy_utils.h" + +using namespace scim_anthy; + +Action::Action (const String &name, const String &key_bindings, PMF pmf) + : m_name (name), + m_pmf (pmf), + m_func (NULL) +{ + scim_string_to_key_list (m_key_bindings, key_bindings); +} + +Action::Action (const String &name, const String &key_bindings, Func func) + : m_name (name), + m_pmf (NULL), + m_func (func) +{ + scim_string_to_key_list (m_key_bindings, key_bindings); +} + +Action::~Action (void) +{ +} + +bool +Action::perform (AnthyInstance *performer) +{ + if (m_pmf) + return (performer->*m_pmf) (); + else if (m_func) + return m_func (performer); + + return false; +} + +bool +Action::perform (AnthyInstance *performer, const KeyEvent &key) +{ + if (!m_pmf && !m_func) + return false; + + if (match_key_event (key)) { + if (m_pmf) + return (performer->*m_pmf) (); + else if (m_func) + return m_func (performer); + } + + return false; +} + +bool +Action::match_key_event (const KeyEvent &key) +{ + return util_match_key_event (m_key_bindings, key, SCIM_KEY_CapsLockMask); +} + +bool +Action::match_action_name (const char *name) +{ + return (m_name.compare (name) == 0); +} diff --git a/src/scim_anthy_action.h b/src/scim_anthy_action.h new file mode 100755 index 0000000..5c78641 --- /dev/null +++ b/src/scim_anthy_action.h @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_ACTION_H__ +#define __SCIM_ANTHY_ACTION_H__ + +#include +#include + +using namespace scim; + +class AnthyInstance; + +namespace scim_anthy { + +class Action +{ + typedef bool (AnthyInstance::*PMF) (void); + typedef bool (*Func) (AnthyInstance *anthy); + +public: + Action (const String &name, const String &key_bindings, PMF pmf); + Action (const String &name, const String &key_bindings, Func func); + ~Action (); + +public: + bool perform (AnthyInstance *performer); + bool perform (AnthyInstance *performer, + const KeyEvent &key); + + bool match_action_name (const char *name); + +private: + bool match_key_event (const KeyEvent &key); + +private: + String m_name; + String m_desc; + PMF m_pmf; + Func m_func; + KeyEventList m_key_bindings; +}; + +} + +#endif /* __SCIM_ANTHY_ACTION_H__ */ diff --git a/src/scim_anthy_color_button.cpp b/src/scim_anthy_color_button.cpp new file mode 100755 index 0000000..841c9aa --- /dev/null +++ b/src/scim_anthy_color_button.cpp @@ -0,0 +1,485 @@ +/* + * Copyright (C) 2005 Hiroyuki Ikezoe + * + * 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. + */ +/* + * The original code is gimpfgbgeditor.c in GIMP-2.3.2. + * Copyright (C) 2004 Michael Natterer + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include + +#include "scim_anthy_color_button.h" +#include "scim_anthy_intl.h" + + +enum +{ + PROP_0, + PROP_ACTIVE_COLOR +}; + +enum +{ + COLOR_CHANGED, + LAST_SIGNAL +}; + +typedef enum +{ + INVALID_AREA, + FOREGROUND_AREA, + BACKGROUND_AREA, + SWAP_AREA, + DEFAULT_AREA +} FgBgTarget; + + +#define WIDGET_WIDTH 32 +#define WIDGET_HEIGHT 32 + +static void scim_anthy_color_button_class_init (ScimAnthyColorButtonClass *klass); +static void scim_anthy_color_button_init (ScimAnthyColorButton *object); + +static void scim_anthy_color_button_destroy (GtkObject *object); +static gboolean scim_anthy_color_button_expose (GtkWidget *widget, + GdkEventExpose *eevent); +static gboolean scim_anthy_color_button_button_press (GtkWidget *widget, + GdkEventButton *bevent); +static gboolean scim_anthy_color_button_button_release (GtkWidget *widget, + GdkEventButton *bevent); + + +static guint button_signals[LAST_SIGNAL] = { 0 }; + +static GtkDrawingAreaClass *parent_class = NULL; + +GType +scim_anthy_color_button_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { + sizeof (ScimAnthyColorButtonClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) scim_anthy_color_button_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (ScimAnthyColorButton), + 0, /* n_preallocs */ + (GInstanceInitFunc) scim_anthy_color_button_init, + }; + + type = g_type_register_static (GTK_TYPE_DRAWING_AREA, + "ScimAnthyColorButton", + &info, (GTypeFlags) 0); + } + + return type; +} + +static void +scim_anthy_color_button_class_init (ScimAnthyColorButtonClass *klass) +{ + GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + parent_class = (GtkDrawingAreaClass *) g_type_class_peek_parent (klass); + + button_signals[COLOR_CHANGED] = + g_signal_new ("color-changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ScimAnthyColorButtonClass, color_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + gtk_object_class->destroy = scim_anthy_color_button_destroy; + + widget_class->expose_event = scim_anthy_color_button_expose; + widget_class->button_press_event = scim_anthy_color_button_button_press; + widget_class->button_release_event = scim_anthy_color_button_button_release; +} + +static void +scim_anthy_color_button_init (ScimAnthyColorButton *object) +{ + /*set default color */ + gdk_color_parse ("#000000", &object->fg_color); + gdk_color_parse ("#ffffff", &object->bg_color); + + gtk_widget_add_events (GTK_WIDGET (object), + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK); +} + + +static void +scim_anthy_color_button_destroy (GtkObject *object) +{ + ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (object); + + if (button->render_buf) { + g_free (button->render_buf); + button->render_buf = NULL; + button->render_buf_size = 0; + } + + if (button->swap_icon) { + g_object_unref (button->swap_icon); + button->swap_icon = NULL; + } + + GTK_OBJECT_CLASS (parent_class)->destroy (object); +} + +static void +scim_anthy_color_button_draw_rect (ScimAnthyColorButton *button, + GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + gint width, + gint height, + GdkColor *color) +{ + gint rowstride; + guchar r, g, b; + gint xx, yy; + guchar *bp; + + g_return_if_fail (width > 0 && height > 0); + + r = (color->red >> 8); + g = (color->green >> 8); + b = (color->blue >> 8); + + rowstride = 3 * ((width + 3) & -4); + + if (! button->render_buf || button->render_buf_size < height * rowstride) { + button->render_buf_size = rowstride * height; + + g_free (button->render_buf); + button->render_buf = (guchar *) g_malloc (button->render_buf_size); + } + + bp = button->render_buf; + for (xx = 0; xx < width; xx++) { + *bp++ = r; + *bp++ = g; + *bp++ = b; + } + + bp = button->render_buf; + + for (yy = 1; yy < height; yy++) { + bp += rowstride; + memcpy (bp, button->render_buf, rowstride); + } + + gdk_draw_rgb_image (drawable, gc, x, y, width, height, + GDK_RGB_DITHER_MAX, + button->render_buf, + rowstride); +} + +static gboolean +scim_anthy_color_button_expose (GtkWidget *widget, + GdkEventExpose *eevent) +{ + ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (widget); + gint width, height; + gint swap_w = 0, swap_h = 0; + gint rect_w, rect_h; + + if (!GTK_WIDGET_DRAWABLE (widget)) + return FALSE; + + width = widget->allocation.width; + height = widget->allocation.height; + + /* draw the swap colors pixbuf */ + if (!button->swap_icon) { + button->swap_icon + = gdk_pixbuf_new_from_file (SCIM_ICONDIR"/scim-anthy-swap-colors.png", + NULL); + } + + if (button->swap_icon) { + swap_w = gdk_pixbuf_get_width (button->swap_icon); + swap_h = gdk_pixbuf_get_height (button->swap_icon); + } + + if (swap_w < width / 2 && swap_h < height / 2) { + gdk_draw_pixbuf (widget->window, NULL, button->swap_icon, + 0, 0, width - swap_w, 0, swap_w, swap_h, + GDK_RGB_DITHER_NORMAL, 0, 0); + } else { + swap_w = swap_h = 0; + } + + rect_h = height - swap_h - 2; + rect_w = width - swap_w - 4; + + if (rect_h > (height * 3 / 4)) { + rect_w = MAX (rect_w - (rect_h - ((height * 3 / 4))), + width * 2 / 3); + } + + button->rect_width = rect_w; + button->rect_height = rect_h; + + + /* draw the background area */ + scim_anthy_color_button_draw_rect (button, + widget->window, + widget->style->fg_gc[0], + (width - rect_w), + (height - rect_h), + rect_w, rect_h, + &button->bg_color); + + gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL, + GTK_SHADOW_IN, + NULL, widget, NULL, + (width - rect_w), + (height - rect_h), + rect_w, rect_h); + + + /* draw the foreground area */ + scim_anthy_color_button_draw_rect (button, + widget->window, + widget->style->fg_gc[0], + 0, 0, + rect_w, rect_h, + &button->fg_color); + + gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL, + GTK_SHADOW_IN, + NULL, widget, NULL, + 0, 0, + rect_w, rect_h); + + return TRUE; +} + +static FgBgTarget +scim_anthy_color_button_target (ScimAnthyColorButton *button, + gint x, + gint y) +{ + gint width = GTK_WIDGET (button)->allocation.width; + gint height = GTK_WIDGET (button)->allocation.height; + gint rect_w = button->rect_width; + gint rect_h = button->rect_height; + + if (x > 0 && x < rect_w && y > 0 && y < rect_h) + return FOREGROUND_AREA; + else if (x > (width - rect_w) && x < width && + y > (height - rect_h) && y < height) + return BACKGROUND_AREA; + else if (x > 0 && x < (width - rect_w) && + y > rect_h && y < height) + return DEFAULT_AREA; + else if (x > rect_w && x < width && + y > 0 && y < (height - rect_h)) + return SWAP_AREA; + + return INVALID_AREA; +} + +static void +scim_anthy_color_button_open_color_dialog (ScimAnthyColorButton *button, gboolean fg) +{ + GtkWidget *dialog; + const gchar *title; + GdkColor *color; + gint result; + + title = fg ? _("Foreground color") : _("Background color"); + color = fg ? &button->fg_color : &button->bg_color; + + dialog = gtk_color_selection_dialog_new (title); + + gtk_color_selection_set_current_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel), + color); + gtk_widget_show (dialog); + + result = gtk_dialog_run (GTK_DIALOG (dialog)); + + switch (result) { + case GTK_RESPONSE_OK: + gtk_color_selection_get_current_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel), + color); + g_signal_emit (button, button_signals[COLOR_CHANGED], 0); + break; + default: + break; + } + + gtk_widget_destroy (dialog); + gtk_widget_queue_draw (GTK_WIDGET (button)); +} + +static void +scim_anthy_color_button_swap_color (ScimAnthyColorButton *button) +{ + GdkColor tmp; + tmp.red = button->fg_color.red; + tmp.green = button->fg_color.green; + tmp.blue = button->fg_color.blue; + + button->fg_color.red = button->bg_color.red; + button->fg_color.green = button->bg_color.green; + button->fg_color.blue = button->bg_color.blue; + + button->bg_color.red = tmp.red; + button->bg_color.green = tmp.green; + button->bg_color.blue = tmp.blue; + g_signal_emit (button, button_signals[COLOR_CHANGED], 0); +} + +static gboolean +scim_anthy_color_button_button_press (GtkWidget *widget, + GdkEventButton *bevent) +{ + ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (widget); + if (bevent->button == 1 && bevent->type == GDK_BUTTON_PRESS) { + FgBgTarget target = scim_anthy_color_button_target (button, + (gint) bevent->x, (gint) bevent->y); + + button->click_target = INVALID_AREA; + + switch (target) { + case FOREGROUND_AREA: + button->click_target = FOREGROUND_AREA; + scim_anthy_color_button_open_color_dialog (button, TRUE); + break; + + case BACKGROUND_AREA: + button->click_target = BACKGROUND_AREA; + scim_anthy_color_button_open_color_dialog (button, FALSE); + break; + + case SWAP_AREA: + scim_anthy_color_button_swap_color (button); + gtk_widget_queue_draw (GTK_WIDGET (button)); + break; + + case DEFAULT_AREA: + break; + + default: + break; + } + } + + return FALSE; +} + +static gboolean +scim_anthy_color_button_button_release (GtkWidget *widget, + GdkEventButton *bevent) +{ + ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (widget); + + if (bevent->button == 1) { + FgBgTarget target = scim_anthy_color_button_target (button, + (gint) bevent->x, (gint) bevent->y); + + if (target == button->click_target) { + switch (target) + { + case FOREGROUND_AREA: + break; + + case BACKGROUND_AREA: + break; + + default: + break; + } + } + + button->click_target = INVALID_AREA; + } + + return FALSE; +} + + +/* public functions */ + +GtkWidget * +scim_anthy_color_button_new (void) +{ + return GTK_WIDGET(g_object_new (SCIM_ANTHY_TYPE_COLOR_BUTTON, + NULL)); +} + +gboolean +scim_anthy_color_button_get_colors (ScimAnthyColorButton *button, + String *fg_value, + String *bg_value) +{ + gchar fg_color_str[8], bg_color_str[8]; + + g_snprintf (fg_color_str, G_N_ELEMENTS (fg_color_str), + "#%02X%02X%02X", + ((button->fg_color.red)>>8), + ((button->fg_color.green)>>8), + ((button->fg_color.blue)>>8)); + g_snprintf (bg_color_str, G_N_ELEMENTS (bg_color_str), + "#%02X%02X%02X", + ((button->bg_color.red)>>8), + ((button->bg_color.green)>>8), + ((button->bg_color.blue)>>8)); + *fg_value = String (fg_color_str); + *bg_value = String (bg_color_str); + + return TRUE; +} + +gboolean +scim_anthy_color_button_set_colors (ScimAnthyColorButton *button, + const String &fg_value, + const String &bg_value) +{ + GdkColor fg_color, bg_color; + gdk_color_parse (fg_value.c_str (), &fg_color); + gdk_color_parse (bg_value.c_str (), &bg_color); + button->fg_color.red = fg_color.red; + button->fg_color.green = fg_color.green; + button->fg_color.blue = fg_color.blue; + + button->bg_color.red = bg_color.red; + button->bg_color.green = bg_color.green; + button->bg_color.blue = bg_color.blue; + + return TRUE; +} + +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_color_button.h b/src/scim_anthy_color_button.h new file mode 100755 index 0000000..f55083a --- /dev/null +++ b/src/scim_anthy_color_button.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2005 Hiroyuki Ikezoe + * + * 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. + */ +/* + * The original code is gimpfgbgeditor.h in GIMP-2.3.2. + * Copyright (C) 2004 Michael Natterer + */ + +#ifndef __SCIM_ANTHY_COLOR_BUTTON_H__ +#define __SCIM_ANTHY_COLOR_BUTTON_H__ + + +#include +#include + +using namespace scim; + +#define SCIM_ANTHY_TYPE_COLOR_BUTTON (scim_anthy_color_button_get_type ()) +#define SCIM_ANTHY_COLOR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButton)) +#define SCIM_ANTHY_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButtonClass)) +#define SCIM_ANTHY_IS_COLOR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON)) +#define SCIM_ANTHY_IS_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCIM_ANTHY_TYPE_COLOR_BUTTON)) +#define SCIM_ANTHY_COLOR_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCIM_ANTHY_TYPE_COLOR_BUTTON, ScimAnthyColorButtonClass)) + + +typedef struct _ScimAnthyColorButtonClass ScimAnthyColorButtonClass; +typedef struct _ScimAnthyColorButton ScimAnthyColorButton; + +struct _ScimAnthyColorButton +{ + GtkDrawingArea parent_instance; + + guchar *render_buf; + gint render_buf_size; + + GdkPixbuf *swap_icon; + + gint rect_width; + gint rect_height; + gint click_target; + + GdkColor fg_color; + GdkColor bg_color; +}; + +struct _ScimAnthyColorButtonClass +{ + GtkDrawingAreaClass parent_class; + + /* signals */ + + void (* color_changed) (ScimAnthyColorButton *button); +}; + + +GType scim_anthy_color_button_get_type (void) G_GNUC_CONST; + +GtkWidget * scim_anthy_color_button_new (void); + +gboolean scim_anthy_color_button_get_colors (ScimAnthyColorButton *button, + String *fg_value, + String *bg_value); +gboolean scim_anthy_color_button_set_colors (ScimAnthyColorButton *button, + const String &fg_value, + const String &bg_value); + +#endif /* __SCIM_ANTHY_COLOR_BUTTON_H__ */ diff --git a/src/scim_anthy_conversion.cpp b/src/scim_anthy_conversion.cpp new file mode 100755 index 0000000..f4215ab --- /dev/null +++ b/src/scim_anthy_conversion.cpp @@ -0,0 +1,866 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#include + +#include "scim_anthy_factory.h" +#include "scim_anthy_imengine.h" +#include "scim_anthy_conversion.h" +#include "scim_anthy_utils.h" +#include "scim_anthy_prefs.h" + +using namespace scim_anthy; + +static void rotate_case (String &str); + + +// +// ConversionSegment Class +// +ConversionSegment::ConversionSegment (WideString str, int cand_id, + unsigned int reading_len) + : m_string (str), + m_cand_id (cand_id), + m_reading_len (reading_len) +{ +} + +ConversionSegment::~ConversionSegment () +{ +} + +WideString & +ConversionSegment::get_string (void) +{ + return m_string; +} + + +int +ConversionSegment::get_candidate_id (void) +{ + return m_cand_id; +} + +unsigned int +ConversionSegment::get_reading_length (void) +{ + return m_reading_len; +} + +void +ConversionSegment::set (WideString str, int cand_id) +{ + m_string = str; + m_cand_id = cand_id; +} + +void +ConversionSegment::set_reading_length (unsigned int len) +{ + m_reading_len = len; +} + + + +// +// Conversion Class +// +Conversion::Conversion (AnthyInstance &anthy, Reading &reading) + : m_anthy (anthy), + m_reading (reading), + m_anthy_context (anthy_create_context()), + m_start_id (0), + m_cur_segment (-1), + m_predicting (false) +{ + set_dict_encoding (String (SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT)); +} + +Conversion::~Conversion () +{ + anthy_release_context (m_anthy_context); +} + + + +// +// starting and finishing +// +void +Conversion::convert (WideString source, CandidateType ctype, + bool single_segment) +{ + if (is_converting ()) + return; + + clear (); + + String dest; + + // convert + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + if (conv_stat.nr_segment <= 0) { + m_iconv.convert (dest, source); + anthy_set_string (m_anthy_context, dest.c_str ()); + } + + if (single_segment) + join_all_segments (); + + // get information about conversion string + anthy_get_stat (m_anthy_context, &conv_stat); + if (conv_stat.nr_segment <= 0) + return; + + // select first segment + m_cur_segment = 0; + + // create segments + m_segments.clear(); + for (int i = m_start_id; i < conv_stat.nr_segment; i++) { + struct anthy_segment_stat seg_stat; + anthy_get_segment_stat (m_anthy_context, i, &seg_stat); + m_segments.push_back ( + ConversionSegment (get_segment_string (i, ctype), ctype, + seg_stat.seg_len)); + } +} + +void +Conversion::convert (CandidateType ctype, bool single_segment) +{ + convert (m_reading.get (), ctype, single_segment); +} + +void +Conversion::convert (const WideString &source, bool single_segment) +{ + convert (source, SCIM_ANTHY_CANDIDATE_DEFAULT, single_segment); +} + +void +Conversion::predict (void) +{ + clear (); + +#ifdef HAS_ANTHY_PREDICTION + String str; + + m_iconv.convert (str, m_reading.get ()); + anthy_set_prediction_string (m_anthy_context, str.c_str ()); + + struct anthy_prediction_stat ps; + anthy_get_prediction_stat (m_anthy_context, &ps); + if (ps.nr_prediction > 0) + m_predicting = true; + else + anthy_reset_context (m_anthy_context); +#endif /* HAS_ANTHY_PREDICTION */ +} + +void +Conversion::clear (int segment_id) +{ + if (segment_id < 0 || m_segments.size () <= 0 || + segment_id >= (int) m_segments.size () - 1) + { + // complete clear + + anthy_reset_context (m_anthy_context); + + m_segments.clear (); + + m_start_id = 0; + m_cur_segment = -1; + m_predicting = false; + + } else { + // partial clear + + // remove stored segments + ConversionSegments::iterator it = m_segments.begin (); + m_segments.erase (it, it + segment_id + 1); + + // adjust selected segment + int new_start_segment_id = m_start_id + segment_id + 1; + if (m_cur_segment >= 0) { + m_cur_segment -= new_start_segment_id - m_start_id; + if (m_cur_segment < 0) + m_cur_segment = 0; + } + + // adjust offset + unsigned int clear_len = 0; + for (int i = m_start_id; i < new_start_segment_id; i++) { + struct anthy_segment_stat seg_stat; + anthy_get_segment_stat (m_anthy_context, i, &seg_stat); + clear_len += seg_stat.seg_len; + } + m_reading.erase (0, clear_len, true); + m_start_id = new_start_segment_id; + } +} + +void +Conversion::commit (int segment_id, bool learn) +{ + if (!is_converting ()) return; + + // learn + for (unsigned int i = m_start_id; + learn && + i < m_segments.size () && + (segment_id < 0 || (int) i <= segment_id); + i++) + { + if (m_segments[i].get_candidate_id () >= 0) + anthy_commit_segment (m_anthy_context, i, + m_segments[i].get_candidate_id ()); + } + + clear (segment_id); +} + + + +// +// getting status +// +bool +Conversion::is_converting (void) +{ + if (m_segments.size () > 0) + return true; + else + return false; +} + +bool +Conversion::is_predicting (void) +{ + return m_predicting; +} + +WideString +Conversion::get (void) +{ + WideString str; + ConversionSegments::iterator it; + for (it = m_segments.begin (); it != m_segments.end (); it++) + str += it->get_string (); + return str; +} + +unsigned int +Conversion::get_length (void) +{ + unsigned int len = 0; + ConversionSegments::iterator it; + for (it = m_segments.begin (); it != m_segments.end (); it++) + len += it->get_string().length (); + return len; +} + +AttributeList +Conversion::get_attribute_list (void) +{ + AttributeList attrs; + unsigned int pos = 0, seg_id; + ConversionSegments::iterator it; + for (it = m_segments.begin (), seg_id = 0; + it != m_segments.end (); + it++, seg_id++) + { + // create attribute for this segment + if (it->get_string().length () <= 0) { + pos += it->get_string().length (); + continue; + } + + if ((int) seg_id == m_cur_segment) { + util_create_attributes ( + attrs, pos, it->get_string().length(), + m_anthy.get_factory()->m_selected_segment_style, + m_anthy.get_factory()->m_selected_segment_fg_color, + m_anthy.get_factory()->m_selected_segment_bg_color); + } else { + util_create_attributes ( + attrs, pos, it->get_string().length(), + m_anthy.get_factory()->m_conversion_style, + m_anthy.get_factory()->m_conversion_fg_color, + m_anthy.get_factory()->m_conversion_bg_color); + } + + pos += it->get_string().length (); + } + + return attrs; +} + + + +// +// segments of the converted sentence +// +int +Conversion::get_nr_segments (void) +{ + if (!is_converting ()) return 0; + + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + + return conv_stat.nr_segment - m_start_id; +} + +WideString +Conversion::get_segment_string (int segment_id, int candidate_id) +{ + if (segment_id < 0) { + if (m_cur_segment < 0) + return WideString (); + else + segment_id = m_cur_segment; + } + + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + + if (conv_stat.nr_segment <= 0) + return WideString (); + + if (m_start_id < 0 || + m_start_id >= conv_stat.nr_segment) + { + return WideString (); // error + } + + if (segment_id < 0 || + segment_id + m_start_id >= conv_stat.nr_segment) + { + return WideString (); //error + } + + // character position of the head of segment. + unsigned int real_seg_start = 0; + for (int i = m_start_id; i < m_start_id + segment_id; i++) { + struct anthy_segment_stat seg_stat; + anthy_get_segment_stat (m_anthy_context, i, &seg_stat); + real_seg_start += seg_stat.seg_len; + } + + int real_seg = segment_id + m_start_id; + int cand; + if (candidate_id <= SCIM_ANTHY_LAST_SPECIAL_CANDIDATE) + cand = m_segments[segment_id].get_candidate_id (); + else + cand = candidate_id; + + // get information of this segment + struct anthy_segment_stat seg_stat; + anthy_get_segment_stat (m_anthy_context, real_seg, &seg_stat); + + // get string of this segment + WideString segment_str; + if (cand < 0) { + get_reading_substr (segment_str, segment_id, cand, + real_seg_start, seg_stat.seg_len); + } else { + int len = anthy_get_segment (m_anthy_context, real_seg, cand, NULL, 0); + if (len > 0) { + char buf[len + 1]; + anthy_get_segment (m_anthy_context, real_seg, cand, buf, len + 1); + buf[len] = '\0'; + m_iconv.convert (segment_str, buf, len); + } + } + + return segment_str; +} + +int +Conversion::get_selected_segment (void) +{ + return m_cur_segment; +} + +void +Conversion::select_segment (int segment_id) +{ + if (!is_converting ()) return; + + if (segment_id < 0) { + m_cur_segment = -1; + return; + } + + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + + int real_segment_id = segment_id + m_start_id; + + if (segment_id >= 0 && real_segment_id < conv_stat.nr_segment) + m_cur_segment = segment_id; +} + +int +Conversion::get_segment_size (int segment_id) +{ + if (!is_converting ()) return -1; + + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + + if (segment_id < 0) { + if (m_cur_segment < 0) + return -1; + else + segment_id = m_cur_segment; + } + int real_segment_id = segment_id + m_start_id; + + if (real_segment_id >= conv_stat.nr_segment) + return -1; + + struct anthy_segment_stat seg_stat; + anthy_get_segment_stat (m_anthy_context, real_segment_id, &seg_stat); + + return seg_stat.seg_len; +} + +void +Conversion::resize_segment (int relative_size, int segment_id) +{ + if (is_predicting ()) return; + if (!is_converting ()) return; + + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + + int real_segment_id; + + if (segment_id < 0) { + if (m_cur_segment < 0) + return; + else + segment_id = m_cur_segment; + real_segment_id = segment_id + m_start_id; + } else { + real_segment_id = segment_id + m_start_id; + if (m_cur_segment > segment_id) + m_cur_segment = segment_id; + } + + if (real_segment_id >= conv_stat.nr_segment) + return; + + // do resize + anthy_resize_segment (m_anthy_context, real_segment_id, relative_size); + + // reset candidates of trailing segments + anthy_get_stat (m_anthy_context, &conv_stat); + ConversionSegments::iterator start_iter = m_segments.begin(); + ConversionSegments::iterator end_iter = m_segments.end(); + m_segments.erase (start_iter + segment_id, end_iter); + for (int i = real_segment_id; i < conv_stat.nr_segment; i++) { + struct anthy_segment_stat seg_stat; + anthy_get_segment_stat (m_anthy_context, i, &seg_stat); + m_segments.push_back ( + ConversionSegment (get_segment_string (i - m_start_id, 0), 0, + seg_stat.seg_len)); + } +} + +unsigned int +Conversion::get_segment_position (int segment_id) +{ + if (segment_id < 0) { + if (m_cur_segment < 0) + return get_length (); + else + segment_id = m_cur_segment; + } + + unsigned int pos = 0; + + for (unsigned int i = 0; + (int) i < m_cur_segment && i < m_segments.size (); + i++) + { + pos += m_segments[i].get_string().length (); + } + + return pos; +} + + + +// +// candidates for a segment or prediction +// +void +Conversion::get_candidates (CommonLookupTable &table, int segment_id) +{ + table.clear (); + + if (is_predicting ()) { +#ifdef HAS_ANTHY_PREDICTION + String str; + struct anthy_prediction_stat ps; + + anthy_get_prediction_stat (m_anthy_context, &ps); + + for (int i = 0; i < ps.nr_prediction; i++) { + int len = anthy_get_prediction (m_anthy_context, i, NULL, 0); + if (len <= 0) + continue; + + char buf[len + 1]; + anthy_get_prediction (m_anthy_context, i, buf, len + 1); + buf[len] = '\0'; + + WideString cand; + m_iconv.convert (cand, buf); + + table.append_candidate (cand); + } +#endif /* HAS_ANTHY_PREDICTION */ + } else if (is_converting ()) { + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + + if (conv_stat.nr_segment <= 0) + return; + + if (segment_id < 0) { + if (m_cur_segment < 0) + return; + else + segment_id = m_cur_segment; + } + int real_segment_id = segment_id + m_start_id; + + if (real_segment_id >= conv_stat.nr_segment) + return; + + struct anthy_segment_stat seg_stat; + anthy_get_segment_stat (m_anthy_context, real_segment_id, &seg_stat); + + for (int i = 0; i < seg_stat.nr_candidate; i++) { + int len = anthy_get_segment (m_anthy_context, real_segment_id, i, + NULL, 0); + if (len <= 0) + continue; + + char buf[len + 1]; + anthy_get_segment (m_anthy_context, real_segment_id, + i, buf, len + 1); + + WideString cand_wide; + m_iconv.convert (cand_wide, buf, len); + + table.append_candidate (cand_wide); + } + + table.set_cursor_pos (get_selected_candidate ()); + } +} + +int +Conversion::get_selected_candidate (int segment_id) +{ + if (is_predicting ()) { +#ifdef HAS_ANTHY_PREDICTION + struct anthy_prediction_stat ps; + + anthy_get_prediction_stat (m_anthy_context, &ps); + + if (ps.nr_prediction <= 0) + return -1; + + if (segment_id < 0) { + if (m_cur_segment < 0) + return -1; + else + segment_id = m_cur_segment; + } else if (segment_id >= ps.nr_prediction) { + return -1; + } + + return m_segments[segment_id].get_candidate_id (); +#endif /* HAS_ANTHY_PREDICTION */ + + } else if (is_converting ()) { + struct anthy_conv_stat cs; + + anthy_get_stat (m_anthy_context, &cs); + + if (cs.nr_segment <= 0) + return -1; + + if (segment_id < 0) { + if (m_cur_segment < 0) + return -1; + else + segment_id = m_cur_segment; + } else if (segment_id >= cs.nr_segment) { + return -1; + } + + return m_segments[segment_id].get_candidate_id (); + } + + return -1; +} + +void +Conversion::select_candidate (int candidate_id, int segment_id) +{ + if (is_predicting ()) { +#ifdef HAS_ANTHY_PREDICTION + if (candidate_id < SCIM_ANTHY_CANDIDATE_DEFAULT) + return; + + struct anthy_prediction_stat ps; + anthy_get_prediction_stat (m_anthy_context, &ps); + + if (ps.nr_prediction <= 0) + return; + + if (!is_converting ()) { + m_cur_segment = 0; + m_segments.push_back (ConversionSegment ( + get_prediction_string (0), 0, + m_reading.get_length ())); + } + + if (candidate_id < ps.nr_prediction) { + m_segments[0].set (get_prediction_string (candidate_id), + candidate_id); + } +#endif /* HAS_ANTHY_PREDICTION */ + + } else if (is_converting ()) { + if (candidate_id <= SCIM_ANTHY_LAST_SPECIAL_CANDIDATE) + return; + + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + + if (conv_stat.nr_segment <= 0) + return; + + if (segment_id < 0) { + if (m_cur_segment < 0) + return; + else + segment_id = m_cur_segment; + } + int real_segment_id = segment_id + m_start_id; + + if (segment_id >= conv_stat.nr_segment) + return; + + struct anthy_segment_stat seg_stat; + anthy_get_segment_stat (m_anthy_context, real_segment_id, &seg_stat); + + if (candidate_id == SCIM_ANTHY_CANDIDATE_HALF) { + switch (m_segments[segment_id].get_candidate_id ()) { + case SCIM_ANTHY_CANDIDATE_LATIN: + case SCIM_ANTHY_CANDIDATE_WIDE_LATIN: + candidate_id = SCIM_ANTHY_CANDIDATE_LATIN; + break; + default: + candidate_id = SCIM_ANTHY_CANDIDATE_HALF_KATAKANA; + break; + } + } + + if (candidate_id < seg_stat.nr_candidate) { + m_segments[segment_id].set (get_segment_string (segment_id, + candidate_id), + candidate_id); + } + } +} + + + +// +// preferences +// +bool +Conversion::set_dict_encoding (String type) +{ +#ifdef HAS_ANTHY_CONTEXT_SET_ENCODING + if (!strcasecmp (type.c_str (), "UTF-8") || + !strcasecmp (type.c_str (), "UTF8")) + { + anthy_context_set_encoding (m_anthy_context, ANTHY_UTF8_ENCODING); + } else { + anthy_context_set_encoding (m_anthy_context, ANTHY_EUC_JP_ENCODING); + } +#endif /* HAS_ANTHY_CONTEXT_SET_ENCODING */ + + if (m_iconv.set_encoding (type.c_str ())) { + return true; + } else { + return m_iconv.set_encoding ("EUC-JP"); + } +} + + + +// +// Utilities +// +void +Conversion::get_reading_substr (WideString &string, + int segment_id, + int candidate_id, + int seg_start, + int seg_len) +{ + int prev_cand = 0; + + if (segment_id < (int) m_segments.size ()) + prev_cand = m_segments[segment_id].get_candidate_id (); + + switch ((CandidateType) candidate_id) { + case SCIM_ANTHY_CANDIDATE_LATIN: + if (prev_cand == SCIM_ANTHY_CANDIDATE_LATIN) { + String str = utf8_wcstombs (m_segments[segment_id].get_string ()); + rotate_case (str); + string = utf8_mbstowcs (str); + } else { + string = m_reading.get (seg_start, seg_len, + SCIM_ANTHY_STRING_LATIN); + } + break; + + case SCIM_ANTHY_CANDIDATE_WIDE_LATIN: + if (prev_cand == SCIM_ANTHY_CANDIDATE_WIDE_LATIN) { + String str; + util_convert_to_half (str, m_segments[segment_id].get_string ()); + rotate_case (str); + util_convert_to_wide (string, str); + } else { + string = m_reading.get (seg_start, seg_len, + SCIM_ANTHY_STRING_WIDE_LATIN); + } + break; + + case SCIM_ANTHY_CANDIDATE_KATAKANA: + string = m_reading.get (seg_start, seg_len, + SCIM_ANTHY_STRING_KATAKANA); + break; + + case SCIM_ANTHY_CANDIDATE_HALF_KATAKANA: + string = m_reading.get (seg_start, seg_len, + SCIM_ANTHY_STRING_HALF_KATAKANA); + break; + + case SCIM_ANTHY_CANDIDATE_HALF: + // shouldn't reach to this entry + string = m_reading.get (seg_start, seg_len, + SCIM_ANTHY_STRING_HALF_KATAKANA); + break; + + case SCIM_ANTHY_CANDIDATE_HIRAGANA: + default: + string = m_reading.get (seg_start, seg_len, + SCIM_ANTHY_STRING_HIRAGANA); + break; + } +} + +WideString +Conversion::get_prediction_string (int candidate_id) +{ +#ifdef HAS_ANTHY_PREDICTION + if (!is_predicting ()) + return WideString (); + + struct anthy_prediction_stat ps; + anthy_get_prediction_stat (m_anthy_context, &ps); + + if (ps.nr_prediction <= 0) + return WideString (); + + int len = anthy_get_prediction (m_anthy_context, candidate_id, NULL, 0); + if (len <= 0) + return WideString (); + + char buf[len + 1]; + anthy_get_prediction (m_anthy_context, candidate_id, buf, len + 1); + buf[len] = '\0'; + + WideString cand; + m_iconv.convert (cand, buf); + + return cand; +#else /* HAS_ANTHY_PREDICTION */ + return WideString (); +#endif /* HAS_ANTHY_PREDICTION */ +} + +void +Conversion::join_all_segments (void) +{ + do { + struct anthy_conv_stat conv_stat; + anthy_get_stat (m_anthy_context, &conv_stat); + int nr_seg = conv_stat.nr_segment - m_start_id; + + if (nr_seg > 1) + anthy_resize_segment (m_anthy_context, m_start_id, 1); + else + break; + } while (true); +} + +static void +rotate_case (String &str) +{ + bool is_mixed = false; + for (unsigned int i = 1; i < str.length (); i++) { + if ((isupper (str[0]) && islower (str[i])) || + (islower (str[0]) && isupper (str[i]))) + { + is_mixed = true; + break; + } + } + + if (is_mixed) { + // Anthy -> anthy, anThy -> anthy + for (unsigned int i = 0; i < str.length (); i++) + str[i] = tolower (str[i]); + } else if (isupper (str[0])) { + // ANTHY -> Anthy + for (unsigned int i = 1; i < str.length (); i++) + str[i] = tolower (str[i]); + } else { + // anthy -> ANTHY + for (unsigned int i = 0; i < str.length (); i++) + str[i] = toupper (str[i]); + } +} diff --git a/src/scim_anthy_conversion.h b/src/scim_anthy_conversion.h new file mode 100755 index 0000000..69ea524 --- /dev/null +++ b/src/scim_anthy_conversion.h @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_CONVERSION_H__ +#define __SCIM_ANTHY_CONVERSION_H__ + +#define Uses_SCIM_ICONV +#define Uses_SCIM_ATTRIBUTE +#define Uses_SCIM_LOOKUP_TABLE +#include +#include + +#include "scim_anthy_reading.h" + +using namespace scim; + +class AnthyInstance; + +namespace scim_anthy { + +typedef enum { + SCIM_ANTHY_CANDIDATE_DEFAULT = 0, + SCIM_ANTHY_CANDIDATE_LATIN = -1, + SCIM_ANTHY_CANDIDATE_WIDE_LATIN = -2, + SCIM_ANTHY_CANDIDATE_HIRAGANA = -3, + SCIM_ANTHY_CANDIDATE_KATAKANA = -4, + SCIM_ANTHY_CANDIDATE_HALF_KATAKANA = -5, + SCIM_ANTHY_CANDIDATE_HALF = -6, + SCIM_ANTHY_LAST_SPECIAL_CANDIDATE = -7, +} CandidateType; + +class ConversionSegment +{ +public: + ConversionSegment (WideString str, + int cand_id, + unsigned int reading_len); + virtual ~ConversionSegment (); + + WideString & get_string (void); + int get_candidate_id (void); + unsigned int get_reading_length (void); + + void set (WideString str, + int cand_id); + void set_reading_length (unsigned int len); + +private: + WideString m_string; + int m_cand_id; + unsigned int m_reading_len; +}; +typedef std::vector ConversionSegments; + +class Conversion +{ +public: + Conversion (AnthyInstance &anthy, Reading &reading); + virtual ~Conversion (); + + // starting and finishing + void convert (WideString source, + CandidateType ctype, + bool single_segment); + void convert (CandidateType type + = SCIM_ANTHY_CANDIDATE_DEFAULT, + bool single_segment = false); + void convert (const WideString &source, + bool single_segment = false); + void predict (void); + void clear (int segment_id = -1); + void commit (int segment_id = -1, + bool learn = true); + + // getting status + bool is_converting (void); + bool is_predicting (void); + + WideString get (void); + unsigned int get_length (void); + AttributeList get_attribute_list (void); + + // segments of the converted sentence + int get_nr_segments (void); + WideString get_segment_string (int segment_id = -1, + int candidate_id + = SCIM_ANTHY_LAST_SPECIAL_CANDIDATE); + int get_selected_segment (void); + void select_segment (int segment_id); + int get_segment_size (int segment_id = -1); + void resize_segment (int relative_size, + int segment_id = -1); + unsigned int get_segment_position (int segment_id = -1); + + // candidates for a segment or prediction + void get_candidates (CommonLookupTable &table, + int segment_id = -1); + int get_selected_candidate (int segment_id = -1); + void select_candidate (int candidate_id, + int segment_id = -1); + + // prefereneces + bool set_dict_encoding (String type); + +private: + void get_reading_substr (WideString &string, + int segment_id, + int candidate_id, + int seg_start, + int seg_len); + WideString get_prediction_string (int candidate_id); + void join_all_segments (void); + +private: + AnthyInstance &m_anthy; + + // convertors + IConvert m_iconv; + Reading &m_reading; + anthy_context_t m_anthy_context; + + // status variables + ConversionSegments m_segments; + int m_start_id; // number of commited segments + int m_cur_segment; // relative position from m_start_id + bool m_predicting; +}; + +} + +#endif /* __SCIM_ANTHY_READING_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_default_tables.cpp b/src/scim_anthy_default_tables.cpp new file mode 100755 index 0000000..a1cacbb --- /dev/null +++ b/src/scim_anthy_default_tables.cpp @@ -0,0 +1,1115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#define Uses_SCIM_EVENT +#include +#include "scim_anthy_default_tables.h" + +using namespace scim; + +/* from Suikyo */ +ConvRule scim_anthy_romaji_typing_rule[] = { +{"-", "ー", ""}, +#if 0 +{"[", "「", ""}, +{"]", "」", ""}, +#endif +{"a", "あ", ""}, +{"i", "い", ""}, +{"u", "う", ""}, +{"e", "え", ""}, +{"o", "お", ""}, +{"xa", "ぁ", ""}, +{"xi", "ぃ", ""}, +{"xu", "ぅ", ""}, +{"xe", "ぇ", ""}, +{"xo", "ぉ", ""}, +{"la", "ぁ", ""}, +{"li", "ぃ", ""}, +{"lu", "ぅ", ""}, +{"le", "ぇ", ""}, +{"lo", "ぉ", ""}, +{"wi", "うぃ", ""}, +{"we", "うぇ", ""}, +{"wha", "うぁ", ""}, +{"whi", "うぃ", ""}, +{"whe", "うぇ", ""}, +{"who", "うぉ", ""}, +#if 0 +{"va", "う゛ぁ", ""}, +{"vi", "う゛ぃ", ""}, +{"vu", "う゛", ""}, +{"ve", "う゛ぇ", ""}, +{"vo", "う゛ぉ", ""}, +#else +{"va", "ヴぁ", ""}, +{"vi", "ヴぃ", ""}, +{"vu", "ヴ", ""}, +{"ve", "ヴぇ", ""}, +{"vo", "ヴぉ", ""}, +#endif +{"ka", "か", ""}, +{"ki", "き", ""}, +{"ku", "く", ""}, +{"ke", "け", ""}, +{"ko", "こ", ""}, +{"ga", "が", ""}, +{"gi", "ぎ", ""}, +{"gu", "ぐ", ""}, +{"ge", "げ", ""}, +{"go", "ご", ""}, +{"kya", "きゃ", ""}, +{"kyi", "きぃ", ""}, +{"kyu", "きゅ", ""}, +{"kye", "きぇ", ""}, +{"kyo", "きょ", ""}, +{"gya", "ぎゃ", ""}, +{"gyi", "ぎぃ", ""}, +{"gyu", "ぎゅ", ""}, +{"gye", "ぎぇ", ""}, +{"gyo", "ぎょ", ""}, +{"sa", "さ", ""}, +{"si", "し", ""}, +{"su", "す", ""}, +{"se", "せ", ""}, +{"so", "そ", ""}, +{"za", "ざ", ""}, +{"zi", "じ", ""}, +{"zu", "ず", ""}, +{"ze", "ぜ", ""}, +{"zo", "ぞ", ""}, +{"sya", "しゃ", ""}, +{"syi", "しぃ", ""}, +{"syu", "しゅ", ""}, +{"sye", "しぇ", ""}, +{"syo", "しょ", ""}, +{"sha", "しゃ", ""}, +{"shi", "し", ""}, +{"shu", "しゅ", ""}, +{"she", "しぇ", ""}, +{"sho", "しょ", ""}, +{"zya", "じゃ", ""}, +{"zyi", "じぃ", ""}, +{"zyu", "じゅ", ""}, +{"zye", "じぇ", ""}, +{"zyo", "じょ", ""}, +{"ja", "じゃ", ""}, +{"jya", "じゃ", ""}, +{"ji", "じ", ""}, +{"jyi", "じぃ", ""}, +{"ju", "じゅ", ""}, +{"jyu", "じゅ", ""}, +{"je", "じぇ", ""}, +{"jye", "じぇ", ""}, +{"jo", "じょ", ""}, +{"jyo", "じょ", ""}, +{"ta", "た", ""}, +{"ti", "ち", ""}, +{"tu", "つ", ""}, +{"tsu", "つ", ""}, +{"te", "て", ""}, +{"to", "と", ""}, +{"da", "だ", ""}, +{"di", "ぢ", ""}, +{"du", "づ", ""}, +{"de", "で", ""}, +{"do", "ど", ""}, +{"xtu", "っ", ""}, +{"xtsu","っ" ""}, +{"ltu", "っ", ""}, +{"ltsu","っ" ""}, +{"tya", "ちゃ", ""}, +{"tyi", "ちぃ", ""}, +{"tyu", "ちゅ", ""}, +{"tye", "ちぇ", ""}, +{"tyo", "ちょ", ""}, +{"cha", "ちゃ", ""}, +{"chi", "ち", ""}, +{"chu", "ちゅ", ""}, +{"che", "ちぇ", ""}, +{"cho", "ちょ", ""}, +{"dya", "ぢゃ", ""}, +{"dyi", "ぢぃ", ""}, +{"dyu", "ぢゅ", ""}, +{"dye", "ぢぇ", ""}, +{"dyo", "ぢょ", ""}, +{"tha", "てゃ", ""}, +{"thi", "てぃ", ""}, +{"thu", "てゅ", ""}, +{"the", "てぇ", ""}, +{"tho", "てょ", ""}, +{"dha", "でゃ", ""}, +{"dhi", "でぃ", ""}, +{"dhu", "でゅ", ""}, +{"dhe", "でぇ", ""}, +{"dho", "でょ", ""}, +{"na", "な", ""}, +{"ni", "に", ""}, +{"nu", "ぬ", ""}, +{"ne", "ね", ""}, +{"no", "の", ""}, +{"nya", "にゃ", ""}, +{"nyi", "にぃ", ""}, +{"nyu", "にゅ", ""}, +{"nye", "にぇ", ""}, +{"nyo", "にょ", ""}, +{"ha", "は", ""}, +{"hi", "ひ", ""}, +{"hu", "ふ", ""}, +{"fu", "ふ", ""}, +{"he", "へ", ""}, +{"ho", "ほ", ""}, +{"ba", "ば", ""}, +{"bi", "び", ""}, +{"bu", "ぶ", ""}, +{"be", "べ", ""}, +{"bo", "ぼ", ""}, +{"pa", "ぱ", ""}, +{"pi", "ぴ", ""}, +{"pu", "ぷ", ""}, +{"pe", "ぺ", ""}, +{"po", "ぽ", ""}, +{"hya", "ひゃ", ""}, +{"hyi", "ひぃ", ""}, +{"hyu", "ひゅ", ""}, +{"hye", "ひぇ", ""}, +{"hyo", "ひょ", ""}, +{"bya", "びゃ", ""}, +{"byi", "びぃ", ""}, +{"byu", "びゅ", ""}, +{"bye", "びぇ", ""}, +{"byo", "びょ", ""}, +{"pya", "ぴゃ", ""}, +{"pyi", "ぴぃ", ""}, +{"pyu", "ぴゅ", ""}, +{"pye", "ぴぇ", ""}, +{"pyo", "ぴょ", ""}, +{"fa", "ふぁ", ""}, +{"fi", "ふぃ", ""}, +{"fu", "ふ", ""}, +{"fe", "ふぇ", ""}, +{"fo", "ふぉ", ""}, +{"ma", "ま", ""}, +{"mi", "み", ""}, +{"mu", "む", ""}, +{"me", "め", ""}, +{"mo", "も", ""}, +{"mya", "みゃ", ""}, +{"myi", "みぃ", ""}, +{"myu", "みゅ", ""}, +{"mye", "みぇ", ""}, +{"myo", "みょ", ""}, +{"lya", "ゃ", ""}, +{"xya", "ゃ", ""}, +{"ya", "や", ""}, +{"lyu", "ゅ", ""}, +{"xyu", "ゅ", ""}, +{"yu", "ゆ", ""}, +{"lyo", "ょ", ""}, +{"xyo", "ょ", ""}, +{"yo", "よ", ""}, +{"ra", "ら", ""}, +{"ri", "り", ""}, +{"ru", "る", ""}, +{"re", "れ", ""}, +{"ro", "ろ", ""}, +{"rya", "りゃ", ""}, +{"ryi", "りぃ", ""}, +{"ryu", "りゅ", ""}, +{"rye", "りぇ", ""}, +{"ryo", "りょ", ""}, +{"xwa", "ゎ", ""}, +{"wa", "わ", ""}, +{"wo", "を", ""}, +{"n'", "ん", ""}, +{"nn", "ん", ""}, +{"n", "ん", ""}, +{"wyi", "ゐ", ""}, +{"wye", "ゑ", ""}, +#if 0 /* emulate dead key */ +{"\\.", "・", ""}, +{";r", "→", ""}, +{";l", "←", ""}, +{";u","↑", ""}, +{";d", "↓", ""}, +{";p", "〒", ""}, +{";e", "€", ""}, +{";t", "™", ""}, +{";s", "®", ""}, +{";c", "©", ""}, +#endif +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_double_consonant_rule[] = { +{"vv", "っ", "v"}, +{"xx", "っ", "x"}, +{"kk", "っ", "k"}, +{"gg", "っ", "g"}, +{"ss", "っ", "s"}, +{"zz", "っ", "z"}, +{"jj", "っ", "j"}, +{"tt", "っ", "t"}, +{"dd", "っ", "d"}, +{"hh", "っ", "h"}, +{"ff", "っ", "f"}, +{"bb", "っ", "b"}, +{"pp", "っ", "p"}, +{"mm", "っ", "m"}, +{"yy", "っ", "y"}, +{"rr", "っ", "r"}, +{"ww", "っ", "w"}, +{"cc", "っ", "c"}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_half_symbol_rule[] = { +{",", ",", ""}, +{".", ".", ""}, +{"!", "!", ""}, +{"\"", "\"", ""}, +{"#", "#", ""}, +{"$", "$", ""}, +{"%", "%", ""}, +{"&", "&", ""}, +{"'", "'", ""}, +{"(", "(", ""}, +{")", ")", ""}, +{"~", "~", ""}, +{"-", "-", ""}, +{"=", "=", ""}, +{"^", "^", ""}, +{"\\", "\\", ""}, +{"|", "|", ""}, +{"`", "`", ""}, +{"@", "@", ""}, +{"{", "{", ""}, +{"[", "[", ""}, +{"+", "+", ""}, +{";", ";", ""}, +{"*", "*", ""}, +{":", ":", ""}, +{"}", "}", ""}, +{"]", "]", ""}, +{"<", "<", ""}, +{">", ">", ""}, +{"?", "?", ""}, +{"/", "/", ""}, +{"_", "_", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_wide_symbol_rule[] = { +{",", "、", ""}, +{".", "。", ""}, +{"!", "!", ""}, +{"\"", "”", ""}, +{"#", "#", ""}, +{"$", "$", ""}, +{"%", "%", ""}, +{"&", "&", ""}, +{"'", "’", ""}, +{"(", "(", ""}, +{")", ")", ""}, +{"~", "〜", ""}, +{"-", "ー", ""}, +{"=", "=", ""}, +{"^", "ï¼¾", ""}, +{"\\", "ï¼¼", ""}, +{"|", "|", ""}, +{"`", "‘", ""}, +{"@", "ï¼ ", ""}, +{"{", "{", ""}, +{"[", "「", ""}, +{"+", "+", ""}, +{";", ";", ""}, +{"*", "*", ""}, +{":", ":", ""}, +{"}", "}", ""}, +{"]", "」", ""}, +{"<", "<", ""}, +{">", ">", ""}, +{"?", "?", ""}, +{"/", "/", ""}, +{"_", "_", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_half_number_rule[] = { +{"1", "1", ""}, +{"2", "2", ""}, +{"3", "3", ""}, +{"4", "4", ""}, +{"5", "5", ""}, +{"6", "6", ""}, +{"7", "7", ""}, +{"8", "8", ""}, +{"9", "9", ""}, +{"0", "0", ""}, +{NULL, NULL, NULL}, +}; + + +ConvRule scim_anthy_wide_number_rule[] = { +{"1", "1", ""}, +{"2", "2", ""}, +{"3", "3", ""}, +{"4", "4", ""}, +{"5", "5", ""}, +{"6", "6", ""}, +{"7", "7", ""}, +{"8", "8", ""}, +{"9", "9", ""}, +{"0", "0", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_typing_rule[] = { +// no modifiers keys +{"1", "ぬ", ""}, +{"2", "", "ふ"}, +{"3", "あ", ""}, +{"4", "う", ""}, +{"5", "え", ""}, +{"6", "お", ""}, +{"7", "や", ""}, +{"8", "ゆ", ""}, +{"9", "よ", ""}, +{"0", "わ", ""}, +{"-", "", "ほ"}, +{"^", "", "へ"}, + +{"q", "", "た"}, +{"w", "", "て"}, +{"e", "い", ""}, +{"r", "", "す"}, +{"t", "", "か"}, +{"y", "ん", ""}, +{"u", "な", ""}, +{"i", "に", ""}, +{"o", "ら", ""}, +{"p", "", "せ"}, +{"@", "゛", ""}, +{"[", "゜", ""}, + +{"a", "", "ち"}, +{"s", "", "と"}, +{"d", "", "し"}, +{"f", "", "は"}, +{"g", "", "き"}, +{"h", "", "く"}, +{"j", "ま", ""}, +{"k", "の", ""}, +{"l", "り", ""}, +{";", "れ", ""}, +{":", "", "け"}, +{"]", "む", ""}, + +{"z", "", "つ"}, +{"x", "", "さ"}, +{"c", "", "そ"}, +{"v", "", "ひ"}, +{"b", "", "こ"}, +{"n", "み", ""}, +{"m", "も", ""}, +{",", "ね", ""}, +{".", "る", ""}, +{"/", "め", ""}, +{"\\", "ー", ""}, + +// shift modifiered keys +{"!", "ぬ", ""}, +{"\"", "", "ふ"}, +{"#", "ぁ", ""}, +{"$", "ぅ", ""}, +{"%", "ぇ", ""}, +{"&", "ぉ", ""}, +{"'", "ゃ", ""}, +{"(", "ゅ", ""}, +{")", "ょ", ""}, +{"~", "を", ""}, +{"=", "", "ほ"}, +{"|", "ー", ""}, + +{"Q", "", "た"}, +{"W", "", "て"}, +{"E", "ぃ", ""}, +{"R", "", "す"}, +{"T", "ヵ", ""}, +{"Y", "ん", ""}, +{"U", "な", ""}, +{"I", "に", ""}, +{"O", "ら", ""}, +{"P", "", "せ"}, +{"`", "゛", ""}, +#if 0 +{"{", "「", ""}, +#endif + +{"A", "", "ち"}, +{"S", "", "と"}, +{"D", "", "し"}, +{"F", "ゎ", ""}, +{"G", "", "き"}, +{"H", "", "く"}, +{"J", "ま", ""}, +{"K", "の", ""}, +{"L", "り", ""}, +{"+", "れ", ""}, +{"*", "ヶ", ""}, +#if 0 +{"}", "」", ""}, +#endif + +{"Z", "っ", ""}, +{"X", "", "さ"}, +{"C", "", "そ"}, +{"V", "", "ゐ"}, +{"B", "", "こ"}, +{"M", "も", ""}, +{"N", "み", ""}, +#if 0 +{"?", "・", ""}, +#endif +{"_", "ろ", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_voiced_consonant_rule[] = { +{"か@", "が", ""}, +{"き@", "ぎ", ""}, +{"く@", "ぐ", ""}, +{"け@", "げ", ""}, +{"こ@", "ご", ""}, +{"さ@", "ざ", ""}, +{"し@", "じ", ""}, +{"す@", "ず", ""}, +{"せ@", "ぜ", ""}, +{"そ@", "ぞ", ""}, +{"た@", "だ", ""}, +{"ち@", "ぢ", ""}, +{"つ@", "づ", ""}, +{"て@", "で", ""}, +{"と@", "ど", ""}, +{"は@", "ば", ""}, +{"ひ@", "び", ""}, +{"ふ@", "ぶ", ""}, +{"へ@", "べ", ""}, +{"ほ@", "ぼ", ""}, +{"か`", "が", ""}, +{"き`", "ぎ", ""}, +{"く`", "ぐ", ""}, +{"け`", "げ", ""}, +{"こ`", "ご", ""}, +{"さ`", "ざ", ""}, +{"し`", "じ", ""}, +{"す`", "ず", ""}, +{"せ`", "ぜ", ""}, +{"そ`", "ぞ", ""}, +{"た`", "だ", ""}, +{"ち`", "ぢ", ""}, +{"つ`", "づ", ""}, +{"て`", "で", ""}, +{"と`", "ど", ""}, +{"は`", "ば", ""}, +{"ひ`", "び", ""}, +{"ふ`", "ぶ", ""}, +{"へ`", "べ", ""}, +{"ほ`", "ぼ", ""}, +{"は[", "ぱ", ""}, +{"ひ[", "ぴ", ""}, +{"ふ[", "ぷ", ""}, +{"へ[", "ぺ", ""}, +{"ほ[", "ぽ", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_ja_period_rule[] = { +{".", "。", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_ja_comma_rule[] = { +{",", "、", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_wide_period_rule[] = { +{".", ".", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_wide_comma_rule[] = { +{",", ",", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_half_period_rule[] = { +{".", ".", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_half_comma_rule[] = { +{",", ",", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_ja_period_rule[] = { +{">", "。", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_ja_comma_rule[] = { +{"<", "、", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_wide_period_rule[] = { +{">", ".", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_wide_comma_rule[] = { +{"<", ",", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_half_period_rule[] = { +{">", ".", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_half_comma_rule[] = { +{"<", ",", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_ja_bracket_rule[] = { +{"[", "「", ""}, +{"]", "」", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_wide_bracket_rule[] = { +{"[", "ï¼»", ""}, +{"]", "ï¼½", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_ja_bracket_rule[] = { +{"{", "「", ""}, +{"}", "」", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_wide_bracket_rule[] = { +{"{", "ï¼»", ""}, +{"}", "ï¼½", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_ja_slash_rule[] = { +{"/", "・", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_romaji_wide_slash_rule[] = { +{"/", "/", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_ja_slash_rule[] = { +{"?", "・", ""}, +{NULL, NULL, NULL}, +}; + +ConvRule scim_anthy_kana_wide_slash_rule[] = { +{"?", "/", ""}, +{NULL, NULL, NULL}, +}; + +HiraganaKatakanaRule scim_anthy_hiragana_katakana_table[] = { +{"あ", "ア", "ï½±"}, +{"い", "イ", "ï½²"}, +{"う", "ウ", "ï½³"}, +{"え", "エ", "ï½´"}, +{"お", "オ", "ï½µ"}, +{"か", "カ", "カ"}, +{"き", "キ", "ï½·"}, +{"く", "ク", "ク"}, +{"け", "ケ", "ï½¹"}, +{"こ", "コ", "コ"}, +{"が", "ガ", "ガ"}, +{"ぎ", "ギ", "ギ"}, +{"ぐ", "グ", "グ"}, +{"げ", "ゲ", "ゲ"}, +{"ご", "ゴ", "ゴ"}, +{"さ", "サ", "ï½»"}, +{"し", "シ", "ï½¼"}, +{"す", "ス", "ï½½"}, +{"せ", "セ", "ï½¾"}, +{"そ", "ソ", "ソ"}, +{"ざ", "ザ", "ザ"}, +{"じ", "ジ", "ジ"}, +{"ず", "ズ", "ズ"}, +{"ぜ", "ゼ", "ゼ"}, +{"ぞ", "ゾ", "ゾ"}, +{"た", "タ", "タ"}, +{"ち", "チ", "チ"}, +{"つ", "ツ", "ツ"}, +{"て", "テ", "テ"}, +{"と", "ト", "ト"}, +{"だ", "ダ", "ダ"}, +{"ぢ", "ヂ", "ヂ"}, +{"づ", "ヅ", "ヅ"}, +{"で", "デ", "デ"}, +{"ど", "ド", "ド"}, +{"な", "ナ", "ナ"}, +{"に", "ニ", "ニ"}, +{"ぬ", "ヌ", "ヌ"}, +{"ね", "ネ", "ネ"}, +{"の", "ノ", "ノ"}, +{"は", "ハ", "ハ"}, +{"ひ", "ヒ", "ヒ"}, +{"ふ", "フ", "フ"}, +{"へ", "ヘ", "ヘ"}, +{"ほ", "ホ", "ホ"}, +{"ば", "バ", "バ"}, +{"び", "ビ", "ビ"}, +{"ぶ", "ブ", "ブ"}, +{"べ", "ベ", "ベ"}, +{"ぼ", "ボ", "ボ"}, +{"ぱ", "パ", "パ"}, +{"ぴ", "ピ", "ピ"}, +{"ぷ", "プ", "プ"}, +{"ぺ", "ペ", "ペ"}, +{"ぽ", "ポ", "ポ"}, +{"ま", "マ", "マ"}, +{"み", "ミ", "ミ"}, +{"む", "ム", "ム"}, +{"め", "メ", "メ"}, +{"も", "モ", "モ"}, +{"や", "ヤ", "ヤ"}, +{"ゆ", "ユ", "ユ"}, +{"よ", "ヨ", "ヨ"}, +{"ら", "ラ", "ラ"}, +{"り", "リ", "リ"}, +{"る", "ル", "ル"}, +{"れ", "レ", "レ"}, +{"ろ", "ロ", "ロ"}, + +{"わ", "ワ", "ワ"}, +{"を", "ヲ", "ヲ"}, +{"ん", "ン", "ン"}, + +{"ぁ", "ァ", "ァ"}, +{"ぃ", "ィ", "ィ"}, +{"ぅ", "ゥ", "ゥ"}, +{"ぇ", "ェ", "ェ"}, +{"ぉ", "ォ", "ォ"}, + +{"っ", "ッ", "ッ"}, + +{"ゃ", "ャ", "ャ"}, +{"ゅ", "ュ", "ï½­"}, +{"ょ", "ョ", "ï½®"}, + +{"ヵ", "ヵ", "カ"}, +{"ヶ", "ヶ", "ï½¹"}, + +{"ゎ", "ヮ", "ワ"}, +{"ゐ", "ヰ", "ィ"}, +{"ゑ", "ヱ", "ェ"}, + +#if 1 +//{"う゛" "ヴ" "ヴ"}, +{"ヴ" "ヴ" "ヴ"}, +#endif + +#if 1 +{"ー", "ー", "ï½°"}, +{"、", "、", "、"}, +{"。", "。", "。"}, +{"!", "!", "!"}, +{"”", "”", "\""}, +{"#", "#", "#"}, +{"$", "$", "$"}, +{"%", "%", "%"}, +{"&", "&", "&"}, +{"’", "’", "'"}, +{"(", "(", "("}, +{")", ")", ")"}, +{"〜", "〜", "~"}, +{"=", "=", "="}, +{"ï¼¾", "ï¼¾", "^"}, +{"ï¼¼", "ï¼¼", "\\"}, +{"|", "|", "|"}, +{"‘", "‘", "`"}, +{"ï¼ ", "ï¼ ", "@"}, +{"{", "{", "{"}, +{"「", "「", "ï½¢"}, +{"+", "+", "+"}, +{";", ";", ";"}, +{"*", "*", "*"}, +{":", ":", ":"}, +{"}", "}", "}"}, +{"」", "」", "ï½£"}, +{"<", "<", "<"}, +{">", ">", ">"}, +{"?", "?", "?"}, +{"/", "/", "/"}, +{"_", "_", "_"}, +#endif +{NULL, NULL, NULL}, +}; + +WideRule scim_anthy_wide_table[] = { +{"a", "a"}, +{"b", "b"}, +{"c", "c"}, +{"d", "d"}, +{"e", "e"}, +{"f", "f"}, +{"g", "g"}, +{"h", "h"}, +{"i", "i"}, +{"j", "j"}, +{"k", "k"}, +{"l", "l"}, +{"m", "m"}, +{"n", "n"}, +{"o", "o"}, +{"p", "p"}, +{"q", "q"}, +{"r", "r"}, +{"s", "s"}, +{"t", "t"}, +{"u", "u"}, +{"v", "v"}, +{"w", "w"}, +{"x", "x"}, +{"y", "y"}, +{"z", "z"}, +{"A", "A"}, +{"B", "ï¼¢"}, +{"C", "ï¼£"}, +{"D", "D"}, +{"E", "ï¼¥"}, +{"F", "F"}, +{"G", "G"}, +{"H", "H"}, +{"I", "I"}, +{"J", "J"}, +{"K", "K"}, +{"L", "L"}, +{"M", "ï¼­"}, +{"N", "ï¼®"}, +{"O", "O"}, +{"P", "ï¼°"}, +{"Q", "ï¼±"}, +{"R", "ï¼²"}, +{"S", "ï¼³"}, +{"T", "ï¼´"}, +{"U", "ï¼µ"}, +{"V", "V"}, +{"W", "ï¼·"}, +{"X", "X"}, +{"Y", "ï¼¹"}, +{"Z", "Z"}, +{"1", "1"}, +{"2", "2"}, +{"3", "3"}, +{"4", "4"}, +{"5", "5"}, +{"6", "6"}, +{"7", "7"}, +{"8", "8"}, +{"9", "9"}, +{"0", "0"}, +{"-", "−"}, +{",", ","}, +{".", "."}, +{"!", "!"}, +{"\"", "”"}, +{"#", "#"}, +{"$", "$"}, +{"%", "%"}, +{"&", "&"}, +{"'", "’"}, +{"(", "("}, +{")", ")"}, +{"~", "〜"}, +{"=", "="}, +{"^", "ï¼¾"}, +{"\\", "ï¼¼"}, +{"|", "|"}, +{"`", "‘"}, +{"@", "ï¼ "}, +{"{", "{"}, +{"[", "ï¼»"}, +{"+", "+"}, +{";", ";"}, +{":", ":"}, +{"}", "}"}, +{"]", "ï¼½"}, +{"<", "<"}, +{">", ">"}, +{"?", "?"}, +{"/", "/"}, +{"_", "_"}, +{"*", "*"}, +{NULL, NULL}, +}; + +VoicedConsonantRule scim_anthy_voiced_consonant_table[] = { +{"か", "が", ""}, +{"き", "ぎ", ""}, +{"く", "ぐ", ""}, +{"け", "げ", ""}, +{"こ", "ご", ""}, +{"さ", "ざ", ""}, +{"し", "じ", ""}, +{"す", "ず", ""}, +{"せ", "ぜ", ""}, +{"そ", "ぞ", ""}, +{"た", "だ", ""}, +{"ち", "ぢ", ""}, +{"つ", "づ", ""}, +{"て", "で", ""}, +{"と", "ど", ""}, +{"は", "ば", "ぱ"}, +{"ひ", "び", "ぴ"}, +{"ふ", "ぶ", "ぷ"}, +{"へ", "べ", "ぺ"}, +{"ほ", "ぼ", "ぽ"}, +{NULL, NULL, NULL}, +}; + +KeyCodeToCharRule scim_anthy_keypad_table[] = { +{SCIM_KEY_KP_Equal, "="}, +{SCIM_KEY_KP_Multiply, "*"}, +{SCIM_KEY_KP_Add, "+"}, +{SCIM_KEY_KP_Separator, ","}, +{SCIM_KEY_KP_Subtract, "-"}, +{SCIM_KEY_KP_Decimal, "."}, +{SCIM_KEY_KP_Divide, "/"}, +{SCIM_KEY_KP_0, "0"}, +{SCIM_KEY_KP_1, "1"}, +{SCIM_KEY_KP_2, "2"}, +{SCIM_KEY_KP_3, "3"}, +{SCIM_KEY_KP_4, "4"}, +{SCIM_KEY_KP_5, "5"}, +{SCIM_KEY_KP_6, "6"}, +{SCIM_KEY_KP_7, "7"}, +{SCIM_KEY_KP_8, "8"}, +{SCIM_KEY_KP_9, "9"}, +{0, NULL} +}; + +KeyCodeToCharRule scim_anthy_kana_table[] = { +{SCIM_KEY_kana_fullstop, "。"}, +{SCIM_KEY_kana_openingbracket, "「"}, +{SCIM_KEY_kana_closingbracket, "」"}, +{SCIM_KEY_kana_comma, "、"}, +{SCIM_KEY_kana_conjunctive, "・"}, +{SCIM_KEY_kana_middledot, "・"}, +{SCIM_KEY_kana_WO, "を"}, +{SCIM_KEY_kana_a, "ぁ"}, +{SCIM_KEY_kana_i, "ぃ"}, +{SCIM_KEY_kana_u, "ぅ"}, +{SCIM_KEY_kana_e, "ぇ"}, +{SCIM_KEY_kana_o, "ぉ"}, +{SCIM_KEY_kana_ya, "ゃ"}, +{SCIM_KEY_kana_yu, "ゅ"}, +{SCIM_KEY_kana_yo, "ょ"}, +{SCIM_KEY_kana_tsu, "っ"}, +{SCIM_KEY_kana_tu, "っ"}, +{SCIM_KEY_prolongedsound, "ー"}, +{SCIM_KEY_kana_A, "あ"}, +{SCIM_KEY_kana_I, "い"}, +{SCIM_KEY_kana_U, "う"}, +{SCIM_KEY_kana_E, "え"}, +{SCIM_KEY_kana_O, "お"}, +{SCIM_KEY_kana_O, "お"}, +{SCIM_KEY_kana_KA, "か"}, +{SCIM_KEY_kana_KI, "き"}, +{SCIM_KEY_kana_KU, "く"}, +{SCIM_KEY_kana_KE, "け"}, +{SCIM_KEY_kana_KO, "こ"}, +{SCIM_KEY_kana_SA, "さ"}, +{SCIM_KEY_kana_SHI, "し"}, +{SCIM_KEY_kana_SU, "す"}, +{SCIM_KEY_kana_SE, "せ"}, +{SCIM_KEY_kana_SO, "そ"}, +{SCIM_KEY_kana_TA, "た"}, +{SCIM_KEY_kana_CHI, "ち"}, +{SCIM_KEY_kana_TI, "ち"}, +{SCIM_KEY_kana_TSU, "つ"}, +{SCIM_KEY_kana_TU, "つ"}, +{SCIM_KEY_kana_TE, "て"}, +{SCIM_KEY_kana_TO, "と"}, +{SCIM_KEY_kana_NA, "な"}, +{SCIM_KEY_kana_NI, "に"}, +{SCIM_KEY_kana_NU, "ぬ"}, +{SCIM_KEY_kana_NE, "ね"}, +{SCIM_KEY_kana_NO, "の"}, +{SCIM_KEY_kana_HA, "は"}, +{SCIM_KEY_kana_HI, "ひ"}, +{SCIM_KEY_kana_FU, "ふ"}, +{SCIM_KEY_kana_HU, "ふ"}, +{SCIM_KEY_kana_HE, "へ"}, +{SCIM_KEY_kana_HO, "ほ"}, +{SCIM_KEY_kana_MA, "ま"}, +{SCIM_KEY_kana_MI, "み"}, +{SCIM_KEY_kana_MU, "む"}, +{SCIM_KEY_kana_ME, "め"}, +{SCIM_KEY_kana_MO, "も"}, +{SCIM_KEY_kana_YA, "や"}, +{SCIM_KEY_kana_YU, "ゆ"}, +{SCIM_KEY_kana_YO, "よ"}, +{SCIM_KEY_kana_RA, "ら"}, +{SCIM_KEY_kana_RI, "り"}, +{SCIM_KEY_kana_RU, "る"}, +{SCIM_KEY_kana_RE, "れ"}, +{SCIM_KEY_kana_RO, "ろ"}, +{SCIM_KEY_kana_WA, "わ"}, +{SCIM_KEY_kana_N, "ん"}, +{SCIM_KEY_voicedsound, "゛"}, +{SCIM_KEY_semivoicedsound, "゜"}, +{0, NULL} +}; + +NicolaRule scim_anthy_nicola_table[] = { +// no modifiered keys +{"1", "1", "?", "!"}, +{"2", "2", "/", "゛"}, +{"3", "3", "〜", "#"}, +{"4", "4", "「", "$"}, +{"5", "5", "」", "%"}, +{"6", "6", "&", "ï¼»"}, +{"7", "7", "’", "ï¼½"}, +{"8", "8", "(", "("}, +{"9", "9", ")", ")"}, +{"0", "0", "〜", "『"}, +{"-", "−", "=", "』"}, +{"^", "ï¼¾", "", ""}, +{"\\", "ï¿¥", "", ""}, + +{"q", "。", "ぁ", "ゐ"}, +{"w", "か", "え", "が"}, +{"e", "た", "り", "だ"}, +{"r", "こ", "ゃ", "ご"}, +{"t", "さ", "れ", "ざ"}, +{"y", "ら", "ぱ", "よ"}, +{"u", "ち", "ぢ", "に"}, +{"i", "く", "ぐ", "る"}, +{"o", "つ", "づ", "ま"}, +{"p", ",", "ぴ", "ぇ"}, +{"@", "、", "", ""}, +{"[", "゛", "゜", "゜"}, + +{"a", "う", "を", "ヴ"}, +{"s", "し", "あ", "じ"}, +{"d", "て", "な", "で"}, +{"f", "け", "ゅ", "げ"}, +{"g", "せ", "も", "ぜ"}, +{"h", "は", "ば", "み"}, +{"j", "と", "ど", "お"}, +{"k", "き", "ぎ", "の"}, +{"l", "い", "ぽ", "ょ"}, +{";", "ん", "", "っ"}, +{":", "", "", ""}, +{"]", "", "", ""}, + +{"z", ".", "ぅ", "ゑ"}, +{"x", "ひ", "ー", "び"}, +{"c", "す", "ろ", "ず"}, +{"v", "ふ", "や", "ぶ"}, +{"b", "へ", "ぃ", "べ"}, +{"n", "め", "ぷ", "ぬ"}, +{"m", "そ", "ぞ", "ゆ"}, +{",", "ね", "ぺ", "む"}, +{".", "ほ", "ぼ", "わ"}, +{"/", "・", "ゎ", "ぉ"}, + +// normal shift modifiered keys +{"!", "!", "", ""}, +{"\"", "”", "", ""}, +{"#", "#", "", ""}, +{"$", "$", "", ""}, +{"%", "%", "", ""}, +{"&", "&", "", ""}, +{"'", "’", "", ""}, +{"(", "(", "", ""}, +{")", ")", "", ""}, +{"~", "〜", "", ""}, +{"=", "=", "", ""}, +{"|", "|", "", ""}, + +{"`", "‘", "", ""}, +{"{", "{", "", ""}, + +{"+", "+", "", ""}, +{"*", "*", "", ""}, +{"}", "}", "", ""}, + +{"<", "<", "", ""}, +{">", ">", "", ""}, +{"?", "?", "", ""}, +{"_", "_", "", ""}, + +{"Q", "。", "ぁ", "ゐ"}, +{"W", "が", "え", "が"}, +{"E", "だ", "り", "だ"}, +{"R", "ご", "ゃ", "ご"}, +{"T", "ざ", "れ", "ざ"}, +{"Y", "ぱ", "ぱ", "よ"}, +{"U", "ぢ", "ぢ", "に"}, +{"I", "ぐ", "ぐ", "る"}, +{"O", "づ", "づ", "ま"}, +{"P", "ぴ", "ぴ", "ぇ"}, +{"`", "、", "", ""}, +{"{", "゛", "゜", "゜"}, + +{"A", "ヴ", "を", "ヴ"}, +{"S", "じ", "あ", "じ"}, +{"D", "で", "な", "で"}, +{"F", "げ", "ゅ", "げ"}, +{"G", "ぜ", "も", "ぜ"}, +{"H", "ば", "ば", "み"}, +{"J", "ど", "ど", "お"}, +{"K", "ぎ", "ぎ", "の"}, +{"L", "ぽ", "ぽ", "ょ"}, +{"+", "ん", "", "っ"}, +{"*", "", "", ""}, +{"}", "", "", ""}, + +{"Z", ".", "ぅ", "ゑ"}, +{"X", "び", "ー", "び"}, +{"C", "ず", "ろ", "ず"}, +{"V", "ぶ", "や", "ぶ"}, +{"B", "べ", "ぃ", "べ"}, +{"N", "ぷ", "ぷ", "ぬ"}, +{"M", "ぞ", "ぞ", "ゆ"}, +{"<", "ぺ", "ぺ", "む"}, +{">", "ぽ", "ぼ", "わ"}, +{"?", "・", "ゎ", "ぉ"}, + +{NULL, NULL, NULL, NULL}, +}; diff --git a/src/scim_anthy_default_tables.h b/src/scim_anthy_default_tables.h new file mode 100755 index 0000000..06e4815 --- /dev/null +++ b/src/scim_anthy_default_tables.h @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_DEFAULT_TABLES_H__ +#define __SCIM_ANTHY_DEFAULT_TABLES_H__ + +typedef struct _ConvRule +{ + const char *string; + const char *result; + const char *cont; +} ConvRule; + +typedef struct _HiraganaKatakanaRule +{ + const char *hiragana; + const char *katakana; + const char *half_katakana; +} HiraganaKatakanaRule; + +typedef struct _WideRule +{ + const char *code; + const char *wide; +} WideRule; + +typedef struct _KeyCodeToCharRule +{ + unsigned int code; + const char *kana; +} KeyCodeToCharRule; + +typedef struct _VoicedConsonantRule +{ + const char *string; + const char *voiced; + const char *half_voiced; +} VoicedConsonantRule; + +typedef struct _NicolaRule +{ + const char *key; + const char *single; + const char *left_shift; + const char *right_shift; +} NicolaRule; + +// fundamental table +extern ConvRule scim_anthy_romaji_typing_rule[]; +extern ConvRule scim_anthy_romaji_double_consonant_rule[]; +extern ConvRule scim_anthy_kana_typing_rule[]; +extern ConvRule scim_anthy_kana_voiced_consonant_rule[]; + +// symbol & number +extern ConvRule scim_anthy_half_symbol_rule[]; +extern ConvRule scim_anthy_wide_symbol_rule[]; +extern ConvRule scim_anthy_half_number_rule[]; +extern ConvRule scim_anthy_wide_number_rule[]; + +// period table +extern ConvRule scim_anthy_romaji_ja_period_rule[]; +extern ConvRule scim_anthy_romaji_wide_period_rule[]; +extern ConvRule scim_anthy_romaji_half_period_rule[]; + +extern ConvRule scim_anthy_kana_ja_period_rule[]; +extern ConvRule scim_anthy_kana_wide_period_rule[]; +extern ConvRule scim_anthy_kana_half_period_rule[]; + +// comma table +extern ConvRule scim_anthy_romaji_ja_comma_rule[]; +extern ConvRule scim_anthy_romaji_wide_comma_rule[]; +extern ConvRule scim_anthy_romaji_half_comma_rule[]; + +extern ConvRule scim_anthy_kana_ja_comma_rule[]; +extern ConvRule scim_anthy_kana_wide_comma_rule[]; +extern ConvRule scim_anthy_kana_half_comma_rule[]; + +// bracket table +extern ConvRule scim_anthy_romaji_ja_bracket_rule[]; +extern ConvRule scim_anthy_romaji_wide_bracket_rule[]; + +extern ConvRule scim_anthy_kana_ja_bracket_rule[]; +extern ConvRule scim_anthy_kana_wide_bracket_rule[]; + +// slash table +extern ConvRule scim_anthy_romaji_ja_slash_rule[]; +extern ConvRule scim_anthy_romaji_wide_slash_rule[]; + +extern ConvRule scim_anthy_kana_ja_slash_rule[]; +extern ConvRule scim_anthy_kana_wide_slash_rule[]; + +// misc +extern HiraganaKatakanaRule scim_anthy_hiragana_katakana_table[]; +extern WideRule scim_anthy_wide_table[]; +extern VoicedConsonantRule scim_anthy_voiced_consonant_table[]; + +// key code +extern KeyCodeToCharRule scim_anthy_keypad_table[]; +extern KeyCodeToCharRule scim_anthy_kana_table[]; + +// nicola +extern NicolaRule scim_anthy_nicola_table[]; + +#endif /* __SCIM_ANTHY_DEFAULT_TABLES_H__ */ diff --git a/src/scim_anthy_factory.cpp b/src/scim_anthy_factory.cpp new file mode 100755 index 0000000..44b5b55 --- /dev/null +++ b/src/scim_anthy_factory.cpp @@ -0,0 +1,782 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +/* + * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3. + * Copyright (C) 2004 James Su + */ + +#define Uses_SCIM_UTILITY +#define Uses_SCIM_IMENGINE +#define Uses_SCIM_CONFIG_BASE + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include +#include +#include +#include + +#include +#include "scim_anthy_factory.h" +#include "scim_anthy_imengine.h" +#include "scim_anthy_prefs.h" +#include "scim_anthy_intl.h" + +#define scim_module_init ise_engine_anthy_LTX_scim_module_init +#define scim_module_exit ise_engine_anthy_LTX_scim_module_exit +#define scim_imengine_module_init ise_engine_anthy_LTX_scim_imengine_module_init +#define scim_imengine_module_create_factory ise_engine_anthy_LTX_scim_imengine_module_create_factory + +#define SCIM_CONFIG_IMENGINE_ANTHY_UUID "/IMEngine/Anthy/UUID-" + +#ifndef SCIM_ANTHY_ICON_FILE + #define SCIM_ANTHY_ICON_FILE (SCIM_ICONDIR"/scim-anthy.png") +#endif + +static ConfigPointer _scim_config (0); + +extern "C" { + void scim_module_init (void) + { + bindtextdomain (GETTEXT_PACKAGE, SCIM_ANTHY_LOCALEDIR); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + } + + void scim_module_exit (void) + { + anthy_quit (); + _scim_config.reset (); + } + + uint32 scim_imengine_module_init (const ConfigPointer &config) + { + SCIM_DEBUG_IMENGINE(1) << "Initialize Anthy Engine.\n"; + + _scim_config = config; + + if (anthy_init ()) { + SCIM_DEBUG_IMENGINE(1) << "Failed to initialize Anthy Library!\n"; + return 0; + } + + return 1; + } + + IMEngineFactoryPointer scim_imengine_module_create_factory (uint32 engine) + { + AnthyFactory *factory = 0; + + try { + factory = new AnthyFactory ( + String ("ja_JP"), + String ("065d7b20-dda2-47fb-8f94-3306d9a25e56"), + _scim_config); + } catch (...) { + delete factory; + factory = 0; + } + + return factory; + } +} + +AnthyFactory::AnthyFactory (const String &lang, + const String &uuid, + const ConfigPointer &config) + : m_uuid (uuid), + m_config (config), + m_input_mode (SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT), + m_typing_method (SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT), + m_conversion_mode (SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT), + m_period_style (SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT), + m_symbol_style (SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT), + m_space_type (SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT), + m_ten_key_type (SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT), + m_behavior_on_period (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT), + m_behavior_on_focus_out (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT), + m_show_candidates_label (SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT), + m_close_cand_win_on_select (SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT), + m_cand_win_page_size (SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT), + m_n_triggers_to_show_cand_win (SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT), + m_learn_on_manual_commit (SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT), + m_learn_on_auto_commit (SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT), + m_romaji_half_symbol (SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT), + m_romaji_half_number (SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT), + m_romaji_allow_split (SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT), + m_romaji_pseudo_ascii_mode (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT), + m_romaji_pseudo_ascii_blank_behavior (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR), + m_nicola_time (SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT), + m_dict_encoding (SCIM_ANTHY_CONFIG_DICT_ENCODING), + m_dict_admin_command (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT), + m_add_word_command (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT), + m_predict_on_input (SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT), + m_use_direct_key_on_predict (SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT), + m_show_input_mode_label (SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT), + m_show_conv_mode_label (SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT), + m_show_typing_method_label (SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT), + m_show_period_style_label (SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT), + m_show_symbol_style_label (SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT), + m_show_dict_label (SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT), + m_show_dict_admin_label (SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT), + m_show_add_word_label (SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT), + m_preedit_style (SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT), + m_conversion_style (SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT), + m_selected_segment_style (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT), + m_custom_romaji_table (NULL), + m_custom_kana_table (NULL), + m_custom_nicola_table (NULL), + m_kana_layout_ro_key (SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY) +{ + SCIM_DEBUG_IMENGINE(1) << "Create Anthy Factory :\n"; + SCIM_DEBUG_IMENGINE(1) << " Lang : " << lang << "\n"; + SCIM_DEBUG_IMENGINE(1) << " UUID : " << uuid << "\n"; + + if (lang.length () >= 2) + set_languages (lang); + + /* config */ + reload_config (m_config); + m_reload_signal_connection = m_config->signal_connect_reload (slot (this, &AnthyFactory::reload_config)); +} + +AnthyFactory::~AnthyFactory () +{ + m_reload_signal_connection.disconnect (); + + if (m_custom_romaji_table) { + delete m_custom_romaji_table; + m_custom_romaji_table = NULL; + } + + if (m_custom_kana_table) { + delete m_custom_kana_table; + m_custom_kana_table = NULL; + } + + if (m_custom_nicola_table) { + delete m_custom_nicola_table; + m_custom_nicola_table = NULL; + } +} + +WideString +AnthyFactory::get_name () const +{ + return utf8_mbstowcs (String ("Anthy")); +} + +WideString +AnthyFactory::get_authors () const +{ + const char *package = + PACKAGE "-" PACKAGE_VERSION "\n" + "\n"; + const char *authors = + _("Authors of scim-anthy:\n" + " Copyright (C) 2004,2005 Takuro Ashie \n" + " Copyright (C) 2004,2005 Hiroyuki Ikezoe \n" + " \n" + "Authors of Anthy:\n" + " Copyright (C) 2000-2005 Yusuke TABATA \n" + " Copyright (C) 2004-2005 Yuichi YOSHIDA \n" + " You can find out all credits of Anthy from AUTHORS file in Anthy package.\n"); + + return utf8_mbstowcs (package) + utf8_mbstowcs (authors); +} + +WideString +AnthyFactory::get_credits () const +{ + return utf8_mbstowcs ( + _("Art work:\n" + " SHIMODA Hiroshi \n" + "\n" + "Translation:\n" + " Gerrit Sangel " + "\n" + "Special thanks:\n" + " UTUMI Hirosi \n" + " Yukiko Bando \n" + " Mike Fabian \n" + " David Oftedal \n" + " Ryo Dairiki \n" + " Seiichi SATO\n" + " AWASHIRO Ikuya \n" + " Hatuka*nezumi \n" + " Teppei Tamra \n" + " Akira TAGOH \n" + " Tatsuki Sugiura \n" + " Takashi Nakamoto ")); +} + +WideString +AnthyFactory::get_help () const +{ + const char *title = + _("Basic operation:\n" + " \n"); + + const char *text1 = + _("1. Switch input mode:\n" + " You can switch on/off Japanese input mode by pressing Zenkaku_Hankaku key\n" + " or Control+J. Or you can rotate all input modes by pressing Control+,\n" + " (comma).\n" + " \n"); + + const char *text2 = + _("2. Input Japanese hiragana and katakana:\n" + " You can input Japanese hiragana and katakana by inputting romaji.\n" + " The Romaji table can be found out from the \"Anthy\" section of the setup\n" + " window in SCIM or SKIM.\n" + " If you want to hiragana and katakana directly by using Japanese keyboard,\n" + " please press Alt + Romaji key or Conrol+\\ key to switch typing method.\n" + " \n"); + + const char *text3 = + _("3. Convert hiragana or katakana to Japanese kanji\n" + " After inputting hiragana or katakana, you can convert it to Japanese\n" + " kanji by pressing Space key. Then it will show some candidates. You can\n" + " select the next candidate by pressing Space key, and can commit it by\n" + " pressing Enter key.\n" + " If you input a sentense, Anthy will split it to some segments. You can\n" + " select the next or previous segment by pressing left or right cursor key,\n" + " and can extend or shrink the selected segment by pressing Shift + left or\n" + " right cursor key.\n" + " \n"); + + const char *text4 = + _("4. Other key bindings:\n" + " You can find out all key bindings definition of scim-anthy from \"Anthy\"\n" + " section on setup window of SCIM or SKIM.\n"); + + return utf8_mbstowcs (title) + + utf8_mbstowcs (text1) + + utf8_mbstowcs (text2) + + utf8_mbstowcs (text3) + + utf8_mbstowcs (text4); +} + +String +AnthyFactory::get_uuid () const +{ + return m_uuid; +} + +String +AnthyFactory::get_icon_file () const +{ + return String (SCIM_ANTHY_ICON_FILE); +} + +IMEngineInstancePointer +AnthyFactory::create_instance (const String &encoding, int id) +{ + return new AnthyInstance (this, encoding, id); +} + +void +AnthyFactory::append_config_listener (AnthyInstance *listener) +{ + bool found = false; + std::vector::iterator it; + for (it = m_config_listeners.begin(); + it != m_config_listeners.end(); + it++) + { + if (*it == listener) { + found = true; + break; + } + } + + if (!found) + m_config_listeners.push_back (listener); +} + +void +AnthyFactory::remove_config_listener (AnthyInstance *listener) +{ + std::vector::iterator it; + for (it = m_config_listeners.begin(); + it != m_config_listeners.end(); + it++) + { + if (*it == listener) { + m_config_listeners.erase (it); + break; + } + } +} + + +#if 0 +#define APPEND_ACTION(key, func) \ +{ \ + String name = "func", str; \ + str = config->read (String (SCIM_ANTHY_CONFIG_##key##_KEY), \ + String (SCIM_ANTHY_CONFIG_##key##_KEY_DEFAULT)); \ + m_actions.push_back (Action (name, str, &AnthyInstance::func)); \ +} +#else +#define APPEND_ACTION(key, func) \ +{ \ + String name = #key, str; \ + if (loaded) { \ + String str2, str3; \ + str2 = String (SCIM_ANTHY_CONFIG_##key##_KEY); \ + str3 = String ("/IMEngine/Anthy/"); \ + if (str2.length () > str3.length ()) { \ + str2 = str2.substr (str3.length (), \ + str2.length () - str3.length ()); \ + style.get_string (str, section_key, str2); \ + } \ + } else if (config) { \ + str = config->read (String (SCIM_ANTHY_CONFIG_##key##_KEY), \ + String (SCIM_ANTHY_CONFIG_##key##_KEY_DEFAULT)); \ + } \ + m_actions.push_back (Action (name, str, func)); \ +} +#endif + +// FIXME +#define ANTHY_DEFINE_ACTION(func) \ +static bool \ +func (AnthyInstance *anthy) \ +{ \ + return anthy->func (); \ +} + +ANTHY_DEFINE_ACTION (action_do_nothing); +ANTHY_DEFINE_ACTION (action_commit_follow_preference); +ANTHY_DEFINE_ACTION (action_commit_reverse_preference); +ANTHY_DEFINE_ACTION (action_convert); +ANTHY_DEFINE_ACTION (action_predict); +ANTHY_DEFINE_ACTION (action_revert); +ANTHY_DEFINE_ACTION (action_cancel_all); +ANTHY_DEFINE_ACTION (action_back); +ANTHY_DEFINE_ACTION (action_delete); +ANTHY_DEFINE_ACTION (action_insert_space); +ANTHY_DEFINE_ACTION (action_insert_alternative_space); +ANTHY_DEFINE_ACTION (action_insert_half_space); +ANTHY_DEFINE_ACTION (action_insert_wide_space); +ANTHY_DEFINE_ACTION (action_move_caret_first); +ANTHY_DEFINE_ACTION (action_move_caret_last); +ANTHY_DEFINE_ACTION (action_move_caret_forward); +ANTHY_DEFINE_ACTION (action_move_caret_backward); +ANTHY_DEFINE_ACTION (action_select_first_segment); +ANTHY_DEFINE_ACTION (action_select_last_segment); +ANTHY_DEFINE_ACTION (action_select_next_segment); +ANTHY_DEFINE_ACTION (action_select_prev_segment); +ANTHY_DEFINE_ACTION (action_shrink_segment); +ANTHY_DEFINE_ACTION (action_expand_segment); +ANTHY_DEFINE_ACTION (action_commit_first_segment); +ANTHY_DEFINE_ACTION (action_commit_selected_segment); +ANTHY_DEFINE_ACTION (action_commit_first_segment_reverse_preference); +ANTHY_DEFINE_ACTION (action_commit_selected_segment_reverse_preference); +ANTHY_DEFINE_ACTION (action_select_first_candidate); +ANTHY_DEFINE_ACTION (action_select_last_candidate); +ANTHY_DEFINE_ACTION (action_select_next_candidate); +ANTHY_DEFINE_ACTION (action_select_prev_candidate); +ANTHY_DEFINE_ACTION (action_candidates_page_up); +ANTHY_DEFINE_ACTION (action_candidates_page_down); +ANTHY_DEFINE_ACTION (action_select_candidate_1); +ANTHY_DEFINE_ACTION (action_select_candidate_2); +ANTHY_DEFINE_ACTION (action_select_candidate_3); +ANTHY_DEFINE_ACTION (action_select_candidate_4); +ANTHY_DEFINE_ACTION (action_select_candidate_5); +ANTHY_DEFINE_ACTION (action_select_candidate_6); +ANTHY_DEFINE_ACTION (action_select_candidate_7); +ANTHY_DEFINE_ACTION (action_select_candidate_8); +ANTHY_DEFINE_ACTION (action_select_candidate_9); +ANTHY_DEFINE_ACTION (action_select_candidate_10); +ANTHY_DEFINE_ACTION (action_convert_char_type_forward); +ANTHY_DEFINE_ACTION (action_convert_char_type_backward); +ANTHY_DEFINE_ACTION (action_convert_to_hiragana); +ANTHY_DEFINE_ACTION (action_convert_to_katakana); +ANTHY_DEFINE_ACTION (action_convert_to_half); +ANTHY_DEFINE_ACTION (action_convert_to_half_katakana); +ANTHY_DEFINE_ACTION (action_convert_to_latin); +ANTHY_DEFINE_ACTION (action_convert_to_wide_latin); +ANTHY_DEFINE_ACTION (action_reconvert); +ANTHY_DEFINE_ACTION (action_on_off); +ANTHY_DEFINE_ACTION (action_circle_input_mode); +ANTHY_DEFINE_ACTION (action_circle_kana_mode); +ANTHY_DEFINE_ACTION (action_circle_typing_method); +ANTHY_DEFINE_ACTION (action_latin_mode); +ANTHY_DEFINE_ACTION (action_wide_latin_mode); +ANTHY_DEFINE_ACTION (action_hiragana_mode); +ANTHY_DEFINE_ACTION (action_katakana_mode); +ANTHY_DEFINE_ACTION (action_half_katakana_mode); +ANTHY_DEFINE_ACTION (action_cancel_pseudo_ascii_mode); +ANTHY_DEFINE_ACTION (action_launch_dict_admin_tool); +ANTHY_DEFINE_ACTION (action_add_word); + +void +AnthyFactory::reload_config (const ConfigPointer &config) +{ + if (config) { + String str; + + m_input_mode + = config->read (String (SCIM_ANTHY_CONFIG_INPUT_MODE), + String (SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT)); + + m_typing_method + = config->read (String (SCIM_ANTHY_CONFIG_TYPING_METHOD), + String (SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT)); + + m_conversion_mode + = config->read (String (SCIM_ANTHY_CONFIG_CONVERSION_MODE), + String (SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT)); + + m_period_style + = config->read (String (SCIM_ANTHY_CONFIG_PERIOD_STYLE), + String (SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT)); + + m_symbol_style + = config->read (String (SCIM_ANTHY_CONFIG_SYMBOL_STYLE), + String (SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT)); + + m_space_type + = config->read (String (SCIM_ANTHY_CONFIG_SPACE_TYPE), + String (SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT)); + + m_ten_key_type + = config->read (String (SCIM_ANTHY_CONFIG_TEN_KEY_TYPE), + String (SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT)); + + m_behavior_on_period + = config->read (String (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD), + String (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT)); + + m_behavior_on_focus_out + = config->read (String (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT), + String (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT)); + + m_cand_win_page_size + = config->read (String (SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE), + SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT); + + m_show_candidates_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL), + SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT); + + m_close_cand_win_on_select + = config->read (String (SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT), + SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT); + + m_n_triggers_to_show_cand_win + = config->read (String (SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN), + SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT); + + m_learn_on_manual_commit + = config->read (String (SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT), + SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT); + + m_learn_on_auto_commit + = config->read (String (SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT), + SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT); + + m_romaji_half_symbol + = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL), + SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT); + + m_romaji_half_number + = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER), + SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT); + + m_romaji_allow_split + = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT), + SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT); + + m_romaji_pseudo_ascii_mode + = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE), + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT); + + m_romaji_pseudo_ascii_blank_behavior + = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR), + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT); + + m_nicola_time + = config->read (String (SCIM_ANTHY_CONFIG_NICOLA_TIME), + SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT); + + str = config->read (String (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY), + String (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY_DEFAULT)); + scim_string_to_key_list (m_left_thumb_keys, str); + + str = config->read (String (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY), + String (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY_DEFAULT)); + scim_string_to_key_list (m_right_thumb_keys, str); + + + m_dict_encoding + = config->read (String (SCIM_ANTHY_CONFIG_DICT_ENCODING), + String (SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT)); + + m_dict_admin_command + = config->read (String (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND), + String (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT)); + + m_add_word_command + = config->read (String (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND), + String (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT)); + + m_predict_on_input + = config->read (String (SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT), + SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT); + + m_use_direct_key_on_predict + = config->read (String (SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT), + SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT); + + m_show_input_mode_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL), + SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT); + + m_show_conv_mode_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL), + SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL_DEFAULT); + + m_show_typing_method_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL), + SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT); + + m_show_period_style_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL), + SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT); + + m_show_symbol_style_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL), + SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT); + + m_show_dict_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL), + SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT); + + m_show_dict_admin_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL), + SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT); + + m_show_add_word_label + = config->read (String (SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL), + SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT); + + // color settings + int red, green, blue; + + // preedit string color + m_preedit_style + = config->read (String (SCIM_ANTHY_CONFIG_PREEDIT_STYLE), + String (SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT)); + str = config->read (String (SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR), + String (SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR_DEFAULT)); + sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue); + m_preedit_fg_color = SCIM_RGB_COLOR (red, green, blue); + + str = config->read (String (SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR), + String (SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR_DEFAULT)); + sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue); + m_preedit_bg_color = SCIM_RGB_COLOR (red, green, blue); + + // conversion string color + m_conversion_style + = config->read (String (SCIM_ANTHY_CONFIG_CONVERSION_STYLE), + String (SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT)); + str = config->read (String (SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR), + String (SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR_DEFAULT)); + sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue); + m_conversion_fg_color = SCIM_RGB_COLOR (red, green, blue); + + str = config->read (String (SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR), + String (SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR_DEFAULT)); + sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue); + m_conversion_bg_color = SCIM_RGB_COLOR (red, green, blue); + + // selected segment color + m_selected_segment_style + = config->read (String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE), + String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT)); + str = config->read (String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR), + String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR_DEFAULT)); + sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue); + m_selected_segment_fg_color = SCIM_RGB_COLOR (red, green, blue); + + str = config->read (String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR), + String (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR_DEFAULT)); + sscanf (str.c_str (), "#%02X%02X%02X", &red, &green, &blue); + m_selected_segment_bg_color = SCIM_RGB_COLOR (red, green, blue); + } + + StyleFile style; + String file; + bool loaded = false; + + // load key bindings + const char *section_key = "KeyBindings"; + file = config->read (String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE), + String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT)); + loaded = style.load (file.c_str ()); + + // clear old actions + m_actions.clear (); + + // convert key + APPEND_ACTION (CONVERT, action_convert); + APPEND_ACTION (PREDICT, action_predict); + + // candidates keys + APPEND_ACTION (CANDIDATES_PAGE_UP, action_candidates_page_up); + APPEND_ACTION (CANDIDATES_PAGE_DOWN, action_candidates_page_down); + APPEND_ACTION (SELECT_CANDIDATE_1, action_select_candidate_1); + APPEND_ACTION (SELECT_CANDIDATE_2, action_select_candidate_2); + APPEND_ACTION (SELECT_CANDIDATE_3, action_select_candidate_3); + APPEND_ACTION (SELECT_CANDIDATE_4, action_select_candidate_4); + APPEND_ACTION (SELECT_CANDIDATE_5, action_select_candidate_5); + APPEND_ACTION (SELECT_CANDIDATE_6, action_select_candidate_6); + APPEND_ACTION (SELECT_CANDIDATE_7, action_select_candidate_7); + APPEND_ACTION (SELECT_CANDIDATE_8, action_select_candidate_8); + APPEND_ACTION (SELECT_CANDIDATE_9, action_select_candidate_9); + APPEND_ACTION (SELECT_CANDIDATE_10, action_select_candidate_10); + APPEND_ACTION (SELECT_FIRST_CANDIDATE, action_select_first_candidate); + APPEND_ACTION (SELECT_LAST_CANDIDATE, action_select_last_candidate); + APPEND_ACTION (SELECT_NEXT_CANDIDATE, action_select_next_candidate); + APPEND_ACTION (SELECT_PREV_CANDIDATE, action_select_prev_candidate); + + // segment keys + APPEND_ACTION (SELECT_FIRST_SEGMENT, action_select_first_segment); + APPEND_ACTION (SELECT_LAST_SEGMENT, action_select_last_segment); + APPEND_ACTION (SELECT_NEXT_SEGMENT, action_select_next_segment); + APPEND_ACTION (SELECT_PREV_SEGMENT, action_select_prev_segment); + APPEND_ACTION (SHRINK_SEGMENT, action_shrink_segment); + APPEND_ACTION (EXPAND_SEGMENT, action_expand_segment); + APPEND_ACTION (COMMIT_FIRST_SEGMENT, action_commit_first_segment); + APPEND_ACTION (COMMIT_SELECTED_SEGMENT, action_commit_selected_segment); + APPEND_ACTION (COMMIT_FIRST_SEGMENT_REVERSE_LEARN, + action_commit_first_segment_reverse_preference); + APPEND_ACTION (COMMIT_SELECTED_SEGMENT_REVERSE_LEARN, + action_commit_selected_segment_reverse_preference); + + // direct convert keys + APPEND_ACTION (CONV_CHAR_TYPE_FORWARD, action_convert_char_type_forward); + APPEND_ACTION (CONV_CHAR_TYPE_BACKWARD, action_convert_char_type_backward); + APPEND_ACTION (CONV_TO_HIRAGANA, action_convert_to_hiragana); + APPEND_ACTION (CONV_TO_KATAKANA, action_convert_to_katakana); + APPEND_ACTION (CONV_TO_HALF, action_convert_to_half); + APPEND_ACTION (CONV_TO_HALF_KATAKANA, action_convert_to_half_katakana); + APPEND_ACTION (CONV_TO_LATIN, action_convert_to_latin); + APPEND_ACTION (CONV_TO_WIDE_LATIN, action_convert_to_wide_latin); + + // pseudo ascii mode + APPEND_ACTION (CANCEL_PSEUDO_ASCII_MODE,action_cancel_pseudo_ascii_mode); + + // caret keys + APPEND_ACTION (MOVE_CARET_FIRST, action_move_caret_first); + APPEND_ACTION (MOVE_CARET_LAST, action_move_caret_last); + APPEND_ACTION (MOVE_CARET_FORWARD, action_move_caret_forward); + APPEND_ACTION (MOVE_CARET_BACKWARD, action_move_caret_backward); + + // edit keys + APPEND_ACTION (BACKSPACE, action_back); + APPEND_ACTION (DELETE, action_delete); + APPEND_ACTION (COMMIT, action_commit_follow_preference); + APPEND_ACTION (COMMIT_REVERSE_LEARN, action_commit_reverse_preference); + APPEND_ACTION (CANCEL, action_revert); + APPEND_ACTION (CANCEL_ALL, action_cancel_all); + APPEND_ACTION (INSERT_SPACE, action_insert_space); + APPEND_ACTION (INSERT_ALT_SPACE, action_insert_alternative_space); + APPEND_ACTION (INSERT_HALF_SPACE, action_insert_half_space); + APPEND_ACTION (INSERT_WIDE_SPACE, action_insert_wide_space); + + // mode keys + APPEND_ACTION (ON_OFF, action_on_off); + APPEND_ACTION (CIRCLE_INPUT_MODE, action_circle_input_mode); + APPEND_ACTION (CIRCLE_KANA_MODE, action_circle_kana_mode); + APPEND_ACTION (CIRCLE_TYPING_METHOD, action_circle_typing_method); + APPEND_ACTION (LATIN_MODE, action_latin_mode); + APPEND_ACTION (WIDE_LATIN_MODE, action_wide_latin_mode); + APPEND_ACTION (HIRAGANA_MODE, action_hiragana_mode); + APPEND_ACTION (KATAKANA_MODE, action_katakana_mode); + APPEND_ACTION (HALF_KATAKANA_MODE, action_half_katakana_mode); + + // dict keys + APPEND_ACTION (DICT_ADMIN, action_launch_dict_admin_tool); + APPEND_ACTION (ADD_WORD, action_add_word); + + // reconvert + APPEND_ACTION (RECONVERT, action_reconvert); + + // disabled key + APPEND_ACTION (DO_NOTHING, action_do_nothing); + + // load custom romaji table + const char *section_romaji = "RomajiTable/FundamentalTable"; + file = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE), + String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT)); + if (m_custom_romaji_table) { + delete m_custom_romaji_table; + m_custom_romaji_table = NULL; + } + if (!file.empty() && style.load (file.c_str ())) { + m_custom_romaji_table = style.get_key2kana_table (section_romaji); + } + + // load custom kana table + const char *section_kana = "KanaTable/FundamentalTable"; + file = config->read (String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE), + String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE_DEFAULT)); + if (m_custom_kana_table) { + delete m_custom_kana_table; + m_custom_kana_table = NULL; + } + if (!file.empty () && style.load (file.c_str ())) { + m_custom_kana_table = style.get_key2kana_table (section_kana); + } + + // load custom NICOLA table + const char *section_nicola = "NICOLATable/FundamentalTable"; + file = config->read (String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE), + String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE_DEFAULT)); + if (m_custom_nicola_table) { + delete m_custom_nicola_table; + m_custom_nicola_table = NULL; + } + if (!file.empty () && style.load (file.c_str ())) { + m_custom_nicola_table = style.get_key2kana_table (section_nicola); + } + + // special kana keys + m_kana_layout_ro_key + = config->read (String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY), + String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY_DEFAULT)); + + + // reload config for all instance + std::vector::iterator it; + for (it = m_config_listeners.begin(); + it != m_config_listeners.end(); + it++) + { + (*it)->reload_config (config); + } +} diff --git a/src/scim_anthy_factory.h b/src/scim_anthy_factory.h new file mode 100755 index 0000000..bbe6e65 --- /dev/null +++ b/src/scim_anthy_factory.h @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +/* + * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3. + * Copyright (C) 2004 James Su + */ + +#ifndef __SCIM_ANTHY_FACTORY_H__ +#define __SCIM_ANTHY_FACTORY_H__ + +#define Uses_SCIM_IMENGINE +#define Uses_SCIM_CONFIG_BASE +#include +#include +#include "scim_anthy_action.h" +#include "scim_anthy_style_file.h" +#include "scim_anthy_key2kana_table.h" + +using namespace scim; +using namespace scim_anthy; + +class AnthyFactory : public IMEngineFactoryBase +{ +public: + AnthyFactory (const String &lang, + const String &uuid, + const ConfigPointer &config); + virtual ~AnthyFactory (); + + virtual WideString get_name () const; + virtual WideString get_authors () const; + virtual WideString get_credits () const; + virtual WideString get_help () const; + virtual String get_uuid () const; + virtual String get_icon_file () const; + + virtual IMEngineInstancePointer create_instance (const String& encoding, + int id = -1); + + virtual void append_config_listener (AnthyInstance *listener); + virtual void remove_config_listener (AnthyInstance *listener); + +private: + void reload_config (const ConfigPointer &config); + +private: + String m_uuid; + Connection m_reload_signal_connection; + std::vector m_config_listeners; + +public: + /* config */ + ConfigPointer m_config; + + /* for preferece */ + String m_input_mode; + String m_typing_method; + String m_conversion_mode; + String m_period_style; + String m_symbol_style; + String m_space_type; + String m_ten_key_type; + String m_behavior_on_period; + String m_behavior_on_focus_out; + + bool m_show_candidates_label; + bool m_close_cand_win_on_select; + int m_cand_win_page_size; + int m_n_triggers_to_show_cand_win; + + bool m_learn_on_manual_commit; + bool m_learn_on_auto_commit; + + bool m_romaji_half_symbol; + bool m_romaji_half_number; + bool m_romaji_allow_split; + + bool m_romaji_pseudo_ascii_mode; + bool m_romaji_pseudo_ascii_blank_behavior; + + int m_nicola_time; + KeyEventList m_left_thumb_keys; + KeyEventList m_right_thumb_keys; + + String m_dict_encoding; + String m_dict_admin_command; + String m_add_word_command; + + bool m_predict_on_input; + bool m_use_direct_key_on_predict; + + bool m_show_input_mode_label; + bool m_show_conv_mode_label; + bool m_show_typing_method_label; + bool m_show_period_style_label; + bool m_show_symbol_style_label; + bool m_show_dict_label; + bool m_show_dict_admin_label; + bool m_show_add_word_label; + + String m_preedit_style; + unsigned int m_preedit_fg_color; + unsigned int m_preedit_bg_color; + String m_conversion_style; + unsigned int m_conversion_fg_color; + unsigned int m_conversion_bg_color; + String m_selected_segment_style; + unsigned int m_selected_segment_fg_color; + unsigned int m_selected_segment_bg_color; + + Key2KanaTable *m_custom_romaji_table; + Key2KanaTable *m_custom_kana_table; + Key2KanaTable *m_custom_nicola_table; + + String m_kana_layout_ro_key; + + /* for key bindings */ + std::vector m_actions; +}; + +#endif /* __SCIM_ANTHY_FACTORY_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_helper.cpp b/src/scim_anthy_helper.cpp new file mode 100755 index 0000000..a0c0d30 --- /dev/null +++ b/src/scim_anthy_helper.cpp @@ -0,0 +1,270 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#define Uses_SCIM_HELPER +#define Uses_SCIM_CONFIG_BASE +#include +#include +#include +#include "scim_anthy_intl.h" +#include "scim_anthy_helper.h" + +using namespace scim; + +#define scim_module_init anthy_imengine_helper_LTX_scim_module_init +#define scim_module_exit anthy_imengine_helper_LTX_scim_module_exit +#define scim_helper_module_number_of_helpers anthy_imengine_helper_LTX_scim_helper_module_number_of_helpers +#define scim_helper_module_get_helper_info anthy_imengine_helper_LTX_scim_helper_module_get_helper_info +#define scim_helper_module_run_helper anthy_imengine_helper_LTX_scim_helper_module_run_helper + +static gboolean helper_agent_input_handler (GIOChannel *source, + GIOCondition condition, + gpointer user_data); +static void slot_imengine_event (const HelperAgent *agent, + int ic, + const String &uuid, + const Transaction &trans); +static gint timeout_func (gpointer data); +static void timeout_ctx_destroy_func (gpointer data); + +static void run (const String &display, + const ConfigPointer &config); + +HelperAgent helper_agent; + +HelperInfo helper_info (SCIM_ANTHY_HELPER_UUID, // uuid + "", // name + "", // icon + "", + SCIM_HELPER_NEED_SCREEN_INFO); + +class TimeoutContext { +public: + TimeoutContext (int ic, const String &uuid, uint32 id) + : m_ic (ic), + m_uuid (uuid), + m_id (id) + {} + virtual ~TimeoutContext () {} +public: + int m_ic; + String m_uuid; + uint32 m_id; +}; +typedef std::map TimeoutIDList; +std::map timeout_ids; + + +//Module Interface +extern "C" { + void scim_module_init (void) + { + bindtextdomain (GETTEXT_PACKAGE, SCIM_ANTHY_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + + helper_info.name = String (_("Anthy helper")); + helper_info.description = String ( + _("A helper module for Anthy IMEngine.")); + } + + void scim_module_exit (void) + { + } + + unsigned int scim_helper_module_number_of_helpers (void) + { + return 1; + } + + bool scim_helper_module_get_helper_info (unsigned int idx, HelperInfo &info) + { + if (idx == 0) { + info = helper_info; + return true; + } + return false; + } + + void scim_helper_module_run_helper (const String &uuid, + const ConfigPointer &config, + const String &display) + { + SCIM_DEBUG_MAIN(1) << "anthy_imengine_helper_LTX_scim_helper_module_run_helper ()\n"; + + if (uuid == String (SCIM_ANTHY_HELPER_UUID)) { + run (display, config); + } + + SCIM_DEBUG_MAIN(1) << "exit anthy_imengine_helper_LTX_scim_helper_module_run_helper ()\n"; + } +} + + +static gboolean +helper_agent_input_handler (GIOChannel *source, + GIOCondition condition, + gpointer user_data) +{ + if (condition == G_IO_IN) { + HelperAgent *agent = static_cast (user_data); + if (agent && agent->has_pending_event ()) + agent->filter_event (); + } else if (condition == G_IO_ERR || condition == G_IO_HUP) { + gtk_main_quit (); + } + return TRUE; +} + +static void +slot_exit (const HelperAgent *agent, int ic, const String &uuid) +{ + gtk_main_quit (); +} + +static void +slot_imengine_event (const HelperAgent *agent, int ic, + const String &uuid, const Transaction &recv) +{ + TransactionReader reader (recv); + int cmd; + + if (!reader.get_command (cmd)) + return; + + switch (cmd) { + case SCIM_ANTHY_TRANS_CMD_GET_SELECTION: + { + GtkClipboard *primary_selection; + WideString selection; + + primary_selection = gtk_clipboard_get (GDK_SELECTION_PRIMARY); + if (primary_selection) { + gchar *text = gtk_clipboard_wait_for_text (primary_selection); + if (text) { + selection = utf8_mbstowcs (text); + g_free (text); + } + } + + Transaction send; + send.put_command (SCIM_ANTHY_TRANS_CMD_GET_SELECTION); + send.put_data (selection); + helper_agent.send_imengine_event (ic, uuid, send); + + break; + } + case SCIM_ANTHY_TRANS_CMD_TIMEOUT_ADD: + { + uint32 id, time_msec; + if (!reader.get_data (id) || !reader.get_data (time_msec)) + break; + TimeoutContext *ctx = new TimeoutContext (ic, uuid, id); + guint timeout_id = gtk_timeout_add_full (time_msec, + timeout_func, + NULL, + (gpointer) ctx, + timeout_ctx_destroy_func); + timeout_ids[ic][id] = timeout_id; + break; + } + case SCIM_ANTHY_TRANS_CMD_TIMEOUT_REMOVE: + { + uint32 id; + if (reader.get_data (id) && + timeout_ids.find (ic) != timeout_ids.end () && + timeout_ids[ic].find (id) != timeout_ids[ic].end ()) + { + guint tid = timeout_ids[ic][id]; + gtk_timeout_remove (tid); + } + break; + } + default: + break; + } +} + +static gint +timeout_func (gpointer data) +{ + TimeoutContext *ctx = static_cast (data); + + Transaction send; + send.put_command (SCIM_ANTHY_TRANS_CMD_TIMEOUT_NOTIFY); + send.put_data (ctx->m_id); + helper_agent.send_imengine_event (ctx->m_ic, ctx->m_uuid, send); + + return FALSE; +} + +static void +timeout_ctx_destroy_func (gpointer data) +{ + TimeoutContext *ctx = static_cast (data); + int ic = ctx->m_ic; + uint32 id = ctx->m_id; + + if (timeout_ids.find (ic) != timeout_ids.end () && + timeout_ids[ic].find (id) != timeout_ids[ic].end ()) + { + timeout_ids[ic].erase (id); + } + delete ctx; +} + +static void +run (const String &display, const ConfigPointer &config) +{ + char **argv = new char * [4]; + int argc = 3; + + argv [0] = "anthy-imengine-helper"; + argv [1] = "--display"; + argv [2] = const_cast (display.c_str ()); + argv [3] = 0; + + setenv ("DISPLAY", display.c_str (), 1); + + gtk_init (&argc, &argv); + + helper_agent.signal_connect_exit (slot (slot_exit)); + helper_agent.signal_connect_process_imengine_event (slot (slot_imengine_event)); + + // open connection + int fd = helper_agent.open_connection (helper_info, display); + GIOChannel *ch = g_io_channel_unix_new (fd); + + if (fd >= 0 && ch) { + g_io_add_watch (ch, G_IO_IN, + helper_agent_input_handler, + (gpointer) &helper_agent); + g_io_add_watch (ch, G_IO_ERR, + helper_agent_input_handler, + (gpointer) &helper_agent); + g_io_add_watch (ch, G_IO_HUP, + helper_agent_input_handler, + (gpointer) &helper_agent); + } + + gtk_main (); + + // close connection + helper_agent.close_connection (); + fd = -1; +} diff --git a/src/scim_anthy_helper.h b/src/scim_anthy_helper.h new file mode 100755 index 0000000..9af9dd3 --- /dev/null +++ b/src/scim_anthy_helper.h @@ -0,0 +1,34 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_HELPER_H__ +#define __SCIM_ANTHY_HELPER_H__ + +#include + +#define SCIM_ANTHY_HELPER_UUID "24a65e2b-10a8-4d4c-adc9-266678cb1a38" + +#define SCIM_ANTHY_TRANS_CMD_NEW_IC SCIM_TRANS_CMD_USER_DEFINED + 1 +#define SCIM_ANTHY_TRANS_CMD_DELETE_IC SCIM_TRANS_CMD_USER_DEFINED + 2 +#define SCIM_ANTHY_TRANS_CMD_GET_SELECTION SCIM_TRANS_CMD_USER_DEFINED + 3 +#define SCIM_ANTHY_TRANS_CMD_TIMEOUT_ADD SCIM_TRANS_CMD_USER_DEFINED + 4 +#define SCIM_ANTHY_TRANS_CMD_TIMEOUT_REMOVE SCIM_TRANS_CMD_USER_DEFINED + 5 +#define SCIM_ANTHY_TRANS_CMD_TIMEOUT_NOTIFY SCIM_TRANS_CMD_USER_DEFINED + 6 + +#endif /* __SCIM_ANTHY_HELPER_H__ */ diff --git a/src/scim_anthy_imengine.cpp b/src/scim_anthy_imengine.cpp new file mode 100755 index 0000000..666b67c --- /dev/null +++ b/src/scim_anthy_imengine.cpp @@ -0,0 +1,2385 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 - 2005 Hiroyuki Ikezoe + * Copyright (C) 2004 - 2005 Takuro Ashie + * + * 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. + */ + +/* + * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3. + * Copyright (C) 2004 James Su + */ + +#define Uses_SCIM_UTILITY +#define Uses_SCIM_IMENGINE +#define Uses_SCIM_LOOKUP_TABLE +#define Uses_SCIM_CONFIG_BASE + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include +#include +#include + +#include +#include "scim_anthy_factory.h" +#include "scim_anthy_imengine.h" +#include "scim_anthy_prefs.h" +#include "scim_anthy_intl.h" +#include "scim_anthy_utils.h" +#include "scim_anthy_helper.h" + +#define SCIM_PROP_PREFIX "/IMEngine/Anthy" +#define SCIM_PROP_INPUT_MODE "/IMEngine/Anthy/InputMode" +#define SCIM_PROP_INPUT_MODE_HIRAGANA "/IMEngine/Anthy/InputMode/Hiragana" +#define SCIM_PROP_INPUT_MODE_KATAKANA "/IMEngine/Anthy/InputMode/Katakana" +#define SCIM_PROP_INPUT_MODE_HALF_KATAKANA "/IMEngine/Anthy/InputMode/HalfKatakana" +#define SCIM_PROP_INPUT_MODE_LATIN "/IMEngine/Anthy/InputMode/Latin" +#define SCIM_PROP_INPUT_MODE_WIDE_LATIN "/IMEngine/Anthy/InputMode/WideLatin" + +#define SCIM_PROP_CONV_MODE "/IMEngine/Anthy/ConvMode" +#define SCIM_PROP_CONV_MODE_MULTI_SEG "/IMEngine/Anthy/ConvMode/MultiSegment" +#define SCIM_PROP_CONV_MODE_SINGLE_SEG "/IMEngine/Anthy/ConvMode/SingleSegment" +#define SCIM_PROP_CONV_MODE_MULTI_REAL_TIME "/IMEngine/Anthy/ConvMode/MultiRealTime" +#define SCIM_PROP_CONV_MODE_SINGLE_REAL_TIME "/IMEngine/Anthy/ConvMode/SingleRealTime" + +#define SCIM_PROP_TYPING_METHOD "/IMEngine/Anthy/TypingMethod" +#define SCIM_PROP_TYPING_METHOD_ROMAJI "/IMEngine/Anthy/TypingMethod/RomaKana" +#define SCIM_PROP_TYPING_METHOD_KANA "/IMEngine/Anthy/TypingMethod/Kana" +#define SCIM_PROP_TYPING_METHOD_NICOLA "/IMEngine/Anthy/TypingMethod/NICOLA" + +#define SCIM_PROP_PERIOD_STYLE "/IMEngine/Anthy/PeriodType" +#define SCIM_PROP_PERIOD_STYLE_JAPANESE "/IMEngine/Anthy/PeriodType/Japanese" +#define SCIM_PROP_PERIOD_STYLE_WIDE_LATIN "/IMEngine/Anthy/PeriodType/WideRatin" +#define SCIM_PROP_PERIOD_STYLE_LATIN "/IMEngine/Anthy/PeriodType/Ratin" +#define SCIM_PROP_PERIOD_STYLE_WIDE_LATIN_JAPANESE \ + "/IMEngine/Anthy/PeriodType/WideRatin_Japanese" + +#define SCIM_PROP_SYMBOL_STYLE "/IMEngine/Anthy/SymbolType" +#define SCIM_PROP_SYMBOL_STYLE_JAPANESE "/IMEngine/Anthy/SymbolType/Japanese" +#define SCIM_PROP_SYMBOL_STYLE_BRACKET_SLASH "/IMEngine/Anthy/SymbolType/WideBracket_WideSlash" +#define SCIM_PROP_SYMBOL_STYLE_CORNER_BRACKET_SLASH \ + "/IMEngine/Anthy/SymbolType/CornerBracket_WideSlash" +#define SCIM_PROP_SYMBOL_STYLE_BRACKET_MIDDLE_DOT \ + "/IMEngine/Anthy/SymbolType/WideBracket_MiddleDot" + +#define SCIM_PROP_DICT "/IMEngine/Anthy/Dictionary" +#define SCIM_PROP_DICT_ADD_WORD "/IMEngine/Anthy/Dictionary/AddWord" +#define SCIM_PROP_DICT_LAUNCH_ADMIN_TOOL "/IMEngine/Anthy/Dictionary/LaunchAdminTool" + +#define UTF8_BRACKET_CORNER_BEGIN "\xE3\x80\x8C" +#define UTF8_BRACKET_CORNER_END "\xE3\x80\x8D" +#define UTF8_BRACKET_WIDE_BEGIN "\xEF\xBC\xBB" +#define UTF8_BRACKET_WIDE_END "\xEF\xBC\xBD" +#define UTF8_MIDDLE_DOT "\xE3\x83\xBB" +#define UTF8_SLASH_WIDE "\xEF\xBC\x8F" + +AnthyInstance::AnthyInstance (AnthyFactory *factory, + const String &encoding, + int id) + : IMEngineInstanceBase (factory, encoding, id), + m_factory (factory), + m_on_init (true), + m_preedit (*this), + m_preedit_string_visible (false), + m_lookup_table_visible (false), + m_n_conv_key_pressed (0), + m_prev_input_mode (SCIM_ANTHY_MODE_HIRAGANA), + m_conv_mode (SCIM_ANTHY_CONVERSION_MULTI_SEGMENT), + m_helper_started (false), + m_timeout_id_seq (0) +{ + SCIM_DEBUG_IMENGINE(1) << "Create Anthy Instance : "; + + reload_config (m_factory->m_config); + m_factory->append_config_listener (this); + m_on_init = false; +} + +AnthyInstance::~AnthyInstance () +{ + if (m_helper_started) + stop_helper (String (SCIM_ANTHY_HELPER_UUID)); + + m_factory->remove_config_listener (this); +} + +// FIXME! +bool +AnthyInstance::is_nicola_thumb_shift_key (const KeyEvent &key) +{ + if (get_typing_method () != SCIM_ANTHY_TYPING_METHOD_NICOLA) + return false; + + if (util_match_key_event (m_factory->m_left_thumb_keys, key, 0xFFFF) || + util_match_key_event (m_factory->m_right_thumb_keys, key, 0xFFFF)) + { + return true; + } + + return false; +} + +bool +AnthyInstance::process_key_event_input (const KeyEvent &key) +{ + // prediction while typing + if (m_factory->m_predict_on_input && key.is_key_release () && + m_preedit.is_preediting () && !m_preedit.is_converting ()) + { + CommonLookupTable table; + m_preedit.predict (); + m_preedit.get_candidates (table); + if (table.number_of_candidates () > 0) { + table.show_cursor (false); + update_lookup_table (table); + show_lookup_table (); + } else { + hide_lookup_table (); + } + } + + if (!m_preedit.can_process_key_event (key)) { + return false; + } + + if (m_preedit.is_converting ()) { + if (is_realtime_conversion ()) { + action_revert (); + } else if (!is_nicola_thumb_shift_key (key)) { + action_commit (m_factory->m_learn_on_auto_commit); + } + } + + bool need_commit = m_preedit.process_key_event (key); + + if (need_commit) { + if (is_realtime_conversion () && + get_input_mode () != SCIM_ANTHY_MODE_LATIN && + get_input_mode () != SCIM_ANTHY_MODE_WIDE_LATIN) + { + m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT, + is_single_segment ()); + } + action_commit (m_factory->m_learn_on_auto_commit); + } else { + if (is_realtime_conversion ()) { + m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT, + is_single_segment ()); + m_preedit.select_segment (-1); + } + show_preedit_string (); + m_preedit_string_visible = true; + set_preedition (); + } + + return true; +} + +bool +AnthyInstance::process_key_event_lookup_keybind (const KeyEvent& key) +{ + std::vector::iterator it; + + m_last_key = key; + + /* try to find a "insert a blank" action to be not stolen a blank key + * when entering the pseudo ascii mode. + */ + if (get_pseudo_ascii_mode () != 0 && + m_factory->m_romaji_pseudo_ascii_blank_behavior && + m_preedit.is_pseudo_ascii_mode ()) { + for (it = m_factory->m_actions.begin(); + it != m_factory->m_actions.end(); + it++) { + if (it->match_action_name ("INSERT_SPACE") && + it->perform (this, key)) { + return true; + } + } + } + for (it = m_factory->m_actions.begin(); + it != m_factory->m_actions.end(); + it++) + { + if (it->perform (this, key)) { + m_last_key = KeyEvent (); + return true; + } + } + + m_last_key = KeyEvent (); + + return false; +} + +bool +AnthyInstance::process_key_event_latin_mode (const KeyEvent &key) +{ + if (key.is_key_release ()) + return false; + + if (util_key_is_keypad (key)) { + String str; + WideString wide; + util_keypad_to_string (str, key); + if (m_factory->m_ten_key_type == "Wide") + util_convert_to_wide (wide, str); + else + wide = utf8_mbstowcs (str); + if (wide.length () > 0) { + commit_string (wide); + return true; + } else { + return false; + } + } else { + // for Multi/Dead key + return false; + } +} + +bool +AnthyInstance::process_key_event_wide_latin_mode (const KeyEvent &key) +{ + if (key.is_key_release ()) + return false; + + String str; + WideString wide; + util_keypad_to_string (str, key); + if (util_key_is_keypad (key) && m_factory->m_ten_key_type == "Half") + wide = utf8_mbstowcs (str); + else + util_convert_to_wide (wide, str); + if (wide.length () > 0) { + commit_string (wide); + return true; + } + + return false; +} + +bool +AnthyInstance::process_key_event (const KeyEvent& key) +{ + SCIM_DEBUG_IMENGINE(2) << "process_key_event.\n"; + + // FIXME! + // for NICOLA thumb shift key + if (get_typing_method () == SCIM_ANTHY_TYPING_METHOD_NICOLA && + is_nicola_thumb_shift_key (key)) + { + if (process_key_event_input (key)) + return true; + } + + // lookup user defined key bindings + if (process_key_event_lookup_keybind (key)) + return true; + + // for Latin mode + if (m_preedit.get_input_mode () == SCIM_ANTHY_MODE_LATIN) + return process_key_event_latin_mode (key); + + // for wide Latin mode + if (m_preedit.get_input_mode () == SCIM_ANTHY_MODE_WIDE_LATIN) + return process_key_event_wide_latin_mode (key); + + // for other mode + if (get_typing_method () != SCIM_ANTHY_TYPING_METHOD_NICOLA || + !is_nicola_thumb_shift_key (key)) + { + if (process_key_event_input (key)) + return true; + } + + if (m_preedit.is_preediting ()) + return true; + else + return false; +} + +void +AnthyInstance::move_preedit_caret (unsigned int pos) +{ + m_preedit.set_caret_pos (pos); + update_preedit_caret (m_preedit.get_caret_pos()); +} + +void +AnthyInstance::select_candidate_no_direct (unsigned int item) +{ + SCIM_DEBUG_IMENGINE(2) << "select_candidate_no_direct.\n"; + + if (m_preedit.is_predicting () && !m_preedit.is_converting ()) + action_predict (); + + if (!is_selecting_candidates ()) + return; + + // update lookup table + m_lookup_table.set_cursor_pos_in_current_page (item); + update_lookup_table (m_lookup_table); + + // update preedit + m_preedit.select_candidate (m_lookup_table.get_cursor_pos ()); + set_preedition (); + + // update aux string + if (m_factory->m_show_candidates_label) + set_aux_string (); +} + +void +AnthyInstance::select_candidate (unsigned int item) +{ + SCIM_DEBUG_IMENGINE(2) << "select_candidate.\n"; + + select_candidate_no_direct (item); + + if (m_factory->m_close_cand_win_on_select) { + unset_lookup_table (); + action_select_next_segment(); + } +} + +void +AnthyInstance::update_lookup_table_page_size (unsigned int page_size) +{ + SCIM_DEBUG_IMENGINE(2) << "update_lookup_table_page_size.\n"; + + m_lookup_table.set_page_size (page_size); +} + +void +AnthyInstance::lookup_table_page_up () +{ + if (!is_selecting_candidates () || + !m_lookup_table.get_current_page_start ()) + { + return; + } + + SCIM_DEBUG_IMENGINE(2) << "lookup_table_page_up.\n"; + + m_lookup_table.page_up (); + + update_lookup_table (m_lookup_table); +} + +void +AnthyInstance::lookup_table_page_down () +{ + int page_start = m_lookup_table.get_current_page_start (); + int page_size = m_lookup_table.get_current_page_size (); + int num = m_lookup_table.number_of_candidates (); + + if (!is_selecting_candidates () || page_start + page_size >= num) + return; + + SCIM_DEBUG_IMENGINE(2) << "lookup_table_page_down.\n"; + + m_lookup_table.page_down (); + + update_lookup_table (m_lookup_table); +} + +void +AnthyInstance::reset () +{ + SCIM_DEBUG_IMENGINE(2) <m_behavior_on_focus_out<< "reset..\n"; + + if (m_preedit.is_preediting ()) { + if (m_factory->m_behavior_on_focus_out == "Clear") + flush (); + else if (m_factory->m_behavior_on_focus_out == "Commit") + action_commit (m_factory->m_learn_on_auto_commit); + else + action_commit (m_factory->m_learn_on_auto_commit); + } +} + +void +AnthyInstance::flush () +{ + SCIM_DEBUG_IMENGINE(3) << "flush ()\n"; + m_preedit.clear (); + m_lookup_table.clear (); + unset_lookup_table (); + + hide_preedit_string (); + m_preedit_string_visible = false; + set_preedition (); +} + +void +AnthyInstance::focus_in () +{ + SCIM_DEBUG_IMENGINE(2) << "focus_in.\n"; + + if (m_preedit_string_visible) { + set_preedition (); + show_preedit_string (); + } else { + hide_preedit_string (); + } + + if (m_lookup_table_visible && is_selecting_candidates ()) { + if (m_factory->m_show_candidates_label && + m_lookup_table.number_of_candidates() > 0) + { + set_aux_string (); + show_aux_string (); + } else { + hide_aux_string (); + } + update_lookup_table (m_lookup_table); + show_lookup_table (); + } else { + hide_aux_string (); + hide_lookup_table (); + } + + install_properties (); + + if (!m_helper_started) + start_helper (String (SCIM_ANTHY_HELPER_UUID)); + + Transaction send; + send.put_command (SCIM_TRANS_CMD_REQUEST); + send.put_command (SCIM_TRANS_CMD_FOCUS_IN); + send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send); +} + +void +AnthyInstance::focus_out () +{ + SCIM_DEBUG_IMENGINE(2) << "focus_out.\n"; + + + + Transaction send; + send.put_command (SCIM_TRANS_CMD_REQUEST); + send.put_command (SCIM_TRANS_CMD_FOCUS_OUT); + send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send); +} + +void +AnthyInstance::set_preedition (void) +{ + update_preedit_string (m_preedit.get_string (), + m_preedit.get_attribute_list ()); + update_preedit_caret (m_preedit.get_caret_pos()); +} + +void +AnthyInstance::set_aux_string (void) +{ + char buf[256]; + sprintf (buf, _("Candidates (%d/%d)"), + m_lookup_table.get_cursor_pos () + 1, + m_lookup_table.number_of_candidates ()); + update_aux_string (utf8_mbstowcs (buf)); +} + +void +AnthyInstance::set_lookup_table (void) +{ + m_n_conv_key_pressed++; + + if (!is_selecting_candidates ()) { + if (is_realtime_conversion () && + m_preedit.get_selected_segment () < 0) + { + // select latest segment + int n = m_preedit.get_nr_segments (); + if (n < 1) + return; + m_preedit.select_segment (n - 1); + } + + // prepare candidates + m_preedit.get_candidates (m_lookup_table); + + if (m_lookup_table.number_of_candidates () == 0) + return; + + // set position + update_lookup_table (m_lookup_table); + + // update preedit + m_preedit.select_candidate (m_lookup_table.get_cursor_pos ()); + set_preedition (); + + } + + bool beyond_threshold = + m_factory->m_n_triggers_to_show_cand_win > 0 && + (int) m_n_conv_key_pressed >= m_factory->m_n_triggers_to_show_cand_win; + + if (!m_lookup_table_visible && + (m_preedit.is_predicting () || beyond_threshold)) + { + show_lookup_table (); + m_lookup_table_visible = true; + m_n_conv_key_pressed = 0; + + if (m_factory->m_show_candidates_label) { + set_aux_string (); + show_aux_string (); + } + } else if (!m_lookup_table_visible) { + hide_lookup_table (); + } +} + +void +AnthyInstance::unset_lookup_table (void) +{ + m_lookup_table.clear (); + hide_lookup_table (); + m_lookup_table_visible = false; + m_n_conv_key_pressed = 0; + + update_aux_string (utf8_mbstowcs ("")); + hide_aux_string (); +} + +void +AnthyInstance::install_properties (void) +{ + if (m_properties.size () <= 0) { + Property prop; + + if (m_factory->m_show_input_mode_label) { + prop = Property (SCIM_PROP_INPUT_MODE, + "\xE3\x81\x82", String (""), _("Input mode")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_INPUT_MODE_HIRAGANA, + _("Hiragana"), String (""), _("Hiragana")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_INPUT_MODE_KATAKANA, + _("Katakana"), String (""), _("Katakana")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_INPUT_MODE_HALF_KATAKANA, + _("Half width katakana"), String (""), + _("Half width katakana")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_INPUT_MODE_LATIN, + _("Latin"), String (""), _("Direct input")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_INPUT_MODE_WIDE_LATIN, + _("Wide latin"), String (""), _("Wide latin")); + m_properties.push_back (prop); + } + + if (m_factory->m_show_typing_method_label) { + prop = Property (SCIM_PROP_TYPING_METHOD, + "\xEF\xBC\xB2", String (""), _("Typing method")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_TYPING_METHOD_ROMAJI, + _("Romaji"), String (""), _("Romaji")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_TYPING_METHOD_KANA, + _("Kana"), String (""), _("Kana")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_TYPING_METHOD_NICOLA, + _("Thumb shift"), String (""), _("Thumb shift")); + m_properties.push_back (prop); + } + + if (m_factory->m_show_conv_mode_label) { + prop = Property (SCIM_PROP_CONV_MODE, + "\xE9\x80\xA3", String (""), + _("Conversion mode")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_CONV_MODE_MULTI_SEG, + _("Multi segment"), String (""), + _("Multi segment")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_CONV_MODE_SINGLE_SEG, + _("Single segment"), String (""), + _("Single segment")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_CONV_MODE_MULTI_REAL_TIME, + _("Convert as you type (Multi segment)"), + String (""), + _("Convert as you type (Multi segment)")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_CONV_MODE_SINGLE_REAL_TIME, + _("Convert as you type (Single segment)"), + String (""), + _("Convert as you type (Single segment)")); + m_properties.push_back (prop); + } + + if (m_factory->m_show_period_style_label) { + prop = Property (SCIM_PROP_PERIOD_STYLE, + "\xE3\x80\x81\xE3\x80\x82", String (""), + _("Period style")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_PERIOD_STYLE_JAPANESE, + "\xE3\x80\x81\xE3\x80\x82", String (""), + "\xE3\x80\x81\xE3\x80\x82"); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_PERIOD_STYLE_WIDE_LATIN_JAPANESE, + "\xEF\xBC\x8C\xE3\x80\x82", String (""), + "\xEF\xBC\x8C\xE3\x80\x82"); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_PERIOD_STYLE_WIDE_LATIN, + "\xEF\xBC\x8C\xEF\xBC\x8E", String (""), + "\xEF\xBC\x8C\xEF\xBC\x8E"); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_PERIOD_STYLE_LATIN, + ",.", String (""), ",."); + m_properties.push_back (prop); + } + + if (m_factory->m_show_symbol_style_label) { + prop = Property (SCIM_PROP_SYMBOL_STYLE, + UTF8_BRACKET_CORNER_BEGIN + UTF8_BRACKET_CORNER_END + UTF8_MIDDLE_DOT, + String (""), + _("Symbol style")); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_SYMBOL_STYLE_JAPANESE, + UTF8_BRACKET_CORNER_BEGIN + UTF8_BRACKET_CORNER_END + UTF8_MIDDLE_DOT, + String (""), + UTF8_BRACKET_CORNER_BEGIN + UTF8_BRACKET_CORNER_END + UTF8_MIDDLE_DOT); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_SYMBOL_STYLE_CORNER_BRACKET_SLASH, + UTF8_BRACKET_CORNER_BEGIN + UTF8_BRACKET_CORNER_END + UTF8_SLASH_WIDE, + String (""), + UTF8_BRACKET_CORNER_BEGIN + UTF8_BRACKET_CORNER_END + UTF8_SLASH_WIDE); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_SYMBOL_STYLE_BRACKET_MIDDLE_DOT, + UTF8_BRACKET_WIDE_BEGIN + UTF8_BRACKET_WIDE_END + UTF8_MIDDLE_DOT, + String (""), + UTF8_BRACKET_WIDE_BEGIN + UTF8_BRACKET_WIDE_END + UTF8_MIDDLE_DOT); + m_properties.push_back (prop); + + prop = Property (SCIM_PROP_SYMBOL_STYLE_BRACKET_SLASH, + UTF8_BRACKET_WIDE_BEGIN + UTF8_BRACKET_WIDE_END + UTF8_SLASH_WIDE, + String (""), + UTF8_BRACKET_WIDE_BEGIN + UTF8_BRACKET_WIDE_END + UTF8_SLASH_WIDE); + m_properties.push_back (prop); + } + + if (m_factory->m_show_dict_label) { + prop = Property (SCIM_PROP_DICT, + String(""), //_("Dictionary"), + String (SCIM_ICONDIR "/" "scim-anthy-dict.png"), + _("Dictionary menu")); + m_properties.push_back (prop); + + if (m_factory->m_show_dict_admin_label) { + prop = Property (SCIM_PROP_DICT_LAUNCH_ADMIN_TOOL, + _("Edit the dictionary"), + String (SCIM_ICONDIR "/" "scim-anthy-dict.png"), + _("Launch the dictionary administration tool.")); + m_properties.push_back (prop); + } + + if (m_factory->m_show_add_word_label) { + prop = Property (SCIM_PROP_DICT_ADD_WORD, + _("Add a word"), + String (SCIM_ICONDIR "/" "scim-anthy-dict.png"), + _("Add a word to the dictionary.")); + m_properties.push_back (prop); + } + } + } + + set_input_mode(get_input_mode ()); + set_conversion_mode (m_conv_mode); + set_typing_method (get_typing_method ()); + set_period_style (m_preedit.get_period_style (), + m_preedit.get_comma_style ()); + set_symbol_style (m_preedit.get_bracket_style (), + m_preedit.get_slash_style ()); + + register_properties (m_properties); +} + +void +AnthyInstance::set_input_mode (InputMode mode) +{ + const char *label = ""; + + switch (mode) { + case SCIM_ANTHY_MODE_HIRAGANA: + label = "\xE3\x81\x82"; + break; + case SCIM_ANTHY_MODE_KATAKANA: + label = "\xE3\x82\xA2"; + break; + case SCIM_ANTHY_MODE_HALF_KATAKANA: + label = "_\xEF\xBD\xB1"; + break; + case SCIM_ANTHY_MODE_LATIN: + label = "_A"; + break; + case SCIM_ANTHY_MODE_WIDE_LATIN: + label = "\xEF\xBC\xA1"; + break; + default: + break; + } + + if (label && *label && m_factory->m_show_input_mode_label) { + PropertyList::iterator it = std::find (m_properties.begin (), + m_properties.end (), + SCIM_PROP_INPUT_MODE); + if (it != m_properties.end ()) { + it->set_label (label); + update_property (*it); + } + } + + if (mode != get_input_mode ()) { + m_preedit.set_input_mode (mode); + set_preedition (); + } +} + +void +AnthyInstance::set_conversion_mode (ConversionMode mode) +{ + const char *label = ""; + + switch (mode) { + case SCIM_ANTHY_CONVERSION_MULTI_SEGMENT: + label = "\xE9\x80\xA3"; + break; + case SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT: + label = "\xE5\x8D\x98"; + break; + case SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE: + label = "\xE9\x80\x90 \xE9\x80\xA3"; + break; + case SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE: + label = "\xE9\x80\x90 \xE5\x8D\x98"; + break; + default: + break; + } + + if (label && *label /*&& m_factory->m_show_input_mode_label*/) { + PropertyList::iterator it = std::find (m_properties.begin (), + m_properties.end (), + SCIM_PROP_CONV_MODE); + if (it != m_properties.end ()) { + it->set_label (label); + update_property (*it); + } + } + + m_conv_mode = mode; +} + +void +AnthyInstance::set_typing_method (TypingMethod method) +{ + const char *label = ""; + + switch (method) { + case SCIM_ANTHY_TYPING_METHOD_ROMAJI: + label = "\xEF\xBC\xB2"; + break; + case SCIM_ANTHY_TYPING_METHOD_KANA: + label = "\xE3\x81\x8B"; + break; + case SCIM_ANTHY_TYPING_METHOD_NICOLA: + label = "\xE8\xA6\xAA"; + break; + default: + break; + } + + if (label && *label && m_factory->m_show_typing_method_label) { + PropertyList::iterator it = std::find (m_properties.begin (), + m_properties.end (), + SCIM_PROP_TYPING_METHOD); + if (it != m_properties.end ()) { + it->set_label (label); + update_property (*it); + } + } + + if (method != get_typing_method ()) { + Key2KanaTable *fundamental_table = NULL; + + if (method == SCIM_ANTHY_TYPING_METHOD_ROMAJI) { + fundamental_table = m_factory->m_custom_romaji_table; + } else if (method == SCIM_ANTHY_TYPING_METHOD_KANA) { + fundamental_table = m_factory->m_custom_kana_table; + } + m_preedit.set_typing_method (method); + m_preedit.set_pseudo_ascii_mode (get_pseudo_ascii_mode ()); + } +} + +void +AnthyInstance::set_period_style (PeriodStyle period, + CommaStyle comma) +{ + String label; + + switch (comma) { + case SCIM_ANTHY_COMMA_JAPANESE: + label = "\xE3\x80\x81"; + break; + case SCIM_ANTHY_COMMA_WIDE: + label = "\xEF\xBC\x8C"; + break; + case SCIM_ANTHY_COMMA_HALF: + label = ","; + break; + default: + break; + } + + switch (period) { + case SCIM_ANTHY_PERIOD_JAPANESE: + label += "\xE3\x80\x82"; + break; + case SCIM_ANTHY_PERIOD_WIDE: + label += "\xEF\xBC\x8E"; + break; + case SCIM_ANTHY_PERIOD_HALF: + label += "."; + break; + default: + break; + } + + if (label.length () > 0) { + PropertyList::iterator it = std::find (m_properties.begin (), + m_properties.end (), + SCIM_PROP_PERIOD_STYLE); + if (it != m_properties.end ()) { + it->set_label (label.c_str ()); + update_property (*it); + } + } + + if (period != m_preedit.get_period_style ()) + m_preedit.set_period_style (period); + if (comma != m_preedit.get_comma_style ()) + m_preedit.set_comma_style (comma); +} + +void +AnthyInstance::set_symbol_style (BracketStyle bracket, + SlashStyle slash) +{ + String label; + + switch (bracket) { + case SCIM_ANTHY_BRACKET_JAPANESE: + label = UTF8_BRACKET_CORNER_BEGIN UTF8_BRACKET_CORNER_END; + break; + case SCIM_ANTHY_BRACKET_WIDE: + label = UTF8_BRACKET_WIDE_BEGIN UTF8_BRACKET_WIDE_END; + break; + default: + break; + } + + switch (slash) { + case SCIM_ANTHY_SLASH_JAPANESE: + label += UTF8_MIDDLE_DOT; + break; + case SCIM_ANTHY_SLASH_WIDE: + label += UTF8_SLASH_WIDE; + break; + default: + break; + } + + if (label.length () > 0) { + PropertyList::iterator it = std::find (m_properties.begin (), + m_properties.end (), + SCIM_PROP_SYMBOL_STYLE); + if (it != m_properties.end ()) { + it->set_label (label.c_str ()); + update_property (*it); + } + } + + if (bracket != m_preedit.get_bracket_style ()) + m_preedit.set_bracket_style (bracket); + if (slash != m_preedit.get_slash_style ()) + m_preedit.set_slash_style (slash); +} + +bool +AnthyInstance::is_selecting_candidates (void) +{ + if (m_lookup_table.number_of_candidates ()) + return true; + else + return false; +} + +bool +AnthyInstance::action_do_nothing (void) +{ + return true; +} + +bool +AnthyInstance::action_convert (void) +{ + if (!m_preedit.is_preediting ()) + return false; + + if (!m_preedit.is_converting ()) { + // show conversion string + m_preedit.finish (); + m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT, + is_single_segment ()); + set_preedition (); + set_lookup_table (); + return true; + } + + return false; +} + +bool +AnthyInstance::action_predict (void) +{ + if (!m_preedit.is_preediting ()) + return false; + + if (m_preedit.is_converting ()) + return false; + + if (!m_preedit.is_predicting ()) + m_preedit.predict (); + + m_preedit.select_candidate (0); + set_preedition (); + set_lookup_table (); + select_candidate_no_direct (0); + + return true; +} + + +bool +AnthyInstance::action_revert (void) +{ + if (m_preedit.is_reconverting ()) { + m_preedit.revert (); + commit_string (m_preedit.get_string ()); + flush (); + return true; + } + + if (!m_preedit.is_preediting ()) + return false; + + if (!m_preedit.is_converting ()) { + flush (); + return true; + } + + if (is_selecting_candidates ()) { + m_lookup_table.clear (); + if (m_lookup_table_visible) { + unset_lookup_table (); + return true; + } + } + + unset_lookup_table (); + m_preedit.revert (); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_cancel_all (void) +{ + if (!m_preedit.is_preediting ()) + return false; + + flush (); + return true; +} + +bool +AnthyInstance::action_commit (bool learn) +{ + if (!m_preedit.is_preediting ()) + return false; + + if (m_preedit.is_converting ()) { + commit_string (m_preedit.get_string ()); + if (learn) + m_preedit.commit (); + } else { + m_preedit.finish (); + commit_string (m_preedit.get_string ()); + } + + flush (); + + return true; +} + +bool +AnthyInstance::action_commit_follow_preference (void) +{ + return action_commit (m_factory->m_learn_on_manual_commit); +} + +bool +AnthyInstance::action_commit_reverse_preference (void) +{ + return action_commit (!m_factory->m_learn_on_manual_commit); +} + +bool +AnthyInstance::action_back (void) +{ + if (!m_preedit.is_preediting ()) + return false; + + if (m_preedit.is_converting ()) { + action_revert (); + if (!is_realtime_conversion ()) + return true; + } + + m_preedit.erase (); + + if (m_preedit.get_length () > 0) { + if (is_realtime_conversion ()) { + m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT, + is_single_segment ()); + m_preedit.select_segment (-1); + } + set_preedition (); + } else { + flush (); + } + + return true; +} + +bool +AnthyInstance::action_delete (void) +{ + if (!m_preedit.is_preediting ()) + return false; + + if (m_preedit.is_converting ()) { + action_revert (); + if (!is_realtime_conversion ()) + return true; + } + + m_preedit.erase (false); + + if (m_preedit.get_length () > 0) { + if (is_realtime_conversion ()) { + m_preedit.convert (SCIM_ANTHY_CANDIDATE_DEFAULT, + is_single_segment ()); + m_preedit.select_segment (-1); + } + set_preedition (); + } else { + flush (); + } + + return true; +} + +bool +AnthyInstance::action_insert_space (void) +{ + String str; + bool is_wide = false, retval = false; + + if (m_preedit.is_preediting () && !m_factory->m_romaji_pseudo_ascii_blank_behavior) + return false; + + if (m_factory->m_space_type == "FollowMode") { + InputMode mode = get_input_mode (); + if (mode == SCIM_ANTHY_MODE_LATIN || + mode == SCIM_ANTHY_MODE_HALF_KATAKANA || + m_preedit.is_pseudo_ascii_mode ()) + { + is_wide = false; + } else { + is_wide = true; + } + } else if (m_factory->m_space_type == "Wide") { + is_wide = true; + } + + if (is_wide) { + str = "\xE3\x80\x80"; + retval = true; + } else if (get_typing_method () == SCIM_ANTHY_TYPING_METHOD_NICOLA || // FIXME! it's a ad-hoc solution. + m_preedit.is_pseudo_ascii_mode () || + (m_last_key.code != SCIM_KEY_space && + m_last_key.code != SCIM_KEY_KP_Space)) + { + str = " "; + retval = true; + } + + if (retval) { + if (m_preedit.is_pseudo_ascii_mode ()) { + m_preedit.append (m_last_key, str); + show_preedit_string (); + m_preedit_string_visible = true; + set_preedition (); + } else { + commit_string (utf8_mbstowcs (str)); + } + } + + return retval; +} + +bool +AnthyInstance::action_insert_alternative_space (void) +{ + bool is_wide = false; + + if (m_preedit.is_preediting ()) + return false; + + if (m_factory->m_space_type == "FollowMode") { + InputMode mode = get_input_mode (); + if (mode == SCIM_ANTHY_MODE_LATIN || + mode == SCIM_ANTHY_MODE_HALF_KATAKANA) + { + is_wide = true; + } else { + is_wide = false; + } + } else if (m_factory->m_space_type != "Wide") { + is_wide = true; + } + + if (is_wide) { + commit_string (utf8_mbstowcs ("\xE3\x80\x80")); + return true; + } else if (get_typing_method () == SCIM_ANTHY_TYPING_METHOD_NICOLA || // FIXME! it's a ad-hoc solution. + (m_last_key.code != SCIM_KEY_space && + m_last_key.code != SCIM_KEY_KP_Space)) + { + commit_string (utf8_mbstowcs (" ")); + return true; + } + + return false; +} + +bool +AnthyInstance::action_insert_half_space (void) +{ + if (m_preedit.is_preediting ()) + return false; + + if (m_last_key.code != SCIM_KEY_space && + m_last_key.code != SCIM_KEY_KP_Space) + { + commit_string (utf8_mbstowcs (" ")); + return true; + } + + return false; +} + +bool +AnthyInstance::action_insert_wide_space (void) +{ + if (m_preedit.is_preediting ()) + return false; + + commit_string (utf8_mbstowcs ("\xE3\x80\x80")); + + return true; +} + +bool +AnthyInstance::action_move_caret_backward (void) +{ + if (!m_preedit.is_preediting ()) + return false; + if (m_preedit.is_converting ()) + return false; + + m_preedit.move_caret(-1); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_move_caret_forward (void) +{ + if (!m_preedit.is_preediting ()) + return false; + if (m_preedit.is_converting ()) + return false; + + m_preedit.move_caret(1); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_move_caret_first (void) +{ + if (!m_preedit.is_preediting ()) + return false; + if (m_preedit.is_converting ()) + return false; + + m_preedit.set_caret_pos (0); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_move_caret_last (void) +{ + if (!m_preedit.is_preediting ()) + return false; + if (m_preedit.is_converting ()) + return false; + + m_preedit.set_caret_pos (m_preedit.get_length ()); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_select_prev_segment (void) +{ + if (!m_preedit.is_converting ()) + return false; + + unset_lookup_table (); + + int idx = m_preedit.get_selected_segment (); + if (idx - 1 < 0) { + int n = m_preedit.get_nr_segments (); + if (n <= 0) return false; + m_preedit.select_segment (n - 1); + } else { + m_preedit.select_segment (idx - 1); + } + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_select_next_segment (void) +{ + if (!m_preedit.is_converting ()) + return false; + + unset_lookup_table (); + + int idx = m_preedit.get_selected_segment (); + if (idx < 0) { + m_preedit.select_segment(0); + } else { + int n = m_preedit.get_nr_segments (); + if (n <= 0) + return false; + if (idx + 1 >= n) + m_preedit.select_segment(0); + else + m_preedit.select_segment(idx + 1); + } + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_select_first_segment (void) +{ + if (!m_preedit.is_converting ()) + return false; + + unset_lookup_table (); + + m_preedit.select_segment(0); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_select_last_segment (void) +{ + if (!m_preedit.is_converting ()) + return false; + + int n = m_preedit.get_nr_segments (); + if (n <= 0) return false; + + unset_lookup_table (); + + m_preedit.select_segment(n - 1); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_shrink_segment (void) +{ + if (!m_preedit.is_converting ()) + return false; + + unset_lookup_table (); + + m_preedit.resize_segment (-1); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_expand_segment (void) +{ + if (!m_preedit.is_converting ()) + return false; + + unset_lookup_table (); + + m_preedit.resize_segment (1); + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_commit_first_segment (void) +{ + if (!m_preedit.is_converting ()) { + if (m_preedit.is_preediting ()) { + return action_commit (m_factory->m_learn_on_manual_commit); + } else { + return false; + } + } + + unset_lookup_table (); + + commit_string (m_preedit.get_segment_string (0)); + if (m_factory->m_learn_on_manual_commit) + m_preedit.commit (0); + else + m_preedit.clear (0); + + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_commit_selected_segment (void) +{ + if (!m_preedit.is_converting ()) { + if (m_preedit.is_preediting ()) { + return action_commit (m_factory->m_learn_on_manual_commit); + } else { + return false; + } + } + + unset_lookup_table (); + + for (int i = 0; i <= m_preedit.get_selected_segment (); i++) + commit_string (m_preedit.get_segment_string (i)); + if (m_factory->m_learn_on_manual_commit) + m_preedit.commit (m_preedit.get_selected_segment ()); + else + m_preedit.clear (m_preedit.get_selected_segment ()); + + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_commit_first_segment_reverse_preference (void) +{ + if (!m_preedit.is_converting ()) { + if (m_preedit.is_preediting ()) { + return action_commit (!m_factory->m_learn_on_manual_commit); + } else { + return false; + } + } + + unset_lookup_table (); + + commit_string (m_preedit.get_segment_string (0)); + if (!m_factory->m_learn_on_manual_commit) + m_preedit.commit (0); + else + m_preedit.clear (0); + + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_commit_selected_segment_reverse_preference (void) +{ + if (!m_preedit.is_converting ()) { + if (m_preedit.is_preediting ()) { + return action_commit (!m_factory->m_learn_on_manual_commit); + } else { + return false; + } + } + + unset_lookup_table (); + + for (int i = 0; i <= m_preedit.get_selected_segment (); i++) + commit_string (m_preedit.get_segment_string (i)); + if (!m_factory->m_learn_on_manual_commit) + m_preedit.commit (m_preedit.get_selected_segment ()); + else + m_preedit.clear (m_preedit.get_selected_segment ()); + + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_select_next_candidate (void) +{ + if (!m_preedit.is_converting ()) + return false; + + //if (!is_selecting_candidates ()) + set_lookup_table (); + + int end = m_lookup_table.number_of_candidates () - 1; + if (m_lookup_table.get_cursor_pos () == end) { + m_lookup_table.set_cursor_pos (0); + } else { + m_lookup_table.cursor_down (); + } + + int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page (); + select_candidate_no_direct (pos_in_page); + + return true; +} + +bool +AnthyInstance::action_select_prev_candidate (void) +{ + if (!m_preedit.is_converting ()) return false; + + //if (!is_selecting_candidates ()) + set_lookup_table (); + + int end = m_lookup_table.number_of_candidates () - 1; + if (m_lookup_table.get_cursor_pos () == 0) + m_lookup_table.set_cursor_pos (end); + else + m_lookup_table.cursor_up (); + + int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page (); + select_candidate_no_direct (pos_in_page); + + return true; +} + +bool +AnthyInstance::action_select_first_candidate (void) +{ + if (!m_preedit.is_converting ()) return false; + if (!is_selecting_candidates ()) return false; + + m_lookup_table.set_cursor_pos (0); + + int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page (); + select_candidate_no_direct (pos_in_page); + + return true; +} + +bool +AnthyInstance::action_select_last_candidate (void) +{ + if (!m_preedit.is_converting ()) return false; + if (!is_selecting_candidates ()) return false; + + int end = m_lookup_table.number_of_candidates () - 1; + m_lookup_table.set_cursor_pos (end); + + int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page (); + select_candidate_no_direct (pos_in_page); + + return true; +} + +bool +AnthyInstance::action_candidates_page_up(void) +{ + if (!m_preedit.is_converting ()) return false; + if (!is_selecting_candidates ()) return false; + if (!m_lookup_table_visible) return false; + + m_lookup_table.page_up (); + + int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page (); + select_candidate_no_direct (pos_in_page); + + return true; +} + +bool +AnthyInstance::action_candidates_page_down (void) +{ + if (!m_preedit.is_converting ()) return false; + if (!is_selecting_candidates ()) return false; + if (!m_lookup_table_visible) return false; + + m_lookup_table.page_down (); + + int pos_in_page = m_lookup_table.get_cursor_pos_in_current_page (); + select_candidate_no_direct (pos_in_page); + + return true; +} + +bool +AnthyInstance::action_select_candidate (unsigned int i) +{ + // FIXME! m_lookup_table_visible should be set as true also on predicting + if (!m_lookup_table_visible && !m_preedit.is_predicting ()) + return false; + + if (m_preedit.is_predicting () && !m_preedit.is_converting () && + m_factory->m_use_direct_key_on_predict) + { + CommonLookupTable table; + m_preedit.get_candidates (table); + if (i < table.number_of_candidates ()) { + select_candidate (i); + return true; + } + } else if (m_preedit.is_converting () && is_selecting_candidates ()) { + select_candidate (i); + return true; + } + + return false; +} + +bool +AnthyInstance::action_select_candidate_1 (void) +{ + return action_select_candidate (0); +} + +bool +AnthyInstance::action_select_candidate_2 (void) +{ + return action_select_candidate (1); +} + +bool +AnthyInstance::action_select_candidate_3 (void) +{ + return action_select_candidate (2); +} + +bool +AnthyInstance::action_select_candidate_4 (void) +{ + return action_select_candidate (3); +} + +bool +AnthyInstance::action_select_candidate_5 (void) +{ + return action_select_candidate (4); +} + +bool +AnthyInstance::action_select_candidate_6 (void) +{ + return action_select_candidate (5); +} + +bool +AnthyInstance::action_select_candidate_7 (void) +{ + return action_select_candidate (6); +} + + +bool +AnthyInstance::action_select_candidate_8 (void) +{ + return action_select_candidate (7); +} + +bool +AnthyInstance::action_select_candidate_9 (void) +{ + return action_select_candidate (8); +} + +bool +AnthyInstance::action_select_candidate_10 (void) +{ + return action_select_candidate (9); +} + +bool +AnthyInstance::action_circle_input_mode (void) +{ + InputMode mode = get_input_mode (); + + switch (mode) { + case SCIM_ANTHY_MODE_HIRAGANA: + mode = SCIM_ANTHY_MODE_KATAKANA; + break; + case SCIM_ANTHY_MODE_KATAKANA: + mode = SCIM_ANTHY_MODE_HALF_KATAKANA; + break; + case SCIM_ANTHY_MODE_HALF_KATAKANA: + mode = SCIM_ANTHY_MODE_LATIN; + break; + case SCIM_ANTHY_MODE_LATIN: + mode = SCIM_ANTHY_MODE_WIDE_LATIN; + break; + case SCIM_ANTHY_MODE_WIDE_LATIN: + mode = SCIM_ANTHY_MODE_HIRAGANA; + break; + default: + mode = SCIM_ANTHY_MODE_HIRAGANA; + break; + } + + set_input_mode (mode); + + return true; +} + +bool +AnthyInstance::action_circle_typing_method (void) +{ + TypingMethod method; + + method = get_typing_method (); + if (method == SCIM_ANTHY_TYPING_METHOD_NICOLA) + method = SCIM_ANTHY_TYPING_METHOD_ROMAJI; + else if (method == SCIM_ANTHY_TYPING_METHOD_KANA) + method = SCIM_ANTHY_TYPING_METHOD_NICOLA; + else + method = SCIM_ANTHY_TYPING_METHOD_KANA; + + set_typing_method (method); + + return true; +} + +bool +AnthyInstance::action_circle_kana_mode (void) +{ + InputMode mode; + + if (get_input_mode () == SCIM_ANTHY_MODE_LATIN || + get_input_mode () == SCIM_ANTHY_MODE_WIDE_LATIN) + { + mode = SCIM_ANTHY_MODE_HIRAGANA; + } else { + switch (get_input_mode ()) { + case SCIM_ANTHY_MODE_HIRAGANA: + mode = SCIM_ANTHY_MODE_KATAKANA; + break; + case SCIM_ANTHY_MODE_KATAKANA: + mode = SCIM_ANTHY_MODE_HALF_KATAKANA; + break; + case SCIM_ANTHY_MODE_HALF_KATAKANA: + default: + mode = SCIM_ANTHY_MODE_HIRAGANA; + break; + } + } + + set_input_mode (mode); + + return true; +} + +bool +AnthyInstance::action_on_off (void) +{ + if (get_input_mode () == SCIM_ANTHY_MODE_LATIN || + get_input_mode () == SCIM_ANTHY_MODE_WIDE_LATIN) + { + set_input_mode (m_prev_input_mode); + m_preedit.set_input_mode (m_prev_input_mode); + } else { + m_prev_input_mode = get_input_mode (); + set_input_mode (SCIM_ANTHY_MODE_LATIN); + m_preedit.set_input_mode (SCIM_ANTHY_MODE_LATIN); + } + + return true; +} + +bool +AnthyInstance::action_latin_mode (void) +{ + set_input_mode (SCIM_ANTHY_MODE_LATIN); + return true; +} + +bool +AnthyInstance::action_wide_latin_mode (void) +{ + set_input_mode (SCIM_ANTHY_MODE_WIDE_LATIN); + return true; +} + +bool +AnthyInstance::action_hiragana_mode (void) +{ + set_input_mode (SCIM_ANTHY_MODE_HIRAGANA); + return true; +} + +bool +AnthyInstance::action_katakana_mode (void) +{ + set_input_mode (SCIM_ANTHY_MODE_KATAKANA); + return true; +} + +bool +AnthyInstance::action_half_katakana_mode (void) +{ + set_input_mode (SCIM_ANTHY_MODE_HALF_KATAKANA); + return true; +} + +bool +AnthyInstance::action_cancel_pseudo_ascii_mode (void) +{ + if (!m_preedit.is_preediting ()) + return false; + if (!m_preedit.is_pseudo_ascii_mode ()) + return false; + + m_preedit.reset_pseudo_ascii_mode (); + + return true; +} + +bool +AnthyInstance::convert_kana (CandidateType type) +{ + if (!m_preedit.is_preediting ()) + return false; + + if (m_preedit.is_reconverting ()) + return false; + + unset_lookup_table (); + + if (m_preedit.is_converting ()) { + int idx = m_preedit.get_selected_segment (); + if (idx < 0) { + action_revert (); + m_preedit.finish (); + m_preedit.convert (type, true); + } else { + m_preedit.select_candidate (type); + } + } else { + m_preedit.finish (); + m_preedit.convert (type, true); + } + + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_convert_to_hiragana (void) +{ + return convert_kana (SCIM_ANTHY_CANDIDATE_HIRAGANA); +} + +bool +AnthyInstance::action_convert_to_katakana (void) +{ + return convert_kana (SCIM_ANTHY_CANDIDATE_KATAKANA); +} + +bool +AnthyInstance::action_convert_to_half (void) +{ + return convert_kana (SCIM_ANTHY_CANDIDATE_HALF); +} + +bool +AnthyInstance::action_convert_to_half_katakana (void) +{ + return convert_kana (SCIM_ANTHY_CANDIDATE_HALF_KATAKANA); +} + +bool +AnthyInstance::action_convert_to_latin (void) +{ + return convert_kana (SCIM_ANTHY_CANDIDATE_LATIN); +} + +bool +AnthyInstance::action_convert_to_wide_latin (void) +{ + return convert_kana (SCIM_ANTHY_CANDIDATE_WIDE_LATIN); +} + +bool +AnthyInstance::action_convert_char_type_forward (void) +{ + if (!m_preedit.is_preediting ()) + return false; + + unset_lookup_table (); + + if (m_preedit.is_converting ()) { + int idx = m_preedit.get_selected_segment (); + if (idx < 0) { + action_revert (); + m_preedit.finish (); + m_preedit.convert (SCIM_ANTHY_CANDIDATE_HIRAGANA, true); + } else { + int cand = m_preedit.get_selected_candidate (); + switch (cand) + { + case SCIM_ANTHY_CANDIDATE_HIRAGANA: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_KATAKANA); + break; + case SCIM_ANTHY_CANDIDATE_KATAKANA: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HALF_KATAKANA); + break; + case SCIM_ANTHY_CANDIDATE_HALF_KATAKANA: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_WIDE_LATIN); + break; + case SCIM_ANTHY_CANDIDATE_WIDE_LATIN: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_LATIN); + break; + case SCIM_ANTHY_CANDIDATE_LATIN: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HIRAGANA); + break; + default: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HIRAGANA); + break; + } + } + } else { + m_preedit.finish (); + m_preedit.convert (SCIM_ANTHY_CANDIDATE_HIRAGANA, true); + } + + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_convert_char_type_backward (void) +{ + if (!m_preedit.is_preediting ()) + return false; + + unset_lookup_table (); + + if (m_preedit.is_converting ()) { + int idx = m_preedit.get_selected_segment (); + if (idx < 0) { + action_revert (); + m_preedit.finish (); + m_preedit.convert (SCIM_ANTHY_CANDIDATE_HIRAGANA, true); + } else { + int cand = m_preedit.get_selected_candidate (); + switch (cand) + { + case SCIM_ANTHY_CANDIDATE_HIRAGANA: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_LATIN); + break; + case SCIM_ANTHY_CANDIDATE_KATAKANA: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HIRAGANA); + break; + case SCIM_ANTHY_CANDIDATE_HALF_KATAKANA: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_KATAKANA); + break; + case SCIM_ANTHY_CANDIDATE_WIDE_LATIN: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HALF_KATAKANA); + break; + case SCIM_ANTHY_CANDIDATE_LATIN: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_WIDE_LATIN); + break; + default: + m_preedit.select_candidate (SCIM_ANTHY_CANDIDATE_HIRAGANA); + break; + } + } + } else { + m_preedit.finish (); + m_preedit.convert (SCIM_ANTHY_CANDIDATE_HIRAGANA, true); + } + + set_preedition (); + + return true; +} + +bool +AnthyInstance::action_reconvert (void) +{ + if (m_preedit.is_preediting ()) + return false; + + Transaction send; + send.put_command (SCIM_ANTHY_TRANS_CMD_GET_SELECTION); + send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send); + + return true; +} + +bool +AnthyInstance::action_add_word (void) +{ + util_launch_program (m_factory->m_add_word_command.c_str ()); + + return true; +} + +bool +AnthyInstance::action_launch_dict_admin_tool (void) +{ + util_launch_program (m_factory->m_dict_admin_command.c_str ()); + + return true; +} + +#if 0 +void +AnthyInstance::action_regist_word (void) +{ +} +#endif + +AnthyFactory * +AnthyInstance::get_factory (void) +{ + return m_factory; +} + +TypingMethod +AnthyInstance::get_typing_method (void) +{ + return m_preedit.get_typing_method (); +} + +InputMode +AnthyInstance::get_input_mode (void) +{ + return m_preedit.get_input_mode (); +} + +int +AnthyInstance::timeout_add (uint32 time_msec, timeout_func timeout_fn, + void *data, delete_func delete_fn) +{ + uint32 id = ++m_timeout_id_seq; + m_closures[id] = TimeoutClosure (time_msec, timeout_fn, data, delete_fn); + /* + * FIXME! Obsoleted closures should be removed at somewhere. + * Currenly only NICOLA related timer uses this feature and it will be + * removed each time on key press event so memory leaks doesn't exist. + */ + + Transaction send; + send.put_command (SCIM_ANTHY_TRANS_CMD_TIMEOUT_ADD); + send.put_data (id); + send.put_data (time_msec); + send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send); + + return id; +} + +void +AnthyInstance::timeout_remove (uint32 id) +{ + if (m_closures.find (id) == m_closures.end ()) + return; + + m_closures.erase (id); + + Transaction send; + send.put_command (SCIM_ANTHY_TRANS_CMD_TIMEOUT_REMOVE); + send.put_data (id); + send_helper_event (String (SCIM_ANTHY_HELPER_UUID), send); +} + +void +AnthyInstance::trigger_property (const String &property) +{ + String anthy_prop = property.substr (property.find_last_of ('/') + 1); + + SCIM_DEBUG_IMENGINE(2) + << "trigger_property : " << property << " - " << anthy_prop << "\n"; + + // input mode + if (property == SCIM_PROP_INPUT_MODE_HIRAGANA) { + set_input_mode (SCIM_ANTHY_MODE_HIRAGANA); + } else if (property == SCIM_PROP_INPUT_MODE_KATAKANA) { + set_input_mode (SCIM_ANTHY_MODE_KATAKANA); + } else if (property == SCIM_PROP_INPUT_MODE_HALF_KATAKANA) { + set_input_mode (SCIM_ANTHY_MODE_HALF_KATAKANA); + } else if (property == SCIM_PROP_INPUT_MODE_LATIN) { + set_input_mode (SCIM_ANTHY_MODE_LATIN); + } else if (property == SCIM_PROP_INPUT_MODE_WIDE_LATIN) { + set_input_mode (SCIM_ANTHY_MODE_WIDE_LATIN); + + // conversion mode + } else if (property == SCIM_PROP_CONV_MODE_MULTI_SEG) { + set_conversion_mode (SCIM_ANTHY_CONVERSION_MULTI_SEGMENT); + } else if (property == SCIM_PROP_CONV_MODE_SINGLE_SEG) { + set_conversion_mode (SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT); + } else if (property == SCIM_PROP_CONV_MODE_MULTI_REAL_TIME) { + set_conversion_mode (SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE); + } else if (property == SCIM_PROP_CONV_MODE_SINGLE_REAL_TIME) { + set_conversion_mode (SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE); + + // typing method + } else if (property == SCIM_PROP_TYPING_METHOD_ROMAJI) { + set_typing_method (SCIM_ANTHY_TYPING_METHOD_ROMAJI); + } else if (property == SCIM_PROP_TYPING_METHOD_KANA) { + set_typing_method (SCIM_ANTHY_TYPING_METHOD_KANA); + } else if (property == SCIM_PROP_TYPING_METHOD_NICOLA) { + set_typing_method (SCIM_ANTHY_TYPING_METHOD_NICOLA); + + // period type + } else if (property == SCIM_PROP_PERIOD_STYLE_JAPANESE) { + set_period_style (SCIM_ANTHY_PERIOD_JAPANESE, + SCIM_ANTHY_COMMA_JAPANESE); + } else if (property == SCIM_PROP_PERIOD_STYLE_WIDE_LATIN_JAPANESE) { + set_period_style (SCIM_ANTHY_PERIOD_JAPANESE, + SCIM_ANTHY_COMMA_WIDE); + } else if (property == SCIM_PROP_PERIOD_STYLE_WIDE_LATIN) { + set_period_style (SCIM_ANTHY_PERIOD_WIDE, + SCIM_ANTHY_COMMA_WIDE); + } else if (property == SCIM_PROP_PERIOD_STYLE_LATIN) { + set_period_style (SCIM_ANTHY_PERIOD_HALF, + SCIM_ANTHY_COMMA_HALF); + + // symbol type + } else if (property == SCIM_PROP_SYMBOL_STYLE_JAPANESE) { + set_symbol_style (SCIM_ANTHY_BRACKET_JAPANESE, + SCIM_ANTHY_SLASH_JAPANESE); + } else if (property == SCIM_PROP_SYMBOL_STYLE_CORNER_BRACKET_SLASH) { + set_symbol_style (SCIM_ANTHY_BRACKET_JAPANESE, + SCIM_ANTHY_SLASH_WIDE); + } else if (property == SCIM_PROP_SYMBOL_STYLE_BRACKET_MIDDLE_DOT) { + set_symbol_style (SCIM_ANTHY_BRACKET_WIDE, + SCIM_ANTHY_SLASH_JAPANESE); + } else if (property == SCIM_PROP_SYMBOL_STYLE_BRACKET_SLASH) { + set_symbol_style (SCIM_ANTHY_BRACKET_WIDE, + SCIM_ANTHY_SLASH_WIDE); + + // dictionary + } else if (property == SCIM_PROP_DICT_ADD_WORD) { + action_add_word (); + } else if (property == SCIM_PROP_DICT_LAUNCH_ADMIN_TOOL) { + action_launch_dict_admin_tool (); + } +} + +void +AnthyInstance::process_helper_event (const String &helper_uuid, + const Transaction &recv) +{ + TransactionReader reader (recv); + int cmd; + + if (helper_uuid != SCIM_ANTHY_HELPER_UUID) + return; + + if (!reader.get_command (cmd)) + return; + + switch (cmd) { + case SCIM_ANTHY_TRANS_CMD_GET_SELECTION: + { + // For reconversion feature, but this code is ad-hoc solution. + + WideString selection, surround; + if (!reader.get_data (selection) || selection.empty ()) + break; + + int cursor; + unsigned int len = selection.length (); + if (!get_surrounding_text (surround, cursor, len, len)) + { + // We expect application to delete selection text. + m_preedit.convert(selection); + set_preedition(); + set_lookup_table(); + } + else + { + // This code will conflict if same string exists at both before and + // after the caret. + if (surround.length () - cursor >= len && + surround.substr (cursor, len) == selection) + { + delete_surrounding_text (0, len); + m_preedit.convert (selection); + set_preedition (); + set_lookup_table (); + } else if (cursor >= (int) len && + surround.substr (cursor - len, len) == selection) + { + delete_surrounding_text (0 - len, len); + m_preedit.convert (selection); + set_preedition (); + set_lookup_table (); + } + } + break; + } + case SCIM_ANTHY_TRANS_CMD_TIMEOUT_NOTIFY: + { + uint32 id; + if (reader.get_data (id) && + m_closures.find (id) != m_closures.end ()) + { + m_closures[id].close (); + m_closures.erase (id); + } + break; + } + default: + break; + } +} + +void +AnthyInstance::reload_config (const ConfigPointer &config) +{ + // set romaji settings + m_preedit.set_symbol_width (m_factory->m_romaji_half_symbol); + m_preedit.set_number_width (m_factory->m_romaji_half_number); + + // set input mode + if (m_on_init || !m_factory->m_show_input_mode_label) { + if (m_factory->m_input_mode == "Hiragana") + m_preedit.set_input_mode (SCIM_ANTHY_MODE_HIRAGANA); + else if (m_factory->m_input_mode == "Katakana") + m_preedit.set_input_mode (SCIM_ANTHY_MODE_KATAKANA); + else if (m_factory->m_input_mode == "HalfKatakana") + m_preedit.set_input_mode (SCIM_ANTHY_MODE_HALF_KATAKANA); + else if (m_factory->m_input_mode == "Latin") + m_preedit.set_input_mode (SCIM_ANTHY_MODE_LATIN); + else if (m_factory->m_input_mode == "WideLatin") + m_preedit.set_input_mode (SCIM_ANTHY_MODE_WIDE_LATIN); + } + + // set typing method and pseudo ASCII mode + if (m_on_init || !m_factory->m_show_typing_method_label) { + if (m_factory->m_typing_method == "NICOLA") { + m_preedit.set_typing_method (SCIM_ANTHY_TYPING_METHOD_NICOLA); + } else if (m_factory->m_typing_method == "Kana") { + m_preedit.set_typing_method (SCIM_ANTHY_TYPING_METHOD_KANA); + } else { + m_preedit.set_typing_method (SCIM_ANTHY_TYPING_METHOD_ROMAJI); + } + m_preedit.set_pseudo_ascii_mode (get_pseudo_ascii_mode ()); + } else { + m_preedit.set_typing_method (get_typing_method ()); + m_preedit.set_pseudo_ascii_mode (get_pseudo_ascii_mode ()); + } + + // set conversion mode + if (m_on_init || !m_factory->m_show_conv_mode_label) { + if (m_factory->m_conversion_mode == "MultiSeg") + m_conv_mode = SCIM_ANTHY_CONVERSION_MULTI_SEGMENT; + else if (m_factory->m_conversion_mode == "SingleSeg") + m_conv_mode = SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT; + else if (m_factory->m_conversion_mode == "CAYT_MultiSeg") + m_conv_mode = SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE; + else if (m_factory->m_conversion_mode == "CAYT_SingleSeg") + m_conv_mode = SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE; + } + + // set period style + if (m_on_init || !m_factory->m_show_period_style_label) { + if (m_factory->m_period_style == "WideLatin") { + m_preedit.set_comma_style (SCIM_ANTHY_COMMA_WIDE); + m_preedit.set_period_style (SCIM_ANTHY_PERIOD_WIDE); + } else if (m_factory->m_period_style == "Latin") { + m_preedit.set_comma_style (SCIM_ANTHY_COMMA_HALF); + m_preedit.set_period_style (SCIM_ANTHY_PERIOD_HALF); + } else if (m_factory->m_period_style == "Japanese") { + m_preedit.set_comma_style (SCIM_ANTHY_COMMA_JAPANESE); + m_preedit.set_period_style (SCIM_ANTHY_PERIOD_JAPANESE); + } else if (m_factory->m_period_style == "WideLatin_Japanese") { + m_preedit.set_comma_style (SCIM_ANTHY_COMMA_WIDE); + m_preedit.set_period_style (SCIM_ANTHY_PERIOD_JAPANESE); + } else { + m_preedit.set_comma_style (SCIM_ANTHY_COMMA_JAPANESE); + m_preedit.set_period_style (SCIM_ANTHY_PERIOD_JAPANESE); + } + } + + // set symbol style + if (m_on_init || !m_factory->m_show_symbol_style_label) { + if (m_factory->m_symbol_style == "Japanese") { + m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_JAPANESE); + m_preedit.set_slash_style (SCIM_ANTHY_SLASH_JAPANESE); + } else if (m_factory->m_symbol_style == "WideBracket_WideSlash") { + m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_WIDE); + m_preedit.set_slash_style (SCIM_ANTHY_SLASH_WIDE); + } else if (m_factory->m_symbol_style == "CornerBracket_WideSlash") { + m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_JAPANESE); + m_preedit.set_slash_style (SCIM_ANTHY_SLASH_WIDE); + } else if (m_factory->m_symbol_style == "WideBracket_MiddleDot") { + m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_WIDE); + m_preedit.set_slash_style (SCIM_ANTHY_SLASH_JAPANESE); + } else { + m_preedit.set_bracket_style (SCIM_ANTHY_BRACKET_JAPANESE); + m_preedit.set_slash_style (SCIM_ANTHY_SLASH_JAPANESE); + } + } + + // set lookup table + if (m_factory->m_cand_win_page_size > 0) + m_lookup_table.set_page_size (m_factory->m_cand_win_page_size); + else + m_lookup_table.set_page_size (SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT); + + // setup toolbar + m_properties.clear (); + install_properties (); + + // set encoding + m_preedit.set_dict_encoding (m_factory->m_dict_encoding); +} + +bool +AnthyInstance::is_single_segment (void) +{ + if (m_conv_mode == SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT || + m_conv_mode == SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE) + return true; + else + return false; +} + +bool +AnthyInstance::is_realtime_conversion (void) +{ + if (m_conv_mode == SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE || + m_conv_mode == SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE) + return true; + else + return false; +} + +int +AnthyInstance::get_pseudo_ascii_mode (void) +{ + int retval = 0; + TypingMethod m = get_typing_method (); + + if (m == SCIM_ANTHY_TYPING_METHOD_ROMAJI) { + if (m_factory->m_romaji_pseudo_ascii_mode) + retval |= SCIM_ANTHY_PSEUDO_ASCII_TRIGGERED_CAPITALIZED; + } + + return retval; +} + +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_imengine.h b/src/scim_anthy_imengine.h new file mode 100755 index 0000000..42f942c --- /dev/null +++ b/src/scim_anthy_imengine.h @@ -0,0 +1,279 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +/* + * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3. + * Copyright (C) 2004 James Su + */ + +#ifndef __SCIM_ANTHY_IMENGINE_H__ +#define __SCIM_ANTHY_IMENGINE_H__ + +#define Uses_SCIM_IMENGINE +#define Uses_SCIM_CONFIG_BASE +#include +#include +#include +#include "scim_anthy_preedit.h" +#include "scim_anthy_key2kana_table.h" + +using namespace scim; +using namespace scim_anthy; + +class AnthyFactory; + +namespace scim_anthy { + +typedef enum { + SCIM_ANTHY_CONVERSION_MULTI_SEGMENT, + SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT, + SCIM_ANTHY_CONVERSION_MULTI_SEGMENT_IMMEDIATE, + SCIM_ANTHY_CONVERSION_SINGLE_SEGMENT_IMMEDIATE, +} ConversionMode; + +typedef void (*timeout_func) (void *data); +typedef void (*delete_func) (void *data); + +class TimeoutClosure +{ +public: + TimeoutClosure () + : m_time_msec (0), + m_timeout_fn (NULL), + m_data (NULL), + m_delete_fn (NULL) + {} + TimeoutClosure (uint32 time_msec, + timeout_func timeout_fn, + void *data, + delete_func delete_fn) + : m_time_msec (time_msec), + m_timeout_fn (timeout_fn), + m_data (data), + m_delete_fn (delete_fn) + {} + virtual ~TimeoutClosure () + { + if (m_delete_fn && m_data) + m_delete_fn (m_data); + } + + void close (void) { m_timeout_fn (m_data); } +private: + uint32 m_time_msec; + timeout_func m_timeout_fn; + void *m_data; + delete_func m_delete_fn; +}; + +typedef std::map TimeoutClosures; + +} + +class AnthyInstance : public IMEngineInstanceBase +{ +public: + AnthyInstance (AnthyFactory *factory, + const String &encoding, + int id = -1); + virtual ~AnthyInstance (); + + virtual bool process_key_event (const KeyEvent& key); + virtual void move_preedit_caret (unsigned int pos); + virtual void select_candidate (unsigned int item); + virtual void update_lookup_table_page_size(unsigned int page_size); + virtual void lookup_table_page_up (void); + virtual void lookup_table_page_down (void); + virtual void reset (void); + virtual void focus_in (void); + virtual void focus_out (void); + virtual void trigger_property (const String &property); + virtual void process_helper_event (const String &helper_uuid, + const Transaction &trans); + + virtual void reload_config (const ConfigPointer &config); + virtual void flush (); + +public: + /* actions */ + bool action_do_nothing (void); + + bool action_convert (void); + bool action_predict (void); + bool action_revert (void); + bool action_cancel_all (void); + bool action_commit_follow_preference (void); + bool action_commit_reverse_preference (void); + bool action_commit_first_segment (void); + bool action_commit_selected_segment (void); + bool action_commit_first_segment_reverse_preference + (void); + bool action_commit_selected_segment_reverse_preference + (void); + bool action_back (void); + bool action_delete (void); + bool action_insert_space (void); + bool action_insert_alternative_space (void); + bool action_insert_half_space (void); + bool action_insert_wide_space (void); + + bool action_move_caret_backward (void); + bool action_move_caret_forward (void); + bool action_move_caret_first (void); + bool action_move_caret_last (void); + + bool action_select_prev_segment (void); + bool action_select_next_segment (void); + bool action_select_first_segment (void); + bool action_select_last_segment (void); + bool action_shrink_segment (void); + bool action_expand_segment (void); + + bool action_select_first_candidate (void); + bool action_select_last_candidate (void); + bool action_select_next_candidate (void); + bool action_select_prev_candidate (void); + bool action_candidates_page_up (void); + bool action_candidates_page_down (void); + + bool action_select_candidate_1 (void); + bool action_select_candidate_2 (void); + bool action_select_candidate_3 (void); + bool action_select_candidate_4 (void); + bool action_select_candidate_5 (void); + bool action_select_candidate_6 (void); + bool action_select_candidate_7 (void); + bool action_select_candidate_8 (void); + bool action_select_candidate_9 (void); + bool action_select_candidate_10 (void); + + bool action_convert_to_hiragana (void); + bool action_convert_to_katakana (void); + bool action_convert_to_half (void); + bool action_convert_to_half_katakana (void); + bool action_convert_to_latin (void); + bool action_convert_to_wide_latin (void); + bool action_convert_char_type_forward (void); + bool action_convert_char_type_backward (void); + bool action_reconvert (void); + + bool action_on_off (void); + + bool action_circle_input_mode (void); + bool action_circle_kana_mode (void); + bool action_circle_typing_method (void); + + bool action_latin_mode (void); + bool action_wide_latin_mode (void); + bool action_hiragana_mode (void); + bool action_katakana_mode (void); + bool action_half_katakana_mode (void); + bool action_cancel_pseudo_ascii_mode (void); + + bool action_add_word (void); + bool action_launch_dict_admin_tool (void); + /* + void actoin_register_word (void); + */ + +public: + AnthyFactory * + get_factory (void); + TypingMethod + get_typing_method (void); + InputMode + get_input_mode (void); + int timeout_add (uint32 time_msec, + timeout_func timeout_fn, + void *data = NULL, + delete_func delete_fn = NULL); + void timeout_remove (uint32 id); + int get_pseudo_ascii_mode (void); + +private: + /* processing key event */ + bool process_key_event_input (const KeyEvent &key); + bool process_key_event_lookup_keybind (const KeyEvent &key); + bool process_key_event_latin_mode (const KeyEvent &key); + bool process_key_event_wide_latin_mode (const KeyEvent &key); + + /* utility */ + void set_preedition (void); + void set_aux_string (void); + void set_lookup_table (void); + void unset_lookup_table (void); + void install_properties (void); + void set_input_mode (InputMode mode); + void set_conversion_mode (ConversionMode mode); + void set_typing_method (TypingMethod method); + void set_period_style (PeriodStyle period, + CommaStyle comma); + void set_symbol_style (BracketStyle bracket, + SlashStyle slash); + bool is_selecting_candidates (void); + void select_candidate_no_direct (unsigned int item); + bool convert_kana (CandidateType type); + + bool action_commit (bool learn); + bool action_select_candidate (unsigned int i); + + bool is_single_segment (void); + bool is_realtime_conversion (void); + +private: // FIXME! + bool is_nicola_thumb_shift_key (const KeyEvent &key); + +private: + AnthyFactory *m_factory; + + bool m_on_init; + + /* for preedit */ + Preedit m_preedit; + bool m_preedit_string_visible; + + /* for candidates window */ + CommonLookupTable m_lookup_table; + bool m_lookup_table_visible; + unsigned int m_n_conv_key_pressed; + + /* for toggling latin and wide latin */ + InputMode m_prev_input_mode; + + /* for toolbar */ + PropertyList m_properties; + + /* */ + ConversionMode m_conv_mode; + + /* for action */ + KeyEvent m_last_key; + + /* Helper */ + bool m_helper_started; + + /* timeout */ + uint32 m_timeout_id_seq; + TimeoutClosures m_closures; +}; +#endif /* __SCIM_ANTHY_IMENGINE_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_intl.h b/src/scim_anthy_intl.h new file mode 100755 index 0000000..42d7a09 --- /dev/null +++ b/src/scim_anthy_intl.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) Hiroyuki Ikezoe + * Copyright (C) 2004 - 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __INTL_H__ +#define __INTL_H__ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#ifdef HAVE_GETTEXT + #include + #define _(String) dgettext(GETTEXT_PACKAGE,String) + #define N_(String) (String) +#else + #define _(String) (String) + #define N_(String) (String) + #define bindtextdomain(Package,Directory) + #define textdomain(domain) + #define bind_textdomain_codeset(domain,codeset) +#endif + +#endif /* __INTL_H__ */ diff --git a/src/scim_anthy_kana.cpp b/src/scim_anthy_kana.cpp new file mode 100755 index 0000000..9bf0bef --- /dev/null +++ b/src/scim_anthy_kana.cpp @@ -0,0 +1,251 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#include + +#include "scim_anthy_kana.h" +#include "scim_anthy_factory.h" +#include "scim_anthy_imengine.h" +#include "scim_anthy_default_tables.h" +#include "scim_anthy_utils.h" + +using namespace scim_anthy; + +static bool +has_voiced_consonant (String str) +{ + VoicedConsonantRule *table = scim_anthy_voiced_consonant_table; + + for (unsigned int i = 0; table[i].string; i++) { + if (!strcmp (str.c_str (), table[i].string) && + table[i].voiced && *table[i].voiced) + { + return true; + } + } + + return false; +} + +static bool +has_half_voiced_consonant (String str) +{ + VoicedConsonantRule *table = scim_anthy_voiced_consonant_table; + + for (unsigned int i = 0; table[i].string; i++) { + if (!strcmp (str.c_str (), table[i].string) && + table[i].half_voiced && *table[i].half_voiced) + { + return true; + } + } + + return false; +} + +String +to_voiced_consonant (String str) +{ + VoicedConsonantRule *table = scim_anthy_voiced_consonant_table; + + for (unsigned int i = 0; table[i].string; i++) { + if (!strcmp (str.c_str (), table[i].string)) + return String (table[i].voiced); + } + + return str; +} + +String +to_half_voiced_consonant (String str) +{ + VoicedConsonantRule *table = scim_anthy_voiced_consonant_table; + + for (unsigned int i = 0; table[i].string; i++) { + if (!strcmp (str.c_str (), table[i].string)) + return String (table[i].half_voiced); + } + + return str; +} + +KanaConvertor::KanaConvertor (AnthyInstance &anthy) + : m_anthy (anthy) +{ +} + +KanaConvertor::~KanaConvertor () +{ +} + +bool +KanaConvertor::can_append (const KeyEvent & key, + bool ignore_space) +{ + // ignore key release. + if (key.is_key_release ()) + return false; + + // ignore short cut keys of apllication. + if (key.mask & SCIM_KEY_ControlMask || + key.mask & SCIM_KEY_AltMask) + { + return false; + } + + if (key.code == SCIM_KEY_overline || + (key.code >= SCIM_KEY_kana_fullstop && + key.code <= SCIM_KEY_semivoicedsound)) + { + return true; + } + +#if 0 + if (key.code == SCIM_KEY_KP_Equal || + (key.code >= SCIM_KEY_KP_Multiply && + key.code <= SCIM_KEY_KP_9)) + { + return true; + } +#endif + + return false; +} + +bool +KanaConvertor::append (const KeyEvent & key, + WideString & result, + WideString & pending, + String &raw) +{ + KeyCodeToCharRule *table = scim_anthy_keypad_table; + + // handle keypad code + if (key.code == SCIM_KEY_KP_Equal || + (key.code >= SCIM_KEY_KP_Multiply && + key.code <= SCIM_KEY_KP_9)) + { + String ten_key_type = m_anthy.get_factory()->m_ten_key_type; + + for (unsigned int i = 0; table[i].code; i++) { + if (table[i].code == key.code) { + if (ten_key_type == "Wide") + util_convert_to_wide (result, table[i].kana); + else + result = utf8_mbstowcs (table[i].kana); + raw = table[i].kana; + + return false; + } + } + } + + table = scim_anthy_kana_table; + + // handle voiced sound + if (key.code == SCIM_KEY_voicedsound && + !m_pending.empty () && has_voiced_consonant (m_pending)) + { + result = utf8_mbstowcs (to_voiced_consonant (m_pending)); + raw = key.get_ascii_code (); + m_pending = String (); + return false; + } + + // handle semi voiced sound + if (key.code == SCIM_KEY_semivoicedsound && + !m_pending.empty () && has_half_voiced_consonant (m_pending)) + { + result = utf8_mbstowcs (to_half_voiced_consonant (m_pending)); + raw = key.get_ascii_code (); + m_pending = String (); + return false; + } + + // kana key code + for (unsigned int i = 0; table[i].code; i++) { + if (table[i].code == key.code) { + bool retval = m_pending.empty () ? false : true; + + if (has_voiced_consonant (table[i].kana)) { + result = WideString (); + pending = utf8_mbstowcs (table[i].kana); + m_pending = table[i].kana; + } else { + result = utf8_mbstowcs (table[i].kana); + m_pending = String (); + } + raw = key.get_ascii_code (); + + return retval; + } + } + + String s; + s += key.get_ascii_code (); + raw = s; + + return append (raw, result, pending); +} + +bool +KanaConvertor::append (const String & str, + WideString & result, + WideString & pending) +{ + result = utf8_mbstowcs (str); + m_pending = String (); + + return false; +} + +void +KanaConvertor::clear (void) +{ + m_pending = String (); +} + +bool +KanaConvertor::is_pending (void) +{ + return !m_pending.empty (); +} + +WideString +KanaConvertor::get_pending (void) +{ + return WideString (utf8_mbstowcs (m_pending)); +} + +WideString +KanaConvertor::flush_pending (void) +{ + return WideString (); +} + +void +KanaConvertor::reset_pending (const WideString &result, const String &raw) +{ + m_pending = String (); + if (has_voiced_consonant (utf8_wcstombs (result))) + m_pending = utf8_wcstombs (result); +} +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_kana.h b/src/scim_anthy_kana.h new file mode 100755 index 0000000..c8ffc87 --- /dev/null +++ b/src/scim_anthy_kana.h @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_KANA_H__ +#define __SCIM_ANTHY_KANA_H__ + +#define Uses_SCIM_ICONV +#define Uses_SCIM_EVENT +#include + +#include "scim_anthy_key2kana_base.h" +#include "scim_anthy_default_tables.h" +#include "scim_anthy_key2kana_table.h" + +using namespace scim; + +class AnthyInstance; + +namespace scim_anthy { + +class KanaConvertor : public Key2KanaConvertorBase +{ +public: + KanaConvertor (AnthyInstance & anthy); + virtual ~KanaConvertor (); + + bool can_append (const KeyEvent & key, + bool ignore_space = false); + bool append (const KeyEvent & key, + WideString & result, + WideString & pending, + String & raw); + bool append (const String & raw, + WideString & result, + WideString & pending); + void clear (void); + + bool is_pending (void); + WideString get_pending (void); + WideString flush_pending (void); + void reset_pending (const WideString & result, + const String & raw); + +private: + AnthyInstance &m_anthy; + + // state + String m_pending; +}; + +} +#endif /* __SCIM_ANTHY_KANA_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_key2kana.cpp b/src/scim_anthy_key2kana.cpp new file mode 100755 index 0000000..8c400e0 --- /dev/null +++ b/src/scim_anthy_key2kana.cpp @@ -0,0 +1,323 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +#include "scim_anthy_key2kana.h" +#include "scim_anthy_factory.h" +#include "scim_anthy_imengine.h" +#include "scim_anthy_utils.h" + +using namespace scim_anthy; + +Key2KanaConvertor::Key2KanaConvertor (AnthyInstance & anthy, + Key2KanaTableSet & tables) + : m_anthy (anthy), + m_tables (tables), + m_is_in_pseudo_ascii_mode (false) +{ + set_case_sensitive (false); + set_pseudo_ascii_mode (0); +} + +Key2KanaConvertor::~Key2KanaConvertor () +{ +} + +bool +Key2KanaConvertor::can_append (const KeyEvent & key, + bool ignore_space) +{ + // ignore key release. + if (key.is_key_release ()) + return false; + + // ignore short cut keys of apllication. + if (key.mask & SCIM_KEY_ControlMask || + key.mask & SCIM_KEY_AltMask) + { + return false; + } + + if (isprint(key.get_ascii_code ()) && + (ignore_space || !isspace(key.get_ascii_code ()))) + return true; + + if (util_key_is_keypad (key)) + return true; + + return false; +} + +bool +Key2KanaConvertor::append (const KeyEvent & key, + WideString & result, + WideString & pending, + String &raw) +{ + if (!can_append (key)) + return false; + + m_last_key = key; + + util_keypad_to_string (raw, key); + + if (util_key_is_keypad (key)) { + bool retval = false; + WideString wide; + String ten_key_type = m_anthy.get_factory()->m_ten_key_type; + + // convert key pad string to wide + if ((ten_key_type == "FollowMode" && + (m_anthy.get_input_mode () == SCIM_ANTHY_MODE_LATIN || + m_anthy.get_input_mode () == SCIM_ANTHY_MODE_HALF_KATAKANA)) || + ten_key_type == "Half") + { + wide = utf8_mbstowcs (raw); + } else { + util_convert_to_wide (wide, raw); + } + + // join to previous string + if (!m_exact_match.is_empty()) { + if (!m_exact_match.get_result(0).empty() && + m_exact_match.get_result(1).empty()) + { + result = utf8_mbstowcs (m_exact_match.get_result(0)); + } else { + retval = true; /* commit prev pending */ + } + result += wide; + } else { + if (m_pending.length () > 0) + retval = true; /* commit prev pending */ + result = wide; + } + + m_pending.clear (); + m_exact_match.clear (); + + return retval; + + } else { + // the key isn't keypad + return append (raw, result, pending); + } +} + +bool +Key2KanaConvertor::append (const String & str, + WideString & result, WideString & pending) +{ + WideString widestr = utf8_mbstowcs (str); + WideString matching_str = m_pending + widestr; + Key2KanaRule exact_match; + bool has_partial_match = false; + bool retval = false; + + if (m_pseudo_ascii_mode != 0 && process_pseudo_ascii_mode (widestr)) { + m_pending += widestr; + pending = m_pending; + return false; + } + if (!m_case_sensitive) { + String half = utf8_wcstombs (matching_str); + for (unsigned int i = 0; i < half.length (); i++) + half[i] = tolower (half[i]); + matching_str = utf8_mbstowcs (half); + } + + /* find matched table */ + if ((m_anthy.get_typing_method () == SCIM_ANTHY_TYPING_METHOD_KANA) && + (m_last_key.mask & /*SCIM_KEY_QuirkKanaRoMask*/ (1<<14)) && + (m_anthy.get_factory()->m_kana_layout_ro_key.length () > 0)) + { + // Special treatment for Kana "Ro" key. + // This code is a temporary solution. It doesn't care some minor cases. + std::vector kana_ro_result; + scim_split_string_list (kana_ro_result, + m_anthy.get_factory()->m_kana_layout_ro_key); + Key2KanaRule kana_ro_rule("\\", kana_ro_result); + result = utf8_mbstowcs (kana_ro_rule.get_result (0)); + m_pending.clear (); + m_exact_match.clear (); + if (matching_str == utf8_mbstowcs ("\\")) { + return false; + } else { + return true; + } + + } else { + std::vector &tables = m_tables.get_tables(); + for (unsigned int j = 0; j < tables.size(); j++) { + if (!tables[j]) + continue; + + Key2KanaRules &rules = tables[j]->get_table (); + + for (unsigned int i = 0; i < rules.size(); i++) { + /* matching */ + String seq = rules[i].get_sequence (); + if (!m_case_sensitive) { + for (unsigned int j = 0; j < seq.length (); j++) + seq[j] = tolower (seq[j]); + } + WideString romaji = utf8_mbstowcs(seq); + if (romaji.find (matching_str) == 0) { + if (romaji.length () == matching_str.length ()) { + /* exact match */ + exact_match = rules[i]; + } else { + /* partial match */ + has_partial_match = true; + } + } + } + } + } + + /* return result */ + if (has_partial_match) { + m_exact_match = exact_match; + result.clear (); + m_pending += widestr; + pending = m_pending; + + } else if (!exact_match.is_empty()) { + if (!exact_match.get_result(1).empty()) + m_exact_match = exact_match; + else + m_exact_match.clear (); + m_pending = utf8_mbstowcs (exact_match.get_result (1)); + result = utf8_mbstowcs (exact_match.get_result (0)); + pending = m_pending; + + } else { + if (!m_exact_match.is_empty()) { + if (!m_exact_match.get_result(0).empty() && + m_exact_match.get_result(1).empty()) + { + result = utf8_mbstowcs (m_exact_match.get_result(0)); + } else { + retval = true; /* commit prev pending */ + } + m_pending.clear (); + m_exact_match.clear (); + + WideString tmp_result; + append(str, tmp_result, pending); + result += tmp_result; + + } else { + if (m_pending.length () > 0) { + retval = true; /* commit prev pending */ + m_pending = widestr; + pending = m_pending; + + } else { + result = widestr; + pending.clear(); + m_pending.clear (); + } + } + } + + return retval; +} + +void +Key2KanaConvertor::clear (void) +{ + m_pending.clear (); + m_exact_match.clear (); + m_last_key = KeyEvent (); + reset_pseudo_ascii_mode(); +} + +bool +Key2KanaConvertor::is_pending (void) +{ + if (m_pending.length () > 0) + return true; + else + return false; +} + +WideString +Key2KanaConvertor::get_pending (void) +{ + return m_pending; +} + +WideString +Key2KanaConvertor::flush_pending (void) +{ + WideString result; + if (!m_exact_match.is_empty ()) { + if (!m_exact_match.get_result(0).empty() && + m_exact_match.get_result(1).empty()) + { + result = utf8_mbstowcs (m_exact_match.get_result(0)); + } else if (!m_exact_match.get_result(1).empty()) { + result += utf8_mbstowcs (m_exact_match.get_result(1)); + } else if (m_pending.length () > 0) { + result += m_pending; + } + } + clear (); + return result; +} + +void +Key2KanaConvertor::reset_pending (const WideString &result, const String &raw) +{ + m_last_key = KeyEvent (); + + for (unsigned int i = 0; i < raw.length (); i++) { + WideString res, pend; + append (raw.substr(i, 1), res, pend); + } +} + +bool +Key2KanaConvertor::process_pseudo_ascii_mode (const WideString & wstr) +{ + for (unsigned int i = 0; i < wstr.length (); i++) { + if ((wstr[i] >= 'A' && wstr[i] <= 'Z') || + iswspace(wstr[i])) + { + m_is_in_pseudo_ascii_mode = true; + } else if (wstr[i] >= 0x80) { + m_is_in_pseudo_ascii_mode = false; + } + } + + return m_is_in_pseudo_ascii_mode; +} + +void +Key2KanaConvertor::reset_pseudo_ascii_mode (void) +{ + if (m_is_in_pseudo_ascii_mode) + m_pending.clear(); + m_is_in_pseudo_ascii_mode = false; +} + +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_key2kana.h b/src/scim_anthy_key2kana.h new file mode 100755 index 0000000..a72572a --- /dev/null +++ b/src/scim_anthy_key2kana.h @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_KEY2KANA_H__ +#define __SCIM_ANTHY_KEY2KANA_H__ + +#define Uses_SCIM_EVENT +#include + +#include "scim_anthy_key2kana_base.h" +#include "scim_anthy_default_tables.h" +#include "scim_anthy_key2kana_table.h" + +using namespace scim; + +class AnthyInstance; + +namespace scim_anthy { + +class Key2KanaConvertor : public Key2KanaConvertorBase +{ +public: + Key2KanaConvertor (AnthyInstance & anthy, + Key2KanaTableSet & tables); + virtual ~Key2KanaConvertor (); + + bool can_append (const KeyEvent & key, + bool ignore_space = false); + bool append (const KeyEvent & key, + WideString & result, + WideString & pending, + String & raw); + void clear (void); + + bool is_pending (void); + WideString get_pending (void); + WideString flush_pending (void); + void reset_pending (const WideString & result, + const String & raw); + void set_pseudo_ascii_mode (int mode) + { m_pseudo_ascii_mode = mode; } + bool is_pseudo_ascii_mode (void) + { return m_is_in_pseudo_ascii_mode; } + bool process_pseudo_ascii_mode (const WideString & wstr); + void reset_pseudo_ascii_mode (void); + +private: + bool append (const String & str, + WideString & result, + WideString & pending); + +private: + AnthyInstance &m_anthy; + Key2KanaTableSet &m_tables; + + // state + KeyEvent m_last_key; + WideString m_pending; + Key2KanaRule m_exact_match; + int m_pseudo_ascii_mode; + bool m_is_in_pseudo_ascii_mode; + bool m_reset_pseudo_ascii_mode; +}; + +} +#endif /* __SCIM_ANTHY_KEY2KANA_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_key2kana_base.h b/src/scim_anthy_key2kana_base.h new file mode 100755 index 0000000..e48c0e2 --- /dev/null +++ b/src/scim_anthy_key2kana_base.h @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_KEY2KANA_BASE_H__ +#define __SCIM_ANTHY_KEY2KANA_BASE_H__ + +#define Uses_SCIM_EVENT +#include + +using namespace scim; + +namespace scim_anthy { + +class Key2KanaConvertorBase +{ +public: + Key2KanaConvertorBase () + : m_case_sensitive (true) + {}; + virtual ~Key2KanaConvertorBase () {}; + + virtual bool can_append (const KeyEvent & key, + bool ignore_space = false) = 0; + virtual bool append (const KeyEvent & key, + WideString & result, + WideString & pending, + String & raw) = 0; + virtual bool append (const String & raw, + WideString & result, + WideString & pending) = 0; + virtual void clear (void) = 0; + + virtual bool is_pending (void) = 0; + virtual WideString get_pending (void) = 0; + virtual WideString flush_pending (void) = 0; + virtual void reset_pending (const WideString & result, + const String & raw) = 0; + + virtual void reset_pseudo_ascii_mode (void) + {} + virtual bool process_pseudo_ascii_mode (const WideString & wstr) + { return false; } + + virtual void set_case_sensitive (bool sensitive) + { m_case_sensitive = sensitive; } + virtual bool get_case_sensitive (void) + { return m_case_sensitive; } + +protected: + bool m_case_sensitive; +}; + +} +#endif /* __SCIM_ANTHY_KEY2KANA_BASE_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_key2kana_table.cpp b/src/scim_anthy_key2kana_table.cpp new file mode 100755 index 0000000..b41dc5b --- /dev/null +++ b/src/scim_anthy_key2kana_table.cpp @@ -0,0 +1,511 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#include "scim_anthy_key2kana_table.h" + +using namespace scim_anthy; + +// fundamental table +static Key2KanaTable romaji_table ( + utf8_mbstowcs ("DefaultRomajiTable"), + scim_anthy_romaji_typing_rule); +static Key2KanaTable romaji_double_consonant_table ( + utf8_mbstowcs ("DefaultRomajiDoubleConsonantTable"), + scim_anthy_romaji_double_consonant_rule); +static Key2KanaTable kana_table ( + utf8_mbstowcs ("DefaultKanaTable"), + scim_anthy_kana_typing_rule); +static Key2KanaTable kana_voiced_consonant_table ( + utf8_mbstowcs ("DefaultKanaVoicedConsonantTable"), + scim_anthy_kana_voiced_consonant_rule); +static Key2KanaTable nicola_table ( + utf8_mbstowcs ("DefaultNICOLATable"), + scim_anthy_nicola_table); + +// symbols +static Key2KanaTable half_symbol_table ( + utf8_mbstowcs ("DefaultRomajiHalfSymbolTable"), + scim_anthy_half_symbol_rule); +static Key2KanaTable wide_symbol_table ( + utf8_mbstowcs ("DefaultRomajiWideSymbolTable"), + scim_anthy_wide_symbol_rule); + +// numbers +static Key2KanaTable half_number_table ( + utf8_mbstowcs ("DefaultRomajiHalfNumberTable"), + scim_anthy_half_number_rule); +static Key2KanaTable wide_number_table ( + utf8_mbstowcs ("DefaultRomajiWideNumberTable"), + scim_anthy_wide_number_rule); + +// period +static Key2KanaTable romaji_ja_period_table ( + utf8_mbstowcs ("DefaultRomajiJaPeriodTable"), + scim_anthy_romaji_ja_period_rule); +static Key2KanaTable romaji_wide_period_table ( + utf8_mbstowcs ("DefaultRomajiWidePeriodTable"), + scim_anthy_romaji_wide_period_rule); +static Key2KanaTable romaji_half_period_table ( + utf8_mbstowcs ("DefaultRomajiHalfPeriodTable"), + scim_anthy_romaji_half_period_rule); + +static Key2KanaTable kana_ja_period_table ( + utf8_mbstowcs ("DefaultKanaJaPeriodTable"), + scim_anthy_kana_ja_period_rule); +static Key2KanaTable kana_wide_period_table ( + utf8_mbstowcs ("DefaultKanaWidePeriodTable"), + scim_anthy_kana_wide_period_rule); +static Key2KanaTable kana_half_period_table ( + utf8_mbstowcs ("DefaultKanaHalfPeriodTable"), + scim_anthy_kana_half_period_rule); + +// comma +static Key2KanaTable romaji_ja_comma_table ( + utf8_mbstowcs ("DefaultRomajiJaCommaTable"), + scim_anthy_romaji_ja_comma_rule); +static Key2KanaTable romaji_wide_comma_table ( + utf8_mbstowcs ("DefaultRomajiWideCommaTable"), + scim_anthy_romaji_wide_comma_rule); +static Key2KanaTable romaji_half_comma_table ( + utf8_mbstowcs ("DefaultRomajiHalfCommaTable"), + scim_anthy_romaji_half_comma_rule); + +static Key2KanaTable kana_ja_comma_table ( + utf8_mbstowcs ("DefaultKanaJaCommaTable"), + scim_anthy_kana_ja_comma_rule); +static Key2KanaTable kana_wide_comma_table ( + utf8_mbstowcs ("DefaultKanaWideCommaTable"), + scim_anthy_kana_wide_comma_rule); +static Key2KanaTable kana_half_comma_table ( + utf8_mbstowcs ("DefaultKanaHalfCommaTable"), + scim_anthy_kana_half_comma_rule); + +// bracket +static Key2KanaTable romaji_ja_bracket_table ( + utf8_mbstowcs ("DefaultRomajiJaBracketTable"), + scim_anthy_romaji_ja_bracket_rule); +static Key2KanaTable romaji_wide_bracket_table ( + utf8_mbstowcs ("DefaultRomajiWideBracketTable"), + scim_anthy_romaji_wide_bracket_rule); + +static Key2KanaTable kana_ja_bracket_table ( + utf8_mbstowcs ("DefaultKanaJaBracketTable"), + scim_anthy_kana_ja_bracket_rule); +static Key2KanaTable kana_wide_bracket_table ( + utf8_mbstowcs ("DefaultRomajiWideBracketTable"), + scim_anthy_kana_wide_bracket_rule); + +// slash +static Key2KanaTable romaji_ja_slash_table ( + utf8_mbstowcs ("DefaultRomajiJaSlashTable"), + scim_anthy_romaji_ja_slash_rule); +static Key2KanaTable romaji_wide_slash_table ( + utf8_mbstowcs ("DefaultRomajiWideSlashTable"), + scim_anthy_romaji_wide_slash_rule); + +static Key2KanaTable kana_ja_slash_table ( + utf8_mbstowcs ("DefaultKanaJaSlashTable"), + scim_anthy_kana_ja_slash_rule); +static Key2KanaTable kana_wide_slash_table ( + utf8_mbstowcs ("DefaultRomajiWideSlashTable"), + scim_anthy_kana_wide_slash_rule); + + +Key2KanaRule::Key2KanaRule () +{ +} + +Key2KanaRule::Key2KanaRule (String sequence, + const std::vector &result) + : m_sequence (sequence), + m_result (result) +{ +} + + +Key2KanaRule::~Key2KanaRule () +{ +} + +String +Key2KanaRule::get_sequence (void) +{ + return m_sequence; +} + +String +Key2KanaRule::get_result (unsigned int idx) +{ + if (idx < m_result.size ()) + return m_result[idx]; + + return String (); +} + +void +Key2KanaRule::clear (void) +{ + m_sequence = String (); + m_result.clear (); +} + +bool +Key2KanaRule::is_empty (void) +{ + if (!m_sequence.empty ()) + return false; + + if (m_result.empty ()) + return true; + + for (unsigned int i = 0; i < m_result.size (); i++) { + if (!m_result[i].empty ()) + return false; + } + + return true; +} + + +Key2KanaTable::Key2KanaTable (WideString name) + : m_name (name) +{ +} + +Key2KanaTable::Key2KanaTable (WideString name, ConvRule *table) + : m_name (name) +{ + for (unsigned int i = 0; table[i].string; i++) { + append_rule (table[i].string ? table[i].string : "", + table[i].result ? table[i].result : "", + table[i].cont ? table[i].cont : ""); + } +} + +Key2KanaTable::Key2KanaTable (WideString name, NicolaRule *table) + : m_name (name) +{ + for (unsigned int i = 0; table[i].key; i++) { + append_rule (table[i].key ? table[i].key : "", + table[i].single ? table[i].single : "", + table[i].left_shift ? table[i].left_shift : "", + table[i].right_shift ? table[i].right_shift : ""); + } +} + +Key2KanaTable::~Key2KanaTable () +{ +} + +void +Key2KanaTable::append_rule (String sequence, + const std::vector &result) +{ + m_rules.push_back (Key2KanaRule (sequence, result)); +} + +void +Key2KanaTable::append_rule (String sequence, + String result, + String cont) +{ + std::vector list; + list.push_back (result); + list.push_back (cont); + m_rules.push_back (Key2KanaRule (sequence, list)); +} + +void +Key2KanaTable::append_rule (String sequence, + String normal, + String left_shift, + String right_shift) +{ + std::vector list; + list.push_back (normal); + list.push_back (left_shift); + list.push_back (right_shift); + m_rules.push_back (Key2KanaRule (sequence, list)); +} + +void +Key2KanaTable::clear (void) +{ + m_rules.clear (); + +} + +Key2KanaTableSet::Key2KanaTableSet () + : m_name (utf8_mbstowcs ("")), + m_fundamental_table (NULL), + m_voiced_consonant_table (Key2KanaTable (utf8_mbstowcs ("voiced consonant table"))), + m_additional_table (NULL), + m_typing_method (SCIM_ANTHY_TYPING_METHOD_ROMAJI), + m_period_style (SCIM_ANTHY_PERIOD_JAPANESE), + m_comma_style (SCIM_ANTHY_COMMA_JAPANESE), + m_bracket_style (SCIM_ANTHY_BRACKET_JAPANESE), + m_slash_style (SCIM_ANTHY_SLASH_JAPANESE), + m_use_half_symbol (false), + m_use_half_number (false) +{ + set_typing_method (m_typing_method); +} + +Key2KanaTableSet::~Key2KanaTableSet () +{ +} + +void +Key2KanaTableSet::set_typing_method (TypingMethod method, + Key2KanaTable *fundamental_table) +{ + m_typing_method = method; + m_fundamental_table = fundamental_table; + reset_tables (); +} + +void +Key2KanaTableSet::set_symbol_width (bool half) +{ + m_use_half_symbol = half; + reset_tables (); +} + +void +Key2KanaTableSet::set_number_width (bool half) +{ + m_use_half_number = half; + reset_tables (); +} + +void +Key2KanaTableSet::set_period_style (PeriodStyle style) +{ + m_period_style = style; + reset_tables (); +} + +void +Key2KanaTableSet::set_comma_style (CommaStyle style) +{ + m_comma_style = style; + reset_tables (); +} + +void +Key2KanaTableSet::set_bracket_style (BracketStyle style) +{ + m_bracket_style = style; + reset_tables (); +} + +void +Key2KanaTableSet::set_slash_style (SlashStyle style) +{ + m_slash_style = style; + reset_tables (); +} + +static void +create_voiced_consonant_table (Key2KanaTable &table, Key2KanaTable &fund_table) +{ + table.clear (); + + const String sonant_mark = String ("\xE3\x82\x9B"); + const String half_sonant_mark = String ("\xE3\x82\x9C"); + std::vector sonant_mark_list; + std::vector half_sonant_mark_list; + + Key2KanaRules::iterator it; + Key2KanaRules &rules = fund_table.get_table (); + for (it = rules.begin (); it != rules.end (); it++) { + String result = it->get_result (0); + if (result == sonant_mark) + sonant_mark_list.push_back (it->get_sequence ()); + else if (result == half_sonant_mark) + half_sonant_mark_list.push_back (it->get_sequence ()); + } + + VoicedConsonantRule *templ = scim_anthy_voiced_consonant_table; + + for (unsigned int i = 0; templ[i].string; i++) { + if (templ[i].voiced && *templ[i].voiced) { + std::vector::iterator it; + for (it = sonant_mark_list.begin (); + it != sonant_mark_list.end (); + it++) + { + table.append_rule (String (templ[i].string) + *it, + String (templ[i].voiced), + String ()); + } + } + if (templ[i].half_voiced && *templ[i].half_voiced) { + std::vector::iterator it; + for (it = half_sonant_mark_list.begin (); + it != half_sonant_mark_list.end (); + it++) + { + table.append_rule (String (templ[i].string) + *it, + String (templ[i].half_voiced), + String ()); + } + } + } +} + +void +Key2KanaTableSet::reset_tables (void) +{ + m_all_tables.clear (); + + bool is_romaji = m_typing_method == SCIM_ANTHY_TYPING_METHOD_ROMAJI; + bool is_kana = m_typing_method == SCIM_ANTHY_TYPING_METHOD_KANA; + bool is_nicola = m_typing_method == SCIM_ANTHY_TYPING_METHOD_NICOLA; + + // symbols table + if (m_use_half_symbol) + m_all_tables.push_back (&half_symbol_table); + else + m_all_tables.push_back (&wide_symbol_table); + + // numbers table + if (m_use_half_number) + m_all_tables.push_back (&half_number_table); + else + m_all_tables.push_back (&wide_number_table); + + if (is_romaji || is_kana) + { + switch (m_period_style) { + case SCIM_ANTHY_PERIOD_JAPANESE: + if (is_romaji) + m_all_tables.push_back (&romaji_ja_period_table); + else + m_all_tables.push_back (&kana_ja_period_table); + break; + case SCIM_ANTHY_PERIOD_WIDE: + if (is_romaji) + m_all_tables.push_back (&romaji_wide_period_table); + else + m_all_tables.push_back (&kana_wide_period_table); + break; + case SCIM_ANTHY_PERIOD_HALF: + if (is_romaji) + m_all_tables.push_back (&romaji_half_period_table); + else + m_all_tables.push_back (&kana_half_period_table); + break; + default: + break; + } + } + + if (is_romaji || is_kana) + { + switch (m_comma_style) { + case SCIM_ANTHY_COMMA_JAPANESE: + if (is_romaji) + m_all_tables.push_back (&romaji_ja_comma_table); + else + m_all_tables.push_back (&kana_ja_comma_table); + break; + case SCIM_ANTHY_COMMA_WIDE: + if (is_romaji) + m_all_tables.push_back (&romaji_wide_comma_table); + else + m_all_tables.push_back (&kana_wide_comma_table); + break; + case SCIM_ANTHY_COMMA_HALF: + if (is_romaji) + m_all_tables.push_back (&romaji_half_comma_table); + else + m_all_tables.push_back (&kana_half_comma_table); + break; + default: + break; + } + } + + if (is_romaji || is_kana) + { + switch (m_bracket_style) { + case SCIM_ANTHY_BRACKET_JAPANESE: + if (is_romaji) + m_all_tables.push_back (&romaji_ja_bracket_table); + else + m_all_tables.push_back (&kana_ja_bracket_table); + break; + case SCIM_ANTHY_BRACKET_WIDE: + if (is_romaji) + m_all_tables.push_back (&romaji_wide_bracket_table); + else + m_all_tables.push_back (&kana_wide_bracket_table); + break; + default: + break; + } + } + + if (is_romaji || is_kana) + { + switch (m_slash_style) { + case SCIM_ANTHY_SLASH_JAPANESE: + if (is_romaji) + m_all_tables.push_back (&romaji_ja_slash_table); + else + m_all_tables.push_back (&kana_ja_slash_table); + break; + case SCIM_ANTHY_SLASH_WIDE: + if (is_romaji) + m_all_tables.push_back (&romaji_wide_slash_table); + else + m_all_tables.push_back (&kana_wide_slash_table); + break; + default: + break; + } + } + + if (!m_fundamental_table) { + if (is_romaji) { + m_all_tables.push_back (&romaji_double_consonant_table); + m_all_tables.push_back (&romaji_table); + } else if (is_kana) { + create_voiced_consonant_table (m_voiced_consonant_table, + kana_table); + m_all_tables.push_back (&m_voiced_consonant_table); + m_all_tables.push_back (&kana_table); + } else if (is_nicola) { + m_all_tables.push_back (&nicola_table); + } + } else { + if (is_romaji) { + m_all_tables.push_back (&romaji_double_consonant_table); + m_all_tables.push_back (m_fundamental_table); + } else if (is_kana) { + create_voiced_consonant_table (m_voiced_consonant_table, + *m_fundamental_table); + m_all_tables.push_back (&m_voiced_consonant_table); + m_all_tables.push_back (m_fundamental_table); + } else if (is_nicola) { + m_all_tables.push_back (m_fundamental_table); + } + } +} diff --git a/src/scim_anthy_key2kana_table.h b/src/scim_anthy_key2kana_table.h new file mode 100755 index 0000000..94fe9af --- /dev/null +++ b/src/scim_anthy_key2kana_table.h @@ -0,0 +1,190 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_KEY2KANA_TABLE_H__ +#define __SCIM_ANTHY_KEY2KANA_TABLE_H__ + +#define Uses_SCIM_TYPES +#include +#include "scim_anthy_default_tables.h" + +using namespace scim; + +namespace scim_anthy { + +typedef enum { + SCIM_ANTHY_PERIOD_JAPANESE, + SCIM_ANTHY_PERIOD_WIDE, + SCIM_ANTHY_PERIOD_HALF, +} PeriodStyle; + +typedef enum { + SCIM_ANTHY_COMMA_JAPANESE, + SCIM_ANTHY_COMMA_WIDE, + SCIM_ANTHY_COMMA_HALF, +} CommaStyle; + +typedef enum { + SCIM_ANTHY_BRACKET_JAPANESE, + SCIM_ANTHY_BRACKET_WIDE, +} BracketStyle; + +typedef enum { + SCIM_ANTHY_SLASH_JAPANESE, + SCIM_ANTHY_SLASH_WIDE, +} SlashStyle; + +typedef enum { + SCIM_ANTHY_TYPING_METHOD_ROMAJI, + SCIM_ANTHY_TYPING_METHOD_KANA, + SCIM_ANTHY_TYPING_METHOD_NICOLA, + SCIM_ANTHY_TYPING_METHOD_CUSTOM, +} TypingMethod; + + +class Key2KanaRule; +class Key2KanaTable; +class Key2KanaTableSet; + +typedef std::vector Key2KanaRules; + + +class Key2KanaRule +{ +public: + Key2KanaRule (); + Key2KanaRule (String sequence, + const std::vector &result); + virtual ~Key2KanaRule (); + + String get_sequence (void); + String get_result (unsigned int idx); + + void clear (void); + + bool is_empty (void); + +private: + String m_sequence; + std::vector m_result; +}; + + +class Key2KanaTable +{ +public: + Key2KanaTable (WideString name); + Key2KanaTable (WideString name, + ConvRule *table); + Key2KanaTable (WideString name, + NicolaRule *table); + virtual ~Key2KanaTable (); + + Key2KanaRules & get_table (void) { return m_rules; } + + void append_rule (String sequence, + const std::vector &result); + void append_rule (String sequence, + String result, + String cont); + void append_rule (String sequence, + String normal, + String left_shift, + String right_shift); + void clear (void); + +private: + WideString m_name; + Key2KanaRules m_rules; +}; + + +class Key2KanaTableSet +{ +public: + Key2KanaTableSet (); + virtual ~Key2KanaTableSet (); + + std::vector & + get_tables (void) { return m_all_tables; }; + + void set_typing_method (TypingMethod method, + Key2KanaTable *fundamental_table = NULL); + void set_symbol_width (bool half); + void set_number_width (bool half); + void set_period_style (PeriodStyle style); + void set_comma_style (CommaStyle style); + void set_bracket_style (BracketStyle style); + void set_slash_style (SlashStyle style); + + TypingMethod + get_typing_method (void) { return m_typing_method; } + bool symbol_is_half (void) { return m_use_half_symbol; } + bool number_is_half (void) { return m_use_half_number;} + PeriodStyle + get_period_style (void) { return m_period_style; } + CommaStyle + get_comma_style (void) { return m_comma_style; } + BracketStyle + get_bracket_style (void) { return m_bracket_style; } + SlashStyle + get_slash_style (void) { return m_slash_style; } + +#if 0 + void set_use_consonant_table (bool use); + void set_use_symbol_table (bool use); + void set_use_number_table (bool use); + void set_use_period_table (bool use); + void set_use_comma_table (bool use); + + bool get_use_consonant_table (void); + bool get_use_symbol_table (void); + bool get_use_number_table (void); + bool get_use_period_table (void); + bool get_use_comma_table (void); +#endif + +private: + void reset_tables (void); + +private: + WideString m_name; + + // tables + Key2KanaTable *m_fundamental_table; + Key2KanaTable m_voiced_consonant_table; + std::vector *m_additional_table; + std::vector m_all_tables; + + // flags + TypingMethod m_typing_method; + PeriodStyle m_period_style; + CommaStyle m_comma_style; + BracketStyle m_bracket_style; + SlashStyle m_slash_style; + bool m_use_half_symbol; + bool m_use_half_number; +}; + +} + +#endif /* __SCIM_ANTHY_KEY2KANA_TABLE_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_nicola.cpp b/src/scim_anthy_nicola.cpp new file mode 100755 index 0000000..ffe9b26 --- /dev/null +++ b/src/scim_anthy_nicola.cpp @@ -0,0 +1,638 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +#define Uses_SCIM_IMENGINE +#define Uses_SCIM_CONFIG_BASE +#include "scim_anthy_nicola.h" +#include "scim_anthy_factory.h" +#include "scim_anthy_imengine.h" +#include "scim_anthy_utils.h" + +using namespace scim_anthy; + +NicolaConvertor::NicolaConvertor (AnthyInstance &anthy, + Key2KanaTableSet &tables) + : m_tables (tables), + m_anthy (anthy), + m_timer_id (0), + m_processing_timeout(false) +{ +} + +NicolaConvertor::~NicolaConvertor () +{ + if (m_timer_id > 0) + m_anthy.timeout_remove (m_timer_id); +} + +bool +NicolaConvertor::can_append (const KeyEvent & key, + bool ignore_space) +{ + if (key == m_through_key_event) { + m_through_key_event = KeyEvent (); + return false; + } + + if (m_processing_timeout && + m_prev_char_key.empty () && !m_prev_thumb_key.empty()) + { + emit_key_event (m_prev_thumb_key); + m_prev_thumb_key = KeyEvent (); + return false; + } + + if (key.is_key_release () && + (key.code != m_prev_char_key.code && + key.code != m_prev_thumb_key.code && + key.code != m_repeat_char_key.code && + key.code != m_repeat_thumb_key.code)) + { + return false; + } + + if (is_repeating ()) { + if (key.is_key_press () && + (key == m_repeat_char_key || key == m_repeat_thumb_key) && + m_repeat_char_key.empty ()) + { + return false; + } + } + + // ignore short cut keys of apllication. + if (key.mask & SCIM_KEY_ControlMask || + key.mask & SCIM_KEY_AltMask) + { + return false; + } + + if (isprint (key.get_ascii_code ()) && + (ignore_space || !isspace (key.get_ascii_code ()))) + { + return true; + } + + if (is_thumb_key (key)) + return true; + + return false; +} + +void +NicolaConvertor::search (const KeyEvent key, + NicolaShiftType shift_type, + WideString &result, + String &raw) +{ + raw = key.get_ascii_code (); + + String str1; + if (get_case_sensitive ()) + str1 = raw; + else + str1 = tolower (key.get_ascii_code ()); + + std::vector &tables = m_tables.get_tables(); + for (unsigned int j = 0; j < tables.size (); j++) { + if (!tables[j]) + continue; + + Key2KanaRules &rules = tables[j]->get_table (); + + for (unsigned int i = 0; i < rules.size (); i++) { + String str2 = rules[i].get_sequence (); + + for (unsigned int k = 0; + !get_case_sensitive () && k < str2.length (); + k++) + { + str2[k] = tolower (str2[k]); + } + + if (str1 == str2) { + switch (shift_type) { + case SCIM_ANTHY_NICOLA_SHIFT_RIGHT: + result = utf8_mbstowcs (rules[i].get_result (2)); + break; + case SCIM_ANTHY_NICOLA_SHIFT_LEFT: + result = utf8_mbstowcs (rules[i].get_result (1)); + break; + default: + result = utf8_mbstowcs (rules[i].get_result (0)); + break; + } + break; + } + } + } + + if (result.empty ()) { + result = utf8_mbstowcs (raw); + } +} + +bool +NicolaConvertor::handle_voiced_consonant (WideString & result, + WideString & pending) +{ + VoicedConsonantRule *table = scim_anthy_voiced_consonant_table; + + if (result.empty ()) + return false; + + if (m_pending.empty ()) { + for (unsigned int i = 0; table[i].string; i++) { + if (result == utf8_mbstowcs (table[i].string)) { + pending = m_pending = result; + result = WideString (); + return false; + } + } + + } else if (result == utf8_mbstowcs ("\xE3\x82\x9B")) { + // voiced consonant + for (unsigned int i = 0; table[i].string; i++) { + if (m_pending == utf8_mbstowcs (table[i].string)) { + result = utf8_mbstowcs (table[i].voiced); + m_pending = WideString (); + return false; + } + } + return true; + + } else if (result == utf8_mbstowcs ("\xE3\x82\x9C")) { + // half voiced consonant + for (unsigned int i = 0; table[i].string; i++) { + if (m_pending == utf8_mbstowcs (table[i].string)) { + result = utf8_mbstowcs (table[i].half_voiced); + m_pending = WideString (); + return false; + } + } + return true; + + } else { + m_pending = WideString (); + for (unsigned int i = 0; table[i].string; i++) { + if (result == utf8_mbstowcs (table[i].string)) { + pending = m_pending = result; + result = WideString (); + return true; + } + } + return true; + } + + return false; +} + +bool +NicolaConvertor::is_char_key (const KeyEvent key) +{ + if (!is_thumb_key (key) && isprint (key.get_ascii_code ())) + return true; + else + return false; +} + +bool +NicolaConvertor::is_thumb_key (const KeyEvent key) +{ + if (is_left_thumb_key (key) || is_right_thumb_key (key)) + return true; + + return false; +} + +bool +NicolaConvertor::is_left_thumb_key (const KeyEvent key) +{ + return util_match_key_event (m_anthy.get_factory()->m_left_thumb_keys, + key, + 0xFFFF); +} + +bool +NicolaConvertor::is_right_thumb_key (const KeyEvent key) +{ + return util_match_key_event (m_anthy.get_factory()->m_right_thumb_keys, + key, + 0xFFFF); +} + +NicolaShiftType +NicolaConvertor::get_thumb_key_type (const KeyEvent key) +{ + if (is_left_thumb_key (key)) + return SCIM_ANTHY_NICOLA_SHIFT_LEFT; + else if (is_right_thumb_key (key)) + return SCIM_ANTHY_NICOLA_SHIFT_RIGHT; + else + return SCIM_ANTHY_NICOLA_SHIFT_NONE; +} + +void +NicolaConvertor::on_key_repeat (const KeyEvent key, + WideString &result, + String &raw) +{ + if (key.is_key_release ()) { + if (!m_repeat_char_key.empty ()) + emit_key_event (key); + m_repeat_char_key = KeyEvent (); + m_repeat_thumb_key = KeyEvent (); + m_prev_char_key = KeyEvent (); +#if 1 + m_prev_thumb_key = KeyEvent (); +#endif + + } else if (key == m_repeat_char_key || key == m_repeat_thumb_key) { + if (!m_repeat_char_key.empty ()) { + search (m_repeat_char_key, get_thumb_key_type (m_repeat_thumb_key), + result, raw); + } else { + // handle by can_append (); + } + + + } else if (!is_thumb_key (key) && !(key == m_repeat_char_key)) { + m_repeat_char_key = KeyEvent (); + m_repeat_thumb_key = KeyEvent (); + m_prev_char_key = key; + m_prev_thumb_key = KeyEvent (); + set_alarm (m_anthy.get_factory()->m_nicola_time); + + } else if (key == m_prev_thumb_key) { + m_repeat_char_key = KeyEvent (); + m_repeat_thumb_key = KeyEvent (); + m_prev_char_key = KeyEvent (); + m_prev_thumb_key = key; + set_alarm (m_anthy.get_factory()->m_nicola_time); + + } else { + m_repeat_char_key = KeyEvent (); + m_repeat_thumb_key = KeyEvent (); + m_prev_char_key = KeyEvent (); + m_prev_thumb_key = KeyEvent (); + } +} + +void +NicolaConvertor::on_both_key_pressed (const KeyEvent key, + WideString & result, + String &raw) +{ + struct timeval cur_time; + long diff1, diff2; + gettimeofday (&cur_time, NULL); + + diff1 = m_time_thumb.tv_usec - m_time_char.tv_usec; + diff2 = cur_time.tv_usec - m_time_thumb.tv_usec; + + if (key.is_key_press () && key == m_prev_thumb_key) { + search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key), + result, raw); + m_repeat_char_key = m_prev_char_key; + m_repeat_thumb_key = m_prev_thumb_key; + + } else if (is_char_key (key)) { + if (key.is_key_press ()) { + if (diff2 < diff1) { + WideString result1, result2; + String raw1, raw2; + search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE, + result1, raw1); + search (key, get_thumb_key_type (m_prev_thumb_key), + result2, raw2); + result = result1 + result2; + raw = raw1 + raw2; + + // repeat + m_repeat_char_key = key; + m_repeat_thumb_key = m_prev_thumb_key; + + } else { + search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key), + result, raw); + m_prev_char_key = key; +#if 1 + m_prev_thumb_key = KeyEvent (); +#endif + set_alarm (m_anthy.get_factory()->m_nicola_time); + } + + } else { + if (diff2 < m_anthy.get_factory()->m_nicola_time * 1000 && + diff1 > diff2) + { + search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE, + result, raw); + m_prev_char_key = KeyEvent (); + + } else { + search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key), + result, raw); + m_prev_char_key = KeyEvent (); +#if 1 + m_prev_thumb_key = KeyEvent (); +#endif + } + } + + } else if (is_thumb_key (key)) { + if (key.is_key_press ()) { + search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key), + result, raw); + m_prev_char_key = KeyEvent (); + m_prev_thumb_key = key; + gettimeofday (&m_time_thumb, NULL); + set_alarm (m_anthy.get_factory()->m_nicola_time); + + } else { + search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key), + result, raw); + m_prev_char_key = KeyEvent (); + m_prev_thumb_key = KeyEvent (); + } + + } else { + search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key), + result, raw); + m_prev_char_key = KeyEvent (); + m_prev_thumb_key = KeyEvent (); + } +} + +void +NicolaConvertor::on_thumb_key_pressed (const KeyEvent key, + WideString & result, + String &raw) +{ + if (key.is_key_press () && key == m_prev_thumb_key) { +#if 1 + m_repeat_thumb_key = key; +#endif + + } else if (is_thumb_key (key) && key.is_key_release ()) { + emit_key_event (m_prev_thumb_key); // key press event + emit_key_event (key); // key release event + m_prev_thumb_key = KeyEvent (); + + } else if (is_thumb_key (key) & key.is_key_press ()) { + emit_key_event (m_prev_thumb_key); + m_prev_thumb_key = key; + gettimeofday (&m_time_thumb, NULL); + + } else if (is_char_key (key) && key.is_key_press ()) { + m_prev_char_key = key; + gettimeofday (&m_time_char, NULL); + + search (m_prev_char_key, get_thumb_key_type (m_prev_thumb_key), + result, raw); + + // repeat + m_repeat_char_key = m_prev_char_key; + m_repeat_thumb_key = m_prev_thumb_key; + + } else { + m_prev_thumb_key = KeyEvent (); + } +} + +void +NicolaConvertor::on_char_key_pressed (const KeyEvent key, + WideString & result, + String &raw) +{ + if (key.is_key_press () && key == m_prev_char_key) { + search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE, + result, raw); + m_repeat_char_key = m_prev_char_key; + + } else if (is_char_key (key) && key.is_key_press ()) { + search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE, + result, raw); + m_prev_char_key = key; + gettimeofday (&m_time_char, NULL); + set_alarm (m_anthy.get_factory()->m_nicola_time); + + } else if (is_thumb_key (key) && key.is_key_press ()) { + m_prev_thumb_key = key; + gettimeofday (&m_time_thumb, NULL); + set_alarm (m_anthy.get_factory()->m_nicola_time); + + } else if (key.is_key_release () && key == m_prev_char_key) { + search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE, + result, raw); + m_prev_char_key = KeyEvent (); + + } else { + search (m_prev_char_key, SCIM_ANTHY_NICOLA_SHIFT_NONE, + result, raw); + m_prev_char_key = KeyEvent (); + } +} + +void +NicolaConvertor::on_no_key_pressed (const KeyEvent key) +{ + if (key.is_key_release ()) + return; + + if (is_char_key (key)) { + m_prev_char_key = key; + gettimeofday (&m_time_char, NULL); + set_alarm (m_anthy.get_factory()->m_nicola_time); + } else if (is_thumb_key (key)) { + m_prev_thumb_key = key; + gettimeofday (&m_time_thumb, NULL); + set_alarm (m_anthy.get_factory()->m_nicola_time); + } +} + +bool +NicolaConvertor::is_repeating (void) +{ + return !m_repeat_char_key.empty () || !m_repeat_thumb_key.empty (); +} + +void +NicolaConvertor::emit_key_event (const KeyEvent & key) +{ + m_through_key_event = key; + + //m_anthy.forward_key_event (key); + m_anthy.process_key_event (key); +} + +static void +timeout_emit_key_event (void *data) +{ + NicolaConvertor *nicola = static_cast (data); + nicola->process_timeout (); +} + +void +NicolaConvertor::process_timeout (void) +{ + m_processing_timeout = true; + if (!m_prev_char_key.empty ()) + m_anthy.process_key_event (m_prev_char_key); + else if (!m_prev_thumb_key.empty ()) + m_anthy.process_key_event (m_prev_thumb_key); + m_processing_timeout = false; +} + +void +NicolaConvertor::set_alarm (int time_msec) +{ + if (time_msec < 5) + time_msec = 5; + if (time_msec > 1000) + time_msec = 1000; + + m_timer_id = m_anthy.timeout_add (time_msec, + timeout_emit_key_event, + (void *) this); +} + +bool +NicolaConvertor::append (const KeyEvent & key, + WideString & result, + WideString & pending, + String &raw) +{ + if (m_timer_id > 0) { + m_anthy.timeout_remove (m_timer_id); + m_timer_id = 0; + } + + if (m_processing_timeout) { + search (m_prev_char_key, + get_thumb_key_type (m_prev_thumb_key), + result, raw); + if (m_prev_thumb_key.empty ()) { + m_prev_char_key = KeyEvent (); + m_prev_thumb_key = KeyEvent (); + } else { + m_repeat_char_key = m_prev_char_key; + m_repeat_thumb_key = m_prev_thumb_key; + } + return handle_voiced_consonant (result, pending); + } + + if (key.is_key_press () && util_key_is_keypad (key)) { + util_keypad_to_string (raw, key); + + // convert key pad string to wide + WideString wide; + String ten_key_type = m_anthy.get_factory()->m_ten_key_type; + if ((ten_key_type == "FollowMode" && + (m_anthy.get_input_mode () == SCIM_ANTHY_MODE_LATIN || + m_anthy.get_input_mode () == SCIM_ANTHY_MODE_HALF_KATAKANA)) || + ten_key_type == "Half") + { + wide = utf8_mbstowcs (raw); + } else { + util_convert_to_wide (wide, raw); + } + + result = wide; + + m_repeat_char_key = KeyEvent (); + m_repeat_thumb_key = KeyEvent (); + m_prev_char_key = KeyEvent (); + m_prev_thumb_key = KeyEvent (); + + return handle_voiced_consonant (result, pending); + } + + if (is_repeating ()) { + on_key_repeat (key, result, raw); + + } else if (!m_prev_thumb_key.empty () && !m_prev_char_key.empty ()) { + on_both_key_pressed (key, result, raw); + + } else if (!m_prev_thumb_key.empty ()) { + on_thumb_key_pressed (key, result, raw); + + } else if (!m_prev_char_key.empty ()) { + on_char_key_pressed (key, result, raw); + + } else { + on_no_key_pressed (key); + } + + return handle_voiced_consonant (result, pending); +} + +bool +NicolaConvertor::append (const String & str, + WideString & result, + WideString & pending) +{ + result = utf8_mbstowcs (str); + m_pending = WideString (); + + return false; +} + +void +NicolaConvertor::clear (void) +{ + m_pending = WideString (); +} + +bool +NicolaConvertor::is_pending (void) +{ + return !m_pending.empty (); +} + +WideString +NicolaConvertor::get_pending (void) +{ + return m_pending; +} + +WideString +NicolaConvertor::flush_pending (void) +{ + return WideString (); +} + +void +NicolaConvertor::reset_pending (const WideString & result, const String & raw) +{ + VoicedConsonantRule *table = scim_anthy_voiced_consonant_table; + + m_pending = WideString (); + + for (unsigned int i = 0; table[i].string; i++) { + if (result == utf8_mbstowcs (table[i].string)) { + m_pending = result; + return; + } + } +} +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_nicola.h b/src/scim_anthy_nicola.h new file mode 100755 index 0000000..65d5d79 --- /dev/null +++ b/src/scim_anthy_nicola.h @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_NICOLA_H__ +#define __SCIM_ANTHY_NICOLA_H__ + +#define Uses_SCIM_ICONV +#define Uses_SCIM_EVENT +#include +#include + +#include "scim_anthy_key2kana_base.h" +#include "scim_anthy_key2kana_table.h" + +using namespace scim; + +class AnthyInstance; + +namespace scim_anthy { + +typedef enum { + SCIM_ANTHY_NICOLA_SHIFT_NONE, + SCIM_ANTHY_NICOLA_SHIFT_LEFT, + SCIM_ANTHY_NICOLA_SHIFT_RIGHT, +} NicolaShiftType; + +class NicolaConvertor : public Key2KanaConvertorBase +{ +public: + NicolaConvertor (AnthyInstance & anthy, + Key2KanaTableSet & tables); + virtual ~NicolaConvertor (); + + bool can_append (const KeyEvent & key, + bool ignore_space = false); + bool append (const KeyEvent & key, + WideString & result, + WideString & pending, + String & raw); + bool append (const String & raw, + WideString & result, + WideString & pending); + void clear (void); + + bool is_pending (void); + WideString get_pending (void); + WideString flush_pending (void); + void reset_pending (const WideString & result, + const String & raw); + +public: + void process_timeout (void); + +private: + void search (const KeyEvent key, + NicolaShiftType shift_type, + WideString & result, + String & raw); + bool handle_voiced_consonant (WideString & result, + WideString & pending); + bool is_char_key (const KeyEvent key); + bool is_thumb_key (const KeyEvent key); + bool is_left_thumb_key (const KeyEvent key); + bool is_right_thumb_key (const KeyEvent key); + NicolaShiftType + get_thumb_key_type (const KeyEvent key); + + void on_key_repeat (const KeyEvent key, + WideString & result, + String & raw); + void on_both_key_pressed (const KeyEvent key, + WideString & result, + String & raw); + void on_thumb_key_pressed (const KeyEvent key, + WideString & result, + String & raw); + void on_char_key_pressed (const KeyEvent key, + WideString & result, + String & raw); + void on_no_key_pressed (const KeyEvent key); + + bool is_repeating (void); + void emit_key_event (const KeyEvent & key); + void set_alarm (int time_msec); + +private: + Key2KanaTableSet &m_tables; + + AnthyInstance &m_anthy; + + // state + KeyEvent m_prev_char_key; + KeyEvent m_prev_thumb_key; + + KeyEvent m_repeat_char_key; + KeyEvent m_repeat_thumb_key; + bool m_is_repeating; + + struct timeval m_time_char; + struct timeval m_time_thumb; + + KeyEvent m_through_key_event; + + uint32 m_timer_id; + bool m_processing_timeout; + + WideString m_pending; +}; + +} +#endif /* __SCIM_ANTHY_NICOLA_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_preedit.cpp b/src/scim_anthy_preedit.cpp new file mode 100755 index 0000000..c828e06 --- /dev/null +++ b/src/scim_anthy_preedit.cpp @@ -0,0 +1,623 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include + +#include "scim_anthy_factory.h" +#include "scim_anthy_imengine.h" +#include "scim_anthy_preedit.h" +#include "scim_anthy_utils.h" + +using namespace scim_anthy; + +static ConvRule *get_period_rule (TypingMethod method, + PeriodStyle period); +static ConvRule *get_comma_rule (TypingMethod method, + CommaStyle period); + +Preedit::Preedit (AnthyInstance &anthy) + : m_anthy (anthy), + //m_key2kana_tables (tables), + m_reading (anthy), + m_conversion (m_anthy, m_reading), + m_input_mode (SCIM_ANTHY_MODE_HIRAGANA) +{ +} + +Preedit::~Preedit () +{ +} + + +/* + * getting status + */ +unsigned int +Preedit::get_length (void) +{ + if (is_converting ()) + return m_conversion.get_length (); + else + return m_reading.get_length (); + + return 0; +} + +WideString +Preedit::get_string (void) +{ + if (is_converting ()) { + return m_conversion.get (); + } else if (!m_source.empty ()) { + return m_source; + } else { + WideString widestr; + switch (m_input_mode) { + case SCIM_ANTHY_MODE_KATAKANA: + util_convert_to_katakana (widestr, m_reading.get ()); + return widestr; + + case SCIM_ANTHY_MODE_HALF_KATAKANA: + util_convert_to_katakana (widestr, m_reading.get (), true); + return widestr; + + case SCIM_ANTHY_MODE_LATIN: + return utf8_mbstowcs (m_reading.get_raw ()); + + case SCIM_ANTHY_MODE_WIDE_LATIN: + util_convert_to_wide (widestr, m_reading.get_raw ()); + return widestr; + + case SCIM_ANTHY_MODE_HIRAGANA: + default: + return m_reading.get (); + } + } + + return WideString (); +} + +AttributeList +Preedit::get_attribute_list (void) +{ + if (is_converting ()) + { + return m_conversion.get_attribute_list (); + } else { + AttributeList attrs; + util_create_attributes (attrs, 0, get_length (), + m_anthy.get_factory()->m_preedit_style, + m_anthy.get_factory()->m_preedit_fg_color, + m_anthy.get_factory()->m_preedit_bg_color); + return attrs; + } +} + +Reading & +Preedit::get_reading (void) +{ + return m_reading; +} + +bool +Preedit::is_preediting (void) +{ + if (m_reading.get_length () > 0 || + m_conversion.is_converting () || + !m_source.empty ()) + { + return true; + } else { + return false; + } +} + +bool +Preedit::is_converting (void) +{ + return m_conversion.is_converting (); +} + +bool +Preedit::is_predicting (void) +{ + return m_conversion.is_predicting (); +} + +bool +Preedit::is_reconverting (void) +{ + return !m_source.empty (); +} + + +/* + * manipulating the preedit string + */ +bool +Preedit::can_process_key_event (const KeyEvent & key) +{ + return m_reading.can_process_key_event (key); +} + +bool +Preedit::process_key_event (const KeyEvent & key) +{ + if (!m_reading.can_process_key_event (key)) + return false; + + bool retval = m_reading.process_key_event (key); + + if (m_input_mode == SCIM_ANTHY_MODE_LATIN || + m_input_mode == SCIM_ANTHY_MODE_WIDE_LATIN) + { + return true; + } + + // auto convert + unsigned int len = m_reading.get_length (); + if (len > 0) { + String str; + str = m_reading.get_raw (len - 1, 1); + if (is_comma_or_period (str)) { + if (m_anthy.get_factory()->m_behavior_on_period == "Convert" && + get_length () > 1) + { + convert (); + } else if (m_anthy.get_factory()->m_behavior_on_period == "Commit") { + return true; + } + } + } + + return retval; +} + +bool +Preedit::append (const KeyEvent & key, + const String & string) +{ + return m_reading.append (key, string); +} + +void +Preedit::erase (bool backward) +{ + if (m_reading.get_length () <= 0) + return; + + // cancel conversion + revert (); + + // erase + TypingMethod method = get_typing_method (); + bool allow_split + = method == SCIM_ANTHY_TYPING_METHOD_ROMAJI && + m_anthy.get_factory()->m_romaji_allow_split; + if (backward && m_reading.get_caret_pos () == 0) + return; + if (!backward && m_reading.get_caret_pos () >= m_reading.get_length ()) + return; + if (backward) + m_reading.move_caret (-1, allow_split); + m_reading.erase (m_reading.get_caret_pos (), 1, allow_split); +} + +void +Preedit::finish (void) +{ + m_reading.finish (); +} + + +/* + * manipulating conversion string + */ +void +Preedit::convert (CandidateType type, bool single_segment) +{ + if (m_source.empty ()) + m_conversion.convert (type, single_segment); + else + m_conversion.convert (m_source, single_segment); +} + +void +Preedit::convert (const WideString &source, bool single_segment) +{ + m_conversion.convert (source, single_segment); + m_source = source; +} + +void +Preedit::revert (void) +{ + m_conversion.clear (); +} + +void +Preedit::commit (int segment_id, bool learn) +{ + if (m_conversion.is_converting ()) + m_conversion.commit (segment_id, learn); + if (!m_conversion.is_converting ()) + clear (); +} + +int +Preedit::get_nr_segments (void) +{ + return m_conversion.get_nr_segments (); +} + +WideString +Preedit::get_segment_string (int segment_id) +{ + return m_conversion.get_segment_string (segment_id); +} + +int +Preedit::get_selected_segment (void) +{ + return m_conversion.get_selected_segment (); +} + +void +Preedit::select_segment (int segment_id) +{ + m_conversion.select_segment (segment_id); +} + +int +Preedit::get_segment_size (int segment_id) +{ + return m_conversion.get_segment_size (segment_id); +} + +void +Preedit::resize_segment (int relative_size, int segment_id) +{ + m_conversion.resize_segment (relative_size, segment_id); +} + + +/* + * candidates for a segment + */ +void +Preedit::get_candidates (CommonLookupTable &table, int segment_id) +{ + m_conversion.get_candidates (table, segment_id); +} + +int +Preedit::get_selected_candidate (int segment_id) +{ + return m_conversion.get_selected_candidate (segment_id); +} + +void +Preedit::select_candidate (int candidate_id, int segment_id) +{ + m_conversion.select_candidate (candidate_id, segment_id); +} + + +/* + * manipulating the caret + */ +unsigned int +Preedit::get_caret_pos (void) +{ + if (is_converting ()) { + return m_conversion.get_segment_position (); + } else { + if (get_input_mode () == SCIM_ANTHY_MODE_HALF_KATAKANA) { + // FIXME! It's ad-hoc + WideString substr; + substr = m_reading.get (0, m_reading.get_caret_pos (), + SCIM_ANTHY_STRING_HALF_KATAKANA); + return substr.length (); + } else { + return m_reading.get_caret_pos (); + } + } +} + +void +Preedit::set_caret_pos (unsigned int pos) +{ + if (is_converting ()) + return; + + m_reading.set_caret_pos (pos); +} + +void +Preedit::move_caret (int step) +{ + if (is_converting ()) + return; + + TypingMethod method = get_typing_method (); + bool allow_split + = method == SCIM_ANTHY_TYPING_METHOD_ROMAJI && + m_anthy.get_factory()->m_romaji_allow_split; + + m_reading.move_caret (step, allow_split); +} + +void +Preedit::predict (void) +{ + m_conversion.predict (); +} + + +/* + * clear all string + */ +void +Preedit::clear (int segment_id) +{ + // FIXME! We should add implementation not only for conversion string but + // also for reading string. + + if (!is_converting ()) { + m_reading.clear (); + m_conversion.clear (); + m_source = WideString (); + return; + } + + m_conversion.clear (segment_id); + if (m_conversion.get_nr_segments () <= 0) { + m_reading.clear (); + m_source = WideString (); + } +} + + +/* + * preference + */ +void +Preedit::set_input_mode (InputMode mode) +{ + m_input_mode = mode; +} + +InputMode +Preedit::get_input_mode (void) +{ + return m_input_mode; +} + +void +Preedit::set_typing_method (TypingMethod method) +{ + m_reading.set_typing_method (method); +} + +TypingMethod +Preedit::get_typing_method (void) +{ + return m_reading.get_typing_method (); +} + +void +Preedit::set_period_style (PeriodStyle style) +{ + m_reading.set_period_style (style); +} + +PeriodStyle +Preedit::get_period_style (void) +{ + return m_reading.get_period_style (); +} + +void +Preedit::set_comma_style (CommaStyle style) +{ + m_reading.set_comma_style (style); +} + +CommaStyle +Preedit::get_comma_style (void) +{ + return m_reading.get_comma_style (); +} + +void +Preedit::set_bracket_style (BracketStyle style) +{ + m_reading.set_bracket_style (style); +} + +BracketStyle +Preedit::get_bracket_style (void) +{ + return m_reading.get_bracket_style (); +} + +void +Preedit::set_slash_style (SlashStyle style) +{ + m_reading.set_slash_style (style); +} + +SlashStyle +Preedit::get_slash_style (void) +{ + return m_reading.get_slash_style (); +} + +void +Preedit::set_symbol_width (bool half) +{ + m_reading.set_symbol_width (half); +} + +bool +Preedit::get_symbol_width (void) +{ + return m_reading.get_symbol_width (); +} + +void +Preedit::set_number_width (bool half) +{ + m_reading.set_number_width (half); +} + +bool +Preedit::get_number_width (void) +{ + return m_reading.get_number_width (); +} + +void +Preedit::set_pseudo_ascii_mode (int mode) +{ + m_reading.set_pseudo_ascii_mode (mode); +} + +bool +Preedit::is_pseudo_ascii_mode (void) +{ + return m_reading.is_pseudo_ascii_mode (); +} + +void +Preedit::reset_pseudo_ascii_mode (void) +{ + m_reading.reset_pseudo_ascii_mode (); +} + +void +Preedit::set_dict_encoding (String type) +{ + m_conversion.set_dict_encoding (type); +} + +bool +Preedit::is_comma_or_period (const String & str) +{ + TypingMethod typing = get_typing_method (); + PeriodStyle period = get_period_style (); + CommaStyle comma = get_comma_style (); + + ConvRule *period_rule = get_period_rule (typing, period); + ConvRule *comma_rule = get_comma_rule (typing, comma); + + for (unsigned int i = 0; period_rule && period_rule[i].string; i++) { + if (period_rule[i].string && + !strcmp (period_rule[i].string, str.c_str ())) + { + return true; + } + } + for (unsigned int i = 0; comma_rule && comma_rule[i].string; i++) { + if (comma_rule[i].string && + !strcmp (comma_rule[i].string, str.c_str ())) + { + return true; + } + } + + return false; +} + + +/* + * utilities + */ +static ConvRule * +get_period_rule (TypingMethod method, PeriodStyle period) +{ + switch (method) { + case SCIM_ANTHY_TYPING_METHOD_KANA: + switch (period) { + case SCIM_ANTHY_PERIOD_WIDE: + return scim_anthy_kana_wide_period_rule; + case SCIM_ANTHY_PERIOD_HALF: + return scim_anthy_kana_half_period_rule; + case SCIM_ANTHY_PERIOD_JAPANESE: + default: + return scim_anthy_kana_ja_period_rule; + }; + break; + + case SCIM_ANTHY_TYPING_METHOD_ROMAJI: + default: + switch (period) { + case SCIM_ANTHY_PERIOD_WIDE: + return scim_anthy_romaji_wide_period_rule; + case SCIM_ANTHY_PERIOD_HALF: + return scim_anthy_romaji_half_period_rule; + case SCIM_ANTHY_PERIOD_JAPANESE: + default: + return scim_anthy_romaji_ja_period_rule; + }; + break; + }; + + return NULL; +} + +static ConvRule * +get_comma_rule (TypingMethod method, CommaStyle period) +{ + switch (method) { + case SCIM_ANTHY_TYPING_METHOD_KANA: + switch (period) { + case SCIM_ANTHY_PERIOD_WIDE: + return scim_anthy_kana_wide_comma_rule; + case SCIM_ANTHY_PERIOD_HALF: + return scim_anthy_kana_half_comma_rule; + case SCIM_ANTHY_PERIOD_JAPANESE: + default: + return scim_anthy_kana_ja_comma_rule; + }; + break; + + case SCIM_ANTHY_TYPING_METHOD_ROMAJI: + default: + switch (period) { + case SCIM_ANTHY_PERIOD_WIDE: + return scim_anthy_romaji_wide_comma_rule; + case SCIM_ANTHY_PERIOD_HALF: + return scim_anthy_romaji_half_comma_rule; + case SCIM_ANTHY_PERIOD_JAPANESE: + default: + return scim_anthy_romaji_ja_comma_rule; + }; + break; + }; + + return NULL; +} +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_preedit.h b/src/scim_anthy_preedit.h new file mode 100755 index 0000000..036cca1 --- /dev/null +++ b/src/scim_anthy_preedit.h @@ -0,0 +1,160 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_PREEDIT_H__ +#define __SCIM_ANTHY_PREEDIT_H__ + +#define Uses_SCIM_ICONV +#define Uses_SCIM_EVENT +#define Uses_SCIM_ATTRIBUTE +#define Uses_SCIM_LOOKUP_TABLE +#include +#include +#include "scim_anthy_reading.h" +#include "scim_anthy_conversion.h" + +#define SCIM_ANTHY_PSEUDO_ASCII_TRIGGERED_CAPITALIZED (1 << 0) +#define SCIM_ANTHY_PSEUDO_ASCII_TRIGGERED_COUPLE_OF_CAPITAL (1 << 1) + +using namespace scim; + +class AnthyInstance; + +namespace scim_anthy { + +typedef enum { + SCIM_ANTHY_MODE_HIRAGANA, + SCIM_ANTHY_MODE_KATAKANA, + SCIM_ANTHY_MODE_HALF_KATAKANA, + SCIM_ANTHY_MODE_LATIN, + SCIM_ANTHY_MODE_WIDE_LATIN, +} InputMode; + +class Preedit +{ +public: + Preedit (AnthyInstance &anthy); + virtual ~Preedit (); + + // getting status + virtual unsigned int get_length (void); + virtual WideString get_string (void); + virtual AttributeList get_attribute_list (void); + virtual Reading &get_reading (void); + + virtual bool is_preediting (void); + virtual bool is_converting (void); + virtual bool is_predicting (void); + virtual bool is_reconverting (void); + + // for handling the preedit string + virtual bool can_process_key_event (const KeyEvent & key); + // return true if commiting is needed. + virtual bool process_key_event (const KeyEvent & key); + virtual bool append (const KeyEvent & key, + const String & string); + virtual void erase (bool backward = true); + virtual void finish (void); + + // for handling the conversion string + virtual void convert (CandidateType type + = SCIM_ANTHY_CANDIDATE_DEFAULT, + bool single_segment = false); + virtual void convert (const WideString &source, + bool single_segment = false); + virtual void revert (void); + virtual void commit (int segment_id = -1, + bool lean = true); + + // for prediction + virtual void predict (void); + + // segments of the converted sentence + virtual int get_nr_segments (void); + virtual WideString get_segment_string (int segment_id = -1); + virtual int get_selected_segment (void); + virtual void select_segment (int segment_id); + virtual int get_segment_size (int segment_id = -1); + virtual void resize_segment (int relative_size, + int segment_id = -1); + + // candidates for a segment + virtual void get_candidates (CommonLookupTable &table, + int segment_id = -1); + virtual int get_selected_candidate (int segment_id = -1); + virtual void select_candidate (int candidate_id, + int segment_id = -1); + + // for handling the caret + virtual unsigned int get_caret_pos (void); + virtual void set_caret_pos (unsigned int pos); + virtual void move_caret (int len); + + // clear all or part of the string. + virtual void clear (int segment_id = -1); + + // preferences + virtual void set_input_mode (InputMode mode); + virtual InputMode get_input_mode (void); + virtual void set_typing_method (TypingMethod method); + virtual TypingMethod get_typing_method (void); + virtual void set_period_style (PeriodStyle style); + virtual PeriodStyle get_period_style (void); + virtual void set_comma_style (CommaStyle style); + virtual CommaStyle get_comma_style (void); + virtual void set_bracket_style (BracketStyle style); + virtual BracketStyle get_bracket_style (void); + virtual void set_slash_style (SlashStyle style); + virtual SlashStyle get_slash_style (void); + virtual void set_symbol_width (bool half); + virtual bool get_symbol_width (void); + virtual void set_number_width (bool half); + virtual bool get_number_width (void); + virtual void set_pseudo_ascii_mode (int mode); + virtual bool is_pseudo_ascii_mode (void); + virtual void reset_pseudo_ascii_mode(void); + virtual void set_dict_encoding (String type); + +private: + void get_reading_substr (WideString & substr, + unsigned int start, + unsigned int len, + CandidateType type); + bool is_comma_or_period (const String & str); + +private: + AnthyInstance &m_anthy; + + // converter objects + Reading m_reading; + Conversion m_conversion; + + // mode flags + InputMode m_input_mode; + + // source string for reconversion + WideString m_source; +}; + +} + +#endif /* __SCIM_ANTHY_PREEDIT_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_prefs.cpp b/src/scim_anthy_prefs.cpp new file mode 100755 index 0000000..92bb13a --- /dev/null +++ b/src/scim_anthy_prefs.cpp @@ -0,0 +1,1339 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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 PARTICUoLAR 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. + */ + +#define SCIM_ANTHY_USE_GTK +#include +#include +#include "scim_anthy_prefs.h" +#include "scim_anthy_intl.h" + +namespace scim_anthy { + +BoolConfigData config_bool_common [] = +{ + { + SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL, + SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT, + N_("Show \"_Candidates\" label"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT, + SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT, + SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT, + N_("Close candidate window when select a candidate _directly"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT, + SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT, + SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT, + N_("Learn on _manual committing"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT, + SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT, + SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT, + N_("Learn on a_uto committing"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL, + SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT, + SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT, + N_("Use half-width characters for _symbols"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER, + SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT, + SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT, + N_("Use half-width characters for _numbers"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT, + SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT, + SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT, + N_("A_llow spliting romaji on editing preedit string"), + NULL, + N_("If this check is enabled, you can delete each letter."), + false, + }, + { + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE, + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT, + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT, + N_("_Entering the pseudo ASCII input mode with capital letters."), + NULL, + N_("If this check is enabled, capital letters will becomes a trigger to enter the pseudo ASCII input mode."), + false, + }, + { + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR, + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT, + SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT, + N_("Insert a _blank with a blank key."), + NULL, + N_("If this check is enabled, a blank key will works to insert a blank when entering the pseudo ASCII input mode."), + false, + }, + { + SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT, + SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT, + SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT, + N_("_Show predicted candidates while inputting letters"), + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT, + SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT, + SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT, + N_("Use _direct select keys while predicting"), + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL, + SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT, + N_("Show _input mode label"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL, + SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL_DEFAULT, + N_("Show _conversion mode label"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL, + SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT, + N_("Show _typing method label"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL, + SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT, + N_("Show _period style label"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL, + SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT, + N_("Show _symbol style label"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL, + SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT, + N_("Show _dictionary menu label"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL, + SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT, + N_("Show _edit dictionary label"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL, + SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT, + SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT, + N_("Show _add word label"), + NULL, + NULL, + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +IntConfigData config_int_common [] = +{ + { + SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE, + SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT, + SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT, + 1, 100, 1, + N_("Number of candidates to show in a _page:"), + NULL, + NULL, + N_("Specify the number of candidates to show in a page of the candidates window."), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN, + SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT, + SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT, + 0, 100, 1, + N_("Number of _triggers until show:"), + N_("[times]"), + NULL, + N_("The number of times to press a conversion key until show the candidates window." + "Specify 0 to never show it."), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_NICOLA_TIME, + SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT, + SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT, + 5, 1000, 1, + N_("_Simultaneous pressing time:"), + N_("[msec]"), + NULL, + N_("Time to regard as simultaneous key pressing."), + NULL, + false, + }, + { + NULL, + 0, + 0, + 0, 0, 0, + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_string_common [] = +{ + { + SCIM_ANTHY_CONFIG_INPUT_MODE, + SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT, + SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT, + N_("_Input mode: "), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_TYPING_METHOD, + SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT, + SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT, + N_("Typing _method: "), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONVERSION_MODE, + SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT, + SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT, + N_("_Conversion mode: "), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_PERIOD_STYLE, + SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT, + SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT, + N_("St_yle of comma and period: "), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SYMBOL_STYLE, + SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT, + SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT, + N_("Symb_ol input style: "), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SPACE_TYPE, + SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT, + SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT, + N_("_Space type: "), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_TEN_KEY_TYPE, + SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT, + SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT, + N_("Input from _ten key: "), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD, + SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT, + SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT, + N_("_Behavior on a comma or a period:"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT, + SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT, + SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT, + N_("_Behavior on focus out:"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY, + SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY_DEFAULT, + N_("_Left thumb shift keys:"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY, + SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY_DEFAULT, + N_("_Right thumb shift keys:"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY, + SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY_DEFAULT, + N_("_Commit:"), + N_("Select commit keys"), + N_("The key events to commit the preedit string " + "with reversing the preference of learning. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY, + SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY_DEFAULT, + N_("Commit the _first segment:"), + N_("Select keys to commit the first segment"), + N_("The key events to commit the first segment " + "with reversing the preference of learning. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY, + SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY_DEFAULT, + N_("Commit the _selected segment:"), + N_("Select keys to commit the selected segment"), + N_("The key events to commit the selected segment " + "with reversing the preference of learning. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_DICT_ENCODING, + SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT, + SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT, + N_("En_coding of dictionary:"), + NULL, + N_("If you choose \"EUC-JP-MS\", interoperatability of documents " + "created on this system with Microsoft Windows may improve, " + "but it depends on the implementation of your operating system " + "and actual encoding of your dictionary."), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND, + SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT, + SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT, + N_("\"_Edit dictionary\" command:"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND, + SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT, + SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT, + N_("\"_Add word\" command:"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_PREEDIT_STYLE, + SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT, + SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT, + N_("_Preedit string:"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONVERSION_STYLE, + SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT, + SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT, + N_("_Conversion string:"), + NULL, + NULL, + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE, + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT, + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT, + N_("_Selected segment:"), + NULL, + NULL, + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_keyboards_mode [] = +{ + { + SCIM_ANTHY_CONFIG_ON_OFF_KEY, + SCIM_ANTHY_CONFIG_ON_OFF_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_ON_OFF_KEY_DEFAULT, + N_("Toggle on/off"), + N_("Select toggle on/off keys"), + N_("The key events to toggle on/off Japanese mode. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY, + SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY_DEFAULT, + N_("Circle input mode"), + N_("Select circle input mode keys"), + N_("The key events to circle input mode. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY, + SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY_DEFAULT, + N_("Circle kana mode"), + N_("Select circle kana mode keys"), + N_("The key events to circle kana mode. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_LATIN_MODE_KEY, + SCIM_ANTHY_CONFIG_LATIN_MODE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_LATIN_MODE_KEY_DEFAULT, + N_("Latin mode"), + N_("Select Latin mode keys"), + N_("The key events to switch input mode to Latin. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY, + SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY_DEFAULT, + N_("Wide Latin mode"), + N_("Select wide Latin mode keys"), + N_("The key events to switch input mode to wide Latin. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY, + SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY_DEFAULT, + N_("Hiragana mode"), + N_("Select hiragana mode keys"), + N_("The key events to switch input mode to hiragana. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY, + SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY_DEFAULT, + N_("Katakana mode"), + N_("Select katakana mode keys"), + N_("The key events to switch input mode to katakana. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY, + SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY_DEFAULT, + N_("Half katakana mode"), + N_("Select half katakana mode keys"), + N_("The key events to switch input mode to half katakana. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY, + SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY_DEFAULT, + N_("Pseudo ASCII mode cancel"), + N_("Select pseudo ASCII mode cancel key"), + N_("The key events to cancel the pseudo ASCII mode."), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY, + SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY_DEFAULT, + N_("Circle typing method"), + N_("Select circle typing method keys"), + N_("The key events to circle typing method. "), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_keyboards_edit [] = +{ + { + SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY, + SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY_DEFAULT, + N_("Insert space"), + N_("Select inserting space keys"), + N_("The key events to insert a space. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY, + SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY_DEFAULT, + N_("Insert alternative space"), + N_("Select inserting alternative space keys"), + N_("The key events to insert a alternative space. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY, + SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY_DEFAULT, + N_("Insert half space"), + N_("Select inserting half width space keys"), + N_("The key events to insert a half width space. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY, + SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY_DEFAULT, + N_("Insert wide space"), + N_("Select inserting wide space keys"), + N_("The key events to insert a wide space. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_BACKSPACE_KEY, + SCIM_ANTHY_CONFIG_BACKSPACE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_BACKSPACE_KEY_DEFAULT, + N_("Backspace"), + N_("Select backspace keys"), + N_("The key events to delete a character before caret. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_DELETE_KEY, + SCIM_ANTHY_CONFIG_DELETE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_DELETE_KEY_DEFAULT, + N_("Delete"), + N_("Select delete keys"), + N_("The key events to delete a character after caret. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_COMMIT_KEY, + SCIM_ANTHY_CONFIG_COMMIT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_COMMIT_KEY_DEFAULT, + N_("Commit"), + N_("Select commit keys"), + N_("The key events to commit the preedit string. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONVERT_KEY, + SCIM_ANTHY_CONFIG_CONVERT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONVERT_KEY_DEFAULT, + N_("Convert"), + N_("Select convert keys"), + N_("The key events to convert the preedit string to kanji. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_PREDICT_KEY, + SCIM_ANTHY_CONFIG_PREDICT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_PREDICT_KEY_DEFAULT, + N_("Predict"), + N_("Select predict keys"), + N_("The key events to predict a word or sentence from already inserted text. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CANCEL_KEY, + SCIM_ANTHY_CONFIG_CANCEL_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CANCEL_KEY_DEFAULT, + N_("Cancel"), + N_("Select cancel keys"), + N_("The key events to cancel preediting or converting. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY, + SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY_DEFAULT, + N_("Cancel all"), + N_("Select cancel all keys"), + N_("The key events to return to initial state. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_RECONVERT_KEY, + SCIM_ANTHY_CONFIG_RECONVERT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_RECONVERT_KEY_DEFAULT, + N_("Reconvert"), + N_("Select reconvert keys"), + N_("The key events to reconvert the commited string in selection. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_DO_NOTHING_KEY, + SCIM_ANTHY_CONFIG_DO_NOTHING_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_DO_NOTHING_KEY_DEFAULT, + N_("Do nothing"), + N_("Select do nothing keys"), + N_("The key events to eat and do nothing anymore. " + "For example, it can be used to disable space key completely."), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_keyboards_caret [] = +{ + { + SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY, + SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY_DEFAULT, + N_("Move to first"), + N_("Select move caret to first keys"), + N_("The key events to move the caret to the first of preedit string. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY, + SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY_DEFAULT, + N_("Move to last"), + N_("Select move caret to last keys"), + N_("The key events to move the caret to the last of the preedit string. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY, + SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY_DEFAULT, + N_("Move forward"), + N_("Select move caret forward keys"), + N_("The key events to move the caret forward. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY, + SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY_DEFAULT, + N_("Move backward"), + N_("Select move caret backward keys"), + N_("The key events to move the caret backward. "), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_keyboards_segments [] = +{ + { + SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY, + SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY_DEFAULT, + N_("Select the first segment"), + N_("Select keys to select the first segment"), + N_("The key events to select the first segment. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY, + SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY_DEFAULT, + N_("Select the last segment"), + N_("Select keys to select the last segment"), + N_("The key events to select the the last segment. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY, + SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY_DEFAULT, + N_("Select the next segment"), + N_("Select keys to select the next segment"), + N_("The key events to select the next segment. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY, + SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY_DEFAULT, + N_("Select the previous segment"), + N_("Select keys to select the previous segment"), + N_("The key events to select the previous segment. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY, + SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY_DEFAULT, + N_("Shrink the segment"), + N_("Select keys to shrink the segment"), + N_("The key events to shrink the selected segment. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY, + SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY_DEFAULT, + N_("Expand the segment"), + N_("Select keys to expand the segment"), + N_("The key events to expand the selected segment. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY, + SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY_DEFAULT, + N_("Commit the first segment"), + N_("Select keys to commit the first segment"), + N_("The key events to commit the first segment. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY, + SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY_DEFAULT, + N_("Commit the selected segment"), + N_("Select keys to commit the selected segment"), + N_("The key events to commit the selected segment. "), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_keyboards_candidates [] = +{ + { + SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY, + SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY_DEFAULT, + N_("First candidate"), + N_("Select the first candidate keys"), + N_("The key events to select the first candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY, + SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY_DEFAULT, + N_("Last candidate"), + N_("Select the last candidate keys"), + N_("The key events to the select last candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY, + SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY_DEFAULT, + N_("Next candidate"), + N_("Select the next candidate keys"), + N_("The key events to select the next candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY, + SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY_DEFAULT, + N_("Previous candidate"), + N_("Select the previous candidate keys"), + N_("The key events to select the previous candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY, + SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY_DEFAULT, + N_("Page up"), + N_("Select page up candidates keys"), + N_("The key events to switch candidates page up. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY, + SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY_DEFAULT, + N_("Page down"), + N_("Select page down candidates keys"), + N_("The key events to switch candidates page down. "), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_keyboards_direct_select [] = +{ + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY_DEFAULT, + N_("1st candidate"), + N_("Select keys to select 1st candidate"), + N_("The key events to select the 1st candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY_DEFAULT, + N_("2nd candidate"), + N_("Select keys to select 2nd candidate"), + N_("The key events to select the 2nd candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY_DEFAULT, + N_("3rd candidate"), + N_("Select keys to select 3rd candidate"), + N_("The key events to select the 3rd candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY_DEFAULT, + N_("4th candidate"), + N_("Select keys to select 4th candidate"), + N_("The key events to select the 4th candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY_DEFAULT, + N_("5th candidate"), + N_("Select keys to select 5th candidate"), + N_("The key events to select the 5th candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY_DEFAULT, + N_("6th candidate"), + N_("Select keys to select 6th candidate"), + N_("The key events to select the 6th candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY_DEFAULT, + N_("7th candidate"), + N_("Select keys to select 7th candidate"), + N_("The key events to select the 7th candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY_DEFAULT, + N_("8th candidate"), + N_("Select keys to select 8th candidate"), + N_("The key events to select the 8th candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY_DEFAULT, + N_("9th candidate"), + N_("Select keys to select 9th candidate"), + N_("The key events to select the 9th candidate. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY_DEFAULT, + N_("10th candidate"), + N_("Select keys to select 10th candidate"), + N_("The key events to select the 10th candidate. "), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_keyboards_converting [] = +{ + { + SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY, + SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY_DEFAULT, + N_("Convert character type forward"), + N_("Select keys to convert character type forward"), + N_("Rotate character type forward."), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY, + SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY_DEFAULT, + N_("Convert character type backward"), + N_("Select keys to convert character type backward"), + N_("Rotate character type backward."), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY, + SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY_DEFAULT, + N_("Convert to hiragana"), + N_("Select keys to convert to hiragana"), + N_("The key events to convert the preedit string to hiragana. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY, + SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY_DEFAULT, + N_("Convert to katakana"), + N_("Select keys to convert to katakana"), + N_("The key events to convert the preedit string to katakana. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY, + SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY_DEFAULT, + N_("Convert to half width"), + N_("Select keys to convert to half width"), + N_("The key events to convert the preedit string to half width. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY, + SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY_DEFAULT, + N_("Convert to half katakana"), + N_("Select keys to convert to half width katakana"), + N_("The key events to convert the preedit string to half width katakana. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY, + SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY_DEFAULT, + N_("Convert to wide latin"), + N_("Select keys to convert to wide latin"), + N_("The key events to convert the preedit string to wide latin. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY, + SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY_DEFAULT, + N_("Convert to latin"), + N_("Select keys to convert to latin"), + N_("The key events to convert the preedit string to latin. "), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +StringConfigData config_keyboards_dict [] = +{ + { + SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY, + SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY_DEFAULT, + N_("Edit dictionary"), + N_("Select edit dictionary keys"), + N_("The key events to launch dictionary administration tool. "), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_ADD_WORD_KEY, + SCIM_ANTHY_CONFIG_ADD_WORD_KEY_DEFAULT, + SCIM_ANTHY_CONFIG_ADD_WORD_KEY_DEFAULT, + N_("Add a word"), + N_("Select add a word keys"), + N_("The key events to launch the tool to add a word. "), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +ColorConfigData config_color_common [] = +{ + { + SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR, + SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR, + SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR_DEFAULT, + N_("Color:"), + N_("The color of preediting text"), + N_("The color of preediting text"), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR, + SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR, + SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR_DEFAULT, + N_("Color:"), + N_("The color of conversion text"), + N_("The color of conversion text"), + NULL, + false, + }, + { + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR, + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR, + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR_DEFAULT, + SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR_DEFAULT, + N_("Color:"), + N_("The color of selected segment text"), + N_("The color of selected segment text in the conversion text"), + NULL, + false, + }, + { + NULL, + "", + "", + NULL, + "", + "", + NULL, + NULL, + NULL, + NULL, + false, + }, +}; + +BoolConfigData * +find_bool_config_entry (const char *config_key) +{ + if (!config_key) + return NULL; + + for (unsigned int i = 0; config_bool_common[i].key; i++) { + BoolConfigData *entry = &config_bool_common[i]; + if (entry->key && !strcmp (entry->key, config_key)) + return entry; + } + + return NULL; +} + +IntConfigData * +find_int_config_entry (const char *config_key) +{ + if (!config_key) + return NULL; + + for (unsigned int i = 0; config_int_common[i].key; i++) { + IntConfigData *entry = &config_int_common[i]; + if (entry->key && !strcmp (entry->key, config_key)) + return entry; + } + + return NULL; +} + +StringConfigData * +find_string_config_entry (const char *config_key) +{ + if (!config_key) + return NULL; + + for (unsigned int i = 0; config_string_common[i].key; i++) { + StringConfigData *entry = &config_string_common[i]; + if (entry->key && !strcmp (entry->key, config_key)) + return entry; + } + + return NULL; +} + +ColorConfigData * +find_color_config_entry (const char *config_key) +{ + if (!config_key) + return NULL; + + for (unsigned int i = 0; config_color_common[i].fg_key; i++) { + ColorConfigData *entry = &config_color_common[i]; + if (entry->fg_key && !strcmp (entry->fg_key, config_key)) + return entry; + } + + return NULL; +} + +} diff --git a/src/scim_anthy_prefs.h b/src/scim_anthy_prefs.h new file mode 100755 index 0000000..aef6f08 --- /dev/null +++ b/src/scim_anthy_prefs.h @@ -0,0 +1,390 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_PREFS_H__ +#define __SCIM_ANTHY_PREFS_H__ + +/* config keys */ +#define SCIM_ANTHY_CONFIG_INPUT_MODE "/IMEngine/Anthy/InputMode" +#define SCIM_ANTHY_CONFIG_TYPING_METHOD "/IMEngine/Anthy/TypingMethod" +#define SCIM_ANTHY_CONFIG_CONVERSION_MODE "/IMEngine/Anthy/ConversionMode" +#define SCIM_ANTHY_CONFIG_PERIOD_STYLE "/IMEngine/Anthy/PeriodStyle" +#define SCIM_ANTHY_CONFIG_SYMBOL_STYLE "/IMEngine/Anthy/SymbolStyle" +#define SCIM_ANTHY_CONFIG_SPACE_TYPE "/IMEngine/Anthy/SpaceType" +#define SCIM_ANTHY_CONFIG_TEN_KEY_TYPE "/IMEngine/Anthy/TenKeyType" +#define SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD "/IMEngine/Anthy/BehaviorOnPeriod" +#define SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT "/IMEngine/Anthy/BehaviorOnFocusOut" + +#define SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE "/IMEngine/Anthy/RomajiThemeFile" +#define SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL "/IMEngine/Anthy/RomajiHalfSymbol" +#define SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER "/IMEngine/Anthy/RomajiHalfNumber" +#define SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT "/IMEngine/Anthy/RomajiAllowSplit" +#define SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE "/IMEngine/Anthy/RomajiPseudoAsciiMode" +#define SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR "/IMEngine/Anthy/RomajiPseudoAsciiBlankBehavior" + +#define SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE "/IMEngine/Anthy/KanaLayoutFile" +#define SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY "/IMEngine/ANthy/KanaLayoutRoKey" + +#define SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE "/IMEngine/Anthy/NICOLALayoutFile" +#define SCIM_ANTHY_CONFIG_NICOLA_TIME "/IMEngine/Anthy/NICOLATime" +#define SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY "/IMEngine/Anthy/LeftThumbShiftKey" +#define SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY "/IMEngine/Anthy/RightThumbShiftKey" + +#define SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT "/IMEngine/Anthy/LearnOnManualCommit" +#define SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT "/IMEngine/Anthy/LearnOnAutoCommit" + +#define SCIM_ANTHY_CONFIG_DICT_ENCODING "/IMEngine/Anthy/DictEncoding" +#define SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND "/IMEngine/Anthy/DictAdminCommand" +#define SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND "/IMEngine/Anthy/AddWordCommand" + +#define SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT "/IMEngine/Anthy/PredictOnInput" +#define SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT "/IMEngine/Anthy/UseDirectKeyOnPredict" + +#define SCIM_ANTHY_CONFIG_COLOR_THEME_FILE "/IMEngine/Anthy/ColorThemeFile" + +#define SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL "/IMEngine/Anthy/ShowCandidatesLabel" +#define SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE "/IMEngine/Anthy/CandWinPageSize" +#define SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT "/IMEngine/Anthy/CloseCandWinOnSelect" +#define SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN "/IMEngine/Anthy/NTriggersToShowCandWin" + +#define SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL "/IMEngine/Anthy/ShowInputModeLabel" +#define SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL "/IMEngine/Anthy/ShowTypingMethodLabel" +#define SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL "/IMEngine/Anthy/ShowConversionModeLabel" +#define SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL "/IMEngine/Anthy/ShowPeriodStyleLabel" +#define SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL "/IMEngine/Anthy/ShowSymbolStyleLabel" +#define SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL "/IMEngine/Anthy/ShowDictLabel" +#define SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL "/IMEngine/Anthy/ShowDictAdminLabel" +#define SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL "/IMEngine/Anthy/ShowAddWordLabel" + +#define SCIM_ANTHY_CONFIG_KEY_THEME "/IMEngine/Anthy/KeyTheme" +#define SCIM_ANTHY_CONFIG_KEY_THEME_FILE "/IMEngine/Anthy/KeyThemeFile" + +#define SCIM_ANTHY_CONFIG_ON_OFF_KEY "/IMEngine/Anthy/OnOffKey" +#define SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY "/IMEngine/Anthy/CircleInputModeKey" +#define SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY "/IMEngine/Anthy/CircleKanaModeKey" +#define SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY "/IMEngine/Anthy/CircleTypingMethodKey" +#define SCIM_ANTHY_CONFIG_LATIN_MODE_KEY "/IMEngine/Anthy/LatinModeKey" +#define SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY "/IMEngine/Anthy/WideLatinModeKey" +#define SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY "/IMEngine/Anthy/HiraganaModeKey" +#define SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY "/IMEngine/Anthy/KatakanaModeKey" +#define SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY "/IMEngine/Anthy/HalfKatakanaModeKey" +#define SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY "/IMEngine/Anthy/CancelPseudoAsciiModeKey" + +#define SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY "/IMEngine/Anthy/InsertSpaceKey" +#define SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY "/IMEngine/Anthy/InsertAltSpaceKey" +#define SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY "/IMEngine/Anthy/InsertHalfSpaceKey" +#define SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY "/IMEngine/Anthy/InsertWideSpaceKey" +#define SCIM_ANTHY_CONFIG_BACKSPACE_KEY "/IMEngine/Anthy/BackSpaceKey" +#define SCIM_ANTHY_CONFIG_DELETE_KEY "/IMEngine/Anthy/DeleteKey" +#define SCIM_ANTHY_CONFIG_COMMIT_KEY "/IMEngine/Anthy/CommitKey" +#define SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY "/IMEngine/Anthy/CommitReverseLearnKey" +#define SCIM_ANTHY_CONFIG_CONVERT_KEY "/IMEngine/Anthy/ConvertKey" +#define SCIM_ANTHY_CONFIG_PREDICT_KEY "/IMEngine/Anthy/PredictKey" +#define SCIM_ANTHY_CONFIG_CANCEL_KEY "/IMEngine/Anthy/CancelKey" +#define SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY "/IMEngine/Anthy/CancelAllKey" +#define SCIM_ANTHY_CONFIG_DO_NOTHING_KEY "/IMEngine/Anthy/DoNothingKey" + +#define SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY "/IMEngine/Anthy/MoveCaretFirstKey" +#define SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY "/IMEngine/Anthy/MoveCaretLastKey" +#define SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY "/IMEngine/Anthy/MoveCaretForwardKey" +#define SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY "/IMEngine/Anthy/MoveCaretBackwardKey" + +#define SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY "/IMEngine/Anthy/SelectFirstSegmentKey" +#define SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY "/IMEngine/Anthy/SelectLastSegmentKey" +#define SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY "/IMEngine/Anthy/SelectNextSegmentKey" +#define SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY "/IMEngine/Anthy/SelectPrevSegmentKey" +#define SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY "/IMEngine/Anthy/ShrinkSegmentKey" +#define SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY "/IMEngine/Anthy/ExpandSegmentKey" +#define SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY "/IMEngine/Anthy/CommitFirstSegmentKey" +#define SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY "/IMEngine/Anthy/CommitSelectedSegmentKey" +#define SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY "/IMEngine/Anthy/CommitFirstSegmentReverseLearnKey" +#define SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY "/IMEngine/Anthy/CommitSelectedSegmentReverseLearnKey" + +#define SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY "/IMEngine/Anthy/SelectFirstCandidateKey" +#define SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY "/IMEngine/Anthy/SelectLastCandidateKey" +#define SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY "/IMEngine/Anthy/SelectNextCandidateKey" +#define SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY "/IMEngine/Anthy/SelectPrevCandidateKey" +#define SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY "/IMEngine/Anthy/CandidatesPageUpKey" +#define SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY "/IMEngine/Anthy/CandidatesPageDownKey" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY "/IMEngine/Anthy/SelectCandidates1Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY "/IMEngine/Anthy/SelectCandidates2Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY "/IMEngine/Anthy/SelectCandidates3Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY "/IMEngine/Anthy/SelectCandidates4Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY "/IMEngine/Anthy/SelectCandidates5Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY "/IMEngine/Anthy/SelectCandidates6Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY "/IMEngine/Anthy/SelectCandidates7Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY "/IMEngine/Anthy/SelectCandidates8Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY "/IMEngine/Anthy/SelectCandidates9Key" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY "/IMEngine/Anthy/SelectCandidates10Key" + +#define SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY "/IMEngine/Anthy/ConvertCharTypeForwardKey" +#define SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY "/IMEngine/Anthy/ConvertCharTypeBackwardKey" +#define SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY "/IMEngine/Anthy/ConvertToHiraganaKey" +#define SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY "/IMEngine/Anthy/ConvertToKatakanaKey" +#define SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY "/IMEngine/Anthy/ConvertToHalfKey" +#define SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY "/IMEngine/Anthy/ConvertToHalfKatakanaKey" +#define SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY "/IMEngine/Anthy/ConvertToWideLatinKey" +#define SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY "/IMEngine/Anthy/ConvertToLatinKey" + +#define SCIM_ANTHY_CONFIG_RECONVERT_KEY "/IMEngine/Anthy/ReconvertKey" + +#define SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY "/IMEngine/Anthy/DictAdminKey" +#define SCIM_ANTHY_CONFIG_ADD_WORD_KEY "/IMEngine/Anthy/AddWordKey" + +#define SCIM_ANTHY_CONFIG_PREEDIT_STYLE "/IMEngine/Anthy/PreeditStyle" +#define SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR "/IMEngine/Anthy/PreeditFGColor" +#define SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR "/IMEngine/Anthy/PreeditBGColor" +#define SCIM_ANTHY_CONFIG_CONVERSION_STYLE "/IMEngine/Anthy/ConversionStyle" +#define SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR "/IMEngine/Anthy/ConversionFGColor" +#define SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR "/IMEngine/Anthy/ConversionBGColor" +#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE "/IMEngine/Anthy/SelectedSegmentStyle" +#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR "/IMEngine/Anthy/SelectedSegmentFGColor" +#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR "/IMEngine/Anthy/SelectedSegmentBGColor" + + +/* default config values */ +#define SCIM_ANTHY_CONFIG_INPUT_MODE_DEFAULT "Hiragana" +#define SCIM_ANTHY_CONFIG_TYPING_METHOD_DEFAULT "Romaji" +#define SCIM_ANTHY_CONFIG_CONVERSION_MODE_DEFAULT "MultiSeg" +#define SCIM_ANTHY_CONFIG_PERIOD_STYLE_DEFAULT "Japanese" +#define SCIM_ANTHY_CONFIG_SYMBOL_STYLE_DEFAULT "Japanese" +#define SCIM_ANTHY_CONFIG_SPACE_TYPE_DEFAULT "FollowMode" +#define SCIM_ANTHY_CONFIG_TEN_KEY_TYPE_DEFAULT "FollowMode" +#define SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD_DEFAULT "None" +#define SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT_DEFAULT "Commit" + +#define SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT "" +#define SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL_DEFAULT false +#define SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER_DEFAULT false +#define SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT_DEFAULT true +#define SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE_DEFAULT true +#define SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR_DEFAULT true + +#define SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE_DEFAULT "" +#define SCIM_ANTHY_CONFIG_KANA_LAYOUT_RO_KEY_DEFAULT "\xE3\x82\x8D" + +#define SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE_DEFAULT "" +#define SCIM_ANTHY_CONFIG_NICOLA_TIME_DEFAULT 200 +#define SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY_DEFAULT "Muhenkan" +#define SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY_DEFAULT "Henkan,space" + +#define SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT_DEFAULT true +#define SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT_DEFAULT true + +#define SCIM_ANTHY_CONFIG_DICT_ENCODING_DEFAULT "UTF-8" +#define SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND_DEFAULT "kasumi" +#define SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND_DEFAULT "kasumi --add" + +#define SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT_DEFAULT false +#define SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT_DEFAULT true + +#define SCIM_ANTHY_CONFIG_COLOR_THEME_FILE_DEFAULT "" + +#define SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL_DEFAULT true +#define SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE_DEFAULT 10 +#define SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT_DEFAULT true +#define SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN_DEFAULT 2 + +#define SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL_DEFAULT true +#define SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL_DEFAULT false +#define SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL_DEFAULT true +#define SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL_DEFAULT false +#define SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL_DEFAULT false +#define SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL_DEFAULT true +#define SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL_DEFAULT true +#define SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL_DEFAULT true + +#define SCIM_ANTHY_CONFIG_KEY_THEME_DEFAULT "Default" +#define SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT "" + +#define SCIM_ANTHY_CONFIG_ON_OFF_KEY_DEFAULT "Zenkaku_Hankaku,Control+j,Control+J" +#define SCIM_ANTHY_CONFIG_CIRCLE_INPUT_MODE_KEY_DEFAULT "Control+comma,Control+less" +#define SCIM_ANTHY_CONFIG_CIRCLE_KANA_MODE_KEY_DEFAULT "Control+period,Control+greater,Hiragana_Katakana" +#define SCIM_ANTHY_CONFIG_CIRCLE_TYPING_METHOD_KEY_DEFAULT "Alt+Romaji,Control+slash" +#define SCIM_ANTHY_CONFIG_LATIN_MODE_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_WIDE_LATIN_MODE_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_HIRAGANA_MODE_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_KATAKANA_MODE_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_HALF_KATAKANA_MODE_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_CANCEL_PSEUDO_ASCII_MODE_KEY_DEFAULT "Escape" + +#define SCIM_ANTHY_CONFIG_INSERT_SPACE_KEY_DEFAULT "space" +#define SCIM_ANTHY_CONFIG_INSERT_ALT_SPACE_KEY_DEFAULT "Shift+space" +#define SCIM_ANTHY_CONFIG_INSERT_HALF_SPACE_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_INSERT_WIDE_SPACE_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_BACKSPACE_KEY_DEFAULT "BackSpace,Control+h,Control+H" +#define SCIM_ANTHY_CONFIG_DELETE_KEY_DEFAULT "Delete,Control+d,Control+D" +#define SCIM_ANTHY_CONFIG_COMMIT_KEY_DEFAULT "Return,KP_Enter,Control+j,Control+J,Control+m,Control+M" +#define SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY_DEFAULT "Shift+Return" +#define SCIM_ANTHY_CONFIG_CONVERT_KEY_DEFAULT "space,KP_Space,Henkan" +#define SCIM_ANTHY_CONFIG_PREDICT_KEY_DEFAULT "Tab,ISO_Left_Tab" +#define SCIM_ANTHY_CONFIG_CANCEL_KEY_DEFAULT "Escape,Control+g,Control+G" +#define SCIM_ANTHY_CONFIG_CANCEL_ALL_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_DO_NOTHING_KEY_DEFAULT "" + +#define SCIM_ANTHY_CONFIG_MOVE_CARET_FIRST_KEY_DEFAULT "Control+a,Control+A,Home" +#define SCIM_ANTHY_CONFIG_MOVE_CARET_LAST_KEY_DEFAULT "Control+e,Control+E,End" +#define SCIM_ANTHY_CONFIG_MOVE_CARET_FORWARD_KEY_DEFAULT "Right,Control+f,Control+F" +#define SCIM_ANTHY_CONFIG_MOVE_CARET_BACKWARD_KEY_DEFAULT "Left,Control+b,Control+B" + +#define SCIM_ANTHY_CONFIG_SELECT_FIRST_SEGMENT_KEY_DEFAULT "Control+a,Control+A,Home" +#define SCIM_ANTHY_CONFIG_SELECT_LAST_SEGMENT_KEY_DEFAULT "Control+e,Control+E,End" +#define SCIM_ANTHY_CONFIG_SELECT_NEXT_SEGMENT_KEY_DEFAULT "Right,Control+f,Control+F" +#define SCIM_ANTHY_CONFIG_SELECT_PREV_SEGMENT_KEY_DEFAULT "Left,Control+b,Control+B" +#define SCIM_ANTHY_CONFIG_SHRINK_SEGMENT_KEY_DEFAULT "Shift+Left,Control+i,Control+I" +#define SCIM_ANTHY_CONFIG_EXPAND_SEGMENT_KEY_DEFAULT "Shift+Right,Control+o,Control+O" +#define SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_KEY_DEFAULT "Shift+Down" +#define SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_KEY_DEFAULT "Control+Down" +#define SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY_DEFAULT "" + +#define SCIM_ANTHY_CONFIG_SELECT_FIRST_CANDIDATE_KEY_DEFAULT "Home" +#define SCIM_ANTHY_CONFIG_SELECT_LAST_CANDIDATE_KEY_DEFAULT "End" +#define SCIM_ANTHY_CONFIG_SELECT_NEXT_CANDIDATE_KEY_DEFAULT "space,KP_Space,Tab,ISO_Left_Tab,Henkan,Down,KP_Add,Control+n,Control+N" +#define SCIM_ANTHY_CONFIG_SELECT_PREV_CANDIDATE_KEY_DEFAULT "Shift+Tab,Shift+ISO_Left_Tab,Up,KP_Subtract,Control+p,Control+P" +#define SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_UP_KEY_DEFAULT "Page_Up" +#define SCIM_ANTHY_CONFIG_CANDIDATES_PAGE_DOWN_KEY_DEFAULT "Page_Down,KP_Tab" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_1_KEY_DEFAULT "1" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_2_KEY_DEFAULT "2" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_3_KEY_DEFAULT "3" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_4_KEY_DEFAULT "4" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_5_KEY_DEFAULT "5" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_6_KEY_DEFAULT "6" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_7_KEY_DEFAULT "7" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_8_KEY_DEFAULT "8" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_9_KEY_DEFAULT "9" +#define SCIM_ANTHY_CONFIG_SELECT_CANDIDATE_10_KEY_DEFAULT "0" + +#define SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_FORWARD_KEY_DEFAULT "Muhenkan" +#define SCIM_ANTHY_CONFIG_CONV_CHAR_TYPE_BACKWARD_KEY_DEFAULT "" +#define SCIM_ANTHY_CONFIG_CONV_TO_HIRAGANA_KEY_DEFAULT "F6" +#define SCIM_ANTHY_CONFIG_CONV_TO_KATAKANA_KEY_DEFAULT "F7" +#define SCIM_ANTHY_CONFIG_CONV_TO_HALF_KEY_DEFAULT "F8" +#define SCIM_ANTHY_CONFIG_CONV_TO_HALF_KATAKANA_KEY_DEFAULT "Shift+F8" +#define SCIM_ANTHY_CONFIG_CONV_TO_WIDE_LATIN_KEY_DEFAULT "F9" +#define SCIM_ANTHY_CONFIG_CONV_TO_LATIN_KEY_DEFAULT "F10" + +#define SCIM_ANTHY_CONFIG_RECONVERT_KEY_DEFAULT "Shift+Henkan" + +#define SCIM_ANTHY_CONFIG_DICT_ADMIN_KEY_DEFAULT "F11" +#define SCIM_ANTHY_CONFIG_ADD_WORD_KEY_DEFAULT "F12" + +#define SCIM_ANTHY_CONFIG_PREEDIT_STYLE_DEFAULT "Underline" +#define SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR_DEFAULT "#006010" +#define SCIM_ANTHY_CONFIG_PREEDIT_BG_COLOR_DEFAULT "#FFFFFF" +#define SCIM_ANTHY_CONFIG_CONVERSION_STYLE_DEFAULT "Underline" +#define SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR_DEFAULT "#006010" +#define SCIM_ANTHY_CONFIG_CONVERSION_BG_COLOR_DEFAULT "#FFFFFF" +#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE_DEFAULT "Reverse" +#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR_DEFAULT "#FFFFFF" +#define SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_BG_COLOR_DEFAULT "#0900A5" + + +#ifdef SCIM_ANTHY_USE_GTK + +#ifdef HAVE_CONFIG_H + #include +#endif /* HAVE_CONFIG_H */ + +#include + +using namespace scim; + +namespace scim_anthy { +struct BoolConfigData +{ + const char *key; + bool value; + bool default_value; + const char *label; + const char *title; + const char *tooltip; + void *widget; + bool changed; +}; + +struct IntConfigData +{ + const char *key; + int value; + int default_value; + int min, max, step; + const char *label; + const char *unit; + const char *title; + const char *tooltip; + void *widget; + bool changed; +}; + +struct StringConfigData +{ + const char *key; + String value; + String default_value; + const char *label; + const char *title; + const char *tooltip; + void *widget; + bool changed; +}; + +struct ColorConfigData +{ + const char *fg_key; + String fg_value; + String fg_default_value; + const char *bg_key; + String bg_value; + String bg_default_value; + const char *label; + const char *title; + const char *tooltip; + void *widget; + bool changed; +}; + +extern BoolConfigData config_bool_common []; +extern IntConfigData config_int_common []; +extern StringConfigData config_string_common []; +extern StringConfigData config_keyboards_mode []; +extern StringConfigData config_keyboards_edit []; +extern StringConfigData config_keyboards_caret []; +extern StringConfigData config_keyboards_segments []; +extern StringConfigData config_keyboards_candidates []; +extern StringConfigData config_keyboards_direct_select []; +extern StringConfigData config_keyboards_converting []; +extern StringConfigData config_keyboards_dict []; +extern ColorConfigData config_color_common []; + +BoolConfigData *find_bool_config_entry (const char *config_key); +IntConfigData *find_int_config_entry (const char *config_key); +StringConfigData *find_string_config_entry (const char *config_key); +ColorConfigData *find_color_config_entry (const char *config_key); + +} + +#endif /* SCIM_ANTHY_USE_GTK */ + + +#endif /* __SCIM_ANTHY_PREFS_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_reading.cpp b/src/scim_anthy_reading.cpp new file mode 100755 index 0000000..1cc7476 --- /dev/null +++ b/src/scim_anthy_reading.cpp @@ -0,0 +1,750 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#include "scim_anthy_reading.h" +#include "scim_anthy_factory.h" +#include "scim_anthy_imengine.h" +#include "scim_anthy_utils.h" + +using namespace scim_anthy; + +ReadingSegment::ReadingSegment () +{ +} + +ReadingSegment::~ReadingSegment () +{ +} + +static const char * +find_romaji (WideString c) +{ + ConvRule *table = scim_anthy_romaji_typing_rule; + + for (unsigned int i = 0; table[i].string; i++) { + WideString kana = utf8_mbstowcs (table[i].result); + if (c == kana) + return table[i].string; + } + + return ""; +} + +static void +to_half (String &dest, WideString &src) +{ + WideRule *table = scim_anthy_wide_table; + + for (unsigned int i = 0; i < src.size (); i++) { + bool found = false; + WideString kana1 = src.substr (i, 1); + for (unsigned int i = 0; table[i].code; i++) { + WideString kana2 = utf8_mbstowcs (table[i].wide); + if (kana1 == kana2) { + dest += table[i].code; + found = true; + break; + } + } + if (!found) + dest += utf8_wcstombs (kana1); + } +} + +// Only a romaji string can be splited with raw key string. +// Other typing method aren't supported splitting raw key string. +void +ReadingSegment::split (ReadingSegments &segments) +{ + if (kana.length () <= 1) + segments.push_back (*this); + + String half; + to_half (half, kana); + bool same_with_raw = half == raw; + + WideString::iterator it; + for (unsigned int i = 0; i < kana.size (); i++) { + WideString c = kana.substr (i, 1); + ReadingSegment seg; + seg.kana = c; + if (same_with_raw) + to_half (seg.raw, c); + else + seg.raw = find_romaji (c); + segments.push_back (seg); + } +} + + + +Reading::Reading (AnthyInstance &anthy) + : m_anthy (anthy), + //m_key2kana_tables (tables), + m_key2kana_normal (anthy, m_key2kana_tables), + m_kana (anthy), + m_nicola (anthy, m_nicola_tables), + m_key2kana (&m_key2kana_normal), + m_segment_pos (0), + m_caret_offset (0) +{ + m_nicola_tables.set_typing_method (SCIM_ANTHY_TYPING_METHOD_NICOLA); +} + +Reading::~Reading () +{ +} + +bool +Reading::can_process_key_event (const KeyEvent & key) +{ + if (m_kana.can_append (key)) + return true; + + return m_key2kana->can_append (key); +} + +bool +Reading::process_key_event (const KeyEvent & key) +{ + if (!can_process_key_event (key)) + return false; + + if (m_caret_offset != 0) { + split_segment (m_segment_pos); + reset_pending (); + } + + bool was_pending; + if (m_kana.can_append (key)) + was_pending = m_kana.is_pending (); + else + was_pending = m_key2kana->is_pending (); + + String raw; + WideString result, pending; + bool need_commiting; + if (m_kana.can_append (key)) + need_commiting = m_kana.append (key, result, pending, raw); + else + need_commiting = m_key2kana->append (key, result, pending, raw); + + ReadingSegments::iterator begin = m_segments.begin (); + + // fix previous segment and prepare next segment if needed + if (!result.empty () || !pending.empty ()) { + if (!was_pending || // previous segment was already fixed + need_commiting) // previous segment has been fixed + { + ReadingSegment c; + m_segments.insert (begin + m_segment_pos, c); + m_segment_pos++; + } + } + + // fill segment + if (result.length() > 0 && pending.length () > 0) { + m_segments[m_segment_pos - 1].kana = result; + + ReadingSegment c; + c.raw += raw; + c.kana = pending; + m_segments.insert (begin + m_segment_pos, c); + m_segment_pos++; + + } else if (result.length () > 0) { + m_segments[m_segment_pos - 1].raw += raw; + m_segments[m_segment_pos - 1].kana = result; + + } else if (pending.length () > 0) { + m_segments[m_segment_pos - 1].raw += raw; + m_segments[m_segment_pos - 1].kana = pending; + + } else { + + } + + return false; +} + +void +Reading::finish (void) +{ + if (!m_key2kana->is_pending ()) return; + + WideString result; + result = m_key2kana->flush_pending (); + if (result.length () > 0) + m_segments[m_segment_pos - 1].kana = result; +} + +void +Reading::clear (void) +{ + m_key2kana_normal.clear (); + m_kana.clear (); + m_nicola.clear (); + m_segments.clear (); + m_segment_pos = 0; + m_caret_offset = 0; +} + +WideString +Reading::get (unsigned int start, int len, StringType type) +{ + WideString str; + unsigned int pos = 0, end = len > 0 ? start + len : get_length () - start; + WideString kana; + String raw; + + if (start >= end) + return str; + if (start >= get_length ()) + return str; + + switch (type) { + case SCIM_ANTHY_STRING_LATIN: + raw = get_raw (start, len); + str = utf8_mbstowcs (raw); + return str; + + case SCIM_ANTHY_STRING_WIDE_LATIN: + raw = get_raw (start, len); + util_convert_to_wide (str, raw); + return str; + + default: + break; + } + + for (unsigned int i = 0; i < m_segments.size (); i++) { + if (pos >= start || pos + m_segments[i].kana.length () > start) { + unsigned int startstart = 0, len; + + if (pos >= start) + startstart = 0; + else + startstart = pos - start; + + if (pos + m_segments[i].kana.length () > end) + len = end - start; + else + len = m_segments[i].kana.length (); + + kana += m_segments[i].kana.substr (startstart, len); + } + + pos += m_segments[i].kana.length (); + if (pos >= end) + break; + } + + switch (type) { + case SCIM_ANTHY_STRING_HIRAGANA: + str = kana; + break; + + case SCIM_ANTHY_STRING_KATAKANA: + util_convert_to_katakana (str, kana); + break; + + case SCIM_ANTHY_STRING_HALF_KATAKANA: + util_convert_to_katakana (str, kana, true); + break; + + default: + break; + } + + return str; +} + +String +Reading::get_raw (unsigned int start, int len) +{ + String str; + unsigned int pos = 0, end = len > 0 ? start + len : get_length () - start; + + if (start >= end) + return str; + + for (unsigned int i = 0; i < m_segments.size (); i++) { + if (pos >= start || pos + m_segments[i].kana.length () > start) { + // FIXME! + str += m_segments[i].raw; + } + + pos += m_segments[i].kana.length (); + + if (pos >= end) + break; + } + + return str; +} + +void +Reading::split_segment (unsigned int seg_id) +{ + if (seg_id >= m_segments.size ()) + return; + + unsigned int pos = 0; + for (unsigned int i = 0; i < seg_id && i < m_segments.size (); i++) + pos += m_segments[i].kana.length (); + + unsigned int caret = get_caret_pos (); + unsigned int seg_len = m_segments[seg_id].kana.length (); + bool caret_was_in_the_segment = false; + if (caret > pos && caret < pos + seg_len) + caret_was_in_the_segment = true; + + ReadingSegments segments; + m_segments[seg_id].split (segments); + m_segments.erase (m_segments.begin () + seg_id); + for (int j = segments.size () - 1; j >= 0; j--) { + m_segments.insert (m_segments.begin () + seg_id, segments[j]); + if (m_segment_pos > seg_id) + m_segment_pos++; + } + + if (caret_was_in_the_segment) { + m_segment_pos += m_caret_offset; + m_caret_offset = 0; + } +} + +bool +Reading::append (const KeyEvent & key, + const String & string) +{ + bool was_pending; + WideString result, pending; + bool need_commiting; + + if (!m_kana.can_append (key, true) && + !m_key2kana->can_append (key, true)) + return false; + + if (m_caret_offset != 0) { + split_segment (m_segment_pos); + reset_pending (); + } + + if (m_kana.can_append (key)) + was_pending = m_kana.is_pending (); + else + was_pending = m_key2kana->is_pending (); + + if (m_kana.can_append (key)) + need_commiting = m_kana.append (string, result, pending); + else + need_commiting = m_key2kana->append (string, result, pending); + + ReadingSegments::iterator begin = m_segments.begin (); + + // fix previous segment and prepare next segment if needed + if (!result.empty () || !pending.empty ()) { + if (!was_pending || // previous segment was already fixed + need_commiting) // previous segment has been fixed + { + ReadingSegment c; + m_segments.insert (begin + m_segment_pos, c); + m_segment_pos++; + } + } + + // fill segment + if (result.length() > 0 && pending.length () > 0) { + m_segments[m_segment_pos - 1].kana = result; + + ReadingSegment c; + c.raw += string; + c.kana = pending; + m_segments.insert (begin + m_segment_pos, c); + m_segment_pos++; + + } else if (result.length () > 0) { + m_segments[m_segment_pos - 1].raw += string; + m_segments[m_segment_pos - 1].kana = result; + + } else if (pending.length () > 0) { + m_segments[m_segment_pos - 1].raw += string; + m_segments[m_segment_pos - 1].kana = pending; + + } else { + + } + + return false; +} + +void +Reading::erase (unsigned int start, int len, bool allow_split) +{ + if (m_segments.size () <= 0) + return; + + if (get_length () < start) + return; + + if (len < 0) + len = get_length () - start; + + // erase + unsigned int pos = 0; + for (int i = 0; i <= (int) m_segments.size (); i++) { + if (pos < start) { + // we have not yet reached start position. + + if (i == (int) m_segments.size ()) + break; + + pos += m_segments[i].kana.length (); + + } else if (pos == start) { + // we have reached start position. + + if (i == (int) m_segments.size ()) + break; + + if (allow_split && + pos + m_segments[i].kana.length () > start + len) + { + // we have overshooted the end position! + // we have to split this segment + split_segment (i); + + } else { + // This segment is completely in the rage, erase it! + len -= m_segments[i].kana.length (); + m_segments.erase (m_segments.begin () + i); + if ((int) m_segment_pos > i) + m_segment_pos--; + } + + // retry from the same position + i--; + + } else { + // we have overshooted the start position! + + if (allow_split) { + pos -= m_segments[i - 1].kana.length (); + split_segment (i - 1); + + // retry from the previous position + i -= 2; + + } else { + // we have overshooted the start position, but have not been + // allowed to split the segment. + // So remove all string of previous segment. + len -= pos - start; + pos -= m_segments[i - 1].kana.length (); + m_segments.erase (m_segments.begin () + i - 1); + if ((int) m_segment_pos > i - 1) + m_segment_pos--; + + // retry from the previous position + i -= 2; + } + } + + // Now all letters in the range are removed. + // Exit the loop. + if (len <= 0) + break; + } + + // reset values + if (m_segments.size () <= 0) { + clear (); + } else { + reset_pending (); + } +} + +void +Reading::reset_pending (void) +{ + if (m_key2kana->is_pending ()) + m_key2kana->clear (); + if (m_kana.is_pending ()) + m_kana.clear (); + + if (m_segment_pos <= 0) + return; + + m_key2kana->reset_pending (m_segments[m_segment_pos - 1].kana, + m_segments[m_segment_pos - 1].raw); + m_kana.reset_pending (m_segments[m_segment_pos - 1].kana, + m_segments[m_segment_pos - 1].raw); + + // FIXME! this code breaks pending state on normal input mode. + m_key2kana->reset_pseudo_ascii_mode(); + for (unsigned int i = 0; i < m_segment_pos; i++) + m_key2kana->process_pseudo_ascii_mode(m_segments[i].kana); +} + +unsigned int +Reading::get_length (void) +{ + unsigned int len = 0; + for (unsigned int i = 0; i < m_segments.size (); i++) + len += m_segments[i].kana.length(); + return len; +} + +unsigned int +Reading::get_caret_pos (void) +{ + unsigned int pos = 0; + + for (unsigned int i = 0; + i < m_segment_pos && i < m_segments.size (); + i++) + { + pos += m_segments[i].kana.length(); + } + + pos += m_caret_offset; + + return pos; +} + +// FIXME! add "allow_split" argument. +void +Reading::set_caret_pos (unsigned int pos) +{ + if (pos == get_caret_pos ()) + return; + + m_key2kana->clear (); + m_kana.clear (); + + if (pos >= get_length ()) { + m_segment_pos = m_segments.size (); + + } else if (pos == 0 || m_segments.size () <= 0) { + m_segment_pos = 0; + + } else { + unsigned int i, tmp_pos = 0; + + for (i = 0; tmp_pos <= pos; i++) + tmp_pos += m_segments[i].kana.length(); + + if (tmp_pos == pos) { + m_segment_pos = i + 1; + } else if (tmp_pos < get_caret_pos ()) { + m_segment_pos = i; + } else if (tmp_pos > get_caret_pos ()) { + m_segment_pos = i + 1; + } + } + + reset_pending (); +} + +void +Reading::move_caret (int step, bool allow_split) +{ + if (step == 0) + return; + + m_key2kana->clear (); + m_kana.clear (); + + if (allow_split) { + unsigned int pos = get_caret_pos (); + if (step < 0 && pos < (int) abs (step)) { + // lower limit + m_segment_pos = 0; + + } else if (step > 0 && pos + step > get_length ()) { + // upper limit + m_segment_pos = m_segments.size (); + + } else { + unsigned int new_pos = pos + step; + ReadingSegments::iterator it; + pos = 0; + m_segment_pos = 0; + m_caret_offset = 0; + for (it = m_segments.begin (); pos < new_pos; it++) { + if (pos + it->kana.length () > new_pos) { + m_caret_offset = new_pos - pos; + break; + } else { + m_segment_pos++; + pos += it->kana.length (); + } + } + } + + } else { + if (step < 0 && m_segment_pos < (int) abs (step)) { + // lower limit + m_segment_pos = 0; + + } else if (step > 0 && m_segment_pos + step > m_segments.size ()) { + // upper limit + m_segment_pos = m_segments.size (); + + } else { + // other + m_segment_pos += step; + } + } + + reset_pending (); +} + +void +Reading::set_typing_method (TypingMethod method) +{ + Key2KanaTable *fundamental_table = NULL; + + if (method == SCIM_ANTHY_TYPING_METHOD_NICOLA) { + fundamental_table = m_anthy.get_factory()->m_custom_nicola_table; + m_key2kana = &m_nicola; + m_nicola_tables.set_typing_method (method, fundamental_table); + m_nicola.set_case_sensitive (true); + } else if (method == SCIM_ANTHY_TYPING_METHOD_KANA) { + fundamental_table = m_anthy.get_factory()->m_custom_kana_table; + m_key2kana = &m_key2kana_normal; + m_key2kana_tables.set_typing_method (method, fundamental_table); + m_key2kana_normal.set_case_sensitive (true); + } else { + fundamental_table = m_anthy.get_factory()->m_custom_romaji_table; + m_key2kana = &m_key2kana_normal; + m_key2kana_tables.set_typing_method (method, fundamental_table); + m_key2kana_normal.set_case_sensitive (false); + } +} + +TypingMethod +Reading::get_typing_method (void) +{ + if (m_key2kana == &m_nicola) + return SCIM_ANTHY_TYPING_METHOD_NICOLA; + else + return m_key2kana_tables.get_typing_method (); +} + +void +Reading::set_period_style (PeriodStyle style) +{ + m_key2kana_tables.set_period_style (style); +} + +PeriodStyle +Reading::get_period_style (void) +{ + return m_key2kana_tables.get_period_style (); +} + +void +Reading::set_comma_style (CommaStyle style) +{ + m_key2kana_tables.set_comma_style (style); +} + +CommaStyle +Reading::get_comma_style (void) +{ + return m_key2kana_tables.get_comma_style (); +} + +void +Reading::set_bracket_style (BracketStyle style) +{ + m_key2kana_tables.set_bracket_style (style); +} + +BracketStyle +Reading::get_bracket_style (void) +{ + return m_key2kana_tables.get_bracket_style (); +} + +void +Reading::set_slash_style (SlashStyle style) +{ + m_key2kana_tables.set_slash_style (style); +} + +SlashStyle +Reading::get_slash_style (void) +{ + return m_key2kana_tables.get_slash_style (); +} + +void +Reading::set_symbol_width (bool half) +{ + m_key2kana_tables.set_symbol_width (half); +} + +bool +Reading::get_symbol_width (void) +{ + return m_key2kana_tables.symbol_is_half (); +} + +void +Reading::set_number_width (bool half) +{ + m_key2kana_tables.set_number_width (half); +} + +bool +Reading::get_number_width (void) +{ + return m_key2kana_tables.number_is_half (); +} + +void +Reading::set_pseudo_ascii_mode (int mode) +{ + m_key2kana_normal.set_pseudo_ascii_mode (mode); +} + +bool +Reading::is_pseudo_ascii_mode (void) +{ + return m_key2kana_normal.is_pseudo_ascii_mode (); +} + +void +Reading::reset_pseudo_ascii_mode (void) +{ + if (m_key2kana_normal.is_pseudo_ascii_mode () && + m_key2kana_normal.is_pending ()) + { + ReadingSegment c; + ReadingSegments::iterator it = m_segments.begin (); + + /* separate to another segment */ + m_key2kana_normal.reset_pseudo_ascii_mode (); + m_segments.insert (it + m_segment_pos, c); + m_segment_pos++; + } +} diff --git a/src/scim_anthy_reading.h b/src/scim_anthy_reading.h new file mode 100755 index 0000000..9389082 --- /dev/null +++ b/src/scim_anthy_reading.h @@ -0,0 +1,141 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_READING_H__ +#define __SCIM_ANTHY_READING_H__ + +#define Uses_SCIM_ICONV +#define Uses_SCIM_EVENT +#include +#include "scim_anthy_key2kana.h" +#include "scim_anthy_kana.h" +#include "scim_anthy_nicola.h" + +using namespace scim; + +class AnthyInstance; + +namespace scim_anthy { + +typedef enum { + SCIM_ANTHY_STRING_LATIN, + SCIM_ANTHY_STRING_WIDE_LATIN, + SCIM_ANTHY_STRING_HIRAGANA, + SCIM_ANTHY_STRING_KATAKANA, + SCIM_ANTHY_STRING_HALF_KATAKANA, +} StringType; + +class Reading; +class ReadingSegment; +typedef std::vector ReadingSegments; + +class ReadingSegment +{ + friend class Reading; + +public: + ReadingSegment (void); + virtual ~ReadingSegment (); + + const WideString & get (void) { return kana; } + const String & get_raw (void) { return raw; } + + void split (ReadingSegments &segments); + +private: + String raw; + WideString kana; +}; + +class Reading +{ +public: + Reading (AnthyInstance &anthy); + virtual ~Reading (); + + bool can_process_key_event (const KeyEvent & key); + bool process_key_event (const KeyEvent & key); + void finish (void); + void clear (void); + + WideString get (unsigned int start = 0, + int length = -1, + StringType type + = SCIM_ANTHY_STRING_HIRAGANA); + String get_raw (unsigned int start = 0, + int length = -1); + bool append (const KeyEvent & key, + const String & string); + void erase (unsigned int start = 0, + int length = -1, + bool allow_split = false); + + unsigned int get_length (void); + unsigned int get_caret_pos (void); + void set_caret_pos (unsigned int pos); + void move_caret (int step, + bool allow_split = false); + + void set_typing_method (TypingMethod method); + TypingMethod get_typing_method (void); + void set_period_style (PeriodStyle style); + PeriodStyle get_period_style (void); + void set_comma_style (CommaStyle style); + CommaStyle get_comma_style (void); + void set_bracket_style (BracketStyle style); + BracketStyle get_bracket_style (void); + void set_slash_style (SlashStyle style); + SlashStyle get_slash_style (void); + void set_symbol_width (bool half); + bool get_symbol_width (void); + void set_number_width (bool half); + bool get_number_width (void); + void set_pseudo_ascii_mode (int mode); + bool is_pseudo_ascii_mode (void); + void reset_pseudo_ascii_mode (void); + +private: + void reset_pending (void); + void split_segment (unsigned int seg_id); + +private: + AnthyInstance &m_anthy; + + // tables + Key2KanaTableSet m_key2kana_tables; + Key2KanaTableSet m_nicola_tables; + + // convertors + Key2KanaConvertor m_key2kana_normal; + KanaConvertor m_kana; + NicolaConvertor m_nicola; + Key2KanaConvertorBase *m_key2kana; + + // state + ReadingSegments m_segments; + unsigned int m_segment_pos; + unsigned int m_caret_offset; +}; + +} + +#endif /* __SCIM_ANTHY_READING_H__ */ +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_setup.cpp b/src/scim_anthy_setup.cpp new file mode 100755 index 0000000..942e852 --- /dev/null +++ b/src/scim_anthy_setup.cpp @@ -0,0 +1,2121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +/* + * Based on scim-hangul. + * Copyright (c) 2004 James Su + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include +#include +#include + +#define Uses_SCIM_CONFIG_BASE +#define Uses_SCIM_EVENT +#define SCIM_ANTHY_USE_GTK +#include +#include +#include "scim_anthy_intl.h" +#include "scim_anthy_style_file.h" +#include "scim_anthy_prefs.h" +#include "scim_anthy_default_tables.h" +#include "scim_anthy_setup.h" +#include "scim_anthy_setup_romaji.h" +#include "scim_anthy_setup_kana.h" +#include "scim_anthy_utils.h" +#include "scim_anthy_color_button.h" + +using namespace scim; +using namespace scim_anthy; + +#define scim_module_init anthy_imengine_setup_LTX_scim_module_init +#define scim_module_exit anthy_imengine_setup_LTX_scim_module_exit + +#define scim_setup_module_create_ui anthy_imengine_setup_LTX_scim_setup_module_create_ui +#define scim_setup_module_get_category anthy_imengine_setup_LTX_scim_setup_module_get_category +#define scim_setup_module_get_name anthy_imengine_setup_LTX_scim_setup_module_get_name +#define scim_setup_module_get_description anthy_imengine_setup_LTX_scim_setup_module_get_description +#define scim_setup_module_load_config anthy_imengine_setup_LTX_scim_setup_module_load_config +#define scim_setup_module_save_config anthy_imengine_setup_LTX_scim_setup_module_save_config +#define scim_setup_module_query_changed anthy_imengine_setup_LTX_scim_setup_module_query_changed + +#define DATA_POINTER_KEY "scim-anthy::ConfigPointer" +#define INDEX_KEY "scim-anthy::Index" + +namespace scim_anthy { + +static GtkWidget * create_setup_window (void); +static void load_style_files (const char *dirname); +static void load_config (const ConfigPointer &config); +static void save_config (const ConfigPointer &config); +static bool query_changed (void); + +//static StyleFiles __style_list; +//static StyleFile __user_style_file; +StyleFiles __style_list; +StyleFile __user_style_file; +const String __user_config_dir_name = + scim_get_home_dir () + + String (SCIM_PATH_DELIM_STRING + ".scim" + SCIM_PATH_DELIM_STRING + "Anthy"); +const String __user_style_dir_name = + __user_config_dir_name + + String (SCIM_PATH_DELIM_STRING + "style"); +const String __user_style_file_name = + __user_config_dir_name + + String (SCIM_PATH_DELIM_STRING + "config.sty"); + +} + +// Module Interface. +extern "C" { + void scim_module_init (void) + { + bindtextdomain (GETTEXT_PACKAGE, SCIM_ANTHY_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + } + + void scim_module_exit (void) + { + } + + GtkWidget * scim_setup_module_create_ui (void) + { + return create_setup_window (); + } + + String scim_setup_module_get_category (void) + { + return String ("IMEngine"); + } + + String scim_setup_module_get_name (void) + { + return String (_("Anthy")); + } + + String scim_setup_module_get_description (void) + { + return String (_("An Anthy IMEngine Module.")); + } + + void scim_setup_module_load_config (const ConfigPointer &config) + { + load_config (config); + } + + void scim_setup_module_save_config (const ConfigPointer &config) + { + save_config (config); + } + + bool scim_setup_module_query_changed () + { + return query_changed (); + } +} // extern "C" + + + +namespace scim_anthy { + +// Internal data structure +struct KeyboardConfigPage +{ + const char *label; + StringConfigData *data; +}; + +struct ComboConfigCandidate +{ + const char *label; + const char *data; +}; + +enum { + COLUMN_LABEL = 0, + COLUMN_VALUE = 1, + COLUMN_DESC = 2, + COLUMN_DATA = 3, + N_COLUMNS = 4, +}; + +// Internal data declaration. +bool __config_changed = false; +bool __style_changed = false; +static GtkWidget * __widget_key_categories_menu = NULL; +static GtkWidget * __widget_key_filter = NULL; +static GtkWidget * __widget_key_filter_button = NULL; +static GtkWidget * __widget_key_theme_menu = NULL; +static GtkWidget * __widget_key_list_view = NULL; +static GtkWidget * __widget_choose_keys_button = NULL; +static GtkTooltips * __widget_tooltips = NULL; + +static String __config_key_theme = SCIM_ANTHY_CONFIG_KEY_THEME_DEFAULT; +static String __config_key_theme_file = SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT; + +static struct KeyboardConfigPage __key_conf_pages[] = +{ + {N_("Mode keys"), config_keyboards_mode}, + {N_("Edit keys"), config_keyboards_edit}, + {N_("Caret keys"), config_keyboards_caret}, + {N_("Segments keys"), config_keyboards_segments}, + {N_("Candidates keys"), config_keyboards_candidates}, + {N_("Direct select keys"), config_keyboards_direct_select}, + {N_("Convert keys"), config_keyboards_converting}, + {N_("Dictionary keys"), config_keyboards_dict}, +}; +static unsigned int __key_conf_pages_num = sizeof (__key_conf_pages) / sizeof (KeyboardConfigPage); + +const int KEY_CATEGORY_INDEX_SEARCH_BY_KEY = __key_conf_pages_num; +const int KEY_CATEGORY_INDEX_ALL = __key_conf_pages_num + 1; + +const int KEY_THEME_INDEX_USER_DEFINED = 0; +const int KEY_THEME_INDEX_DEFAULT = 1; + +static ComboConfigCandidate input_modes[] = +{ + {N_("Hiragana"), "Hiragana"}, + {N_("Katakana"), "Katakana"}, + {N_("Half width katakana"), "HalfKatakana"}, + {N_("Latin"), "Latin"}, + {N_("Wide latin"), "WideLatin"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate typing_methods[] = +{ + {N_("Romaji typing method"), "Romaji"}, + {N_("Kana typing method"), "Kana"}, + {N_("Thumb shift typing method"), "NICOLA"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate conversion_modes[] = +{ + {N_("Multi segment"), "MultiSeg"}, + {N_("Single segment"), "SingleSeg"}, + {N_("Convert as you type (Multi segment)"), "CAYT_MultiSeg"}, + {N_("Convert as you type (Single segment)"), "CAYT_SingleSeg"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate period_styles[] = +{ + {"\xE3\x80\x81\xE3\x80\x82", "Japanese"}, + {"\xEF\xBC\x8C\xE3\x80\x82", "WideLatin_Japanese"}, + {"\xEF\xBC\x8C\xEF\xBC\x8E", "WideLatin"}, + {",.", "Latin"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate symbol_styles[] = +{ + {"\xE3\x80\x8C\xE3\x80\x8D\xE3\x83\xBB", "Japanese"}, + {"\xE3\x80\x8C\xE3\x80\x8D\xEF\xBC\x8F", "CornerBracket_WideSlash"}, + {"\xEF\xBC\xBB\xEF\xBC\xBD\xE3\x83\xBB", "WideBracket_MiddleDot"}, + {"\xEF\xBC\xBB\xEF\xBC\xBD\xEF\xBC\x8F", "WideBracket_WideSlash"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate space_types[] = +{ + {N_("Follow input mode"), "FollowMode"}, + {N_("Wide"), "Wide"}, + {N_("Half"), "Half"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate ten_key_types[] = +{ + {N_("Follow input mode"), "FollowMode"}, + {N_("Wide"), "Wide"}, + {N_("Half"), "Half"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate behavior_on_period[] = +{ + {N_("Do nothing"), "None"}, + {N_("Start conversion"), "Convert"}, + {N_("Commit"), "Commit"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate behavior_on_focus_out[] = +{ + {N_("Commit"), "Commit"}, + {N_("Clear"), "Clear"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate dict_encoding[] = +{ + {N_("UTF-8"), "UTF-8"}, + {N_("EUC-JP"), "EUC-JP"}, + {N_("EUC-JP-MS"), "EUC-JP-MS"}, + {NULL, NULL}, +}; + +static ComboConfigCandidate preedit_style[] = +{ + {N_("No decoration"), "None"}, + {N_("Underline"), "Underline"}, + {N_("Reverse"), "Reverse"}, + {N_("Highlight"), "Highlight"}, + {N_("String color"), "FGColor"}, + {N_("BG color"), "BGColor"}, + {N_("Both color"), "Color"}, + {NULL, NULL}, +}; + + +static void setup_key_theme_menu (GtkOptionMenu *omenu); +static void setup_widget_value (void); + +static void on_default_editable_changed (GtkEditable *editable, + gpointer user_data); +static void on_default_toggle_button_toggled (GtkToggleButton *togglebutton, + gpointer user_data); +static void on_default_spin_button_changed (GtkSpinButton *spinbutton, + gpointer user_data); +static void on_default_key_selection_clicked (GtkButton *button, + gpointer user_data); +static void on_default_combo_changed (GtkEditable *editable, + gpointer user_data); +static void on_default_option_menu_changed (GtkOptionMenu *omenu, + gpointer user_data); +static void on_preedit_style_menu_changed (GtkOptionMenu *omenu, + gpointer user_data); +static void on_key_filter_selection_clicked (GtkButton *button, + gpointer user_data); +static void on_dict_menu_label_toggled (GtkToggleButton *togglebutton, + gpointer user_data); +static void on_key_category_menu_changed (GtkOptionMenu *omenu, + gpointer user_data); +static gboolean on_key_list_view_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); +static gboolean on_key_list_view_button_press (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data); +static void on_key_theme_menu_changed (GtkOptionMenu *omenu, + gpointer user_data); +static void on_key_list_selection_changed (GtkTreeSelection *selection, + gpointer data); +static void on_choose_keys_button_clicked (GtkWidget *button, + gpointer data); +static void on_dict_launch_button_clicked (GtkButton *button, + gpointer user_data); +static void on_color_button_changed (ScimAnthyColorButton *button, + gpointer user_data); + + +static StringConfigData * +find_key_config_entry (const char *config_key) +{ + for (unsigned int j = 0; j < __key_conf_pages_num; j++) { + for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) { + StringConfigData *entry = &__key_conf_pages[j].data[i]; + if (entry->key && !strcmp (entry->key, config_key)) + return entry; + } + } + + return NULL; +} + +GtkWidget * +create_check_button (const char *config_key) +{ + BoolConfigData *entry = find_bool_config_entry (config_key); + if (!entry) + return NULL; + + entry->widget = gtk_check_button_new_with_mnemonic (_(entry->label)); + gtk_container_set_border_width (GTK_CONTAINER (entry->widget), 4); + g_signal_connect (G_OBJECT (entry->widget), "toggled", + G_CALLBACK (on_default_toggle_button_toggled), + entry); + gtk_widget_show (GTK_WIDGET (entry->widget)); + + if (!__widget_tooltips) + __widget_tooltips = gtk_tooltips_new(); + if (entry->tooltip) + gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget), + _(entry->tooltip), NULL); + + return GTK_WIDGET (entry->widget); +} + +GtkWidget * +create_spin_button (const char *config_key, GtkTable *table, int idx) +{ + IntConfigData *entry = find_int_config_entry (config_key); + if (!entry) + return NULL; + + GtkWidget *label = gtk_label_new_with_mnemonic (_(entry->label)); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 4, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, idx, idx + 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), + 4, 4); + gtk_widget_show (GTK_WIDGET (label)); + + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); + gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (hbox), + 1, 2, idx, idx + 1, + (GtkAttachOptions) GTK_FILL, + (GtkAttachOptions) GTK_FILL, + 4, 4); + gtk_widget_show (hbox); + + entry->widget = gtk_spin_button_new_with_range (entry->min, entry->max, + entry->step); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), + GTK_WIDGET (entry->widget)); + gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (entry->widget), + FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (entry->widget), "value-changed", + G_CALLBACK (on_default_spin_button_changed), + entry); + gtk_widget_show (GTK_WIDGET (entry->widget)); + + if (entry->unit) { + label = gtk_label_new_with_mnemonic (_(entry->unit)); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 4, 0); + gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (label), + FALSE, FALSE, 0); + gtk_widget_show (GTK_WIDGET (label)); + } + + if (!__widget_tooltips) + __widget_tooltips = gtk_tooltips_new(); + if (entry->tooltip) + gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget), + _(entry->tooltip), NULL); + + return GTK_WIDGET (entry->widget); +} + +GtkWidget * +create_entry (const char *config_key, GtkTable *table, int idx) +{ + StringConfigData *entry = find_string_config_entry (config_key); + if (!entry) + return NULL; + + GtkWidget *label = gtk_label_new (NULL); + gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _(entry->label)); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 4, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, idx, idx + 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 4); + (entry)->widget = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), + GTK_WIDGET (entry->widget)); + g_signal_connect ((gpointer) (entry)->widget, "changed", + G_CALLBACK (on_default_editable_changed), + entry); + gtk_widget_show (GTK_WIDGET (entry->widget)); + gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget), + 1, 2, idx, idx + 1, + (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), + (GtkAttachOptions) (GTK_FILL), 4, 4); + + if (!__widget_tooltips) + __widget_tooltips = gtk_tooltips_new(); + if (entry->tooltip) + gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget), + _(entry->tooltip), NULL); + + return GTK_WIDGET (entry->widget); +} + +GtkWidget * +create_combo (const char *config_key, gpointer candidates_p, + GtkTable *table, gint idx) +{ + StringConfigData *entry = find_string_config_entry (config_key); + if (!entry) + return NULL; + + GtkWidget *label; + + label = gtk_label_new_with_mnemonic (_(entry->label)); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 4, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, idx, idx + 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 4); + gtk_widget_show (label); + + entry->widget = gtk_combo_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), + GTK_COMBO (entry->widget)->entry); + gtk_combo_set_value_in_list (GTK_COMBO (entry->widget), TRUE, FALSE); + gtk_combo_set_case_sensitive (GTK_COMBO (entry->widget), TRUE); + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (entry->widget)->entry), + FALSE); + gtk_widget_show (GTK_WIDGET (entry->widget)); + gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget), + 1, 2, idx, idx + 1, + (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), + (GtkAttachOptions) (GTK_FILL), 4, 4); + g_object_set_data (G_OBJECT (GTK_COMBO (entry->widget)->entry), + DATA_POINTER_KEY, + (gpointer) candidates_p); + + g_signal_connect ((gpointer) GTK_COMBO (entry->widget)->entry, "changed", + G_CALLBACK (on_default_combo_changed), + entry); + + if (!__widget_tooltips) + __widget_tooltips = gtk_tooltips_new(); + if (entry->tooltip) + gtk_tooltips_set_tip (__widget_tooltips, + GTK_WIDGET (GTK_COMBO (entry->widget)->entry), + _(entry->tooltip), NULL); + + return GTK_WIDGET (entry->widget); +} + +GtkWidget * +create_option_menu (const char *config_key, gpointer candidates_p, + GtkTable *table, gint idx) +{ + StringConfigData *entry = find_string_config_entry (config_key); + ComboConfigCandidate *data = static_cast (candidates_p); + if (!entry) + return NULL; + + GtkWidget *label; + label = gtk_label_new_with_mnemonic (_(entry->label)); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 4, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, idx, idx + 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 4); + gtk_widget_show (label); + + entry->widget = gtk_option_menu_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), + GTK_WIDGET (entry->widget)); + gtk_widget_show (GTK_WIDGET (entry->widget)); + gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget), + 1, 2, idx, idx + 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 4); + g_object_set_data (G_OBJECT (entry->widget), + DATA_POINTER_KEY, + (gpointer) candidates_p); + + GtkWidget *menu = gtk_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (entry->widget), menu); + gtk_widget_show (menu); + + for (unsigned int i = 0; data[i].label; i++) { + GtkWidget *menuitem = gtk_menu_item_new_with_label (_(data[i].label)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + } + + gtk_option_menu_set_history (GTK_OPTION_MENU (entry->widget), 0); + + g_signal_connect ((gpointer) GTK_OPTION_MENU (entry->widget), "changed", + G_CALLBACK (on_default_option_menu_changed), + entry); + + if (!__widget_tooltips) + __widget_tooltips = gtk_tooltips_new(); + if (entry->tooltip) + gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget), + _(entry->tooltip), NULL); + + return GTK_WIDGET (entry->widget); +} + +GtkWidget * +create_key_select_button (const char *config_key, GtkTable *table, int idx) +{ + StringConfigData *entry = find_string_config_entry (config_key); + if (!entry) + return NULL; + + GtkWidget *button = gtk_button_new_with_label ("..."); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, idx, idx + 1, + GTK_FILL, GTK_FILL, 4, 4); + g_signal_connect ((gpointer) button, "clicked", + G_CALLBACK (on_default_key_selection_clicked), + entry); + + return button; +} + +GtkWidget * +create_color_button (const char *config_key) +{ + ColorConfigData *entry = find_color_config_entry (config_key); + if (!entry) + return NULL; + + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_widget_show (hbox); + + GtkWidget *label = NULL; + if (entry->label) { + label = gtk_label_new_with_mnemonic (_(entry->label)); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + } + + entry->widget = scim_anthy_color_button_new (); + gtk_widget_set_size_request (GTK_WIDGET (entry->widget), 32, 24); + g_signal_connect (G_OBJECT (entry->widget), "color-changed", + G_CALLBACK (on_color_button_changed), + entry); + gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (entry->widget), + FALSE, FALSE, 2); + gtk_widget_show (GTK_WIDGET (entry->widget)); + + if (label) + gtk_label_set_mnemonic_widget (GTK_LABEL (label), + GTK_WIDGET (entry->widget)); + + if (!__widget_tooltips) + __widget_tooltips = gtk_tooltips_new(); + if (entry->tooltip) + gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget), + _(entry->tooltip), NULL); + + return hbox; +} + +static void +append_key_bindings (GtkTreeView *treeview, gint idx, const gchar *filter) +{ + GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview)); + KeyEventList keys1, keys2; + + if (filter && *filter) + scim_string_to_key_list (keys1, filter); + + if (idx < 0 || idx >= (gint) __key_conf_pages_num) + return; + + for (unsigned int i = 0; __key_conf_pages[idx].data[i].key; i++) { + if (filter && *filter) { + scim_string_to_key_list ( + keys2, + __key_conf_pages[idx].data[i].value.c_str()); + KeyEventList::const_iterator kit; + bool found = true; + for (kit = keys1.begin (); kit != keys1.end (); kit++) { + if (!util_match_key_event (keys2, *kit)) { + found = false; + break; + } + } + if (!found) + continue; + } + + GtkTreeIter iter; + gtk_list_store_append (store, &iter); + gtk_list_store_set ( + store, &iter, + COLUMN_LABEL, _(__key_conf_pages[idx].data[i].label), + COLUMN_VALUE, __key_conf_pages[idx].data[i].value.c_str (), + COLUMN_DESC, _(__key_conf_pages[idx].data[i].tooltip), + COLUMN_DATA, &__key_conf_pages[idx].data[i], + -1); + } +} + +static void +key_list_view_popup_key_selection (GtkTreeView *treeview) +{ + GtkTreeModel *model = gtk_tree_view_get_model (treeview); + GtkTreePath *treepath = NULL; + GtkTreeIter iter; + + gtk_tree_view_get_cursor (treeview, &treepath, NULL); + if (!treepath) return; + gtk_tree_model_get_iter (model, &iter, treepath); + gtk_tree_path_free (treepath); + + StringConfigData *data; + gtk_tree_model_get (model, &iter, + COLUMN_DATA, &data, + -1); + if (data) { + GtkWidget *dialog = scim_key_selection_dialog_new (_(data->title)); + gint result; + + scim_key_selection_dialog_set_keys + (SCIM_KEY_SELECTION_DIALOG (dialog), + data->value.c_str()); + + result = gtk_dialog_run (GTK_DIALOG (dialog)); + + if (result == GTK_RESPONSE_OK) { + const gchar *keys = scim_key_selection_dialog_get_keys + (SCIM_KEY_SELECTION_DIALOG (dialog)); + + if (!keys) keys = ""; + + if (strcmp (keys, data->value.c_str())) { + data->value = keys; + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COLUMN_VALUE, data->value.c_str(), + -1); + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_key_theme_menu), + KEY_THEME_INDEX_USER_DEFINED); + data->changed = true; + __config_changed = true; + } + } + + gtk_widget_destroy (dialog); + } +} + +static GtkWidget * +create_common_page (void) +{ + GtkWidget *vbox, *table, *widget; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + table = gtk_table_new (7, 2, FALSE); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); + gtk_widget_show (table); + + /* input mode */ + widget = create_combo (SCIM_ANTHY_CONFIG_INPUT_MODE, + (gpointer) &input_modes, + GTK_TABLE (table), 0); + + /* typing method */ + widget = create_combo (SCIM_ANTHY_CONFIG_TYPING_METHOD, + (gpointer) &typing_methods, + GTK_TABLE (table), 1); + + /* conversion mode */ + widget = create_combo (SCIM_ANTHY_CONFIG_CONVERSION_MODE, + (gpointer) &conversion_modes, + GTK_TABLE (table), 2); + + /* behavior on focus out */ + widget = create_combo (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_FOCUS_OUT, + (gpointer) &behavior_on_focus_out, + GTK_TABLE (table), 3); + + return vbox; +} + +static GtkWidget * +create_symbols_page (void) +{ + GtkWidget *vbox, *table, *widget; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + table = gtk_table_new (7, 2, FALSE); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); + gtk_widget_show (table); + + /* period style */ + widget = create_combo (SCIM_ANTHY_CONFIG_PERIOD_STYLE, + (gpointer) &period_styles, + GTK_TABLE (table), 3); + + /* symbol style */ + widget = create_combo (SCIM_ANTHY_CONFIG_SYMBOL_STYLE, + (gpointer) &symbol_styles, + GTK_TABLE (table), 4); + + /* space_style */ + widget = create_combo (SCIM_ANTHY_CONFIG_SPACE_TYPE, + (gpointer) &space_types, + GTK_TABLE (table), 5); + + /* ten key_style */ + widget = create_combo (SCIM_ANTHY_CONFIG_TEN_KEY_TYPE, + (gpointer) &ten_key_types, + GTK_TABLE (table), 6); + + /* behavior on period */ + widget = create_combo (SCIM_ANTHY_CONFIG_BEHAVIOR_ON_PERIOD, + (gpointer) &behavior_on_period, + GTK_TABLE (table), 7); + + return vbox; +} + +static GtkWidget * +create_keyboard_page (void) +{ + GtkWidget *vbox, *hbox; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + gtk_widget_show(hbox); + + // category menu + GtkWidget *label = gtk_label_new_with_mnemonic (_("_Group:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + GtkWidget *omenu = gtk_option_menu_new (); + __widget_key_categories_menu = omenu; + gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2); + gtk_widget_show (omenu); + + gtk_label_set_mnemonic_widget (GTK_LABEL (label), omenu); + + GtkWidget *menu = gtk_menu_new (); + + GtkWidget *menuitem; + + for (unsigned int i = 0; i < __key_conf_pages_num; i++) { + menuitem = gtk_menu_item_new_with_label (_(__key_conf_pages[i].label)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + } + + menuitem = gtk_menu_item_new_with_label (_("Search by key")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + + menuitem = gtk_menu_item_new_with_label (_("all")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + + gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu); + gtk_widget_show (menu); + + GtkWidget *entry = gtk_entry_new (); + __widget_key_filter = entry; + gtk_entry_set_editable (GTK_ENTRY (entry), FALSE); + gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 2); + gtk_widget_show(entry); + + GtkWidget *button = gtk_button_new_with_label ("..."); + __widget_key_filter_button = button; + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_key_filter_selection_clicked), entry); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_widget_show (button); + + // key bindings view + GtkWidget *scrwin = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrwin), + GTK_SHADOW_IN); + gtk_container_set_border_width (GTK_CONTAINER (scrwin), 4); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrwin), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_box_pack_start (GTK_BOX (vbox), scrwin, TRUE, TRUE, 2); + gtk_widget_show (scrwin); + + GtkListStore *store = gtk_list_store_new (N_COLUMNS, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_POINTER); + GtkWidget *treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); + __widget_key_list_view = treeview; + gtk_container_add (GTK_CONTAINER (scrwin), treeview); + gtk_widget_show (treeview); + + GtkCellRenderer *cell; + GtkTreeViewColumn *column; + cell = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Feature"), cell, + "text", COLUMN_LABEL, + NULL); + gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); + gtk_tree_view_column_set_fixed_width (column, 120); + gtk_tree_view_column_set_resizable(column, TRUE); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); + + cell = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Key bindings"), cell, + "text", COLUMN_VALUE, + NULL); + gtk_tree_view_column_set_fixed_width (column, 200); + gtk_tree_view_column_set_resizable(column, TRUE); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); + + cell = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Description"), cell, + "text", COLUMN_DESC, + NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); + + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); + + // connect signals + g_signal_connect (G_OBJECT (omenu), "changed", + G_CALLBACK (on_key_category_menu_changed), treeview); + g_signal_connect (G_OBJECT (treeview), "key-press-event", + G_CALLBACK (on_key_list_view_key_press), treeview); + g_signal_connect (G_OBJECT (treeview), "button-press-event", + G_CALLBACK (on_key_list_view_button_press), treeview); + g_signal_connect (G_OBJECT (selection), "changed", + G_CALLBACK (on_key_list_selection_changed), treeview); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + gtk_widget_show(hbox); + + // for key bind theme + label = gtk_label_new_with_mnemonic (_("Key bindings _theme:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + omenu = gtk_option_menu_new (); + __widget_key_theme_menu = omenu; + g_signal_connect (G_OBJECT (omenu), "changed", + G_CALLBACK (on_key_theme_menu_changed), NULL); + gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2); + gtk_widget_show (omenu); + + gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu); + + // edit button + button = gtk_button_new_with_mnemonic (_("_Choose keys...")); + __widget_choose_keys_button = button; + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_choose_keys_button_clicked), treeview); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_widget_set_sensitive (button, false); + gtk_widget_show (button); + + // clean + g_object_unref (G_OBJECT (store)); + + return vbox; +} + +static GtkWidget * +create_learning_page () +{ + GtkWidget *vbox, *vbox2, *hbox, *alignment, *table; + GtkWidget *widget, *label; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4); + gtk_widget_show (hbox); + + label = gtk_label_new (_("Enable/Disable learning")); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4); + gtk_widget_show (label); + + alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 24, 0); + gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); + gtk_widget_show (alignment); + + vbox2 = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (alignment), vbox2); + gtk_widget_show (vbox2); + + /* maual commit */ + widget = create_check_button (SCIM_ANTHY_CONFIG_LEARN_ON_MANUAL_COMMIT); + gtk_box_pack_start (GTK_BOX (vbox2), widget, FALSE, FALSE, 4); + + /* auto commit */ + widget = create_check_button (SCIM_ANTHY_CONFIG_LEARN_ON_AUTO_COMMIT); + gtk_box_pack_start (GTK_BOX (vbox2), widget, FALSE, FALSE, 4); + + /* key preference */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4); + gtk_widget_show (hbox); + + label = gtk_label_new (_("Key preferences to commit " + "with reversing learning preference")); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4); + gtk_widget_show (label); + + alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 24, 0); + gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); + gtk_widget_show (alignment); + + table = gtk_table_new (3, 3, FALSE); + gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_widget_show (table); + + StringConfigData *entries[3]; + entries [0] = find_string_config_entry ( + SCIM_ANTHY_CONFIG_COMMIT_REVERSE_LEARN_KEY); + entries [1] = find_string_config_entry ( + SCIM_ANTHY_CONFIG_COMMIT_FIRST_SEGMENT_REVERSE_LEARN_KEY); + entries [2] = find_string_config_entry ( + SCIM_ANTHY_CONFIG_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN_KEY); + + for (unsigned int i = 0; + i < sizeof (entries) / sizeof (StringConfigData*); + i++) + { + StringConfigData *entry = entries[i]; + widget = create_entry (entry->key, GTK_TABLE (table), i); + gtk_entry_set_editable (GTK_ENTRY (widget), FALSE); + create_key_select_button (entry->key, GTK_TABLE (table), i); + } + + return vbox; +} + +static GtkWidget * +create_prediction_page () +{ + GtkWidget *vbox, *widget; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + /* predict while inputting */ + widget = create_check_button (SCIM_ANTHY_CONFIG_PREDICT_ON_INPUT); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4); + + /* use direct select keys */ + widget = create_check_button (SCIM_ANTHY_CONFIG_USE_DIRECT_KEY_ON_PREDICT); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4); + + return vbox; +} + +static GtkWidget * +create_dict_page (void) +{ + GtkWidget *table, *button; + StringConfigData *entry; + + table = gtk_table_new (3, 3, FALSE); + gtk_widget_show (table); + + // encoding of dictionary + create_combo (SCIM_ANTHY_CONFIG_DICT_ENCODING, + (gpointer) &dict_encoding, + GTK_TABLE (table), 0); + + // dict admin command + create_entry (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND, + GTK_TABLE (table), 1); + entry = find_string_config_entry (SCIM_ANTHY_CONFIG_DICT_ADMIN_COMMAND); + + button = gtk_button_new_with_mnemonic (_("_Launch")); + gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (button), + 2, 3, 1, 2, + (GtkAttachOptions) 0, + (GtkAttachOptions) 0, 4, 4); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_dict_launch_button_clicked), entry); + gtk_widget_show (button); + + // add word command + create_entry (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND, + GTK_TABLE (table), 2); + entry = find_string_config_entry (SCIM_ANTHY_CONFIG_ADD_WORD_COMMAND); + + button = gtk_button_new_with_mnemonic (_("_Launch")); + gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (button), + 2, 3, 2, 3, + (GtkAttachOptions) 0, + (GtkAttachOptions) 0, 4, 4); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_dict_launch_button_clicked), entry); + gtk_widget_show (button); + + return table; +} + +static GtkWidget * +create_candidates_window_page (void) +{ + GtkWidget *vbox, *widget, *table; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + /* show candidates label */ + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_CANDIDATES_LABEL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2); + + /* close candidate window on select */ + widget = create_check_button (SCIM_ANTHY_CONFIG_CLOSE_CAND_WIN_ON_SELECT); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2); + + table = gtk_table_new (2, 2, FALSE); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); + gtk_widget_show (table); + + /* number of triggers until show candidates window */ + create_spin_button (SCIM_ANTHY_CONFIG_CAND_WIN_PAGE_SIZE, + GTK_TABLE (table), 0); + + /* number of triggers until show candidates window */ + create_spin_button (SCIM_ANTHY_CONFIG_N_TRIGGERS_TO_SHOW_CAND_WIN, + GTK_TABLE (table), 1); + + return vbox; +} + +static GtkWidget * +create_toolbar_page (void) +{ + GtkWidget *vbox, *hbox, *label, *widget; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + /* show/hide toolbar label */ + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_INPUT_MODE_LABEL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2); + + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_TYPING_METHOD_LABEL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2); + + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_CONVERSION_MODE_LABEL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2); + + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_PERIOD_STYLE_LABEL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2); + + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_SYMBOL_STYLE_LABEL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2); + + /* dictionary menu */ + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_DICT_LABEL); + g_signal_connect ((gpointer) widget, "toggled", + G_CALLBACK (on_dict_menu_label_toggled), + NULL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2); + gtk_widget_show (hbox); + label = gtk_label_new (" "); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + gtk_widget_show (label); + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL); + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + + gtk_widget_show (label); + widget = create_check_button (SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL); + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + + // set initial state + on_dict_menu_label_toggled (GTK_TOGGLE_BUTTON (widget), NULL); + + return vbox; +} + +static GtkWidget * +create_appearance_page (void) +{ + GtkWidget *vbox, *table, *omenu, *widget, *hbox; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + table = gtk_table_new (2, 3, FALSE); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); + gtk_widget_show (table); + + /* preedit style */ + omenu = create_option_menu (SCIM_ANTHY_CONFIG_PREEDIT_STYLE, + &preedit_style, GTK_TABLE (table), 0); + + /* preedit color */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + widget = create_color_button (SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR); + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + gtk_table_attach (GTK_TABLE (table), hbox, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 4); + gtk_widget_set_sensitive (hbox, FALSE); + + g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed", + G_CALLBACK (on_preedit_style_menu_changed), hbox); + + /* conversion style */ + omenu = create_option_menu (SCIM_ANTHY_CONFIG_CONVERSION_STYLE, + &preedit_style, GTK_TABLE (table), 1); + + /* conversion color */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + widget = create_color_button (SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR); + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + gtk_table_attach (GTK_TABLE (table), hbox, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 4); + gtk_widget_set_sensitive (hbox, FALSE); + + g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed", + G_CALLBACK (on_preedit_style_menu_changed), hbox); + + /* selected segment style */ + omenu = create_option_menu (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE, + &preedit_style, GTK_TABLE (table), 2); + + /* selected segment color */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + widget = create_color_button (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR); + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + gtk_table_attach (GTK_TABLE (table), hbox, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 4); + gtk_widget_set_sensitive (hbox, FALSE); + + g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed", + G_CALLBACK (on_preedit_style_menu_changed), hbox); + + return vbox; +} + +static GtkWidget * +create_about_page () +{ + GtkWidget *vbox, *label; + gchar str[256]; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + g_snprintf ( + str, 256, + _("" + "%s-%s" + "\n\n" + + "" + "A Japanese input method module\nfor SCIM using Anthy" + "\n\n\n\n" + + "" + "Copyright 2005-2006, Takuro Ashie <ashie@homa.ne.jp>" + ""), + PACKAGE, PACKAGE_VERSION); + + label = gtk_label_new (NULL); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER); + gtk_label_set_markup (GTK_LABEL (label), str); + gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); + gtk_widget_show (label); + + return vbox; +} + +static GtkWidget * +create_setup_window (void) +{ + static GtkWidget *window = NULL; + + if (!window) { + GtkWidget *notebook = gtk_notebook_new(); + gtk_notebook_popup_enable(GTK_NOTEBOOK(notebook)); + gtk_widget_show (notebook); + window = notebook; + gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE); + + // Create the common page. + GtkWidget *page = create_common_page (); + GtkWidget *label = gtk_label_new (_("Common")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the symbols page. + page = create_symbols_page (); + label = gtk_label_new (_("Symbols")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the key bind page. + page = create_keyboard_page (); + label = gtk_label_new (_("Key bindings")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the romaji page. + page = romaji_page_create_ui (); + label = gtk_label_new (_("Romaji typing")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the kana page. + page = kana_page_create_ui (); + label = gtk_label_new (_("Kana typing")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the learning page. + page = create_prediction_page (); + label = gtk_label_new (_("Prediction")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the learning page. + page = create_learning_page (); + label = gtk_label_new (_("Learning")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the dictionary page. + page = create_dict_page (); + label = gtk_label_new (_("Dictionary")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the candidates widnow page. + page = create_candidates_window_page (); + label = gtk_label_new (_("Candidates window")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the toolbar page. + page = create_toolbar_page (); + label = gtk_label_new (_("Toolbar")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the appearance page. + page = create_appearance_page (); + label = gtk_label_new (_("Appearance")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // Create the appearance page. + page = create_about_page (); + label = gtk_label_new (_("About")); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + + // for preventing enabling left arrow. + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1); + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); + + setup_widget_value (); + } + + return window; +} + +static void +setup_combo_value (GtkCombo *combo, const String & str) +{ + GList *list = NULL; + const char *defval = NULL; + + ComboConfigCandidate *data + = static_cast + (g_object_get_data (G_OBJECT (GTK_COMBO(combo)->entry), + DATA_POINTER_KEY)); + + for (unsigned int i = 0; data[i].label; i++) { + list = g_list_append (list, (gpointer) _(data[i].label)); + if (!strcmp (data[i].data, str.c_str ())) + defval = _(data[i].label); + } + + gtk_combo_set_popdown_strings (combo, list); + g_list_free (list); + + if (defval) + gtk_entry_set_text (GTK_ENTRY (combo->entry), defval); +} + +static void +setup_option_menu_value (GtkOptionMenu *omenu, const String & str) +{ + ComboConfigCandidate *data + = static_cast + (g_object_get_data (G_OBJECT (omenu), DATA_POINTER_KEY)); + + for (unsigned int i = 0; data[i].label; i++) { + if (!strcmp (data[i].data, str.c_str ())) { + gtk_option_menu_set_history (omenu, i); + return; + } + } +} + +static void +setup_key_theme_menu (GtkOptionMenu *omenu) +{ + GtkWidget *menu = gtk_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), + menu); + gtk_widget_show (menu); + + // create menu items + GtkWidget *menuitem = gtk_menu_item_new_with_label (_("User defined")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + + menuitem = gtk_menu_item_new_with_label (_("Default")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + + StyleFiles::iterator it; + unsigned int i; + for (i = 0, it = __style_list.begin (); + it != __style_list.end (); + i++, it++) + { + const char *section_name = "KeyBindings"; + StyleLines section; + if (!it->get_entry_list (section, section_name)) + continue; + + menuitem = gtk_menu_item_new_with_label (_(it->get_title().c_str())); + g_object_set_data (G_OBJECT (menuitem), + INDEX_KEY, GINT_TO_POINTER (i)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + } + + // set default value + g_signal_handlers_block_by_func (G_OBJECT (omenu), + (gpointer) (on_key_theme_menu_changed), + NULL); + + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), + KEY_THEME_INDEX_DEFAULT); + + if (__config_key_theme_file == __user_style_file.get_file_name () || + __config_key_theme == __user_style_file.get_title ()) + { + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), + KEY_THEME_INDEX_USER_DEFINED); + + } else { + GList *node, *list = gtk_container_get_children (GTK_CONTAINER (menu)); + for (i = 2, node = g_list_next (g_list_next (list)); + node; + i++, node = g_list_next (node)) + { + gint idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (node->data), + INDEX_KEY)); + if (__style_list[idx].get_file_name () == __config_key_theme_file) { + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i); + break; + } + } + } + + g_signal_handlers_unblock_by_func (G_OBJECT (omenu), + (gpointer) (on_key_theme_menu_changed), + NULL); +} + +static void +setup_widget_value (void) +{ + for (unsigned int i = 0; config_bool_common[i].key; i++) { + BoolConfigData &entry = config_bool_common[i]; + if (entry.widget) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (entry.widget), + entry.value); + } + + for (unsigned int i = 0; config_int_common[i].key; i++) { + IntConfigData &entry = config_int_common[i]; + if (entry.widget) + gtk_spin_button_set_value (GTK_SPIN_BUTTON (entry.widget), + entry.value); + } + + for (unsigned int i = 0; config_string_common[i].key; i++) { + StringConfigData &entry = config_string_common[i]; + if (entry.widget && GTK_IS_OPTION_MENU (entry.widget)) { + setup_option_menu_value (GTK_OPTION_MENU (entry.widget), + entry.value); + } else if (entry.widget && GTK_IS_COMBO (entry.widget)) { + setup_combo_value (GTK_COMBO (entry.widget), entry.value); + } else if (entry.widget && GTK_IS_ENTRY (entry.widget)) { + gtk_entry_set_text (GTK_ENTRY (entry.widget), + entry.value.c_str ()); + } + } + + for (unsigned int j = 0; j < __key_conf_pages_num; j++) { + for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) { + if (__key_conf_pages[j].data[i].widget) { + gtk_entry_set_text ( + GTK_ENTRY (__key_conf_pages[j].data[i].widget), + __key_conf_pages[j].data[i].value.c_str ()); + } + } + } + + for (unsigned int i = 0; config_color_common[i].fg_key; i++) { + ColorConfigData &entry = config_color_common[i]; + if (entry.widget) { + scim_anthy_color_button_set_colors (SCIM_ANTHY_COLOR_BUTTON (entry.widget), + entry.fg_value, entry.bg_value); + } + } + + gtk_option_menu_set_history + (GTK_OPTION_MENU (__widget_key_categories_menu), + KEY_CATEGORY_INDEX_ALL); + GtkTreeView *treeview = GTK_TREE_VIEW (__widget_key_list_view); + GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview)); + gtk_list_store_clear (store); + for (unsigned int i = 0; i < __key_conf_pages_num; i++) + append_key_bindings (treeview, i, NULL); + gtk_widget_set_sensitive (__widget_key_filter, FALSE); + gtk_widget_set_sensitive (__widget_key_filter_button, FALSE); + + // setup option menu + setup_key_theme_menu (GTK_OPTION_MENU (__widget_key_theme_menu)); +} + +bool operator < (const StyleFile &left, const StyleFile &right) +{ + if (const_cast(left).get_title() < + const_cast(right).get_title()) + { + return true; + } + return false; +} + +bool operator > (const StyleFile &left, const StyleFile &right) +{ + if (const_cast(left).get_title() > + const_cast(right).get_title()) + { + return true; + } + return false; +} + +static void +load_style_files (const char *dirname) +{ + GDir *dir; + GError *error = NULL; + const gchar *entry; + + // load system wide style files + dir = g_dir_open (dirname, 0, &error); + if (error) + { + //g_warning ("%s", error->message); + g_error_free (error); + } + + if (dir) { + while ((entry = g_dir_read_name (dir))) + { + String file = dirname; + file += SCIM_PATH_DELIM_STRING; + file += entry; + + // FIXME! check duplicates + __style_list.push_back (StyleFile ()); + StyleFile &style = __style_list.back (); + bool success = style.load (file.c_str ()); + if (!success) + __style_list.pop_back (); + } + g_dir_close (dir); + } + std::sort(__style_list.begin(), __style_list.end()); +} + +static void +load_config (const ConfigPointer &config) +{ + if (config.null ()) + return; + + __style_list.clear (); + + load_style_files (SCIM_ANTHY_STYLEDIR); + load_style_files (__user_style_dir_name.c_str ()); + + __user_style_file.load (__user_style_file_name.c_str ()); + + __config_key_theme + = config->read (String (SCIM_ANTHY_CONFIG_KEY_THEME), + String (SCIM_ANTHY_CONFIG_KEY_THEME_DEFAULT)); + __config_key_theme_file + = config->read (String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE), + String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT)); + + for (unsigned int i = 0; config_bool_common[i].key; i++) { + BoolConfigData &entry = config_bool_common[i]; + entry.value = config->read (String (entry.key), entry.value); + } + + for (unsigned int i = 0; config_int_common[i].key; i++) { + IntConfigData &entry = config_int_common[i]; + entry.value = config->read (String (entry.key), entry.value); + } + + for (unsigned int i = 0; config_string_common[i].key; i++) { + StringConfigData &entry = config_string_common[i]; + entry.value = config->read (String (entry.key), entry.value); + } + + for (unsigned int j = 0; j < __key_conf_pages_num; j++) { + for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) { + __key_conf_pages[j].data[i].value = + config->read (String (__key_conf_pages[j].data[i].key), + __key_conf_pages[j].data[i].value); + } + } + + for (unsigned int i = 0; config_color_common[i].fg_key; i++) { + ColorConfigData &entry = config_color_common[i]; + entry.fg_value = config->read (String (entry.fg_key), entry.fg_value); + entry.bg_value = config->read (String (entry.bg_key), entry.bg_value); + } + + romaji_page_load_config (config); + kana_page_load_config (config); + + setup_widget_value (); + + for (unsigned int i = 0; config_bool_common[i].key; i++) + config_bool_common[i].changed = false; + + for (unsigned int i = 0; config_int_common[i].key; i++) + config_int_common[i].changed = false; + + for (unsigned int i = 0; config_string_common[i].key; i++) + config_string_common[i].changed = false; + + for (unsigned int j = 0; j < __key_conf_pages_num; j++) { + for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) + __key_conf_pages[j].data[i].changed = false; + } + + for (unsigned int i = 0; config_color_common[i].fg_key; i++) + config_color_common[i].changed = false; + + __config_changed = false; +} + +static void +save_config (const ConfigPointer &config) +{ + if (config.null ()) + return; + + __config_key_theme + = config->write (String (SCIM_ANTHY_CONFIG_KEY_THEME), + String (__config_key_theme)); + __config_key_theme_file + = config->write (String (SCIM_ANTHY_CONFIG_KEY_THEME_FILE), + String (__config_key_theme_file)); + + for (unsigned int i = 0; config_bool_common[i].key; i++) { + BoolConfigData &entry = config_bool_common[i]; + if (entry.changed) + entry.value = config->write (String (entry.key), entry.value); + entry.changed = false; + } + + for (unsigned int i = 0; config_int_common[i].key; i++) { + IntConfigData &entry = config_int_common[i]; + if (entry.changed) + entry.value = config->write (String (entry.key), entry.value); + entry.changed = false; + } + + for (unsigned int i = 0; config_string_common[i].key; i++) { + StringConfigData &entry = config_string_common[i]; + if (entry.changed) + entry.value = config->write (String (entry.key), entry.value); + entry.changed = false; + } + + for (unsigned int j = 0; j < __key_conf_pages_num; j++) { + for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) { + if (__key_conf_pages[j].data[i].changed) + config->write (String (__key_conf_pages[j].data[i].key), + String (__key_conf_pages[j].data[i].value)); + __key_conf_pages[j].data[i].changed = false; + } + } + + for (unsigned int i = 0; config_color_common[i].fg_key; i++) { + ColorConfigData &entry = config_color_common[i]; + if (entry.changed) { + entry.fg_value = config->write (String (entry.fg_key), + entry.fg_value); + entry.bg_value = config->write (String (entry.bg_key), + entry.bg_value); + } + entry.changed = false; + } + + __config_changed = false; + + if (__style_changed) { + scim_make_dir (__user_config_dir_name); + __user_style_file.save (__user_style_file_name.c_str ()); + __style_changed = false; + } + + romaji_page_save_config (config); + kana_page_save_config (config); +} + +static bool +query_changed (void) +{ + return + __config_changed || + __style_changed || + romaji_page_query_changed () || + kana_page_query_changed (); +} + + +static void +on_default_toggle_button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + BoolConfigData *entry = static_cast (user_data); + + if (entry) { + entry->value = gtk_toggle_button_get_active (togglebutton); + entry->changed = true; + __config_changed = true; + } +} + +static void +on_default_spin_button_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + IntConfigData *entry = static_cast (user_data); + + if (entry) { + entry->value = static_cast (gtk_spin_button_get_value (spinbutton)); + entry->changed = true; + __config_changed = true; + } +} + +static void +on_default_editable_changed (GtkEditable *editable, + gpointer user_data) +{ + StringConfigData *entry = static_cast (user_data); + + if (entry) { + entry->value = String (gtk_entry_get_text (GTK_ENTRY (editable))); + entry->changed = true; + __config_changed = true; + } +} + +static void +on_default_key_selection_clicked (GtkButton *button, + gpointer user_data) +{ + StringConfigData *data = static_cast (user_data); + + if (data) { + GtkWidget *dialog = scim_key_selection_dialog_new (_(data->title)); + gint result; + + scim_key_selection_dialog_set_keys ( + SCIM_KEY_SELECTION_DIALOG (dialog), + gtk_entry_get_text (GTK_ENTRY (data->widget))); + + result = gtk_dialog_run (GTK_DIALOG (dialog)); + + if (result == GTK_RESPONSE_OK) { + const gchar *keys = scim_key_selection_dialog_get_keys ( + SCIM_KEY_SELECTION_DIALOG (dialog)); + + if (!keys) keys = ""; + + if (strcmp (keys, gtk_entry_get_text (GTK_ENTRY (data->widget)))) + gtk_entry_set_text (GTK_ENTRY (data->widget), keys); + } + + gtk_widget_destroy (dialog); + } +} + +static void +on_default_combo_changed (GtkEditable *editable, + gpointer user_data) +{ + StringConfigData *entry = static_cast (user_data); + ComboConfigCandidate *data = static_cast + (g_object_get_data (G_OBJECT (editable), + DATA_POINTER_KEY)); + + if (!entry) return; + if (!data) return; + + const char *label = gtk_entry_get_text (GTK_ENTRY (editable)); + + for (unsigned int i = 0; data[i].label; i++) { + if (label && !strcmp (_(data[i].label), label)) { + entry->value = data[i].data; + entry->changed = true; + __config_changed = true; + break; + } + } +} + +static void +on_default_option_menu_changed (GtkOptionMenu *omenu, gpointer user_data) +{ + StringConfigData *entry = static_cast (user_data); + ComboConfigCandidate *data = static_cast + (g_object_get_data (G_OBJECT (omenu), + DATA_POINTER_KEY)); + + if (!entry) return; + if (!data) return; + + for (int i = 0; data[i].label; i++) { + if (i == gtk_option_menu_get_history (omenu)) { + entry->value = data[i].data; + entry->changed = true; + __config_changed = true; + break; + } + } +} + +static void +on_preedit_style_menu_changed (GtkOptionMenu *omenu, gpointer user_data) +{ + GtkWidget *widget = GTK_WIDGET (user_data); + + gint idx = gtk_option_menu_get_history (omenu); + + for (int i = 0; preedit_style[i].data && i <= idx; i++) { + if (i == idx && + (!strcmp (preedit_style[i].data, "Color") || + !strcmp (preedit_style[i].data, "FGColor") || + !strcmp (preedit_style[i].data, "BGColor"))) + { + gtk_widget_set_sensitive (widget, TRUE); + return; + } + } + + gtk_widget_set_sensitive (widget, FALSE); +} + +static void +on_dict_menu_label_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + bool active = gtk_toggle_button_get_active (togglebutton); + + BoolConfigData *entry; + entry = find_bool_config_entry (SCIM_ANTHY_CONFIG_SHOW_DICT_ADMIN_LABEL); + if (entry->widget) + gtk_widget_set_sensitive (GTK_WIDGET (entry->widget), active); + entry = find_bool_config_entry (SCIM_ANTHY_CONFIG_SHOW_ADD_WORD_LABEL); + if (entry->widget) + gtk_widget_set_sensitive (GTK_WIDGET (entry->widget), active); +} + +static void +on_key_category_menu_changed (GtkOptionMenu *omenu, gpointer user_data) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (user_data); + GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview)); + + gtk_list_store_clear (store); + + gint idx = gtk_option_menu_get_history (omenu); + + bool use_filter = false; + + if (idx >= 0 && idx < (gint) __key_conf_pages_num) { + append_key_bindings (treeview, idx, NULL); + + } else if (idx == KEY_CATEGORY_INDEX_SEARCH_BY_KEY) { + // search by key + use_filter = true; + const char *str = gtk_entry_get_text (GTK_ENTRY (__widget_key_filter)); + for (unsigned int i = 0; i < __key_conf_pages_num; i++) + append_key_bindings (treeview, i, str); + + } else if (idx == KEY_CATEGORY_INDEX_ALL) { + // all + for (unsigned int i = 0; i < __key_conf_pages_num; i++) + append_key_bindings (treeview, i, NULL); + } + + gtk_widget_set_sensitive (__widget_key_filter, use_filter); + gtk_widget_set_sensitive (__widget_key_filter_button, use_filter); +} + +static void +on_key_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data) +{ + gint idx = gtk_option_menu_get_history (omenu); + GtkWidget *menu = gtk_option_menu_get_menu (omenu); + GList *list = gtk_container_get_children (GTK_CONTAINER (menu)); + GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx)); + + if (!menuitem) + return; + + gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), + INDEX_KEY)); + + // clear all key bindings + if (idx != 0) { + for (unsigned int j = 0; j < __key_conf_pages_num; j++) { + for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) { + __key_conf_pages[j].data[i].value = ""; + __key_conf_pages[j].data[i].changed = true; + } + } + } + + // set new key bindings + if (idx == KEY_THEME_INDEX_USER_DEFINED) { + __config_key_theme = String ("User defined"); + __config_key_theme_file = String (""); //__user_style_file.get_file_name (); + + } else if (idx == KEY_THEME_INDEX_DEFAULT) { + for (unsigned int j = 0; j < __key_conf_pages_num; j++) { + for (unsigned int i = 0; __key_conf_pages[j].data[i].key; i++) { + __key_conf_pages[j].data[i].value + = __key_conf_pages[j].data[i].default_value; + } + } + __config_key_theme = String ("Default"); + __config_key_theme_file = String (""); + + } else if (theme_idx >= 0) { + // reset key bindings + StyleLines lines; + StyleLines::iterator it; + __style_list[theme_idx].get_entry_list (lines, "KeyBindings"); + for (it = lines.begin (); it != lines.end (); it++) { + if (it->get_type () != SCIM_ANTHY_STYLE_LINE_KEY) + continue; + String key, fullkey; + it->get_key (key); + fullkey = String ("/IMEngine/Anthy/") + key; + StringConfigData *entry = find_key_config_entry (fullkey.c_str ()); + if (entry) { + it->get_value (entry->value); + entry->changed = true; + } else { + std::cerr << "No entry for : " << key << std::endl; + } + } + __config_key_theme = __style_list[theme_idx].get_title (); + __config_key_theme_file = __style_list[theme_idx].get_file_name (); + } + + // sync widgets + if (idx != KEY_THEME_INDEX_USER_DEFINED) { + gtk_option_menu_set_history + (GTK_OPTION_MENU (__widget_key_categories_menu), + KEY_CATEGORY_INDEX_ALL); + gtk_widget_set_sensitive (__widget_key_filter, FALSE); + gtk_widget_set_sensitive (__widget_key_filter_button, FALSE); + GtkTreeModel *model; + model = gtk_tree_view_get_model ( + GTK_TREE_VIEW (__widget_key_list_view)); + gtk_list_store_clear (GTK_LIST_STORE (model)); +#if 0 + append_key_bindings (GTK_TREE_VIEW (__widget_key_list_view), + KEY_CATEGORY_INDEX_ALL, NULL); +#else + for (unsigned int i = 0; i < __key_conf_pages_num; i++) + append_key_bindings (GTK_TREE_VIEW (__widget_key_list_view), + i, NULL); +#endif + } + + __config_changed = true; +} + +static void +on_key_filter_selection_clicked (GtkButton *button, + gpointer user_data) +{ + GtkEntry *entry = static_cast (user_data); + + if (entry) { + GtkWidget *dialog = scim_key_selection_dialog_new (_("Set key filter")); + gint result; + + scim_key_selection_dialog_set_keys ( + SCIM_KEY_SELECTION_DIALOG (dialog), + gtk_entry_get_text (entry)); + + result = gtk_dialog_run (GTK_DIALOG (dialog)); + + if (result == GTK_RESPONSE_OK) { + const gchar *keys = scim_key_selection_dialog_get_keys ( + SCIM_KEY_SELECTION_DIALOG (dialog)); + + if (!keys) keys = ""; + + if (strcmp (keys, gtk_entry_get_text (entry))) + gtk_entry_set_text (entry, keys); + + GtkTreeModel *model; + model = gtk_tree_view_get_model ( + GTK_TREE_VIEW (__widget_key_list_view)); + gtk_list_store_clear (GTK_LIST_STORE (model)); + for (unsigned int i = 0; i < __key_conf_pages_num; i++) + append_key_bindings (GTK_TREE_VIEW (__widget_key_list_view), + i, keys); + } + + gtk_widget_destroy (dialog); + } +} + +static gboolean +on_key_list_view_key_press (GtkWidget *widget, GdkEventKey *event, + gpointer user_data) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (widget); + + switch (event->keyval) { + case GDK_Return: + case GDK_KP_Enter: + key_list_view_popup_key_selection (treeview); + break; + } + + return FALSE; +} + +static gboolean +on_key_list_view_button_press (GtkWidget *widget, GdkEventButton *event, + gpointer user_data) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (widget); + + if (event->type == GDK_2BUTTON_PRESS) { + key_list_view_popup_key_selection (treeview); + return TRUE; + } + + return FALSE; +} + +static void +on_key_list_selection_changed (GtkTreeSelection *selection, gpointer data) +{ + GtkTreeModel *model = NULL; + GtkTreeIter iter; + + gboolean selected; + + selected = gtk_tree_selection_get_selected (selection, &model, &iter); + + if (__widget_choose_keys_button) { + if (selected) { + gtk_widget_set_sensitive (__widget_choose_keys_button, true); + } else { + gtk_widget_set_sensitive (__widget_choose_keys_button, false); + } + } +} + +static void +on_choose_keys_button_clicked (GtkWidget *button, gpointer data) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (data); + key_list_view_popup_key_selection (treeview); +} + +static void +on_dict_launch_button_clicked (GtkButton *button, gpointer user_data) +{ + StringConfigData *entry = static_cast (user_data); + + if (entry->widget) { + const char *command = gtk_entry_get_text (GTK_ENTRY (entry->widget)); + if (command && *command) + util_launch_program (command); + } +} + +static void +on_color_button_changed (ScimAnthyColorButton *button, + gpointer user_data) +{ + ColorConfigData *entry = static_cast (user_data); + + if (entry->widget) { + scim_anthy_color_button_get_colors (button, &entry->fg_value, &entry->bg_value); + entry->changed = true; + __config_changed = true; + } +} + +} +/* +vi:ts=4:nowrap:ai:expandtab +*/ diff --git a/src/scim_anthy_setup.h b/src/scim_anthy_setup.h new file mode 100755 index 0000000..6bdc862 --- /dev/null +++ b/src/scim_anthy_setup.h @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_SETUP_H__ +#define __SCIM_ANTHY_SETUP_H__ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include +#include + +#define SCIM_ANTHY_USE_GTK +#include +#include "scim_anthy_style_file.h" + +namespace scim_anthy { + +GtkWidget *create_check_button (const char *config_key); +GtkWidget *create_spin_button (const char *config_key, + GtkTable *table, + int idx); +GtkWidget *create_entry (const char *config_key, + GtkTable *table, + int idx); +GtkWidget *create_combo (const char *config_key, + gpointer candidates_p, + GtkTable *table, + gint idx); +GtkWidget *create_option_menu (const char *config_key, + gpointer candidates_p, + GtkTable *table, + gint idx); +GtkWidget *create_color_button (const char *config_key); +GtkWidget *create_key_select_button (const char *config_key, + GtkTable *table, + int idx); + +extern StyleFiles __style_list; +extern StyleFile __user_style_file; +extern bool __config_changed; +extern bool __style_changed; + +}; + +#endif /* __SCIM_ANTHY_SETUP_H__ */ diff --git a/src/scim_anthy_setup_kana.cpp b/src/scim_anthy_setup_kana.cpp new file mode 100755 index 0000000..1cc4740 --- /dev/null +++ b/src/scim_anthy_setup_kana.cpp @@ -0,0 +1,959 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include +#include + +#define Uses_SCIM_CONFIG_BASE +#define Uses_SCIM_EVENT +#define SCIM_ANTHY_USE_GTK +#include +//#include "scim_anthy_setup_kana.h" +#include "scim_anthy_intl.h" +#include "scim_anthy_style_file.h" +#include "scim_anthy_prefs.h" +#include "scim_anthy_default_tables.h" +#include "scim_anthy_setup.h" +#include "scim_anthy_table_editor.h" + +using namespace scim; + +namespace scim_anthy { + +#define INDEX_KEY "scim-anthy::Index" +static const char * const __kana_fund_table = "KanaTable/FundamentalTable"; +static const char * const __nicola_fund_table = "NICOLATable/FundamentalTable"; + +static const int KANA_LAYOUT_INDEX_USER_DEFINED = 0; +static const int KANA_LAYOUT_INDEX_DEFAULT = 1; + +static const int NICOLA_LAYOUT_INDEX_USER_DEFINED = 0; +static const int NICOLA_LAYOUT_INDEX_DEFAULT = 1; + +// Internal data declaration. +static GtkWidget * __widget_kana_layout_menu = NULL; +static GtkWidget * __widget_kana_layout_menu2 = NULL; +static GtkWidget * __widget_nicola_layout_menu = NULL; +static GtkWidget * __widget_nicola_layout_menu2 = NULL; + +static String __config_kana_layout_file = SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE_DEFAULT; +static String __config_nicola_layout_file = SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE_DEFAULT; + + +static GtkWidget *create_kana_window (GtkWindow *parent); +static GtkWidget *create_nicola_window (GtkWindow *parent); + +static void setup_kana_page (void); +static void setup_kana_layout_menu (GtkOptionMenu *omenu); +static void setup_nicola_layout_menu (GtkOptionMenu *omenu); +static void setup_kana_window_value (ScimAnthyTableEditor *editor); +static void setup_nicola_window_value (ScimAnthyTableEditor *editor); + +static bool load_kana_layout (void); +static bool load_nicola_layout (void); + +static void on_kana_layout_menu_changed (GtkOptionMenu *omenu, + gpointer user_data); +static void on_kana_customize_button_clicked (GtkWidget *button, + gpointer data); +static void on_kana_table_editor_add_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_kana_table_editor_added_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_kana_table_editor_remove_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_kana_table_editor_removed_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_nicola_layout_menu_changed (GtkOptionMenu *omenu, + gpointer user_data); +static void on_nicola_customize_button_clicked (GtkWidget *button, + gpointer data); +static void on_nicola_table_editor_add_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_nicola_table_editor_added_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_nicola_table_editor_remove_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_nicola_table_editor_removed_entry (ScimAnthyTableEditor *editor, + gpointer data); + +GtkWidget * +kana_page_create_ui (void) +{ + GtkWidget *vbox; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + // JIS Kana Layout + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4); + gtk_widget_show (hbox); + + GtkWidget *label = gtk_label_new (_("JIS Kana Layout")); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4); + gtk_widget_show (label); + + GtkWidget *alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 8, 24, 0); + gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); + gtk_widget_show (alignment); + + /* kana table */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_container_add (GTK_CONTAINER (alignment), hbox); + gtk_widget_show(hbox); + + label = gtk_label_new_with_mnemonic (_("La_yout:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + GtkWidget *omenu = gtk_option_menu_new (); + __widget_kana_layout_menu = omenu; + g_signal_connect (G_OBJECT (omenu), "changed", + G_CALLBACK (on_kana_layout_menu_changed), NULL); + gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2); + gtk_widget_show (omenu); + + gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu); + + GtkWidget *button = gtk_button_new_with_mnemonic (_("_Customize...")); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_kana_customize_button_clicked), NULL); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_widget_show (button); + + + // Thumb Shift Layout + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4); + gtk_widget_show (hbox); + + label = gtk_label_new (_("Thumb Shift Layout")); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4); + gtk_widget_show (label); + + alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 24, 0); + gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); + gtk_widget_show (alignment); + + GtkWidget *vbox2 = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (alignment), vbox2); + gtk_widget_show (vbox2); + + /* nicola table */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); + gtk_widget_show(hbox); + + label = gtk_label_new_with_mnemonic (_("La_yout:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + omenu = gtk_option_menu_new (); + __widget_nicola_layout_menu = omenu; + g_signal_connect (G_OBJECT (omenu), "changed", + G_CALLBACK (on_nicola_layout_menu_changed), NULL); + gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2); + gtk_widget_show (omenu); + + gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu); + + button = gtk_button_new_with_mnemonic (_("_Customize...")); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_nicola_customize_button_clicked), NULL); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_widget_show (button); + + /* thumb shift keys */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + GtkWidget *table = gtk_table_new (2, 2, FALSE); + gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 4); + gtk_widget_show (table); + + // left + GtkWidget *widget = create_entry (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY, + GTK_TABLE (table), 0); + gtk_entry_set_editable (GTK_ENTRY (widget), FALSE); + widget = create_key_select_button (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY, + GTK_TABLE (table), 0); + + // right + widget = create_entry (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY, + GTK_TABLE (table), 1); + gtk_entry_set_editable (GTK_ENTRY (widget), FALSE); + widget = create_key_select_button (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY, + GTK_TABLE (table), 1); + + /* NICOLA time */ + create_spin_button (SCIM_ANTHY_CONFIG_NICOLA_TIME, + GTK_TABLE (table), 3); + + // prepare + setup_kana_page (); + + return vbox; +} + +void +kana_page_load_config (const ConfigPointer &config) +{ + __config_kana_layout_file + = config->read (String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE), + String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE_DEFAULT)); + __config_nicola_layout_file + = config->read (String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE), + String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE_DEFAULT)); + setup_kana_page (); +} + +void +kana_page_save_config (const ConfigPointer &config) +{ + __config_kana_layout_file + = config->write (String (SCIM_ANTHY_CONFIG_KANA_LAYOUT_FILE), + String (__config_kana_layout_file)); + __config_nicola_layout_file + = config->write (String (SCIM_ANTHY_CONFIG_NICOLA_LAYOUT_FILE), + String (__config_nicola_layout_file)); +} + +bool +kana_page_query_changed (void) +{ + return __config_changed || __style_changed; +} + + +static GtkWidget * +create_kana_window (GtkWindow *parent) +{ + GtkWidget *dialog = scim_anthy_table_editor_new (); + const char *titles[3]; + titles[0] = _("Key"); + titles[1] = _("Result"); + titles[2] = NULL; + scim_anthy_table_editor_set_columns (SCIM_ANTHY_TABLE_EDITOR (dialog), + titles); + gtk_window_set_transient_for (GTK_WINDOW (dialog), + GTK_WINDOW (parent)); + gtk_window_set_title (GTK_WINDOW (dialog), + _("Customize kana layout table")); + + // option menu area + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, + FALSE, FALSE, 0); + gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0); + gtk_widget_show(hbox); + + GtkWidget *label = gtk_label_new_with_mnemonic (_("Layout _table:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + GtkWidget *omenu = gtk_option_menu_new (); + __widget_kana_layout_menu2 = omenu; + g_object_add_weak_pointer (G_OBJECT (omenu), + (gpointer*) &__widget_kana_layout_menu2); + gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2); + setup_kana_layout_menu (GTK_OPTION_MENU (omenu)); + gtk_option_menu_set_history + (GTK_OPTION_MENU (omenu), + gtk_option_menu_get_history ( + GTK_OPTION_MENU (__widget_kana_layout_menu))); + gtk_widget_show (omenu); + + gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu); + +#if 0 + GtkWidget *button = gtk_button_new_with_mnemonic ("Save _as..."); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_widget_show (button); +#endif + + // set data and connect signals + setup_kana_window_value (SCIM_ANTHY_TABLE_EDITOR (dialog)); + g_signal_connect (G_OBJECT (omenu), "changed", + G_CALLBACK (on_kana_layout_menu_changed), + dialog); + g_signal_connect (G_OBJECT (dialog), "add-entry", + G_CALLBACK (on_kana_table_editor_add_entry), + NULL); + g_signal_connect (G_OBJECT (dialog), "remove-entry", + G_CALLBACK (on_kana_table_editor_remove_entry), + NULL); + g_signal_connect_after (G_OBJECT (dialog), "add-entry", + G_CALLBACK (on_kana_table_editor_added_entry), + NULL); + g_signal_connect_after (G_OBJECT (dialog), "remove-entry", + G_CALLBACK (on_kana_table_editor_removed_entry), + NULL); + + return dialog; +} + + +static GtkWidget * +create_nicola_window (GtkWindow *parent) +{ + GtkWidget *dialog = scim_anthy_table_editor_new (); + gtk_window_set_default_size (GTK_WINDOW (dialog), 450, 350); + const char *titles[5]; + titles[0] = _("Key"); + titles[1] = _("Single press"); + titles[2] = _("Left thumb shift"); + titles[3] = _("Right thumb shift"); + titles[4] = NULL; + scim_anthy_table_editor_set_columns (SCIM_ANTHY_TABLE_EDITOR (dialog), + titles); + gtk_window_set_transient_for (GTK_WINDOW (dialog), + GTK_WINDOW (parent)); + gtk_window_set_title (GTK_WINDOW (dialog), + _("Customize thumb shift layout table")); + + // option menu area + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, + FALSE, FALSE, 0); + gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0); + gtk_widget_show(hbox); + + GtkWidget *label = gtk_label_new_with_mnemonic (_("Layout _table:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + GtkWidget *omenu = gtk_option_menu_new (); + __widget_nicola_layout_menu2 = omenu; + g_object_add_weak_pointer (G_OBJECT (omenu), + (gpointer*) &__widget_nicola_layout_menu2); + gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2); + setup_nicola_layout_menu (GTK_OPTION_MENU (omenu)); + gtk_option_menu_set_history + (GTK_OPTION_MENU (omenu), + gtk_option_menu_get_history ( + GTK_OPTION_MENU (__widget_nicola_layout_menu))); + gtk_widget_show (omenu); + + gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu); + +#if 0 + GtkWidget *button = gtk_button_new_with_mnemonic ("Save _as..."); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_widget_show (button); +#endif + + // set data and connect signals + setup_nicola_window_value (SCIM_ANTHY_TABLE_EDITOR (dialog)); + g_signal_connect (G_OBJECT (omenu), "changed", + G_CALLBACK (on_nicola_layout_menu_changed), + dialog); + g_signal_connect (G_OBJECT (dialog), "add-entry", + G_CALLBACK (on_nicola_table_editor_add_entry), + NULL); + g_signal_connect (G_OBJECT (dialog), "remove-entry", + G_CALLBACK (on_nicola_table_editor_remove_entry), + NULL); + g_signal_connect_after (G_OBJECT (dialog), "add-entry", + G_CALLBACK (on_nicola_table_editor_added_entry), + NULL); + g_signal_connect_after (G_OBJECT (dialog), "remove-entry", + G_CALLBACK (on_nicola_table_editor_removed_entry), + NULL); + + return dialog; +} + +static void +setup_kana_page (void) +{ + setup_kana_layout_menu (GTK_OPTION_MENU (__widget_kana_layout_menu)); + setup_nicola_layout_menu (GTK_OPTION_MENU (__widget_nicola_layout_menu)); +} + +static void +setup_kana_layout_menu (GtkOptionMenu *omenu) +{ + GtkWidget *menu = gtk_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), + menu); + gtk_widget_show (menu); + + // create menu items + GtkWidget *menuitem = gtk_menu_item_new_with_label (_("User defined")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + + menuitem = gtk_menu_item_new_with_label (_("Default")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + + StyleFiles::iterator it; + unsigned int i; + for (i = 0, it = __style_list.begin (); + it != __style_list.end (); + i++, it++) + { + StyleLines section; + if (!it->get_entry_list (section, __kana_fund_table)) + continue; + + menuitem = gtk_menu_item_new_with_label (_(it->get_title().c_str())); + g_object_set_data (G_OBJECT (menuitem), + INDEX_KEY, GINT_TO_POINTER (i)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + } + + // set default value + g_signal_handlers_block_by_func ( + G_OBJECT (omenu), + (gpointer) (on_kana_layout_menu_changed), + NULL); + + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), + KANA_LAYOUT_INDEX_DEFAULT); + + if (__config_kana_layout_file == __user_style_file.get_file_name ()) { + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), + KANA_LAYOUT_INDEX_USER_DEFINED); + + } else { + GList *node, *list = gtk_container_get_children (GTK_CONTAINER (menu)); + for (i = 2, node = g_list_next (g_list_next (list)); + node; + i++, node = g_list_next (node)) + { + gint idx = GPOINTER_TO_INT ( + g_object_get_data (G_OBJECT (node->data), INDEX_KEY)); + if (__style_list[idx].get_file_name () == __config_kana_layout_file) { + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i); + break; + } + } + } + + g_signal_handlers_unblock_by_func ( + G_OBJECT (omenu), + (gpointer) (on_kana_layout_menu_changed), + NULL); +} + +static void +setup_nicola_layout_menu (GtkOptionMenu *omenu) +{ + GtkWidget *menu = gtk_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), + menu); + gtk_widget_show (menu); + + // create menu items + GtkWidget *menuitem = gtk_menu_item_new_with_label (_("User defined")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + + menuitem = gtk_menu_item_new_with_label (_("Default")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + + StyleFiles::iterator it; + unsigned int i; + for (i = 0, it = __style_list.begin (); + it != __style_list.end (); + i++, it++) + { + StyleLines section; + if (!it->get_entry_list (section, __nicola_fund_table)) + continue; + + menuitem = gtk_menu_item_new_with_label (_(it->get_title().c_str())); + g_object_set_data (G_OBJECT (menuitem), + INDEX_KEY, GINT_TO_POINTER (i)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + } + + // set default value + g_signal_handlers_block_by_func ( + G_OBJECT (omenu), + (gpointer) (on_nicola_layout_menu_changed), + NULL); + + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), + NICOLA_LAYOUT_INDEX_DEFAULT); + + if (__config_nicola_layout_file == __user_style_file.get_file_name ()) { + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), + NICOLA_LAYOUT_INDEX_USER_DEFINED); + + } else { + GList *node, *list = gtk_container_get_children (GTK_CONTAINER (menu)); + for (i = 2, node = g_list_next (g_list_next (list)); + node; + i++, node = g_list_next (node)) + { + gint idx = GPOINTER_TO_INT ( + g_object_get_data (G_OBJECT (node->data), INDEX_KEY)); + if (__style_list[idx].get_file_name () == __config_nicola_layout_file) { + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i); + break; + } + } + } + + g_signal_handlers_unblock_by_func ( + G_OBJECT (omenu), + (gpointer) (on_nicola_layout_menu_changed), + NULL); +} + +static void +setup_kana_window_value (ScimAnthyTableEditor *editor) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview); + GtkTreeModel *model = gtk_tree_view_get_model (treeview); + GtkListStore *store = GTK_LIST_STORE (model); + + gtk_list_store_clear (store); + + std::vector keys; + __user_style_file.get_key_list (keys, __kana_fund_table); + if (keys.empty ()) { + load_kana_layout (); + __user_style_file.get_key_list (keys, __kana_fund_table); + } + + std::vector::iterator it; + for (it = keys.begin (); it != keys.end (); it++) { + std::vector value; + __user_style_file.get_string_array (value, __kana_fund_table, *it); + String result, cont; + if (value.size () > 0) result = utf8_wcstombs(value[0]); + if (value.size () > 1) result = utf8_wcstombs(value[1]); + GtkTreeIter iter; + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + 0, it->c_str (), + 1, result.c_str (), + -1); + } +} + +static void +setup_nicola_window_value (ScimAnthyTableEditor *editor) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview); + GtkTreeModel *model = gtk_tree_view_get_model (treeview); + GtkListStore *store = GTK_LIST_STORE (model); + + gtk_list_store_clear (store); + + std::vector keys; + __user_style_file.get_key_list (keys, __nicola_fund_table); + if (keys.empty ()) { + load_nicola_layout (); + __user_style_file.get_key_list (keys, __nicola_fund_table); + } + + std::vector::iterator it; + for (it = keys.begin (); it != keys.end (); it++) { + std::vector value; + __user_style_file.get_string_array (value, __nicola_fund_table, *it); + String single, left, right; + if (value.size () > 0) single = utf8_wcstombs(value[0]); + if (value.size () > 1) left = utf8_wcstombs(value[1]); + if (value.size () > 2) right = utf8_wcstombs(value[2]); + GtkTreeIter iter; + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + 0, it->c_str (), + 1, single.c_str (), + 2, left.c_str (), + 3, right.c_str (), + -1); + } +} + +static void +setup_default_kana_table (void) +{ + __user_style_file.delete_section (__kana_fund_table); + ConvRule *table = scim_anthy_kana_typing_rule; + for (unsigned int i = 0; table[i].string; i++) { + std::vector value; + if ((table[i].result && *(table[i].result)) || + (table[i].cont && *(table[i].cont))) + { + const char *result = table[i].result ? table[i].result : ""; + value.push_back (result); + } + if (table[i].cont && *(table[i].cont)) { + value.push_back (table[i].cont); + } + __user_style_file.set_string_array (__kana_fund_table, + table[i].string, + value); + } +} + +static void +setup_default_nicola_table (void) +{ + __user_style_file.delete_section (__nicola_fund_table); + NicolaRule *table = scim_anthy_nicola_table; + for (unsigned int i = 0; table[i].key; i++) { + std::vector value; + const char *str; + str = table[i].single ? table[i].single : ""; + value.push_back (str); + str = table[i].left_shift ? table[i].left_shift : ""; + value.push_back (str); + str = table[i].right_shift ? table[i].right_shift : ""; + value.push_back (str); + __user_style_file.set_string_array (__nicola_fund_table, + table[i].key, + value); + } +} + +static bool +load_kana_layout (void) +{ + GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_kana_layout_menu); + gint idx = gtk_option_menu_get_history (omenu); + GtkWidget *menu = gtk_option_menu_get_menu (omenu); + GList *list = gtk_container_get_children (GTK_CONTAINER (menu)); + GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx)); + + if (!menuitem) + return false; + + gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), + INDEX_KEY)); + + // set new kana table + if (idx == KANA_LAYOUT_INDEX_USER_DEFINED) { + // User defined table + __config_kana_layout_file = __user_style_file.get_file_name (); + StyleLines lines; + bool success = __user_style_file.get_entry_list + (lines, __kana_fund_table); + if (!success || lines.empty ()) + setup_default_kana_table (); + + return true; + + } else if (idx == KANA_LAYOUT_INDEX_DEFAULT) { + // Default table + __config_kana_layout_file = ""; + setup_default_kana_table (); + + return true; + + } else if (theme_idx >= 0 && theme_idx < (int) __style_list.size ()) { + // Tables defined in system theme files + __config_kana_layout_file = __style_list[theme_idx].get_file_name (); + __user_style_file.delete_section (__kana_fund_table); + + std::vector keys; + bool success = __style_list[theme_idx].get_key_list + (keys, __kana_fund_table); + if (success) { + std::vector::iterator it; + for (it = keys.begin (); it != keys.end (); it++) { + std::vector value; + __style_list[theme_idx].get_string_array + (value, __kana_fund_table, *it); + __user_style_file.set_string_array (__kana_fund_table, + *it, value); + } + } + return true; + + } else { + // error + return false; + } +} + +static bool +load_nicola_layout (void) +{ + GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_nicola_layout_menu); + gint idx = gtk_option_menu_get_history (omenu); + GtkWidget *menu = gtk_option_menu_get_menu (omenu); + GList *list = gtk_container_get_children (GTK_CONTAINER (menu)); + GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx)); + + if (!menuitem) + return false; + + gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), + INDEX_KEY)); + + // set new NICOLA table + if (idx == NICOLA_LAYOUT_INDEX_USER_DEFINED) { + // User defined table + __config_nicola_layout_file = __user_style_file.get_file_name (); + StyleLines lines; + bool success = __user_style_file.get_entry_list + (lines, __nicola_fund_table); + if (!success || lines.empty ()) + setup_default_nicola_table (); + + return true; + + } else if (idx == NICOLA_LAYOUT_INDEX_DEFAULT) { + // Default table + __config_nicola_layout_file = ""; + setup_default_nicola_table (); + + return true; + + } else if (theme_idx >= 0 && theme_idx < (int) __style_list.size ()) { + // Tables defined in system theme files + __config_nicola_layout_file = __style_list[theme_idx].get_file_name (); + __user_style_file.delete_section (__nicola_fund_table); + + std::vector keys; + bool success = __style_list[theme_idx].get_key_list + (keys, __nicola_fund_table); + if (success) { + std::vector::iterator it; + for (it = keys.begin (); it != keys.end (); it++) { + std::vector value; + __style_list[theme_idx].get_string_array + (value, __nicola_fund_table, *it); + __user_style_file.set_string_array (__nicola_fund_table, + *it, value); + } + } + return true; + + } else { + // error + return false; + } +} + +static bool +has_voiced_consonant (String str) +{ + ConvRule *table = scim_anthy_kana_voiced_consonant_rule; + + WideString str1_wide = utf8_mbstowcs (str); + if (str1_wide.length () <= 0) + return false; + + for (unsigned int i = 0; table[i].string; i++) { + WideString str2_wide = utf8_mbstowcs (table[i].string); + if (str2_wide.length () <= 0) + continue; + if (str1_wide[0] == str2_wide[0]) + return true; + } + + return false; +} + +static void +on_kana_layout_menu_changed (GtkOptionMenu *omenu, gpointer user_data) +{ + bool success; + + if (__widget_kana_layout_menu != GTK_WIDGET (omenu)) { + g_signal_handlers_block_by_func ( + G_OBJECT (__widget_kana_layout_menu), + (gpointer) (on_kana_layout_menu_changed), + NULL); + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_kana_layout_menu), + gtk_option_menu_get_history (omenu)); + g_signal_handlers_unblock_by_func ( + G_OBJECT (__widget_kana_layout_menu), + (gpointer) (on_kana_layout_menu_changed), + NULL); + + success = load_kana_layout (); + + setup_kana_window_value (SCIM_ANTHY_TABLE_EDITOR (user_data)); + } else { + success = load_kana_layout (); + } + + if (success) { + // sync widgets + __style_changed = true; + __config_changed = true; + } +} + +static void +on_kana_customize_button_clicked (GtkWidget *button, gpointer data) +{ + GtkWidget *widget = create_kana_window ( + GTK_WINDOW (gtk_widget_get_toplevel (button))); + gtk_dialog_run (GTK_DIALOG (widget)); + gtk_widget_destroy (widget); +} + +static void +on_kana_table_editor_add_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + const gchar *sequence, *result; + sequence = scim_anthy_table_editor_get_nth_text (editor, 0); + result = scim_anthy_table_editor_get_nth_text (editor, 1); + + // real add + std::vector value; + if (has_voiced_consonant (result)) + value.push_back (""); + value.push_back (result); + __user_style_file.set_string_array (__kana_fund_table, sequence, value); +} + +static void +on_kana_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + // change menu item to "User defined" + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_kana_layout_menu2), + KANA_LAYOUT_INDEX_USER_DEFINED); + + __style_changed = true; +} + +static void +on_kana_table_editor_remove_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + const gchar *sequence; + sequence = scim_anthy_table_editor_get_nth_text (editor, 0); + + // real remove + __user_style_file.delete_key (__kana_fund_table, sequence); +} + +static void +on_kana_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + // change menu item to "User deined" + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_kana_layout_menu2), + KANA_LAYOUT_INDEX_USER_DEFINED); + + __style_changed = true; +} + +static void +on_nicola_layout_menu_changed (GtkOptionMenu *omenu, gpointer user_data) +{ + bool success; + + if (__widget_nicola_layout_menu != GTK_WIDGET (omenu)) { + g_signal_handlers_block_by_func ( + G_OBJECT (__widget_nicola_layout_menu), + (gpointer) (on_nicola_layout_menu_changed), + NULL); + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_nicola_layout_menu), + gtk_option_menu_get_history (omenu)); + g_signal_handlers_unblock_by_func ( + G_OBJECT (__widget_nicola_layout_menu), + (gpointer) (on_nicola_layout_menu_changed), + NULL); + + success = load_nicola_layout (); + + setup_nicola_window_value (SCIM_ANTHY_TABLE_EDITOR (user_data)); + } else { + success = load_nicola_layout (); + } + + if (success) { + // sync widgets + __style_changed = true; + __config_changed = true; + } +} + +static void +on_nicola_customize_button_clicked (GtkWidget *button, gpointer data) +{ + GtkWidget *widget = create_nicola_window ( + GTK_WINDOW (gtk_widget_get_toplevel (button))); + gtk_dialog_run (GTK_DIALOG (widget)); + gtk_widget_destroy (widget); +} + +static void +on_nicola_table_editor_add_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + const gchar *key = scim_anthy_table_editor_get_nth_text (editor, 0); + std::vector value; + value.push_back (scim_anthy_table_editor_get_nth_text (editor, 1)); + value.push_back (scim_anthy_table_editor_get_nth_text (editor, 2)); + value.push_back (scim_anthy_table_editor_get_nth_text (editor, 3)); + __user_style_file.set_string_array (__nicola_fund_table, key, value); +} + +static void +on_nicola_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + // change menu item to "User defined" + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_nicola_layout_menu2), + NICOLA_LAYOUT_INDEX_USER_DEFINED); + + __style_changed = true; +} + +static void +on_nicola_table_editor_remove_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + const gchar *sequence; + sequence = scim_anthy_table_editor_get_nth_text (editor, 0); + + // real remove + __user_style_file.delete_key (__nicola_fund_table, sequence); +} + +static void +on_nicola_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + // change menu item to "User deined" + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_nicola_layout_menu2), + NICOLA_LAYOUT_INDEX_USER_DEFINED); + + __style_changed = true; +} + +} diff --git a/src/scim_anthy_setup_kana.h b/src/scim_anthy_setup_kana.h new file mode 100755 index 0000000..13eecfd --- /dev/null +++ b/src/scim_anthy_setup_kana.h @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_SETUP_KANA_H__ +#define __SCIM_ANTHY_SETUP_KANA_H__ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include + +#define Uses_SCIM_CONFIG_BASE +#include + + +namespace scim_anthy { + +GtkWidget *kana_page_create_ui (void); +void kana_page_load_config (const ConfigPointer &config); +void kana_page_save_config (const ConfigPointer &config); +bool kana_page_query_changed (void); + +}; + +#endif /* __SCIM_ANTHY_SETUP_KANA_H__ */ diff --git a/src/scim_anthy_setup_romaji.cpp b/src/scim_anthy_setup_romaji.cpp new file mode 100755 index 0000000..5739c57 --- /dev/null +++ b/src/scim_anthy_setup_romaji.cpp @@ -0,0 +1,525 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include +#include + +#define Uses_SCIM_CONFIG_BASE +#define Uses_SCIM_EVENT +#define SCIM_ANTHY_USE_GTK +#include +#include "scim_anthy_intl.h" +#include "scim_anthy_style_file.h" +#include "scim_anthy_prefs.h" +#include "scim_anthy_default_tables.h" +#include "scim_anthy_setup.h" +#include "scim_anthy_table_editor.h" + +using namespace scim; + +namespace scim_anthy { + +#define INDEX_KEY "scim-anthy::Index" +static const char * const __romaji_fund_table = "RomajiTable/FundamentalTable"; + +static const int ROMAJI_THEME_INDEX_USER_DEFINED = 0; +static const int ROMAJI_THEME_INDEX_DEFAULT = 1; + +// Internal data declaration. +static GtkWidget * __widget_romaji_theme_menu = NULL; +static GtkWidget * __widget_romaji_theme_menu2 = NULL; + +static String __config_romaji_theme_file = SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT; + +static GtkWidget *create_romaji_window (GtkWindow *parent); + +static void setup_romaji_page (void); +static void setup_romaji_theme_menu (GtkOptionMenu *omenu); +static void setup_romaji_window_value (ScimAnthyTableEditor *editor); + +static bool load_romaji_theme (void); + +static void on_romaji_pseudo_ascii_mode_toggled(GtkToggleButton *togglebutton, + gpointer user_data); +static void on_romaji_theme_menu_changed (GtkOptionMenu *omenu, + gpointer user_data); +static void on_romaji_customize_button_clicked (GtkWidget *button, + gpointer data); +static void on_table_editor_add_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_table_editor_added_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_table_editor_remove_entry (ScimAnthyTableEditor *editor, + gpointer data); +static void on_table_editor_removed_entry (ScimAnthyTableEditor *editor, + gpointer data); + +GtkWidget * +romaji_page_create_ui (void) +{ + GtkWidget *vbox, *widget, *hbox, *label; + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + + /* romaji splitting */ + widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_ALLOW_SPLIT); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4); + + /* symbol */ + widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_HALF_SYMBOL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4); + + /* number */ + widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_HALF_NUMBER); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4); + + /* pseudo ascii mode */ + widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_MODE); + g_signal_connect ((gpointer) widget, "toggled", + G_CALLBACK (on_romaji_pseudo_ascii_mode_toggled), + NULL); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4); + + /* pseudo ascii: blank behavior */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4); + gtk_widget_show (hbox); + label = gtk_label_new (" "); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + gtk_widget_show (label); + + widget = create_check_button (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR); + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + // set initial state + on_romaji_pseudo_ascii_mode_toggled (GTK_TOGGLE_BUTTON (widget), NULL); + + /* romaji table */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + gtk_widget_show(hbox); + + label = gtk_label_new_with_mnemonic (_("Romaji _table:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + GtkWidget *omenu = gtk_option_menu_new (); + __widget_romaji_theme_menu = omenu; + g_signal_connect (G_OBJECT (omenu), "changed", + G_CALLBACK (on_romaji_theme_menu_changed), NULL); + gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2); + gtk_widget_show (omenu); + + gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu); + + GtkWidget *button = gtk_button_new_with_mnemonic (_("_Customize...")); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_romaji_customize_button_clicked), NULL); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_widget_show (button); + + setup_romaji_page (); + + return vbox; +} + +void +romaji_page_load_config (const ConfigPointer &config) +{ + __config_romaji_theme_file + = config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE), + String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT)); + setup_romaji_page (); +} + +void +romaji_page_save_config (const ConfigPointer &config) +{ + __config_romaji_theme_file + = config->write (String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE), + String (__config_romaji_theme_file)); +} + +bool +romaji_page_query_changed (void) +{ + return __config_changed || __style_changed; +} + + +static GtkWidget * +create_romaji_window (GtkWindow *parent) +{ + GtkWidget *dialog = scim_anthy_table_editor_new (); + const char *titles[3]; + titles[0] = _("Sequence"); + titles[1] = _("Result"); + titles[2] = NULL; + scim_anthy_table_editor_set_columns (SCIM_ANTHY_TABLE_EDITOR (dialog), + titles); + gtk_window_set_transient_for (GTK_WINDOW (dialog), + GTK_WINDOW (parent)); + gtk_window_set_title (GTK_WINDOW (dialog), + _("Customize romaji table")); + + // option menu area + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, + FALSE, FALSE, 0); + gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0); + gtk_widget_show(hbox); + + GtkWidget *label = gtk_label_new_with_mnemonic (_("Romaji _table:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + GtkWidget *omenu = gtk_option_menu_new (); + __widget_romaji_theme_menu2 = omenu; + g_object_add_weak_pointer (G_OBJECT (omenu), + (gpointer*) &__widget_romaji_theme_menu2); + gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2); + setup_romaji_theme_menu (GTK_OPTION_MENU (omenu)); + gtk_option_menu_set_history + (GTK_OPTION_MENU (omenu), + gtk_option_menu_get_history ( + GTK_OPTION_MENU (__widget_romaji_theme_menu))); + gtk_widget_show (omenu); + + gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu); + +#if 0 + GtkWidget *button = gtk_button_new_with_mnemonic ("Save _as..."); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_widget_show (button); +#endif + + // set data and connect signals + setup_romaji_window_value (SCIM_ANTHY_TABLE_EDITOR (dialog)); + g_signal_connect (G_OBJECT (omenu), "changed", + G_CALLBACK (on_romaji_theme_menu_changed), + dialog); + g_signal_connect (G_OBJECT (dialog), "add-entry", + G_CALLBACK (on_table_editor_add_entry), + NULL); + g_signal_connect (G_OBJECT (dialog), "remove-entry", + G_CALLBACK (on_table_editor_remove_entry), + NULL); + g_signal_connect_after (G_OBJECT (dialog), "add-entry", + G_CALLBACK (on_table_editor_added_entry), + NULL); + g_signal_connect_after (G_OBJECT (dialog), "remove-entry", + G_CALLBACK (on_table_editor_removed_entry), + NULL); + + return dialog; +} + +static void +setup_romaji_page (void) +{ + setup_romaji_theme_menu (GTK_OPTION_MENU (__widget_romaji_theme_menu)); +} + +static void +setup_romaji_theme_menu (GtkOptionMenu *omenu) +{ + GtkWidget *menu = gtk_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), + menu); + gtk_widget_show (menu); + + // create menu items + GtkWidget *menuitem = gtk_menu_item_new_with_label (_("User defined")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + + menuitem = gtk_menu_item_new_with_label (_("Default")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + + StyleFiles::iterator it; + unsigned int i; + for (i = 0, it = __style_list.begin (); + it != __style_list.end (); + i++, it++) + { + StyleLines section; + if (!it->get_entry_list (section, __romaji_fund_table)) + continue; + + menuitem = gtk_menu_item_new_with_label (_(it->get_title().c_str())); + g_object_set_data (G_OBJECT (menuitem), + INDEX_KEY, GINT_TO_POINTER (i)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + } + + // set default value + g_signal_handlers_block_by_func ( + G_OBJECT (omenu), + (gpointer) (on_romaji_theme_menu_changed), + NULL); + + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), + ROMAJI_THEME_INDEX_DEFAULT); + + if (__config_romaji_theme_file == __user_style_file.get_file_name ()) { + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), + ROMAJI_THEME_INDEX_USER_DEFINED); + + } else { + GList *node, *list = gtk_container_get_children (GTK_CONTAINER (menu)); + for (i = 2, node = g_list_next (g_list_next (list)); + node; + i++, node = g_list_next (node)) + { + gint idx = GPOINTER_TO_INT ( + g_object_get_data (G_OBJECT (node->data), INDEX_KEY)); + if (__style_list[idx].get_file_name () == __config_romaji_theme_file) { + gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i); + break; + } + } + } + + g_signal_handlers_unblock_by_func ( + G_OBJECT (omenu), + (gpointer) (on_romaji_theme_menu_changed), + NULL); +} + +static void +setup_romaji_window_value (ScimAnthyTableEditor *editor) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview); + GtkTreeModel *model = gtk_tree_view_get_model (treeview); + GtkListStore *store = GTK_LIST_STORE (model); + + gtk_list_store_clear (store); + + std::vector keys; + __user_style_file.get_key_list (keys, __romaji_fund_table); + if (keys.empty ()) { + load_romaji_theme (); + __user_style_file.get_key_list (keys, __romaji_fund_table); + } + + std::vector::iterator it; + for (it = keys.begin (); it != keys.end (); it++) { + std::vector value; + __user_style_file.get_string_array (value, __romaji_fund_table, *it); + String result, cont; + if (value.size () > 0) result = utf8_wcstombs(value[0]); + if (value.size () > 1) cont = utf8_wcstombs(value[1]); + GtkTreeIter iter; + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + 0, it->c_str (), + 1, result.c_str (), + -1); + } +} + +static void +setup_default_romaji_table (void) +{ + __user_style_file.delete_section (__romaji_fund_table); + ConvRule *table = scim_anthy_romaji_typing_rule; + for (unsigned int i = 0; table[i].string; i++) { + std::vector value; + if ((table[i].result && *(table[i].result)) || + (table[i].cont && *(table[i].cont))) + { + const char *result = table[i].result ? table[i].result : ""; + value.push_back (result); + } + if (table[i].cont && *(table[i].cont)) { + value.push_back (table[i].cont); + } + __user_style_file.set_string_array (__romaji_fund_table, + table[i].string, + value); + } +} + +static bool +load_romaji_theme (void) +{ + GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_romaji_theme_menu); + gint idx = gtk_option_menu_get_history (omenu); + GtkWidget *menu = gtk_option_menu_get_menu (omenu); + GList *list = gtk_container_get_children (GTK_CONTAINER (menu)); + GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx)); + + if (!menuitem) + return false; + + gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), + INDEX_KEY)); + + // set new romaji table + if (idx == ROMAJI_THEME_INDEX_USER_DEFINED) { + // User defined table + __config_romaji_theme_file = __user_style_file.get_file_name (); + StyleLines lines; + bool success = __user_style_file.get_entry_list + (lines, __romaji_fund_table); + if (!success || lines.empty ()) + setup_default_romaji_table (); + + return true; + + } else if (idx == ROMAJI_THEME_INDEX_DEFAULT) { + // Default table + __config_romaji_theme_file = ""; + setup_default_romaji_table (); + + return true; + + } else if (theme_idx >= 0 && theme_idx < (int) __style_list.size ()) { + // Tables defined in system theme files + __config_romaji_theme_file = __style_list[theme_idx].get_file_name (); + __user_style_file.delete_section (__romaji_fund_table); + + std::vector keys; + bool success = __style_list[theme_idx].get_key_list + (keys, __romaji_fund_table); + if (success) { + std::vector::iterator it; + for (it = keys.begin (); it != keys.end (); it++) { + std::vector value; + __style_list[theme_idx].get_string_array + (value, __romaji_fund_table, *it); + __user_style_file.set_string_array (__romaji_fund_table, + *it, value); + } + } + return true; + + } else { + // error + return false; + } +} + +static void +on_romaji_pseudo_ascii_mode_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + gboolean active = gtk_toggle_button_get_active (togglebutton); + BoolConfigData *entry; + + entry = find_bool_config_entry (SCIM_ANTHY_CONFIG_ROMAJI_PSEUDO_ASCII_BLANK_BEHAVIOR); + if (entry->widget) + gtk_widget_set_sensitive (GTK_WIDGET (entry->widget), active); +} + +static void +on_romaji_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data) +{ + bool success; + + if (__widget_romaji_theme_menu != GTK_WIDGET (omenu)) { + g_signal_handlers_block_by_func ( + G_OBJECT (__widget_romaji_theme_menu), + (gpointer) (on_romaji_theme_menu_changed), + NULL); + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_romaji_theme_menu), + gtk_option_menu_get_history (omenu)); + g_signal_handlers_unblock_by_func ( + G_OBJECT (__widget_romaji_theme_menu), + (gpointer) (on_romaji_theme_menu_changed), + NULL); + + success = load_romaji_theme (); + + setup_romaji_window_value (SCIM_ANTHY_TABLE_EDITOR (user_data)); + } else { + success = load_romaji_theme (); + } + + if (success) { + // sync widgets + __style_changed = true; + __config_changed = true; + } +} + +static void +on_romaji_customize_button_clicked (GtkWidget *button, gpointer data) +{ + GtkWidget *widget = create_romaji_window ( + GTK_WINDOW (gtk_widget_get_toplevel (button))); + gtk_dialog_run (GTK_DIALOG (widget)); + gtk_widget_destroy (widget); +} + +static void +on_table_editor_add_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + const gchar *sequence, *result; + sequence = scim_anthy_table_editor_get_nth_text (editor, 0); + result = scim_anthy_table_editor_get_nth_text (editor, 1); + + // real add + __user_style_file.set_string (__romaji_fund_table, sequence, result); +} + +static void +on_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + // change menu item to "User defined" + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_romaji_theme_menu2), + ROMAJI_THEME_INDEX_USER_DEFINED); + + __style_changed = true; +} + +static void +on_table_editor_remove_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + const gchar *sequence; + sequence = scim_anthy_table_editor_get_nth_text (editor, 0); + + // real remove + __user_style_file.delete_key (__romaji_fund_table, sequence); + + __style_changed = true; +} + +static void +on_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data) +{ + // change menu item to "User deined" + gtk_option_menu_set_history ( + GTK_OPTION_MENU (__widget_romaji_theme_menu2), + ROMAJI_THEME_INDEX_USER_DEFINED); + + __style_changed = true; +} + +} diff --git a/src/scim_anthy_setup_romaji.h b/src/scim_anthy_setup_romaji.h new file mode 100755 index 0000000..cdd81fb --- /dev/null +++ b/src/scim_anthy_setup_romaji.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004 Hiroyuki Ikezoe + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_SETUP_ROMAJI_H__ +#define __SCIM_ANTHY_SETUP_ROMAJI_H__ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include + +#define Uses_SCIM_CONFIG_BASE +#include + +namespace scim_anthy { + +GtkWidget *romaji_page_create_ui (void); +void romaji_page_load_config (const ConfigPointer &config); +void romaji_page_save_config (const ConfigPointer &config); +bool romaji_page_query_changed (void); + +}; + +#endif /* __SCIM_ANTHY_SETUP_ROMAJI_H__ */ diff --git a/src/scim_anthy_style_file.cpp b/src/scim_anthy_style_file.cpp new file mode 100755 index 0000000..413383e --- /dev/null +++ b/src/scim_anthy_style_file.cpp @@ -0,0 +1,729 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#include "scim_anthy_style_file.h" + +using namespace scim_anthy; + +const int MAX_LINE_LENGTH = 4096; + +static String +escape (const String &str) +{ + String dest = str; + + for (unsigned int i = 0; i < dest.size (); i++) { + if (dest[i] == '#' || // for comment + dest[i] == '\\' || // for backslash itself + dest[i] == '=' || // for separatort + dest[i] == '[' || dest[i] == ']' || // for section + dest[i] == ',' || // for array + dest[i] == ' ' || dest[i] == '\t') // for space + { + dest.insert (i, "\\"); + i++; + } + } + + return dest; +} + +static String +unescape (const String &str) +{ + String dest = str; + + for (unsigned int i = 0; i < dest.size (); i++) { + if (dest[i] == '\\') { + dest.erase (i, 1); + if (i < dest.size () && dest[i] == '\\') + i++; + } + } + + return dest; +} + +StyleLine::StyleLine (StyleFile *style_file, String line) + : m_style_file (style_file), + m_line (line), + m_type (SCIM_ANTHY_STYLE_LINE_UNKNOWN) +{ +} + +StyleLine::StyleLine (StyleFile *style_file, String key, String value) + : m_style_file (style_file), + m_line (escape (key) + String ("=")), + m_type (SCIM_ANTHY_STYLE_LINE_KEY) +{ + set_value (value); +} + +StyleLine::StyleLine (StyleFile *style_file, String key, + std::vector &value) + : m_style_file (style_file), + m_line (escape (key) + String("=")), + m_type (SCIM_ANTHY_STYLE_LINE_KEY) +{ + set_value_array (value); +} + +StyleLine::~StyleLine () +{ +} + +StyleLineType +StyleLine::get_type (void) +{ + if (m_type != SCIM_ANTHY_STYLE_LINE_UNKNOWN) + return m_type; + + unsigned int spos, epos; + for (spos = 0; + spos < m_line.length () && isspace (m_line[spos]); + spos++); + if (m_line.length() > 0) { + for (epos = m_line.length () - 1; + epos >= 0 && isspace (m_line[epos]); + epos--); + } else { + epos = 0; + } + + if (m_line.length() == 0 || spos >= m_line.length()) { + m_type = SCIM_ANTHY_STYLE_LINE_SPACE; + return m_type; + + } else if (m_line[spos] == '#') { + m_type = SCIM_ANTHY_STYLE_LINE_COMMENT; + return m_type; + + } else if (m_line[spos] == '[' && m_line[epos] == ']') { + m_type = SCIM_ANTHY_STYLE_LINE_SECTION; + return m_type; + } + + m_type = SCIM_ANTHY_STYLE_LINE_KEY; + return m_type; +} + +bool +StyleLine::get_section (String §ion) +{ + if (get_type () != SCIM_ANTHY_STYLE_LINE_SECTION) + return false; + + unsigned int spos, epos; + for (spos = 0; + spos < m_line.length () && isspace (m_line[spos]); + spos++); + for (epos = m_line.length () - 1; + epos >= 0 && isspace (m_line[epos]); + epos--); + spos++; + + if (spos < epos) + section = m_line.substr (spos, epos - spos); + else + section = String (); + + return true; +} + +bool +StyleLine::get_key (String &key) +{ + if (get_type () != SCIM_ANTHY_STYLE_LINE_KEY) + return false; + + unsigned int spos, epos; + for (spos = 0; + spos < m_line.length () && isspace (m_line[spos]); + spos++); + bool found = false; + for (epos = spos; + epos < m_line.length (); + epos++) + { + if (m_line[epos] == '\\') { + epos++; + continue; + } + if (m_line[epos] == '=') { + found = true; + break; + } + } + for (--epos; + epos >= spos && isspace (m_line[epos]); + epos--); + if (!isspace(m_line[epos])) + epos++; + + if (spos >= 0 && spos < epos && epos <= m_line.length ()) { + key = unescape (m_line.substr (spos, epos - spos)); + } else + key = String (); + + return true; +} + +static int +get_value_position (String &str) +{ + unsigned int spos; + for (spos = 0; + spos < str.length (); + spos++) + { + if (str[spos] == '\\') { + spos++; + continue; + } + if (str[spos] == '=') { + break; + } + } + if (spos >= str.length ()) + return true; + else + spos++; + for (; + spos < str.length () && isspace(str[spos]); + spos++); + + return spos; +} + +bool +StyleLine::get_value (String &value) +{ + if (get_type () != SCIM_ANTHY_STYLE_LINE_KEY) + return false; + + unsigned int spos = get_value_position (m_line); + unsigned int epos = m_line.length (); + + value = unescape (m_line.substr (spos, epos - spos)); + + return true; +} + +void +StyleLine::set_value (String value) +{ + String key; + get_key (key); + m_line = escape (key) + String ("=") + escape (value); +} + +bool +StyleLine::get_value_array (std::vector &value) +{ + if (get_type () != SCIM_ANTHY_STYLE_LINE_KEY) + return false; + + unsigned int spos = get_value_position (m_line); + unsigned int epos = m_line.length (); + + unsigned int head_of_element = spos; + for (unsigned int i = spos; i <= epos; i++) { + if (i < epos && m_line[i] == '\\') { + i++; + continue; + } + + if (i == epos || m_line[i] == ',') { + String str; + if (head_of_element == epos) + str = String (); + else + str = unescape (m_line.substr (head_of_element, + i - head_of_element)); + value.push_back (str); + head_of_element = i + 1; + } + } + + return true; +} + +void +StyleLine::set_value_array (std::vector &value) +{ + String key; + get_key (key); + + m_line = escape (key) + String ("="); + for (unsigned int i = 0; i < value.size (); i++) { + if (i != 0) + m_line += ","; + m_line += escape (value[i]); + } +} + + +StyleFile::StyleFile () +{ + setup_default_entries (); +} + +StyleFile::~StyleFile () +{ +} + +bool +StyleFile::load (const char *filename) +{ + clear (); + setup_default_entries (); + m_filename = filename; + + std::ifstream in_file (filename); + if (!in_file) + return false; + + clear (); + + m_sections.push_back (StyleLines ()); + StyleLines *section = &m_sections[0]; + unsigned int section_id = 0; + + char buf[MAX_LINE_LENGTH]; + do { + in_file.getline (buf, MAX_LINE_LENGTH); + if (in_file.eof ()) + break; + + WideString dest; + m_iconv.convert (dest, buf); + StyleLine line (this, utf8_wcstombs (dest)); + StyleLineType type = line.get_type (); + + if (type == SCIM_ANTHY_STYLE_LINE_SECTION) { + m_sections.push_back (StyleLines ()); + section = &m_sections.back(); + section_id++; + } + + section->push_back (line); + + if (section_id == 0) { + String key; + line.get_key (key); + if (key == "FormatVersion") { + line.get_value (m_format_version); + + } else if (key == "Encoding") { + line.get_value (m_encoding); + bool success = m_iconv.set_encoding (m_encoding); + if (!success) + m_iconv.set_encoding ("UTF-8"); + + } else if (key == "Title") { + line.get_value (m_title); + + } else if (key == "Version") { + line.get_value (m_version); + } + } + } while (!in_file.eof ()); + + in_file.close (); + + m_filename = filename; + + return true; +} + +bool +StyleFile::save (const char *filename) +{ + std::ofstream out_file (filename); + if (!out_file) + return false; + + StyleSections::iterator it; + for (it = m_sections.begin (); it != m_sections.end (); it++) { + StyleLines::iterator lit; + for (lit = it->begin (); lit != it->end (); lit++) { + String line, dest; + lit->get_line (line); + m_iconv.convert (dest, utf8_mbstowcs (line)); + out_file << dest.c_str () << std::endl; + } + } + + out_file.close (); + + m_filename = filename; + + return true; +} + +void +StyleFile::clear (void) +{ + m_filename = String (); + m_format_version = String (); + m_encoding = String (); + m_title = String (); + m_version = String (); + m_sections.clear (); +} + +String +StyleFile::get_encoding (void) +{ + return m_encoding; +} + +String +StyleFile::get_title (void) +{ + return m_title; +} + +String +StyleFile::get_file_name (void) +{ + return m_filename; +} + +bool +StyleFile::get_string (String &value, String section, String key) +{ + StyleSections::iterator it; + for (it = m_sections.begin (); it != m_sections.end (); it++) { + if (it->size () <= 0) + continue; + + String s, k; + (*it)[0].get_section (s); + + if (s != section) + continue; + + StyleLines::iterator lit; + for (lit = it->begin (); lit != it->end (); lit++) { + lit->get_key (k); + if (k == key) { + lit->get_value (value); + return true; + } + } + } + + return false; +} + +bool +StyleFile::get_string (WideString &value, String section, String key) +{ + String str; + bool success = get_string (str, section, key); + if (!success) + return false; + value = utf8_mbstowcs (str); + return true; +} + +bool +StyleFile::get_string_array (std::vector &value, + String section, String key) +{ + StyleLines *lines = find_section (section); + if (!lines) + return false; + + // find entry + StyleLines::iterator lit; + for (lit = lines->begin (); lit != lines->end (); lit++) { + String k; + lit->get_key (k); + if (k == key) { + lit->get_value_array (value); + return true; + } + } + + return false; +} + +bool +StyleFile::get_string_array (std::vector &value, + String section, String key) +{ + std::vector array; + bool success = get_string_array (array, section, key); + if (!success) + return false; + + std::vector::iterator it; + for (it = array.begin (); it != array.end (); it++) + value.push_back (utf8_mbstowcs (*it)); + return true; +} + +void +StyleFile::set_string (String section, String key, String value) +{ + StyleLines *lines = find_section (section); + if (lines) { + // find entry + StyleLines::iterator lit, last = lines->begin () + 1; + for (lit = last; lit != lines->end (); lit++) { + StyleLineType type = lit->get_type (); + if (type != SCIM_ANTHY_STYLE_LINE_SPACE) + last = lit + 1; + + String k; + lit->get_key (k); + + // replace existing entry + if (k.length () > 0 && k == key) { + lit->set_value (value); + return; + } + } + + // append new entry if no mathced entry exists. + lines->insert (last, StyleLine (this, key, value)); + + } else { + StyleLines &newsec = append_new_section (section); + + // append new entry + newsec.push_back (StyleLine (this, key, value)); + } +} + +void +StyleFile::set_string (String section, String key, WideString value) +{ + set_string (section, key, utf8_wcstombs (value)); +} + +void +StyleFile::set_string_array (String section, String key, + std::vector &value) +{ + StyleLines *lines = find_section (section); + if (lines) { + // find entry + StyleLines::iterator lit, last = lines->begin () + 1; + for (lit = last; lit != lines->end (); lit++) { + StyleLineType type = lit->get_type (); + if (type != SCIM_ANTHY_STYLE_LINE_SPACE) + last = lit; + + String k; + lit->get_key (k); + + // replace existing entry + if (k.length () > 0 && k == key) { + lit->set_value_array (value); + return; + } + } + + // append new entry if no mathced entry exists. + lines->insert (last + 1, StyleLine (this, key, value)); + + } else { + StyleLines &newsec = append_new_section (section); + + // append new entry + newsec.push_back (StyleLine (this, key, value)); + } +} + +void +StyleFile::set_string_array (String section, String key, + std::vector &value) +{ + std::vector array; + std::vector::iterator it; + for (it = value.begin (); it != value.end (); it++) + array.push_back (utf8_wcstombs (*it)); + set_string_array (section, key, array); +} + +bool +StyleFile::get_section_list (StyleSections §ions) +{ + sections = m_sections; + return true; +} + +bool +StyleFile::get_entry_list (StyleLines &lines, String section) +{ + StyleSections::iterator it; + for (it = m_sections.begin (); it != m_sections.end (); it++) { + if (it->size () <= 0) + continue; + + String s; + (*it)[0].get_section (s); + if (s == section) { + lines = (*it); + return true; + } + } + + return false; +} + +bool +StyleFile::get_key_list (std::vector &keys, String section) +{ + StyleLines *lines = find_section (section); + if (!lines) + return false; + + StyleLines::iterator lit; + for (lit = lines->begin (); lit != lines->end (); lit++) { + if (lit->get_type () != SCIM_ANTHY_STYLE_LINE_KEY) + continue; + + String key; + lit->get_key (key); + keys.push_back (key); + } + return true; +} + +void +StyleFile::delete_key (String section, String key) +{ + StyleLines *lines = find_section (section); + if (!lines) + return; + + // find entry + StyleLines::iterator lit; + for (lit = lines->begin (); lit != lines->end (); lit++) { + String k; + lit->get_key (k); + if (k == key) { + lines->erase (lit); + return; + } + } +} + +void +StyleFile::delete_section (String section) +{ + StyleSections::iterator it; + for (it = m_sections.begin (); it != m_sections.end (); it++) { + if (it->size () <= 0) + continue; + + StyleLines::iterator lit; + String s; + (*it)[0].get_section (s); + if (s == section) { + m_sections.erase (it); + return; + } + } +} + +Key2KanaTable * +StyleFile::get_key2kana_table (String section) +{ + Key2KanaTable *table = NULL; + + std::vector keys; + bool success = get_key_list (keys, section); + if (success) { + table = new Key2KanaTable (utf8_mbstowcs (get_title ())); + std::vector::iterator it; + for (it = keys.begin (); it != keys.end (); it++) { + std::vector array; + get_string_array (array, section, *it); + table->append_rule (*it, array); + } + } + + return table; +} + +void +StyleFile::setup_default_entries (void) +{ + m_encoding = "UTF-8"; + m_title = "User defined"; + m_iconv.set_encoding (m_encoding); + m_sections.push_back (StyleLines ()); + + m_sections.push_back (StyleLines ()); + StyleLines &newsec = m_sections.back (); + String str = String ("Encoding") + String ("=") + escape (m_encoding); + newsec.push_back (StyleLine (this, str.c_str ())); + str = String ("Title") + String ("=") + escape (m_title); + newsec.push_back (StyleLine (this, str.c_str ())); +} + +StyleLines * +StyleFile::find_section (const String §ion) +{ + // find section + StyleSections::iterator it; + for (it = m_sections.begin (); it != m_sections.end (); it++) { + if (it->size () <= 0) + continue; + + String s; + (*it)[0].get_section (s); + + if (s == section) + return &(*it); + } + + return NULL; +} + +StyleLines & +StyleFile::append_new_section (const String §ion) +{ + // append space before new section + if (!m_sections.empty()) { + StyleLines &sec = m_sections.back (); + if (sec.empty() || + sec.back().get_type() != SCIM_ANTHY_STYLE_LINE_SPACE) + { + sec.push_back (StyleLine (this, "")); + } + } + + // + // append new section + // + m_sections.push_back (StyleLines ()); + StyleLines &newsec = m_sections.back (); + + // new section entry + String str = String ("[") + String (section) + String ("]"); + newsec.push_back (StyleLine (this, str.c_str ())); + + return newsec; +} diff --git a/src/scim_anthy_style_file.h b/src/scim_anthy_style_file.h new file mode 100755 index 0000000..d879745 --- /dev/null +++ b/src/scim_anthy_style_file.h @@ -0,0 +1,152 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_STYLE_FILE_H__ +#define __SCIM_ANTHY_STYLE_FILE_H__ + +#define Uses_SCIM_ICONV +#include + +#include "scim_anthy_key2kana_table.h" + +using namespace scim; + +namespace scim_anthy { + +class StyleLine; +class StyleSection; +class StyleFile; + +typedef std::vector StyleLines; +typedef std::vector StyleSections; +typedef std::vector StyleFiles; + +typedef enum { + SCIM_ANTHY_STYLE_LINE_UNKNOWN, + SCIM_ANTHY_STYLE_LINE_SPACE, + SCIM_ANTHY_STYLE_LINE_COMMENT, + SCIM_ANTHY_STYLE_LINE_SECTION, + SCIM_ANTHY_STYLE_LINE_KEY, +} StyleLineType; + +class StyleLine +{ +public: + StyleLine (StyleFile *style_file, + String line); + StyleLine (StyleFile *style_file, + String key, + String value); + StyleLine (StyleFile *style_file, + String key, + std::vector &value); + ~StyleLine (); + +public: + StyleLineType get_type (void); + void get_line (String &line) { line = m_line; } + bool get_section (String §ion); + bool get_key (String &key); + bool get_value (String &value); + void set_value (String value); + bool get_value_array (std::vector &value); + void set_value_array (std::vector &value); + +private: + StyleFile *m_style_file; + String m_line; + StyleLineType m_type; +}; + +class StyleFile +{ +public: + StyleFile (); + ~StyleFile (); + +public: + bool load (const char *filename); + bool save (const char *filename); + + String get_encoding (void); + String get_title (void); + String get_file_name (void); + + bool get_section_list (StyleSections §ions); + bool get_entry_list (StyleLines &lines, + String section); + bool get_key_list (std::vector &keys, + String section); + bool get_string (String &value, + String section, + String key); + bool get_string (WideString &value, + String section, + String key); + bool get_string_array (std::vector &value, + String section, + String key); + bool get_string_array (std::vector &value, + String section, + String key); + + void set_string (String section, + String key, + String value); + void set_string (String section, + String key, + WideString value); + void set_string_array (String section, + String key, + std::vector &value); + void set_string_array (String section, + String key, + std::vector &value); + + void delete_key (String section, + String key); + void delete_section (String section); + +public: // for getting specific data + Key2KanaTable * + get_key2kana_table (String section); + +private: + void clear (void); + void setup_default_entries (void); + StyleLines * + find_section (const String §ion); + StyleLines & + append_new_section (const String §ion); + +private: + IConvert m_iconv; + + String m_filename; + String m_format_version; + String m_encoding; + String m_title; + String m_version; + + StyleSections m_sections; +}; + +} + +#endif /* __SCIM_ANTHY_STYLE_FILE_H__ */ diff --git a/src/scim_anthy_table_editor.cpp b/src/scim_anthy_table_editor.cpp new file mode 100755 index 0000000..1a70123 --- /dev/null +++ b/src/scim_anthy_table_editor.cpp @@ -0,0 +1,532 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "scim_anthy_table_editor.h" + +#include +#include +#include "scim_anthy_intl.h" + +enum { + ADD_ENTRY_SIGNAL, + REMOVE_ENTRY_SIGNAL, + LAST_SIGNAL, +}; + +static void scim_anthy_table_editor_class_init (ScimAnthyTableEditorClass *klass); +static void scim_anthy_table_editor_init (ScimAnthyTableEditor *object); +static void scim_anthy_table_editor_dispose (GObject *object); + +static void scim_anthy_table_editor_add_entry (ScimAnthyTableEditor *editor); +static void scim_anthy_table_editor_remove_entry (ScimAnthyTableEditor *editor); + +static gint compare_string (GtkTreeModel *model, + GtkTreeIter *a, + GtkTreeIter *b, + gpointer user_data); + +static void on_table_view_selection_changed (GtkTreeSelection *selection, + gpointer data); +static void on_add_button_clicked (GtkButton *button, + gpointer data); +static void on_remove_button_clicked (GtkButton *button, + gpointer data); +static void on_entry_activate (GtkEntry *entry, + gpointer data); +static void on_entry_changed (GtkEditable *editable, + gpointer data); +static void on_sequence_entry_insert_text (GtkEditable *editable, + const gchar *text, + gint length, + gint *position, + gpointer data); + +static guint editor_signals[LAST_SIGNAL] = { 0 }; +static GtkDialogClass *parent_class = NULL; + +GType +scim_anthy_table_editor_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { + sizeof (ScimAnthyTableEditorClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) scim_anthy_table_editor_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (ScimAnthyTableEditor), + 0, /* n_preallocs */ + (GInstanceInitFunc) scim_anthy_table_editor_init, + }; + + type = g_type_register_static (GTK_TYPE_DIALOG, + "ScimAnthyTableEditor", + &info, (GTypeFlags) 0); + } + + return type; +} + +static void +scim_anthy_table_editor_class_init (ScimAnthyTableEditorClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + //GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + parent_class = (GtkDialogClass *) g_type_class_peek_parent (klass); + + editor_signals[ADD_ENTRY_SIGNAL] = + g_signal_new ("add-entry", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ScimAnthyTableEditorClass, add_entry), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + editor_signals[REMOVE_ENTRY_SIGNAL] = + g_signal_new ("remove-entry", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ScimAnthyTableEditorClass, remove_entry), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + gobject_class->dispose = scim_anthy_table_editor_dispose; + klass->add_entry = scim_anthy_table_editor_add_entry; + klass->remove_entry = scim_anthy_table_editor_remove_entry; +} + +static void +scim_anthy_table_editor_init (ScimAnthyTableEditor *editor) +{ + gtk_dialog_add_buttons (GTK_DIALOG (editor), + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, + NULL); + + gtk_window_set_default_size (GTK_WINDOW (editor), 350, 250); + gtk_window_set_position (GTK_WINDOW (editor), + GTK_WIN_POS_CENTER_ON_PARENT); + + // edit area + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox), hbox, + TRUE, TRUE, 0); + gtk_widget_show (hbox); + + // tree view area + GtkWidget *scrwin = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrwin), + GTK_SHADOW_IN); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrwin), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_box_pack_start (GTK_BOX (hbox), scrwin, TRUE, TRUE, 0); + gtk_widget_show (scrwin); + + GtkWidget *treeview = gtk_tree_view_new (); + editor->treeview = treeview; + gtk_container_add (GTK_CONTAINER (scrwin), treeview); + gtk_widget_show (treeview); + + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); + g_signal_connect (G_OBJECT (selection), "changed", + G_CALLBACK (on_table_view_selection_changed), editor); + + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE); + gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW (treeview), TRUE); + + // button area + GtkWidget *vbox = gtk_vbox_new (FALSE, 0); + editor->button_area = vbox; + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 5); + gtk_widget_show (vbox); + + editor->entries = NULL; +} + +static void +scim_anthy_table_editor_dispose (GObject *object) +{ + ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (object); + + if (editor->entries) { + g_list_free (editor->entries); + editor->entries = NULL; + } + + if (G_OBJECT_CLASS(parent_class)->dispose) + G_OBJECT_CLASS(parent_class)->dispose(object); +} + +GtkWidget * +scim_anthy_table_editor_new (void) +{ + return GTK_WIDGET(g_object_new (SCIM_ANTHY_TYPE_TABLE_EDITOR, + NULL)); +} + +void +scim_anthy_table_editor_set_columns (ScimAnthyTableEditor *editor, + const char **titles) +{ + g_return_if_fail (SCIM_ANTHY_IS_TABLE_EDITOR (editor)); + + if (!titles) + return; + + gint n_cols; + for (n_cols = 0; titles[n_cols]; n_cols++); + if (n_cols <= 0) + return; + + GType types[n_cols]; + for (gint i = 0; i < n_cols; i++) + types[i] = G_TYPE_STRING; + + GtkListStore *store = gtk_list_store_newv (n_cols, types); + gtk_tree_view_set_model (GTK_TREE_VIEW (editor->treeview), + GTK_TREE_MODEL (store)); + + // columns + for (int i = 0; i < n_cols; i++) { + GtkCellRenderer *cell; + GtkTreeViewColumn *column; + cell = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (titles[i], cell, + "text", i, + NULL); + gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); + gtk_tree_view_column_set_fixed_width (column, 80); + gtk_tree_view_column_set_resizable(column, TRUE); + gtk_tree_view_append_column(GTK_TREE_VIEW(editor->treeview), column); + + gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store), i, + compare_string, + GINT_TO_POINTER (i), NULL); + gtk_tree_view_column_set_sort_column_id (column, i); + } + + // entries + for (int i = 0; i < n_cols; i++) { + GtkWidget *label = gtk_label_new_with_mnemonic (titles[i]); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (editor->button_area), label, FALSE, FALSE, 2); + gtk_widget_show (label); + + GtkWidget *entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (editor->button_area), entry, + FALSE, FALSE, 2); + gtk_widget_set_size_request (entry, 80, -1); + g_signal_connect (G_OBJECT (entry), "activate", + G_CALLBACK (on_entry_activate), editor); + g_signal_connect (G_OBJECT (entry), "changed", + G_CALLBACK (on_entry_changed), editor); + if (i == 0) + g_signal_connect (G_OBJECT (entry), "insert-text", + G_CALLBACK (on_sequence_entry_insert_text), + editor); + gtk_widget_show (entry); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); + + editor->entries = g_list_append (editor->entries, entry); + } + + // buttons + GtkWidget *button = gtk_button_new_from_stock (GTK_STOCK_ADD); + editor->add_button = button; + gtk_box_pack_start (GTK_BOX (editor->button_area), button, FALSE, FALSE, 5); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_add_button_clicked), editor); + gtk_widget_set_sensitive (button, FALSE); + gtk_widget_show (button); + + button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); + editor->remove_button = button; + gtk_box_pack_start (GTK_BOX (editor->button_area), button, FALSE, FALSE, 5); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (on_remove_button_clicked), editor); + gtk_widget_set_sensitive (button, FALSE); + gtk_widget_show (button); + + // clean + g_object_unref (store); +} + +const char * +scim_anthy_table_editor_get_nth_text (ScimAnthyTableEditor *editor, guint nth) +{ + g_return_val_if_fail (SCIM_ANTHY_IS_TABLE_EDITOR (editor), ""); + + GtkEntry *entry = GTK_ENTRY (g_list_nth_data (editor->entries, nth)); + if (!entry) + return ""; + + return gtk_entry_get_text (entry); +} + +static void +scim_anthy_table_editor_add_entry (ScimAnthyTableEditor *editor) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview); + GtkTreeModel *model = gtk_tree_view_get_model (treeview); + GtkTreeIter iter; + + gboolean go_next; + bool found = false; + + const gchar *sequence; + sequence = scim_anthy_table_editor_get_nth_text (editor, 0); + + if (!sequence) + return; + + for (go_next = gtk_tree_model_get_iter_first (model, &iter); + go_next; + go_next = gtk_tree_model_iter_next (model, &iter)) + { + gchar *seq = NULL; + gtk_tree_model_get (model, &iter, + 0, &seq, + -1); + if (seq && !strcmp (sequence, seq)) { + found = true; + g_free (seq); + break; + } + g_free (seq); + } + + if (!found) + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + + GList *node; + gint i; + for (i = 0, node = editor->entries; + node; + i++, node = g_list_next (node)) + { + const char *text = gtk_entry_get_text (GTK_ENTRY (node->data)); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + i, text, + -1); + } + + GtkTreePath *path = gtk_tree_model_get_path (model, &iter); + gtk_tree_view_set_cursor (treeview, path, NULL, FALSE); + gtk_tree_path_free (path); +} + +static void +scim_anthy_table_editor_remove_entry (ScimAnthyTableEditor *editor) +{ + GtkTreeView *treeview = GTK_TREE_VIEW (editor->treeview); + GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview); + GtkTreeModel *model = NULL; + GtkTreeIter iter, next; + gboolean selected, success; + + selected = gtk_tree_selection_get_selected (selection, &model, &iter); + if (!selected) + return; + + gchar *sequence = NULL; + gtk_tree_model_get (model, &iter, + 0, &sequence, + -1); + + next = iter; + success = gtk_tree_model_iter_next (model, &next); + GtkTreePath *path = NULL; + if (success) { + path = gtk_tree_model_get_path (model, &next); + } else { + path = gtk_tree_model_get_path (model, &iter); + if (path) + success = gtk_tree_path_prev (path); + } + + if (success && path) + gtk_tree_view_set_cursor (GTK_TREE_VIEW (treeview), path, NULL, FALSE); + if (path) + gtk_tree_path_free (path); + + gtk_list_store_remove (GTK_LIST_STORE (model), &iter); + + g_free (sequence); +} + +static gint +compare_string (GtkTreeModel *model, + GtkTreeIter *a, + GtkTreeIter *b, + gpointer user_data) +{ + gint n_cols, column, cur_column = GPOINTER_TO_INT (user_data); + gint ret = 0; + + n_cols = gtk_tree_model_get_n_columns (model); + + if (cur_column < n_cols) { + gchar *seq1 = NULL, *seq2 = NULL; + gtk_tree_model_get (model, a, + cur_column, &seq1, + -1); + gtk_tree_model_get (model, b, + cur_column, &seq2, + -1); + if (!seq1 && seq2) { + ret = -1; + } else if (seq1 && !seq2) { + ret = 1; + } else if (seq1 && seq2) { + ret = strcmp (seq1, seq2); + } else { + ret = 0; + } + g_free (seq1); + g_free (seq2); + } + + for (column = 0; ret == 0 && column < n_cols; column++) { + gchar *seq1 = NULL, *seq2 = NULL; + + if (cur_column == column) + continue; + + gtk_tree_model_get (model, a, + column, &seq1, + -1); + gtk_tree_model_get (model, b, + column, &seq2, + -1); + if (!seq1 && seq2) { + ret = -1; + } else if (seq1 && !seq2) { + ret = 1; + } else if (!seq1 && !seq2) { + ret = strcmp (seq1, seq2); + } else { + ret = 0; + } + g_free (seq1); + g_free (seq2); + } + + return ret; +} + +static void +on_table_view_selection_changed (GtkTreeSelection *selection, gpointer data) +{ + ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data); + GtkTreeModel *model = NULL; + GtkTreeIter iter; + + gboolean selected; + + selected = gtk_tree_selection_get_selected (selection, &model, &iter); + + if (editor->remove_button) { + if (selected) { + gtk_widget_set_sensitive (editor->remove_button, true); + } else { + gtk_widget_set_sensitive (editor->remove_button, false); + } + } + + GList *node; + + if (selected) { + gint i; + for (i = 0, node = editor->entries; + node; + i++, node = g_list_next (node)) + { + gchar *str = NULL; + gtk_tree_model_get (model, &iter, + i, &str, + -1); + gtk_entry_set_text (GTK_ENTRY (node->data), str); + g_free (str); + } + } else { + for (node = editor->entries; node; node = g_list_next (node)) + gtk_entry_set_text (GTK_ENTRY (node->data), ""); + } +} + +static void +on_add_button_clicked (GtkButton *button, gpointer data) +{ + ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data); + g_signal_emit (editor, editor_signals[ADD_ENTRY_SIGNAL], 0); +} + +static void +on_remove_button_clicked (GtkButton *button, gpointer data) +{ + ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data); + g_signal_emit (editor, editor_signals[REMOVE_ENTRY_SIGNAL], 0); +} + +static void +on_entry_activate (GtkEntry *entry, gpointer data) +{ + ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data); + g_signal_emit (editor, editor_signals[ADD_ENTRY_SIGNAL], 0); +} + +static void +on_entry_changed (GtkEditable *editable, gpointer data) +{ + ScimAnthyTableEditor *editor = SCIM_ANTHY_TABLE_EDITOR (data); + const char *seq; + + if (!editor->entries || !editor->entries->data) + return; + + seq = gtk_entry_get_text (GTK_ENTRY (editor->entries->data)); + gtk_widget_set_sensitive (editor->add_button, + seq && *seq); +} + +static void +on_sequence_entry_insert_text (GtkEditable *editable, + const gchar *text, + gint length, + gint *position, + gpointer data) +{ + for (int i = 0; i < length; i++) { + if (!isascii (text[i]) || isspace (text[i])) { + g_signal_stop_emission_by_name (editable, "insert_text"); + return; + } + } +} diff --git a/src/scim_anthy_table_editor.h b/src/scim_anthy_table_editor.h new file mode 100755 index 0000000..ee3a707 --- /dev/null +++ b/src/scim_anthy_table_editor.h @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2004-2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_TABLE_EDITOR_H__ +#define __SCIM_ANTHY_TABLE_EDITOR_H__ + +#include + +#define SCIM_ANTHY_TYPE_TABLE_EDITOR (scim_anthy_table_editor_get_type ()) +#define SCIM_ANTHY_TABLE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCIM_ANTHY_TYPE_TABLE_EDITOR, ScimAnthyTableEditor)) +#define SCIM_ANTHY_TABLE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCIM_ANTHY_TYPE_TABLE_EDITOR, ScimAnthyTableEditorClass)) +#define SCIM_ANTHY_IS_TABLE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCIM_ANTHY_TYPE_TABLE_EDITOR)) +#define SCIM_ANTHY_IS_TABLE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCIM_ANTHY_TYPE_TABLE_EDITOR)) +#define SCIM_ANTHY_TABLE_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCIM_ANTHY_TYPE_TABLE_EDITOR, ScimAnthyTableEditorClass)) + + +typedef struct _ScimAnthyTableEditorClass ScimAnthyTableEditorClass; +typedef struct _ScimAnthyTableEditor ScimAnthyTableEditor; + +struct _ScimAnthyTableEditor +{ + GtkDialog parent_instance; + + GtkWidget *treeview; + + GtkWidget *button_area; + + GtkWidget *add_button; + GtkWidget *remove_button; + + GList *entries; +}; + +struct _ScimAnthyTableEditorClass +{ + GtkDialogClass parent_class; + + /* -- signals -- */ + void (*add_entry) (ScimAnthyTableEditor *editor); + void (*remove_entry) (ScimAnthyTableEditor *editor); +}; + + +GType scim_anthy_table_editor_get_type (void) G_GNUC_CONST; +GtkWidget *scim_anthy_table_editor_new (void); +const char *scim_anthy_table_editor_get_nth_text (ScimAnthyTableEditor *editor, + guint nth); +void scim_anthy_table_editor_set_columns (ScimAnthyTableEditor *editor, + const char **titles); + +#endif /* __SCIM_ANTHY_TABLE_EDITOR_H__ */ diff --git a/src/scim_anthy_utils.cpp b/src/scim_anthy_utils.cpp new file mode 100755 index 0000000..3264b5f --- /dev/null +++ b/src/scim_anthy_utils.cpp @@ -0,0 +1,330 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#include +#include +#include +#include + +#include "scim_anthy_utils.h" +#include "scim_anthy_default_tables.h" + +namespace scim_anthy { + +bool +util_match_key_event (const KeyEventList &list, const KeyEvent &key, + uint16 ignore_mask) +{ + KeyEventList::const_iterator kit; + + for (kit = list.begin (); kit != list.end (); kit++) { + uint16 mod1, mod2; + + mod1 = kit->mask; + mod2 = key.mask; + mod1 &= ~ignore_mask; + mod2 &= ~ignore_mask; + + if (key.code == kit->code && mod1 == mod2) + return true; + } + return false; +} + +void +util_split_string (String &str, std::vector &str_list, + char *delim, int num) +{ + String::size_type start = 0, end; + + for (int i = 0; (num > 0 && i < num) || start < str.length (); i++) { + end = str.find (delim, start); + if ((num > 0 && i == num - 1) || (end == String::npos)) + end = str.length (); + + if (start < str.length ()) { + str_list.push_back (str.substr (start, end - start)); + start = end + strlen (delim); + } else { + str_list.push_back (String ()); + } + } +} + +void +util_convert_to_wide (WideString & wide, const String & str) +{ + if (str.length () < 0) + return; + + for (unsigned int i = 0; i < str.length (); i++) { + int c = str[i]; + char cc[2]; cc[0] = c; cc[1] = '\0'; + bool found = false; + + for (unsigned int j = 0; scim_anthy_wide_table[j].code; j++) { + if ( scim_anthy_wide_table[j].code && + *scim_anthy_wide_table[j].code == c) + { + wide += utf8_mbstowcs (scim_anthy_wide_table[j].wide); + found = true; + break; + } + } + + if (!found) + wide += utf8_mbstowcs (cc); + } +} + +void +util_convert_to_half (String & half, const WideString & str) +{ + if (str.length () < 0) + return; + + for (unsigned int i = 0; i < str.length (); i++) { + WideString wide = str.substr (i, 1); + bool found = false; + + for (unsigned int j = 0; scim_anthy_wide_table[j].code; j++) { + if (scim_anthy_wide_table[j].wide && + wide == utf8_mbstowcs (scim_anthy_wide_table[j].wide)) + { + half += scim_anthy_wide_table[j].code; + found = true; + break; + } + } + + if (!found) + half += utf8_wcstombs (wide); + } +} + +void +util_convert_to_katakana (WideString & kata, + const WideString & hira, + bool half) +{ + if (hira.length () < 0) + return; + + for (unsigned int i = 0; i < hira.length (); i++) { + WideString tmpwide; + bool found = false; + + HiraganaKatakanaRule *table = scim_anthy_hiragana_katakana_table; + + for (unsigned int j = 0; table[j].hiragana; j++) { + tmpwide = utf8_mbstowcs (table[j].hiragana); + if (hira.substr(i, 1) == tmpwide) { + if (half) + kata += utf8_mbstowcs (table[j].half_katakana); + else + kata += utf8_mbstowcs (table[j].katakana); + found = true; + break; + } + } + + if (!found) + kata += hira.substr(i, 1); + } +} + +void +util_create_attributes (AttributeList &attrs, + unsigned int start, + unsigned int length, + String type, + unsigned int fg_color, + unsigned int bg_color) +{ + if (type == "None") { + return; + } else if (type == "Underline") { + attrs.push_back (Attribute (start, length, + SCIM_ATTR_DECORATE, + SCIM_ATTR_DECORATE_UNDERLINE)); + } else if (type == "Reverse") { + attrs.push_back (Attribute (start, length, + SCIM_ATTR_DECORATE, + SCIM_ATTR_DECORATE_REVERSE)); + } else if (type == "Highlight") { + attrs.push_back (Attribute (start, length, + SCIM_ATTR_DECORATE, + SCIM_ATTR_DECORATE_HIGHLIGHT)); + } else { + if (type == "Color" || type == "FGColor") + attrs.push_back (Attribute (start, length, + SCIM_ATTR_FOREGROUND, + fg_color)); + if (type == "Color" || type == "BGColor") + attrs.push_back (Attribute (start, length, + SCIM_ATTR_BACKGROUND, + bg_color)); + } +} + +bool +util_key_is_keypad (const KeyEvent &key) +{ + switch (key.code) { + case SCIM_KEY_KP_Equal: + case SCIM_KEY_KP_Multiply: + case SCIM_KEY_KP_Add: + case SCIM_KEY_KP_Separator: + case SCIM_KEY_KP_Subtract: + case SCIM_KEY_KP_Decimal: + case SCIM_KEY_KP_Divide: + case SCIM_KEY_KP_0: + case SCIM_KEY_KP_1: + case SCIM_KEY_KP_2: + case SCIM_KEY_KP_3: + case SCIM_KEY_KP_4: + case SCIM_KEY_KP_5: + case SCIM_KEY_KP_6: + case SCIM_KEY_KP_7: + case SCIM_KEY_KP_8: + case SCIM_KEY_KP_9: + return true; + default: + return false; + } +} + +void +util_keypad_to_string (String &str, const KeyEvent &key) +{ + char raw[2]; + + switch (key.code) { + case SCIM_KEY_KP_Equal: + raw[0] = '='; + break; + + case SCIM_KEY_KP_Multiply: + raw[0] = '*'; + break; + + case SCIM_KEY_KP_Add: + raw[0] = '+'; + break; + + case SCIM_KEY_KP_Separator: + raw[0] = ','; + break; + + case SCIM_KEY_KP_Subtract: + raw[0] = '-'; + break; + + case SCIM_KEY_KP_Decimal: + raw[0] = '.'; + break; + + case SCIM_KEY_KP_Divide: + raw[0] = '/'; + break; + + case SCIM_KEY_KP_0: + case SCIM_KEY_KP_1: + case SCIM_KEY_KP_2: + case SCIM_KEY_KP_3: + case SCIM_KEY_KP_4: + case SCIM_KEY_KP_5: + case SCIM_KEY_KP_6: + case SCIM_KEY_KP_7: + case SCIM_KEY_KP_8: + case SCIM_KEY_KP_9: + raw[0] = '0' + key.code - SCIM_KEY_KP_0; + break; + + default: + if (isprint (key.get_ascii_code())) + raw[0] = key.get_ascii_code(); + else + raw[0] = '\0'; + break; + } + + raw[1] = '\0'; + str = raw; +} + +void +util_launch_program (const char *command) +{ + if (!command) return; + + /* split string */ + unsigned int len = strlen (command); + char tmp[len + 1]; + strncpy (tmp, command, len); + tmp[len] = '\0'; + + char *str = tmp; + std::vector array; + + for (unsigned int i = 0; i < len + 1; i++) { + if (!tmp[i] || isspace (tmp[i])) { + if (*str) { + tmp[i] = '\0'; + array.push_back (str); + } + str = tmp + i + 1; + } + } + + if (array.size () <= 0) return; + array.push_back (NULL); + + char *args[array.size()]; + for (unsigned int i = 0; i < array.size (); i++) + args[i] = array[i]; + + + /* exec command */ + pid_t child_pid; + + child_pid = fork(); + if (child_pid < 0) { + perror("fork"); + } else if (child_pid == 0) { /* child process */ + pid_t grandchild_pid; + + grandchild_pid = fork(); + if (grandchild_pid < 0) { + perror("fork"); + _exit(1); + } else if (grandchild_pid == 0) { /* grandchild process */ + execvp(args[0], args); + perror("execvp"); + _exit(1); + } else { + _exit(0); + } + } else { /* parent process */ + int status; + waitpid(child_pid, &status, 0); + } +} + +} diff --git a/src/scim_anthy_utils.h b/src/scim_anthy_utils.h new file mode 100755 index 0000000..7249ecc --- /dev/null +++ b/src/scim_anthy_utils.h @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2005 Takuro Ashie + * + * 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. + */ + +#ifndef __SCIM_ANTHY_UTILS_H__ +#define __SCIM_ANTHY_UTILS_H__ + +#define Uses_SCIM_ICONV +#define Uses_SCIM_EVENT +#define Uses_SCIM_ATTRIBUTE +#include + +using namespace scim; + +namespace scim_anthy { + +bool util_match_key_event (const KeyEventList &list, + const KeyEvent &key, + uint16 ignore_mask = 0); +void util_split_string (String &str, + std::vector &str_list, + char *delim, + int num); +void util_convert_to_wide (WideString &wide, + const String &str); +void util_convert_to_half (String &half, + const WideString &str); +void util_convert_to_katakana (WideString &kata, + const WideString &hira, + bool half = false); +void util_create_attributes (AttributeList &attrs, + unsigned int start, + unsigned int length, + String type, + unsigned int fg_color, + unsigned int bg_color); +bool util_key_is_keypad (const KeyEvent &key); +void util_keypad_to_string (String &str, + const KeyEvent &key); +void util_launch_program (const char *command); + +} + +#endif /* __SCIM_ANTHY_UTILS_H__ */ -- 2.7.4